@arcgis/core 4.33.0-next.20250502 → 4.33.0-next.20250503

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0219c3f9408d3fa3c9a0.js → 03ee9d0407c230b885ed.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{84f972d7851d982701a0.js → 1ca7e0d519ecbfe6976f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3fb25912b274f264c84e.js +1 -0
  5. package/assets/esri/core/workers/chunks/{9652cfd4668b95036c87.js → 532088a72c3ddc50f3be.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{653ff3e631fea8ad393a.js → a0db1f3ca29e34dfa16f.js} +12 -12
  7. package/assets/esri/core/workers/chunks/{581180668e0229dcdc14.js → bf190d672dcbaedc1a41.js} +1 -1
  8. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  9. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +14 -1
  10. package/assets/esri/themes/base/widgets/_SelectionList.scss +34 -0
  11. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +6 -0
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  16. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  17. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList.json +1 -1
  18. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_en.json +1 -1
  19. package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar.json +1 -1
  20. package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_en.json +1 -1
  21. package/chunks/pe-wasm.js +1 -1
  22. package/chunks/pe.js +1 -1
  23. package/geometry/coordinateFormatter.js +1 -1
  24. package/geometry/support/WKIDUnitConversion.js +1 -1
  25. package/package.json +1 -1
  26. package/support/revision.js +1 -1
  27. package/views/3d/interactive/Manipulator3D.js +1 -1
  28. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  29. package/views/3d/layers/DrapedSubView3D.js +1 -1
  30. package/views/3d/layers/I3SMeshView3D.js +1 -1
  31. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  32. package/views/3d/layers/MediaLayerView3D.js +1 -1
  33. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  34. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  35. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  36. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  37. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  38. package/views/3d/support/StreamTextureCollection.js +1 -1
  39. package/views/3d/support/TextureCollection.js +1 -1
  40. package/views/3d/webgl-engine/Stage.js +1 -1
  41. package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
  42. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  43. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  44. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  45. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  46. package/views/3d/webgl-engine/parts/Model.js +1 -1
  47. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  48. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  49. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  50. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +5 -0
  51. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  52. package/widgets/OrientedImageryViewer/css.js +1 -1
  53. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  54. package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
  55. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +5 -0
  56. package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +5 -0
  57. package/widgets/OrientedImageryViewer.js +1 -1
  58. package/widgets/Sketch.js +1 -1
  59. package/widgets/support/SelectionList/LayerItem.js +1 -1
  60. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  61. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  62. package/widgets/support/SelectionList.js +1 -1
  63. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  64. package/widgets/support/SelectionToolbar/VisibleElements.js +5 -0
  65. package/widgets/support/SelectionToolbar.js +1 -1
  66. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  67. package/assets/esri/core/workers/chunks/e3ef0451dcdc2e966628.js +0 -1
  68. package/views/3d/webgl-engine/lib/ContentObject.js +0 -5
  69. package/views/3d/webgl-engine/lib/ContentObjectType.js +0 -5
@@ -316,4 +316,4 @@ gl_Position = posProjCenter;
316
316
  gl_PointSize = 1.0;`),a.main.add(s.H`fragColor = vec4(1);
317
317
  if(discardByTerrainDepth()) {
318
318
  fragColor.g = 0.5;
319
- }`)}},65215:(e,t,r)=>{r.d(t,{HE:()=>n,R6:()=>i}),r(51850);class n{constructor(e){this.layerViewUid=e}}class i extends n{constructor(e,t){super(e),this.graphicUid=t}}},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>a});var n=r(67076),i=r(90360),s=r(41214);function a(e,t){return l(e,null,t)}const o=(0,i.C)({types:s.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new n.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):o(e,t,r):null}},66208:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(53655);function i(e,t){const r=(0,n.SH)(e,t),i=r.queryResult.featureResult,s=r.queryResult.queryGeometry,a=r.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=s,i.queryGeometryType=a),i}},69418:(e,t,r)=>{r.d(t,{S:()=>c,z:()=>l});var n=r(83047),i=r(21325),s=r(43334),a=r(58512),o=r(92722);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this._options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.A}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||(0,i.aI)(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,n.G9)(this._options.sourceSpatialReference)/(0,n.G9)(e.spatialReference);if(1!==t)for(const r of e.features){if(!(0,s.N3)(r))continue;const e=r.geometry.coords;for(let r=2;r<e.length;r+=3)e[r]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new s.Om(null,{},null,0)}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.A}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.A}}},72385:(e,t,r)=>{function n(){return new Float32Array(3)}function i(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(e,t,r){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}function a(){return n()}function o(){return s(1,1,1)}function l(){return s(1,0,0)}function c(){return s(0,1,0)}function d(){return s(0,0,1)}r.d(t,{fA:()=>s,o8:()=>i,vt:()=>n});const u=a(),h=o(),f=l(),p=c(),m=d();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:p,UNIT_Z:m,ZEROS:u,clone:i,create:n,fromValues:s,ones:o,unitX:l,unitY:c,unitZ:d,zeros:a},Symbol.toStringTag,{value:"Module"}))},73681:(e,t,r)=>{r.d(t,{n:()=>l});var n=r(49186),i=r(53966),s=r(46140),a=r(95466),o=r(55674);class l{static async from(e,t,r){const a=e.dictionary_version?s.R.parse(e.dictionary_version):null,d=new Set(e.itemsNames),u={};if(t)for(const e in t)u[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)u.hasOwnProperty(t.name)||(u[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))h.delete(e);h.size&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const f=await(0,o.xR)(e.expression,null,u);if(!f)throw new n.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const p=!a||!a.greaterEqual(4,0);p&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:a});const m=new c(r,p);return new l(p,d,f,m)}constructor(e,t,r,n){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=n}get itemNames(){return this._itemNames}evaluate(e,t,r,n){try{return this._reader.bind(e,r,n),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new a.A(e);const t=e.map((e=>({...e,type:"esriFieldTypeString"})));return new a.A(t)}}class c extends o.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t?"":""+this._boundTarget.attributes[t.name]}}},75503:(e,t,r)=>{r.d(t,{E:()=>I,w:()=>o});var n=r(4576),i=r(21818),s=(r(44208),r(3694)),a=r(11006);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),x.prune(),C.prune(),S.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(b(e,r))for(w.clear();r;){for(let i=0,s=r.children.length;i<s;i++){const s=r.children[i],a=r.leaf?n(s):s;b(e,a)&&(r.leaf?t(s):_(e,a)?l(s,t):w.push(s))}r=w.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!b(e,t))return!1;for(w.clear();t;){for(let n=0,i=t.children.length;n<i;n++){const i=t.children[n],s=t.leaf?r(i):i;if(b(e,s)){if(t.leaf||_(e,s))return!0;w.push(i)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new T([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,a=0,o=!1;const l=this._toBBox(e);for(C.clear(),S.clear();r||C.length>0;){if(r||(r=C.pop(),s=C.data[C.length-1],a=S.pop()??0,o=!0),r.leaf&&(t=(0,n.qh)(r.children,(0,i.zI)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),C.push(r),this._condense(C),this;o||r.leaf||!_(r,l)?s?(a++,r=s.children[a],o=!1):r=null:(C.push(r),S.push(a),a=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,n){const i=r-t+1;let s=this._maxEntries;if(i<=s){const n=new T(e.slice(t,r+1));return c(n,this._toBBox),n}n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/s**(n-1)));const a=new O([]);a.height=n;const o=Math.ceil(i/s),l=o*Math.ceil(Math.sqrt(s));v(e,t,r,l,this._compareMinX);for(let i=t;i<=r;i+=l){const t=Math.min(i+l-1,r);v(e,i,t,o,this._compareMinY);for(let r=i;r<=t;r+=o){const i=Math.min(r+o-1,t);a.children.push(this._build(e,r,i,n-1))}}return c(a,this._toBBox),a}_insert(e,t,r){const n=this._toBBox,i=r?e:n(e);C.clear();const s=function(e,t,r,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==r;){let r,n=1/0,i=1/0;for(let s=0,a=t.children.length;s<a;s++){const a=t.children[s],o=p(a),l=g(e,a)-o;l<i?(i=l,n=o<n?o:n,r=a):l===i&&o<n&&(n=o,r=a)}t=r||t.children[0]}return t}(i,this._data,t,C);for(s.children.push(e),u(s,i);t>=0&&C.data[t].children.length>this._maxEntries;)this._split(C,t),t--;!function(e,t,r){for(let n=r;n>=0;n--)u(t.data[n],e)}(i,C,t)}_split(e,t){const r=e.data[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const s=this._chooseSplitIndex(r,i,n);if(!s)return;const a=r.children.splice(s,r.children.length-s),o=r.leaf?new T(a):new O(a);o.height=r.height,c(r,this._toBBox),c(o,this._toBBox),t?e.data[t-1].children.push(o):this._splitRoot(r,o)}_splitRoot(e,t){this._data=new O([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,i,s;n=i=1/0;for(let a=t;a<=r-t;a++){const t=d(e,0,a,this._toBBox),o=d(e,a,r,this._toBBox),l=y(t,o),c=p(t)+p(o);l<n?(n=l,s=a,i=c<i?c:i):l===n&&c<i&&(i=c,s=a)}return s}_chooseSplitAxis(e,t,r){const n=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);const i=this._toBBox,s=d(e,0,t,i),a=d(e,r-t,r,i);let o=m(s)+m(a);for(let n=t;n<r-t;n++){const t=e.children[n];u(s,e.leaf?i(t):t),o+=m(s)}for(let n=r-t-1;n>=t;n--){const t=e.children[n];u(a,e.leaf?i(t):t),o+=m(a)}return o}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const i=e.data[t-1],s=i.children;s.splice((0,n.qh)(s,r,s.length,i.indexHint),1)}else this.clear();else c(r,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let r=e;for(x.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,i.zI)(e));else x.pushArray(r.children);r=x.pop()??null}}function c(e,t){d(e,0,e.children.length,t,e)}function d(e,t,r,n,i){i||(i=new T([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a<r;a++)s=e.children[a],u(i,e.leaf?n(s):s);return i}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,r,n,i){const s=[t,r];for(;s.length;){const t=s.pop(),r=s.pop();if(t-r<=n)continue;const o=r+Math.ceil((t-r)/n/2)*n;(0,a.q)(e,o,r,t,i),s.push(r,o,o,t)}}const w=new s.A,x=new s.A,C=new s.A,S=new s.A({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class T extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class O extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(90237),i=r(66552),s=r(25482),a=r(10107),o=(r(44208),r(53966),r(87811),r(93223)),l=r(40608);const c=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends s.A{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,o.e)(c),(0,a.MZ)({json:{write:{isRequired:!0}}})],d.prototype,"type",void 0),d=(0,n._)([(0,l.$)("esri.layers.support.Domain")],d);const u=d},77548:(e,t,r)=>{r.d(t,{tk:()=>u,BR:()=>d,wI:()=>c,Ov:()=>o,W_:()=>l,TU:()=>a,XX:()=>s});var n=r(70333),i=r(78888);r(5503),r(36563),r(36708),new WeakMap;const s={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function o(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function c(e,t){const r=n.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const a=`${e.slice(0,s)}/rest/info`,o=null!=t?t.signal:null,{data:l}=await(0,i.A)(a,{query:{f:"json"},responseType:"json",signal:o});return l?.owningSystemUrl||null}function d(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function u(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}},80451:(e,t,r)=>{r.d(t,{rS:()=>g,gK:()=>m}),r(44208);var n,i=r(53177),s=r(76357),a=r(90237),o=(r(53966),r(87811),r(49186),r(93223)),l=r(40608);let c=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,a._)([(0,o.e)({inherited:"inherited"})],c.prototype,"type",void 0),c=n=(0,a._)([(0,l.$)("esri.layers.support.InheritedDomain")],c);const d=c;var u,h=r(10107);let f=class extends s.A{static{u=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new u({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],f.prototype,"maxValue",void 0),(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],f.prototype,"minValue",void 0),(0,a._)([(0,o.e)({range:"range"})],f.prototype,"type",void 0),f=u=(0,a._)([(0,l.$)("esri.layers.support.RangeDomain")],f);const p=f,m={key:"type",base:s.A,typeMap:{range:p,"coded-value":i.A,inherited:d}};function g(e){if(!e?.type)return null;switch(e.type){case"range":return p.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return d.fromJSON(e)}return null}},80893:(e,t,r)=>{r.d(t,{IJ:()=>p,Jf:()=>_,Pk:()=>g,eW:()=>f,gW:()=>y,kS:()=>m});var n=r(78888),i=r(84952),s=r(65864),a=r(17136),o=r(21325),l=r(10536),c=r(66208),d=r(58501);const u="Layer does not support extent calculation.";function h(e,t){const r=e.geometry,n=e.toJSON();delete n.compactGeometryEnabled,delete n.defaultSpatialReferenceEnabled;const i=n;let a,l,c;if(null!=r&&(l=r.spatialReference,c=(0,o.YX)(l),i.geometryType=(0,s.$B)(r),i.geometry=function(e,t){if(t&&"extent"===e.type)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&"point"===e.type)return`${e.x},${e.y}`;const r=e.toJSON();return delete r.spatialReference,JSON.stringify(r)}(r,e.compactGeometryEnabled),i.inSR=c),n.groupByFieldsForStatistics&&(i.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(i.objectIds=n.objectIds.join(",")),n.orderByFields&&(i.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(t?.returnCountOnly||t?.returnExtentOnly||t?.returnIdsOnly)?delete i.outFields:n.outFields.includes("*")?i.outFields="*":i.outFields=n.outFields.join(","),n.outSR?(i.outSR=(0,o.YX)(n.outSR),a=e.outSpatialReference):r&&(n.returnGeometry||n.returnCentroid)&&(i.outSR=i.inSR,a=l),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(i.outStatistics=JSON.stringify(n.outStatistics)),n.fullText&&(i.fullText=JSON.stringify(n.fullText)),n.pixelSize&&(i.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(e.defaultSpatialReferenceEnabled&&null!=l&&null!=e.quantizationParameters?.extent&&l.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,i.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(i.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(i.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(i.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:r}=e;null==t&&null==r||(i.time=t===r?t:`${t??"null"},${r??"null"}`),delete n.timeExtent}return e.defaultSpatialReferenceEnabled&&null!=l&&null!=a&&l.equals(a)&&(i.defaultSR=i.inSR,delete i.inSR,delete i.outSR),i}async function f(e,t,r,n){const i=null!=t.timeExtent&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",n);return(0,d.q)(t,r,i.data),i}async function p(e,t,r,n){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:r.createFeatureResult()};const i=await m(e,t,n),s=i;return s.data=(0,c.m)(i.data,r),s}function m(e,t,r){return b(e,t,"pbf",r)}function g(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",r,{returnIdsOnly:!0})}function y(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",r,{returnIdsOnly:!0,returnCountOnly:!0})}async function _(e,t,r){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:{count:0,extent:null}};const n=await b(e,t,"json",r,{returnExtentOnly:!0,returnCountOnly:!0}),i=n.data;if(i.hasOwnProperty("extent"))return n;if(i.features)throw new Error(u);if(i.hasOwnProperty("count"))throw new Error(u);return n}async function b(e,t,r,s={},o={}){const c="string"==typeof e?(0,i.An)(e):e,d=t.geometry?[t.geometry]:[],u=await(0,a.el)(d,null,{signal:s.signal}),f=u?.[0];null!=f&&((t=t.clone()).geometry=f);const p=(0,l.z)({...c.query,f:r,...o,...h(t,o)});return(0,n.A)((0,i.fj)(c.path,(m=o,null==t.formatOf3DObjects||m.returnCountOnly||m.returnExtentOnly||m.returnIdsOnly?"query":"query3d")),{...s,responseType:"pbf"===r?"array-buffer":"json",query:{...p,...s.query}});var m}},85071:(e,t,r)=>{r.r(t),r.d(t,{default:()=>pn});var n=r(90237),i=r(65529),s=r(74887),a=r(36708),o=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),d=r(5443),u=r(80586),h=r(16930),f=r(68298),p=r(61956),m=r(65494);class g{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new g(e,e.createRenderCommandBuffer(),t)}}function y(e){return 0===e.length?null:e.reduce(((e,t)=>(e.append(t),e)))}var _=r(68197),b=r(18574),v=r(87403),w=r(28975);function x(){return new b.A({material:new w.N({color:new _.A("red")})})}var C=r(9093),S=r(51850),I=r(91829),A=r(6847),T=r(83047),O=r(58083),R=(r(87317),r(70328)),P=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var E=r(37585),M=r(48163),D=r(34727),F=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const V=[];{const e=16;for(let t=0;t<360;t+=360/e)V.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}var j,B;(B=j||(j={}))[B.Left=0]="Left",B[B.Center=1]="Center",B[B.Right=2]="Right",Object.freeze({left:0,center:.5,right:1});const L=Object.freeze({"bottom-left":(0,M.fA)(0,0),bottom:(0,M.fA)(.5,0),"bottom-right":(0,M.fA)(1,0),left:(0,M.fA)(0,.5),center:(0,M.fA)(.5,.5),right:(0,M.fA)(1,.5),"top-left":(0,M.fA)(0,1),top:(0,M.fA)(.5,1),"top-right":(0,M.fA)(1,1)});var U=r(9762),z=r(27993);function N(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function k(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function q(e,t){const r=t.viewSpatialReference,n=t.renderSpatialReference,{extent:i}=e,s=(0,P.gX)(i),a=(0,S.vt)();return(0,z.F)([s[0],s[1],0],r,a,n),a}var H=r(97146);function G(e){const t=new Map;for(const[r,n]of e)t.set(r,{...n,indices:(0,H.Dg)(n.indices)});return t}var $=r(40804),Y=(r(31006),r(63907));const Z=(0,I.CN)(.25,.25,.75,.75);function W(e){return"cross"===e||"x"===e}function X(e,t=128,r=.5*t,n=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return te(e,K(r,r,t/2))}(t,r);case"square":return function(e,t){return J(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return Q(e,t,!1,r)}(t,r,n);case"x":return function(e,t,r=0){return Q(e,t,!0,r)}(t,r,n);case"kite":return function(e,t){return J(e,t,!0)}(t,r);case"triangle":return function(e,t){return te(e,ee(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,n=t/2,i=e/2,s=.8*r,a=K(i,(e-t)/2-s,Math.sqrt(s*s+n*n)),o=ee(i,r,n);return te(e,((e,t)=>Math.max(o(e,t),-a(e,t))))}(t,r)}}function J(e,t,r){return r&&(t/=Math.SQRT2),te(e,((n,i)=>{let s=n-.5*e+.25,a=.5*e-i-.75;if(r){const e=(s+a)/Math.SQRT2;a=(a-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(a))-.5*t}))}function Q(e,t,r,n=0){t-=n,r&&(t*=Math.SQRT2);const i=.5*t;return te(e,((t,s)=>{let a,o=t-.5*e,l=.5*e-s-1;if(r){const e=(o+l)/Math.SQRT2;l=(l-o)/Math.SQRT2,o=e}return o=Math.abs(o),l=Math.abs(l),a=o>l?o>i?Math.sqrt((o-i)*(o-i)+l*l):l:l>i?Math.sqrt(o*o+(l-i)*(l-i)):o,a-=n/2,a}))}function K(e,t,r){return(n,i)=>{const s=n-e,a=i-t;return Math.sqrt(s*s+a*a)-r}}function ee(e,t,r){const n=Math.sqrt(t*t+r*r);return(i,s)=>{const a=Math.abs(i-e)-r,o=s-e+t/2+.75,l=(t*a+r*o)/n,c=-o;return Math.max(l,c)}}function te(e,t){const r=new Uint8Array(4*e*e);for(let n=0;n<e;n++)for(let i=0;i<e;i++){const s=i+e*n;let a=t(i,n);a=a/e+.5,(0,$.U)(a,r,4*s)}return r}var re=r(46610),ne=r(46540);class ie{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.getOrCreateSharedTexture("circle-icon",(()=>function(e,t=128,r=.5*t,n=0){return{data:X(e,t,r,n),parameters:{mipmap:!1,wrap:{s:Y.pF.CLAMP_TO_EDGE,t:Y.pF.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle")));this._iconTextureID=t;const r={anchorPosition:L.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:Z,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:W("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r;if(null==t)throw new Error("expected material not to be null");const i=await this._createGeometry(e);if(null==i)return r.createPipelineCommand();const s=q(e,r);return r.createPipelineCommand(n.addDirectRendererGeometry(e.id,i,s))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:n}=r,{featureCount:i}=e;if(0===i||null==t)return null;const s=N(e),a=k(e),o=function(e,t){const r=e.length/3,n=t.viewSpatialReference,i=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,U.projectBuffer)(e,n,0,s,i,0,r))throw new Error("Failed to project coordinates");return s}(await n.applyElevationAlignmentTo(a),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),d=new Float64Array([24,24]),u=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),p=new Uint32Array(i);for(let e=0;e<i;++e)p[e]=e;const m=new Uint32Array(i);for(let e=0;e<i;++e)m[e]=0;const g=new re.n(o,p,3,!0),y=new re.n(l,m,3,!0),_=new re.n(h,m,2,!0),b=new re.n(c,m,4,!0),v=new re.n(f,m,1,!0),w=new re.n(d,m,2,!0),x=new re.n(u,m,4,!0),S=[[ne.r.POSITION,g],[ne.r.NORMAL,y],[ne.r.UV0,_],[ne.r.COLOR,b],[ne.r.ROTATION,v],[ne.r.SIZE,w],[ne.r.CENTEROFFSETANDDISTANCE,x]],I=new Uint8Array(i);return e.getVisibilityArray(I),{attributes:G(S),objectAndLayerIdColor:void 0,transformation:(0,C.vt)(),materialId:t,objectIds:s,visibilities:I}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(n.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r,{featureCount:i,id:s}=e;if(null==t||0===i)return r.createPipelineCommand();const a=await this._createGeometry(e);if(null==a)return r.createPipelineCommand();const o=q(e,r);return r.createPipelineCommand(n.updateDirectRendererGeometry(s,a,o))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let n;return n=null!=e?await r.releaseSharedTexture("circle-icon"):g.create(r),n.appendPipelineStateCommand((()=>this._destroy())),n}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=_.A.toUnitRGB(r),n=r.a*e;return[t[0],t[1],t[2],n]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return ae;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=se){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=se){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const n=(0,I.o8)(I.Un);return null!=e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),null!=t?n[3]=t:null!=e&&e.length>3&&(n[3]=e[3]),r&&(n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r),n}(null!=e?_.A.toUnitRGB(e):S.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??A.r;var e}}const se={hasIntrinsicColor:!1},ae=I.uY;class oe{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,n=[];for(const i of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(i);null!=t&&(n.push(t.load()),r.push(t))}await Promise.all(n),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const n=e.joinPipelineCommands(await Promise.all(r));return n.appendPipelineStateCommand((()=>this._destroy())),n}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(n))}}class le{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createAddCommand(e);return n.appendPipelineStateCommand((()=>this._featureData.set(e.id,e))),n}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return n.appendPipelineStateCommand((()=>this._featureData.delete(e))),n}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const n=[];for(const t of e.values())n.push(r.createUpdateElevationCommand(t));const i=await Promise.all(n);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const n=[];for(const e of r.keys())n.push(this.createRemoveCommand(e));n.push(e.createDestroyCommand());const i=await Promise.all(n);return t.joinPipelineCommands(i)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var ce,de,ue=r(48353),he=r(30809),fe=r(8887),pe=r(38954),me=r(72385),ge=(r(4197),r(11868)),ye=r(240);r(71351),(de=ce||(ce={})).length=function(e,t){const r=e[t],n=e[t+1],i=e[t+2];return Math.sqrt(r*r+n*n+i*i)},de.normalize=function(e,t){const r=e[t],n=e[t+1],i=e[t+2],s=1/Math.sqrt(r*r+n*n+i*i);e[t]*=s,e[t+1]*=s,e[t+2]*=s},de.scale=function(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r},de.add=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]+r[n],i[s+1]=e[t+1]+r[n+1],i[s+2]=e[t+2]+r[n+2]},de.subtract=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]-r[n],i[s+1]=e[t+1]-r[n+1],i[s+2]=e[t+2]-r[n+2]},r(87170);var _e=r(620);r(75039);const be=ce,ve=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)ve[6*e+t]=e;const we=new Array(36);for(let e=0;e<6;e++)we[6*e]=0,we[6*e+1]=1,we[6*e+2]=2,we[6*e+3]=2,we[6*e+4]=3,we[6*e+5]=0;const xe=(0,me.fA)(-.5,0,-.5),Ce=(0,me.fA)(.5,0,-.5),Se=(0,me.fA)(0,0,.5),Ie=(0,me.fA)(0,.5,0),Ae=(0,me.vt)(),Te=(0,me.vt)(),Oe=(0,me.vt)(),Re=(0,me.vt)(),Pe=(0,me.vt)();(0,pe.d)(Ae,xe,Ie),(0,pe.d)(Te,xe,Ce),(0,pe.e)(Oe,Ae,Te),(0,pe.n)(Oe,Oe),(0,pe.d)(Ae,Ce,Ie),(0,pe.d)(Te,Ce,Se),(0,pe.e)(Re,Ae,Te),(0,pe.n)(Re,Re),(0,pe.d)(Ae,Se,Ie),(0,pe.d)(Te,Se,xe),(0,pe.e)(Pe,Ae,Te),(0,pe.n)(Pe,Pe),Oe[0],Oe[1],Oe[2],Re[0],Re[1],Re[2],Pe[0],Pe[1],Pe[2],(0,S.vt)();var Ee=r(4576),Me=r(69397),De=r(24151);r(62258),r(65215),r(86305),r(16396),(0,S.vt)(),(0,I.vt)(),r(87582);var Fe=r(57917);function Ve(e,t){const r=(e,r,n=!1)=>({levels:e.map((e=>{const i=G(r(e.tesselation));return n&&function(e){const t=e,r=t.get(ne.r.POSITION).data,n=t.get(ne.r.NORMAL).data;if(n){const t=je(e,ne.r.NORMAL).data;for(let e=0;e<n.length;e+=3){const r=n[e+1];t[e+1]=-n[e+2],t[e+2]=r}}if(r){const t=je(e,ne.r.POSITION).data;for(let e=0;e<r.length;e+=3){const n=r[e+1];t[e+1]=-r[e+2],t[e+2]=n}}}(i),{components:[{attributes:i,objectAndLayerIdColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}}))});switch(e){case"cone":return r(Be,(e=>function(e,t,r,n,i=!0,s=!0){let a=0;const o=t,l=e;let c=(0,me.fA)(0,a,0),d=(0,me.fA)(0,a+l,0),u=(0,me.fA)(0,-1,0),h=(0,me.fA)(0,1,0);n&&(a=l,d=(0,me.fA)(0,0,0),c=(0,me.fA)(0,a,0),u=(0,me.fA)(0,1,0),h=(0,me.fA)(0,-1,0));const f=[d,c],p=[u,h],m=r+2,g=Math.sqrt(l*l+o*o);if(n)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),n=(0,me.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,me.fA)(l*Math.cos(t)/g,-o/g,l*Math.sin(t)/g);p.push(i)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),n=(0,me.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,me.fA)(l*Math.cos(t)/g,o/g,l*Math.sin(t)/g);p.push(i)}const y=new Array,_=new Array;if(i){for(let e=3;e<f.length;e++)y.push(1),y.push(e-1),y.push(e),_.push(0),_.push(0),_.push(0);y.push(f.length-1),y.push(2),y.push(1),_.push(0),_.push(0),_.push(0)}if(s){for(let e=3;e<f.length;e++)y.push(e),y.push(e-1),y.push(0),_.push(e),_.push(e-1),_.push(1);y.push(0),y.push(2),y.push(f.length-1),_.push(1),_.push(2),_.push(p.length-1)}const b=(0,ge.oe)(3*m);for(let e=0;e<m;e++)b[3*e]=f[e][0],b[3*e+1]=f[e][1],b[3*e+2]=f[e][2];const v=(0,ge.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[[ne.r.POSITION,new re.n(b,y,3,!0)],[ne.r.NORMAL,new re.n(v,_,3,!0)]]}(1,.5,e,!1)),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],(e=>function(e,t,r){const n=e;let i,s;if(r)i=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],s=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=n*(1+Math.sqrt(5))/2;i=[-n,e,0,n,e,0,-n,-e,0,n,-e,0,0,-n,e,0,n,e,0,-n,-e,0,n,-e,e,0,-n,e,0,n,-e,0,-n,-e,0,n],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<i.length;t+=3)be.scale(i,t,e/be.length(i,t));let a={};function o(t,r){t>r&&([t,r]=[r,t]);const n=t.toString()+"."+r.toString();if(a[n])return a[n];let s=i.length;return i.length+=3,be.add(i,3*t,i,3*r,i,s),be.scale(i,s,e/be.length(i,s)),s/=3,a[n]=s,s}for(let e=0;e<t;e++){const e=s.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=s[r],n=s[r+1],i=s[r+2],a=o(e,n),l=o(n,i),c=o(i,e),d=4*r;t[d]=e,t[d+1]=a,t[d+2]=c,t[d+3]=n,t[d+4]=l,t[d+5]=a,t[d+6]=i,t[d+7]=c,t[d+8]=l,t[d+9]=a,t[d+10]=l,t[d+11]=c}s=t,a={}}const l=(0,ge.Wz)(i);for(let e=0;e<l.length;e+=3)be.normalize(l,e);return[[ne.r.POSITION,new re.n((0,ge.Wz)(i),s,3,!0)],[ne.r.NORMAL,new re.n(l,s,3,!0)]]}(.5,e,!0)));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function je(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Fe.S)(r.data)},e.set(t,r)),r}const Be=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var Le=r(89192),Ue=r(88076),ze=r(74810);class Ne{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:ze.Bt,ambient:S.Un,diffuse:S.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=I.Un,r.isInstanced=!0,this._isPrimitive){const e=new Ue.fs;e.layerOpacity=t,r={...r,cullFace:ke((0,Ue.ty)(e))}}const n=await e.createMaterial({type:"default",parameters:r}),i=this._symbolLayer.resource;this._primitive=i&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(i?.primitive)?i.primitive:he.r;const s=Ve(this._primitive,n);this._lodRendererId=await e.createLodRenderer(s),this._primitiveMaterialId=n,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,n=r.renderCommandContext,i=[];return null!=e&&i.push(n.destroyLodRenderer(e)),null!=t&&i.push(n.destroyMaterial(t)),new g(n,n.mergeRenderCommandBuffers(i),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:n}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:i}=e;if(0===i)return t.createPipelineCommand();const s=this._isPrimitive,a=this._primitive||he.r,o=(0,R.vt)((0,fe.Fq)(a)),l=(0,S.ci)((0,R.Ej)(o)),c=(0,S.ci)((0,fe.Bb)(l,{isPrimitive:s,width:100,depth:null,height:null})),d=new Float64Array(16*i),u=new Float64Array(16*i),h=k(e),f=await n.applyElevationAlignmentTo(h);for(let e=0;e<i;++e){const t=e,r=f[3*e+0],n=f[3*e+1],i=f[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ge),a=this._computeLocalTransform(c,l,He);this._writeMatrixToTypedBuffer(d,t,a),this._writeMatrixToTypedBuffer(u,t,s)}const p=N(e),m=new Uint8Array(i);e.getVisibilityArray(m);const g={featureIds:new Uint32Array(p),visibility:m,localTransforms:d,globalTransforms:u};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,g))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,n=this._primitiveMaterialId;if(null==n)return t.createPipelineCommand();const i=this._getLayerOpacity();let s={layerOpacity:i};if(this._isPrimitive){const e=new Ue.fs;e.layerOpacity=i,s={...s,cullFace:ke((0,Ue.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:n,parameters:s}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:n,mainThreadDelegate:i}=t,{featureCount:s,id:a}=e;if(null==r||0===s)return t.createPipelineCommand();const o=new Float64Array(16*s),l=k(e),c=await i.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],n=c[3*e+1],i=c[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ge);this._writeMatrixToTypedBuffer(o,t,s)}return t.createPipelineCommand(n.updateLodInstancesData(r,a,o))}_writeMatrixToTypedBuffer(e,t,r){let n=16*t;for(let t=0;t<16;t++)e[n++]=r[t]}_computeGlobalTransform(e,t,r,n,i){return qe[0]=e,qe[1]=t,qe[2]=r,(0,ue.l)(n,qe,i,this._context.renderSpatialReference),i}_computeLocalTransform(e,t,r){return(0,O.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const n=function(e=S.Un,t,r,n=1){const i=new Array(3);if(null==t||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,s=0;for(let a=2;a>=0;a--){const o=e[a],l=null!=o,c=0===a&&!n&&!l,d=r[a];let u;"symbol-value"===o||c?u=0!==d?t[a]/d:1:l&&"proportional"!==o&&isFinite(o)&&(u=0!==d?o/d:1),null!=u&&(i[a]=u,n=u,s=Math.max(s,Math.abs(u)))}for(let e=2;e>=0;e--)null==i[e]?i[e]=n:0===i[e]&&(i[e]=.001*s)}for(let e=2;e>=0;e--)i[e]/=n;return(0,S.ci)(i)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===n[0]&&1===n[1]&&1===n[2]||(0,O.hs)(r,r,n)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function ke(e){return e?Le.s2.None:Le.s2.Back}const qe=(0,S.vt)(),He=(0,C.vt)(),Ge=(0,C.vt)();class $e{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new ie(x(),this._context),this._symbols[1]=new Ne(new v.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),n=await Promise.all(r.map((async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))}))),i=t.joinPipelineCommands(n);return i.appendPipelineStateCommand((()=>this._featureDataPartitioning.set(e.id,r))),i}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))}))),a=r.joinPipelineCommands(s);return a.appendPipelineStateCommand((()=>t.delete(e))),a}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e.id);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))})));return r.joinPipelineCommands(s)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const n=this._symbols[t];null!=n&&n.loaded&&r.push(n.createUpdateLayerViewOpacityCommand(e))}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))}));r.push(...e)}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const n=await Promise.all(r);return t.joinPipelineCommands(n)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=N(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,n=[[],[]];for(let e=0;e<r;++e)n[t[e]%2].push(e);return n.map(((t,r)=>new Ye(r,e.subset(new Uint32Array(t))))).filter((e=>e.features.featureCount>0))}}class Ye{constructor(e,t){this.index=e,this.features=t}}class Ze{constructor(e,t,r,n,i,s,a){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=n,this.renderCommandContext=i,this.layerInfo=s,this.layerViewInfo=a,this.symbolRendererFactory=new We(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new g(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter((e=>null!=e)).reduce(((e,t)=>(e.append(t),e)))}}class We{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,m.L)(e??Xe)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new le(t,this.context);case"unique-value":return new $e(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON(Xe)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new oe(e,this.context);case"picture-marker":return new ie(x(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new ie(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const Xe={type:"simple"};var Je,Qe,Ke,et=r(69622),tt=r(60999),rt=r(32587);class nt{constructor(e,t){this._joinCommands=e,this._createCommand=t,this._executing=new Set,this._nextEvents=new Map}async enqueueActions(e){const{_executing:t}=this;return e.every((e=>!t.has(e.tileId)))?await this._executeActions(e):await this._scheduleActions(e)}async _scheduleActions(e){const{_nextEvents:t}=this,r=new Set(e.map((e=>t.get(e.tileId))).filter(Ee.Ru));let n;if(0!==r.size){const i=new Array,s=new Array;for(const e of r)i.push(e.actions),s.push(e.resolver);i.push(e);for(const e of i)for(const r of e)t.delete(r.tileId);const a=i.reduce(at);n=new it(a),n.resolver.promise.then((()=>{for(const e of s)e.resolve()}),(e=>{for(const t of s)t.reject(e)}))}else n=new it(e);for(const e of n.actions)t.set(e.tileId,n);return this._validate(),await n.resolver.promise}async _executeActions(e){const t=e.map((e=>e.tileId)),{_executing:r}=this;for(const e of t)r.add(e);this._validate();try{const t=(await Promise.allSettled(e.map(this._createCommand))).map((e=>"fulfilled"===e.status?e.value:null)).filter(Ee.Ru);if(0===t.length)return;const r=this._joinCommands(t);await(r?.execute())}finally{for(const e of t)r.delete(e);this._executeTails(t)}}_executeTails(e){const{_nextEvents:t}=this,r=new Set(e.map((e=>t.get(e))).filter(Ee.Ru));if(0===r.size)return;const{_executing:n}=this;for(const e of r)if(!e.actions.some((e=>n.has(e.tileId)))){for(const r of e.actions)t.delete(r.tileId);this._executeActions(e.actions).then((()=>{e.resolver.resolve()}),(t=>{e.resolver.reject(t)}))}}_validate(){const{_nextEvents:e}=this,t=Array.from(new Set(e.values()));if(0!==t.length&&t.some((t=>t.actions.some((({tileId:r})=>e.get(r)!==t)))))throw new Error("Mismatch between map and event")}}class it{constructor(e){this.actions=e,this.resolver=(0,s.Tw)()}}class st{constructor(e,t,r){this.tileId=e,this.type=t,this.data=r}toString(){return`${this.tileId}: ${this.type}`}}function at(e,t){const r=new Array(e.length).fill(!0),n=new Array(t.length).fill(!0);e:for(let i=0;i<e.length;++i){const s=e[i];for(let e=0;e<t.length;++e)if(n[e])switch(ot(s,t[e])){case Qe.NONE:break;case Qe.OVERWRITE:r[i]=!1;continue e;case Qe.REDUNDANT:n[e]=!1;break;case Qe.ANNIHILATE:r[i]=!1,n[e]=!1;continue e}}const i=new Array;for(let t=0;t<e.length;++t)r[t]&&i.push(e[t]);for(let e=0;e<t.length;++e)n[e]&&i.push(t[e]);return i}function ot(e,t){if(e.tileId!==t.tileId)return Qe.NONE;if(e.type===Je.ADD&&t.type===Je.REMOVE)return Qe.ANNIHILATE;if(e.type===Je.ADD&&t.type===Je.UPDATE_VISIBILITY)return Qe.REDUNDANT;if(e.type===Je.REMOVE&&t.type===Je.ADD)return Qe.ANNIHILATE;if(e.type===Je.UPDATE_VISIBILITY&&t.type===Je.REMOVE)return Qe.OVERWRITE;if(e.type===Je.UPDATE_VISIBILITY&&t.type===Je.UPDATE_VISIBILITY)return Qe.OVERWRITE;throw new Error("Impossible sequence of actions")}(Ke=Je||(Je={})).ADD="ADD",Ke.REMOVE="REMOVE",Ke.UPDATE_VISIBILITY="UPDATE_VISIBILITY",function(e){e.NONE="NONE",e.ANNIHILATE="ANNIHILATE",e.OVERWRITE="OVERWRITE",e.REDUNDANT="REDUNDANT"}(Qe||(Qe={}));var lt=r(24326);function ct(e=""){return`${e}${(0,lt.c)()}`}r(37539),new Float64Array(3);class dt{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=ct(`featureDataSubset-${e.id}-`)}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Me.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let n=0;n<r.length;++n)r[n]=t[e[n]];return new dt(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let n=0;n<t;++n)this.getEnabled(n)&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class ut{constructor(e){this._tile=e,this.id=ct(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get featureCount(){return this._tile.featureCount}get usedMemory(){return Me.qK+(0,Me.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every((e=>e))}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new dt(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const n of this._allFeatureIndices())t[n]&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:n}=this;for(const i of t)e[r++]=Number(n[i]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let ht=class extends et.A{constructor(e){super(e),this._updatingCount=0,this.extent=null,this._tileHandles=new rt.A,this._wanted=new rt.A}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updatingCount>0}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,P.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const n of t.values())null==r.get(n.id)?.featureData&&e.push(n);return e}async onTileTreeChange(e){++this._updatingCount;try{const{added:t,removed:r}=e,n=this._tileHandles,{_boundingRect:i}=this,s=null!=i?t.filter((e=>(0,P.HY)(i,e.extent))):t,a=this._wanted,o=new Array;for(const{id:e}of r)a.delete(e);for(const e of s)a.set(e.id,e);const l=this._missingTiles;for(const e of r){const{id:t}=e;if(l.some((t=>ft(t,e)||ft(e,t))))continue;const r=n.get(t);null!=r&&o.push(this._removeTile(r))}for(const e of s)o.push(this._addTile(e));const c=await Promise.allSettled(o);for(const e of c)"rejected"===e.status&&console.error(e.reason)}finally{--this._updatingCount}}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;null!=t&&await this.synchronizer.enqueueActions([new st(e.id,Je.REMOVE,t)])}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!mt(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const n=new pt(e,(0,tt.UT)((async t=>{const r=await this.loadTile(e,t);return(0,s.Te)(t),new ut(r)})));this._tileHandles.set(n.id,n);try{await n.loadTask.promise}catch(e){return void(0,s.jH)(e)}(function(e){if(!mt(e))throw new Error})(n),await this._onTileLoad(n)}async _onTileLoad(e){const{_wanted:t,_tileHandles:r,_missingTiles:n}=this,i=e.descriptor,s=new Array,a=new Set;for(const o of r.values()){if(o===e)continue;const{descriptor:l,id:c}=o;if(t.has(c)||n.some((e=>ft(e,l)||ft(l,e)))){if(mt(o)){if(ft(i,l)){const e=o.featureData;for(const t of e.objectIds())a.add(t)}if(ft(l,i)){const t=e.featureData,r=new Set(t.objectIds()),{featureData:n}=o;n.disableObjectIds(r),s.push(new st(c,Je.UPDATE_VISIBILITY,n)),this._validateRemoval(n,r)}}}else{r.delete(c),o.loadTask.abort();const{featureData:e}=o;null!=e&&s.push(new st(c,Je.REMOVE,e))}}a.size>0&&(e.featureData.disableObjectIds(a),this._validateRemoval(e.featureData,a)),this._validate(),s.push(new st(e.id,Je.ADD,e.featureData)),await this.synchronizer.enqueueActions(s)}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!mt(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:n}=e[t];for(let i=t+1;i<e.length;++i){const{featureData:t,objectIds:s}=e[i];for(const e of s)if(n.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function ft({lij:[e,t,r]},{lij:[n,i,s]}){const a=n-e;return a>=0&&t===i>>a&&r===s>>a}(0,n._)([(0,o.MZ)()],ht.prototype,"updating",null),(0,n._)([(0,o.MZ)({constructOnly:!0})],ht.prototype,"loadTile",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],ht.prototype,"synchronizer",void 0),(0,n._)([(0,o.MZ)()],ht.prototype,"_updatingCount",void 0),(0,n._)([(0,o.MZ)()],ht.prototype,"extent",void 0),(0,n._)([(0,o.MZ)()],ht.prototype,"_boundingRect",null),(0,n._)([(0,o.MZ)()],ht.prototype,"_missingTiles",null),ht=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],ht);class pt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function mt(e){return null!=e.featureData}var gt=r(75503),yt=r(27647),_t=r(92722);class bt{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Me.qK+Me.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new vt(this._index,this._view,e)}}class vt extends bt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,yt.Q)(new _t.A,this._geometryOverride,e.hasZ,e.hasM)}}class wt{constructor(e,t){this.featureData=e,this.bounds=t}}class xt{constructor(){this._tileBounds=new Map,this.events=new i.A,this.featureAdapter=Ct.shared}get usedMemory(){return Me.qK+Me.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new gt.w(9,(t=>e.getBounds(t))),n=new Array;for(let e=0;e<t;++e)n[e]=e;r.load(n),this._tileBounds.set(e.id,new wt(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all((r=>{t.getEnabled(r)&&e(new bt(r,t))}))}forEachInBounds(e,t){St.minX=e[0],St.minY=e[1],St.maxX=e[2],St.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(St,(r=>{e.getEnabled(r)&&t(new bt(r,e))}))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:a,maxX:o,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,a),n=Math.min(n,o),i=Math.min(i,l)}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:e}}}class Ct{static{this.shared=new Ct}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const St=new gt.E;var It=r(80893);class At{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const n=Me.ez+t.reduce(((e,{usedMemory:t})=>e+t),0),i=3*Me.RS;this.usedMemory=Me.qK+n+i,this.featureCount=t.reduce(((e,t)=>e+t.featureCount),0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttribute(n,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(n,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:n,featurePageIndex:i}=this._translateIndex(e);this._pages[n].getCoordinates(i,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getCentroid(n,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getObjectIdsArray(e,i,n);return n}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getCoordinatesArray(e,i,n);return n}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,n=new Array;for(const i of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(i);r!==e&&(0!==n.length&&t.push({pageIndex:r,indices:n}),r=e,n=[]),n.push(s)}0!==n.length&&t.push({pageIndex:r,indices:n})}const{_pages:r}=this;for(const{pageIndex:e,indices:n}of t)yield{page:r[e],indices:n}}}var Tt=r(49186),Ot=r(51624),Rt=r(62577),Pt=r(95466),Et=r(53655);class Mt{constructor(e){this._reader=new Ot.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return Dt(e.getMessage());e.skip()}Vt()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:n}}=this,i=r.get(t)?.index;if(null==i)return;const s=n[e*r.fields.length+i],a=this._reader;return a.move(s),jt(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,n=e*t.fields.length,i=this._reader,s={};for(const e of t.fields){const t=r[n+e.index];i.move(t),s[e.name]=jt(i)}return s}getCoordinates(e,t,r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;n.move(s[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=(0,S.vt)();return this.getCoordinates(e,t),new _t.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Bt);const[n,i,s]=Bt,a=[n,i];return t&&(a[3]=s),r&&(a[t?4:3]=0),new _t.A([],a)}getBounds(e){this.getCoordinates(e,Bt);const[t,r]=Bt,n=new gt.E;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,Bt);const[t,r,n]=Bt;return(0,R.fA)(t,r,n,t,r,n)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{objectIdFieldName:i,attributeIndices:s,fieldsIndex:a}=this._index,o=a.get(i).index,l=a.fields.length;for(const i of t){const t=s[i*l+o];n.move(t),e[r++]=jt(n)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;for(const i of t){const t=s[i];n.move(t),r=this._readCoordinates(a,o,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:n,fieldsIndex:i}=this._index,s=i.get(r).index,a=i.fields.length;for(const r of e){const e=n[r*a+s];t.move(e),yield jt(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[n,i,s],a,o){const l=this._reader,c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)3===l.tag()?(l.getUInt32(),a[o++]=n+e*l.getSInt64(),a[o++]=i+t*l.getSInt64(),a[o++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return o}}function Dt(e){for(;e.next();){if(1===e.tag())return Ft(e.getMessage());e.skip()}Vt()}function Ft(e){let t,r,n=!1,i=!1,s=0;const a=new Array,o=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&Vt();break;case 9:n=e.getBool()??!1;break;case 12:t=(0,Rt.Q1)(e.processMessage(Et.ae));break;case 13:{const t=e.processMessage(Et.cn);t.index=s++,a.push(t);break}case 15:{o.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:i=e.getBool()??!1;break;default:e.skip()}const c=new Pt.A(a);return null!=t&&i&&null!=r&&c.has(r)||Vt(),{transform:t,exceededTransferLimit:n,fieldsIndex:c,objectIdFieldName:r,featureIndices:o,attributeIndices:l}}function Vt(){const e=new Tt.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function jt(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const Bt=(0,S.vt)();class Lt{constructor(e,t,r,n,i){this.spatialReference=e,this.url=r,this.objectIdField=n,this.capabilities=i;const{supportsMaxRecordCountFactor:s,maxRecordCount:a}=this.capabilities.query,o=s?4:1,l=(a??8e3)*o;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=o,c.num=this._pageSize,c.outFields=[n],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:n}=this,i=(0,P.w1)(e.extent,r),a=this._baseQuery.clone();a.geometry=i;const o=new Array;let l=0,c=!1,d=1;for(;!c;){const e=[];for(let r=0;r<d;++r)e.push(this._fetchPage(a,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&o.push(e)}d=Math.min(d+1,4)}return new At(e,o,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,It.kS)(this.url,n,{signal:r})).data;return(0,s.Te)(r),new Mt(i)}}var Ut=r(29920),zt=r(77690),Nt=r(29242);var kt=r(13030),qt=r(78662),Ht=r(1843),Gt=r(49255),$t=r(40268),Yt=r(16943),Zt=r(25634),Wt=r(11725),Xt=r(13464),Jt=r(77194);class Qt{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var Kt=r(59907),er=r(43616),tr=r(13259),rr=r(97220),nr=r(98958),ir=r(59643),sr=r(33524),ar=r(90644);class or extends nr.w{constructor(e,t){super(e,t,new rr.$(tr.H,(()=>r.e(8241).then(r.bind(r,48241))))),this.primitiveType=t.occlusionPass?Y.WR.POINTS:Y.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:n,output:i,depthTestEnabled:s,occlusionPass:a}=e,o=t===ir.Y.NONE,l=t===ir.Y.ColorAlpha,c=i===Gt.V.Highlight,d=s&&!n&&!l&&!a&&!c;return(0,ar.Ey)({blending:(0,Gt.RN)(i)?o?ar.RC:(0,sr.ez)(t):null,depthTest:s&&!n?{func:Y.MT.LEQUAL}:null,depthWrite:d?ar.Uy:null,drawBuffers:(0,sr.m6)(t,i),colorWrite:ar.kn,polygonOffset:r?lr:null})}}const lr={factor:0,units:-4};var cr=r(53466),dr=r(22911),ur=r(51976),hr=r(35256);class fr extends hr.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.textureCoordinateType=cr.I.None,this.emissionSource=dr.ZX.None,this.discardInvisibleFragments=!0,this.hasVvInstancing=!1,this.snowCover=!1}}(0,n._)([(0,ur.W)()],fr.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"occlusionTestEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"signedDistanceFieldEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"vvSize",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"vvColor",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasVerticalOffset",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasScreenSizePerspective",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasRotation",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"debugDrawLabelBorder",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasPolygonOffset",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"depthTestEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"pixelSnappingEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"draped",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"terrainDepthTest",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"cullAboveTerrain",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"occlusionPass",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"occludedFragmentFade",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"horizonCullingEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"isFocused",void 0);var pr=r(49788);class mr extends Wt.im{constructor(e,t){super(e,Ur),this.produces=new Map([[Xt.N.HUD_MATERIAL,e=>(0,Gt.Mb)(e)&&!this.parameters.drawAsLabel],[Xt.N.LABEL_MATERIAL,e=>(0,Gt.Mb)(e)&&this.parameters.drawAsLabel],[Xt.N.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[Xt.N.DRAPED_MATERIAL,e=>this.parameters.draped&&(0,Gt.Mb)(e)]]),this._visible=!0,this._configuration=new fr(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===Xt.N.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===Xt.N.OCCLUSION_PIXELS,(0,Gt.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!F.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,n,i,s){const{options:{selectionMode:a,hud:o,excludeLabels:l},point:c,camera:d}=r,{parameters:u}=this;if(!a||!o||l&&u.isLabel||!e.visible||!c)return;const h=e.attributes.get(ne.r.FEATUREATTRIBUTE),f=null==h?null:(0,I.ci)(h.data,Dr),{scaleX:p,scaleY:m}=qr(f,u,d.pixelRatio);(0,zt.z0)(Tr,t),e.attributes.has(ne.r.FEATUREATTRIBUTE)&&function(e){const t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+n*n),u=1/Math.sqrt(i*i+s*s+a*a),h=1/Math.sqrt(o*o+l*l+c*c);e[0]=t*d,e[1]=r*d,e[2]=n*d,e[3]=i*u,e[4]=s*u,e[5]=a*u,e[6]=o*h,e[7]=l*h,e[8]=c*h}(Tr);const g=e.attributes.get(ne.r.POSITION),y=e.attributes.get(ne.r.SIZE),_=e.attributes.get(ne.r.NORMAL),b=e.attributes.get(ne.r.ROTATION),v=e.attributes.get(ne.r.CENTEROFFSETANDDISTANCE);(0,_e.vA)(g.size>=3);const w=(0,tr.c)(u),x="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<g.data.length/g.size;e++){const n=e*g.size;(0,pe.i)(vr,g.data[n],g.data[n+1],g.data[n+2]),(0,pe.t)(vr,vr,t),(0,pe.t)(vr,vr,d.viewMatrix);const i=e*v.size;if((0,pe.i)(Er,v.data[i],v.data[i+1],v.data[i+2]),!x&&(vr[0]+=Er[0],vr[1]+=Er[1],0!==Er[2])){const e=Er[2];(0,pe.n)(Er,vr),(0,pe.d)(vr,vr,(0,pe.h)(Er,Er,e))}const a=e*_.size;if((0,pe.i)(wr,_.data[a],_.data[a+1],_.data[a+2]),yr(wr,Tr,d,Fr),Hr(this.parameters,vr,Fr,d,br),d.applyProjection(vr,xr),xr[0]>-1){x&&(Er[0]||Er[1])&&(xr[0]+=Er[0]*d.pixelRatio,0!==Er[1]&&(xr[1]+=(0,Jt.m0)(Er[1],br.factorAlignment)*d.pixelRatio),d.unapplyProjection(xr,vr)),xr[0]+=this.parameters.screenOffset[0]*d.pixelRatio,xr[1]+=this.parameters.screenOffset[1]*d.pixelRatio,xr[0]=Math.floor(xr[0]),xr[1]=Math.floor(xr[1]);const t=e*y.size;Br[0]=y.data[t],Br[1]=y.data[t+1],(0,Jt.MD)(Br,br.factor,Br);const n=Vr*d.pixelRatio;let i=0;u.textureIsSignedDistanceField&&(i=Math.min(u.outlineSize,.5*Br[0])*d.pixelRatio/2),Br[0]*=p,Br[1]*=m;const a=e*b.size,o=u.rotation+b.data[a];if(_r(c,xr[0],xr[1],Br,n,i,o,u,w)){const e=r.ray;if((0,pe.t)(Sr,vr,(0,O.B8)(Rr,d.viewMatrix)),xr[0]=c[0],xr[1]=c[1],d.unprojectFromRenderScreen(xr,vr)){const t=(0,S.vt)();(0,pe.c)(t,e.direction);const r=1/(0,pe.l)(t);(0,pe.h)(t,t,r),s((0,pe.j)(e.origin,vr)*r,t,-1,!0,1,Sr)}}}}}intersectDraped(e,t,r,n,i,s){const a=e.attributes.get(ne.r.POSITION),o=e.attributes.get(ne.r.SIZE),l=e.attributes.get(ne.r.ROTATION),c=this.parameters,d=(0,tr.c)(c),u=e.attributes.get(ne.r.FEATUREATTRIBUTE),h=null==u?null:(0,I.ci)(u.data,Dr),{scaleX:f,scaleY:p}=qr(h,c,e.screenToWorldRatio),m=jr*e.screenToWorldRatio;for(let t=0;t<a.data.length/a.size;t++){const r=t*a.size,u=a.data[r],h=a.data[r+1],g=t*o.size;Br[0]=o.data[g],Br[1]=o.data[g+1];let y=0;c.textureIsSignedDistanceField&&(y=Math.min(c.outlineSize,.5*Br[0])*e.screenToWorldRatio/2),Br[0]*=f,Br[1]*=p;const _=t*l.size,b=c.rotation+l.data[_];_r(n,u,h,Br,m,y,b,c,d)&&i(s.dist,s.normal,-1,!1)}}createBufferWriter(){return new kr}applyShaderOffsetsView(e,t,r,n,i,s,a){const o=yr(t,r,i,Fr);return this._applyVerticalGroundOffsetView(e,o,i,a),Hr(this.parameters,a,o,i,s),this._applyPolygonOffsetView(a,o,n[3],i,a),this._applyCenterOffsetView(a,n,a),a}applyShaderOffsetsNDC(e,t,r,n,i){return this._applyCenterOffsetNDC(e,t,r,n),null!=i&&(0,pe.c)(i,n),this._applyPolygonOffsetNDC(n,t,r,n),n}_applyPolygonOffsetView(e,t,r,n,i){const s=n.aboveGround?1:-1;let a=Math.sign(r);0===a&&(a=s);const o=s*a;if(this.parameters.shaderPolygonOffset<=0)return(0,pe.c)(i,e);const l=(0,D.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/n.viewport[2];return(0,pe.h)(i,e,o>0?c:1/c),i}_applyVerticalGroundOffsetView(e,t,r,n){const i=(0,pe.l)(e),s=r.aboveGround?1:-1,a=r.computeRenderPixelSizeAtDist(i)*$t.R,o=(0,pe.h)(vr,t.normal,s*a);return(0,pe.g)(n,e,o),n}_applyCenterOffsetView(e,t,r){const n="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,pe.c)(r,e),n&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,pe.n)(wr,r),(0,pe.g)(r,r,(0,pe.h)(wr,wr,t[2])))),r}_applyCenterOffsetNDC(e,t,r,n){const i="screen"!==this.parameters.centerOffsetUnits;return n!==e&&(0,pe.c)(n,e),i||(n[0]+=t[0]/r.fullWidth*2,n[1]+=t[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,t,r,n){const i=this.parameters.shaderPolygonOffset;if(e!==n&&(0,pe.c)(n,e),i){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);n[2]-=(s||e)*i}return n}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,n=e[3]>=pr.Q||t>=pr.Q&&r[3]>=pr.Q;return this._visible&&n}createGLMaterial(e){return new gr(e)}calculateRelativeScreenBounds(e,t,r=(0,P.vt)()){return function(e,t,r,n){n[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,n[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class gr extends Zt.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(or,e)}}function yr(e,t,r,n){return function(e){return function(e){return e instanceof Float32Array&&e.length>=16}(e)||function(e){return Array.isArray(e)&&e.length>=16}(e)}(t)&&(t=(0,zt.z0)(Or,t)),(0,pe.q)(n.normal,e,t),(0,pe.t)(n.normal,n.normal,r.viewInverseTransposeMatrix),n.cosAngle=(0,pe.f)(Cr,Lr),n}function _r(e,t,r,n,i,s,a,o,l){let c=t-i-n[0]*l[0],d=c+n[0]+2*i,u=r-i-n[1]*l[1],h=u+n[1]+2*i;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&null!=f&&(c+=n[0]*f[0],u+=n[1]*f[1],d-=n[0]*(1-f[2]),h-=n[1]*(1-f[3]),c-=s,d+=s,u-=s,h+=s),(0,E.hZ)(Ar,t,r),(0,E.e$)(Ir,e,Ar,(0,D.kU)(a)),Ir[0]>c&&Ir[0]<d&&Ir[1]>u&&Ir[1]<h}const br=new class{constructor(){this.factor=new Qt,this.factorAlignment=new Qt}},vr=(0,S.vt)(),wr=(0,S.vt)(),xr=(0,I.vt)(),Cr=(0,S.vt)(),Sr=(0,S.vt)(),Ir=(0,M.vt)(),Ar=(0,M.vt)(),Tr=(0,Nt.vt)(),Or=(0,Nt.vt)(),Rr=(0,C.vt)(),Pr=(0,I.vt)(),Er=(0,S.vt)(),Mr=(0,S.vt)(),Dr=(0,I.vt)(),Fr={normal:Cr,cosAngle:0},Vr=1,jr=2,Br=(0,M.fA)(0,0),Lr=(0,S.fA)(0,0,1);class Ur extends Zt.NV{constructor(){super(...arguments),this.renderOccluded=Wt.m$.Occlude,this.isDecoration=!1,this.color=(0,I.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,M.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,I.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,I.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const zr=(0,Ht.BP)().vec3f(ne.r.POSITION).vec3f(ne.r.NORMAL).vec2i16(ne.r.UVI).vec4u8(ne.r.COLOR).vec2f(ne.r.SIZE).f32(ne.r.ROTATION).vec4f(ne.r.CENTEROFFSETANDDISTANCE).vec4f(ne.r.FEATUREATTRIBUTE),Nr=zr.clone().vec4u8(ne.r.OLIDCOLOR);class kr{constructor(){this.vertexBufferLayout=(0,Yt.E)()?Nr:zr}elementCount(e){return 6*e.get(ne.r.POSITION).indices.length}write(e,t,r,n,i,s){const{position:a,normal:o,uvi:l,color:c,size:d,rotation:u,centerOffsetAndDistance:h,featureAttribute:f}=i;(0,Kt.Hk)(r.get(ne.r.POSITION),e,a,s,6),(0,Kt.p1)(r.get(ne.r.NORMAL),t,o,s,6);const p=r.get(ne.r.UVI)?.data;let m=0,g=0,y=-1-tr.f,_=-1-tr.f;p&&p.length>=4&&(m=p[0],g=p[1],y=-1-p[2],_=-1-p[3]);let b=r.get(ne.r.POSITION).indices.length,v=s;for(let e=0;e<b;++e)l.set(v,0,m),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,g),v++;(0,Kt.tb)(r.get(ne.r.COLOR),4,c,s,6);const{data:w,indices:x}=r.get(ne.r.SIZE);b=x.length,v=s;for(let e=0;e<b;++e){const t=w[2*x[e]],r=w[2*x[e]+1];for(let e=0;e<6;++e)d.set(v,0,t),d.set(v,1,r),v++}if((0,Kt.uO)(r.get(ne.r.ROTATION),u,s,6),r.get(ne.r.CENTEROFFSETANDDISTANCE)?(0,Kt.Ut)(r.get(ne.r.CENTEROFFSETANDDISTANCE),h,s,6):(0,Kt.Pq)(h,s,6*b),r.get(ne.r.FEATUREATTRIBUTE)?(0,Kt.Ut)(r.get(ne.r.FEATUREATTRIBUTE),f,s,6):(0,Kt.Pq)(f,s,6*b),null!=n){const e=r.get(ne.r.POSITION)?.indices;if(e){const t=e.length,r=i.getField(ne.r.OLIDCOLOR,kt.XP);(0,Kt.vx)(n,r,t,s,6)}}return{numVerticesPerItem:6,numItems:b}}intersect(e,t,r,n,i,s,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:u}=n;if(!o||!l||c&&t.isLabel||!d)return;const h=this.vertexBufferLayout.createView(e),f=h.getField(ne.r.POSITION,kt.xs),p=h.getField(ne.r.NORMAL,kt.xs),m=h.getField(ne.r.ROTATION,kt.Y$),g=h.getField(ne.r.SIZE,kt.gH),y=h.getField(ne.r.FEATUREATTRIBUTE,kt.Eq),_=h.getField(ne.r.CENTEROFFSETANDDISTANCE,kt.Eq),b="screen"===t.centerOffsetUnits,v=(0,tr.c)(t);if(null==f||null==p||null==m||null==g||null==_)return;const w=null==y?null:y.getVec(0,Dr),{scaleX:x,scaleY:C}=qr(w,t,u.pixelRatio),I=f.count/6;for(let e=0;e<I;e++){const i=6*e;if(f.getVec(i,vr),null!=r&&(0,pe.g)(vr,vr,r),(0,pe.t)(vr,vr,u.viewMatrix),_.getVec(i,Pr),(0,pe.i)(Er,Pr[0],Pr[1],Pr[2]),!b&&(vr[0]+=Er[0],vr[1]+=Er[1],0!==Er[2])){const e=Er[2];(0,pe.n)(Er,vr),(0,pe.d)(vr,vr,(0,pe.h)(Er,Er,e))}if(p.getVec(i,wr),yr(wr,Tr,u,Fr),Hr(t,vr,Fr,u,br),u.applyProjection(vr,xr),xr[0]>-1){b&&(Er[0]||Er[1])&&(xr[0]+=Er[0]*u.pixelRatio,0!==Er[1]&&(xr[1]+=(0,Jt.m0)(Er[1],br.factorAlignment)*u.pixelRatio),u.unapplyProjection(xr,vr)),xr[0]+=t.screenOffset[0]*u.pixelRatio,xr[1]+=t.screenOffset[1]*u.pixelRatio,xr[0]=Math.floor(xr[0]),xr[1]=Math.floor(xr[1]),g.getVec(i,Br),(0,Jt.MD)(Br,br.factor,Br);const r=Vr*u.pixelRatio;let s=0;t.textureIsSignedDistanceField&&(s=Math.min(t.outlineSize,.5*Br[0])*u.pixelRatio/2),Br[0]*=x,Br[1]*=C;const o=m.get(i),l=t.rotation+o;if(_r(d,xr[0],xr[1],Br,r,s,l,t,v)){const t=n.ray;if((0,pe.t)(Sr,vr,(0,O.B8)(Rr,u.viewMatrix)),xr[0]=d[0],xr[1]=d[1],u.unprojectFromRenderScreen(xr,vr)){const r=(0,S.vt)();(0,pe.c)(r,t.direction);const n=1/(0,pe.l)(r);(0,pe.h)(r,r,n),a((0,pe.j)(t.origin,vr)*n,r,e,!0,1,Sr)}}}}}}function qr(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,qt.VC)(Mr,t,e),{scaleX:Mr[0]*r,scaleY:Mr[1]*r})}function Hr(e,t,r,n,i){if(!e.verticalOffset?.screenLength)return e.screenSizePerspective||e.screenSizePerspectiveAlignment?Gr(e,i,(0,pe.l)(t),r.cosAngle):(i.factor.scale=1,i.factorAlignment.scale=1),t;const s=(0,pe.l)(t),a=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=(0,er.kE)(n,s,e.verticalOffset,r.cosAngle,a);return Gr(e,i,s,r.cosAngle),(0,pe.h)(r.normal,r.normal,o),(0,pe.g)(t,t,r.normal)}function Gr(e,t,r,n){null!=e.screenSizePerspective?(0,Jt.cJ)(n,r,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?(0,Jt.cJ)(n,r,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}class $r{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this._sharedTextures=new Map,this.globalViewingMode=e===De.RT.Global}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async getOrCreateSharedTexture(e,t){const{data:r,parameters:n}=t(),i=await this._mainThreadDelegate.createTexture(r,n);return this._sharedTextures.set(e,i),i}async releaseSharedTexture(e){const t=this._sharedTextures,r=t.get(e);if(null==r)return g.create(this);const n=this._destroyTexture(r);return new g(this,n,[()=>t.delete(e)])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,n=ct("material");let i,s;switch(t){case"default":i=new Ue.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,materialId:n,parameters:e.parameters};break;case"hud":i=new mr(r,this.globalViewingMode),s={type:t,materialId:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),n}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(n,e,i,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(n,e,i,s,r)}addDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=ct("lod-renderer"),r=new Set,n={levels:e.levels.map((e=>({components:e.components.map((e=>{const t=e.attributes.get(ne.r.POSITION);if(!t||0===t.indices.length)throw new Error("positions attribute expected");const n=(0,H.tM)(t.indices.length/3),i=new Ut.j(n,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:i.bbMax,bbMin:i.bbMin}}})),minScreenSpaceRadius:e.minScreenSpaceRadius})))};return await this._mainThreadDelegate.createLodRenderer(t,n,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:n,objectIds:i}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let a=null;if(e.transformation&&t)(0,O.C)(Yr,e.transformation),Yr[12]-=t[0],Yr[13]-=t[1],Yr[14]-=t[2],a=Yr;else{if(t)throw new Error("not implemented");e.transformation&&(a=e.transformation)}let o=null;a&&((0,O.B8)(Zr,Yr),(0,O.mg)(Zr,Zr),o=Zr);const l=e.attributes,c=s.elementCount(l),d=s.vertexBufferLayout.stride/4;c>Math.floor(Wr/d)&&console.warn("geometry with very large number of elements encountered");const u=s.vertexBufferLayout.createBuffer(c),h=s.write(a,o,l,e.objectAndLayerIdColor,u,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(n.length!==h.numItems||i.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:u.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:i,visibilities:n,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const Yr=(0,C.vt)(),Zr=(0,C.vt)(),Wr=4194304;var Xr=r(73941),Jr=r(98764),Qr=r(65806);const Kr=(0,S.vt)();var en=r(88582),tn=r(17352),rn=r(97937);function nn(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const sn=2**50;function an(e,t,r,n){return e.operations.setAltitudeAt(e.value,t,r,n)}function on(e,t,r){return e.operations.elevate(e.value,t,r.value)}const ln=(0,S.vt)();(0,S.vt)();var cn=r(44280),dn=r(32114);function un(e){return"point"===e.type}class hn{constructor(e,t,r,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(n),this.referenceEllipsoid=(0,Xr.tO)(t),this.sphericalPCPF=(0,Jr.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return function(e,t){return e.operations.getExtent(e.value,t),t}(this._coordinateSystem,(0,P.vt)())}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return an(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){!function(e,t,r,n){t!==n&&(0,O.C)(n,t),(0,pe.i)(ln,n[12],n[13],n[14]),an(e,ln,r,ln),n[12]=ln[0],n[13]=ln[1],n[14]=ln[2]}(this._coordinateSystem,t,e,t)}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,en._.Z,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,n){return e.operations.axisAt(e.value,t,r,n)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,en._.X,dn.rq.get()),n=this.worldBasisAtPosition(e,en._.Y,dn.rq.get()),i=this.worldBasisAtPosition(e,en._.Z,dn.rq.get());return(0,O.hZ)(t,r[0],r[1],r[2],0,n[0],n[1],n[2],0,i[0],i[1],i[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,dn.rq.get()),n=this.worldBasisAtPosition(e,en._.Y,dn.rq.get()),i=(0,cn.EJ)(t,n,r);return(0,D.KJ)(i)}intersectManifoldClosestSilhouette(e,t,r){return on(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){on(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=dn.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,n)?(0,pe.c)(r,n):null}intersectInfiniteManifold(e,t,r){if(this.viewingMode===De.RT.Global)return this.intersectManifold(e,t,r);on(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,i=dn.rq.get();return(0,ye.Ui)(n.plane,e,i)?(0,pe.c)(r,i):null}toRenderCoords(e,t,r){return un(e)?(0,Qr.g)(e,t,this.spatialReference):(0,z.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return un(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,z.F)(e,t,Kr,r.spatialReference)&&(r.x=Kr[0],r.y=Kr[1],r.z=Kr[2],!0)}(e,this.spatialReference,t)?t:null):(0,z.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case De.RT.Local:return new hn(De.RT.Local,t,(0,T.GA)(t),nn(tn.b,(0,tn.f)([0,0,0],[sn,0,0],[0,sn,0])));case De.RT.Global:return new hn(De.RT.Global,t,1,function(e){return nn(rn.s,(0,rn.f)(0,0,0,(0,Xr.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,T.KX)(e)/(0,T.KX)(t)}}let fn=class extends i.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new xt,this._actionSynchronizer=new nt(y,(e=>this._createCommand(e))),this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:n,layerViewInfo:i}){const s=h.A.fromJSON(e);this._viewSpatialReference=s;const o=h.A.fromJSON(t);this._fetcher=new Lt(this._viewSpatialReference,p.A.fromJSON(n.baseQuery),n.url,n.objectIdField,n.capabilities),this._queryEngine=new f.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:n.objectIdField,fieldsIndex:n.fieldIndex,availableFields:[n.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:n.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const n={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",n,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const l=hn.create(r,o),c=new $r(r,this._mainThreadDelegate);this._renderCommandContext=c;const m=new Ze(s,o,this._mainThreadDelegate,l,c,n,i);this._context=m,this._renderer=m.symbolRendererFactory.createSymbolRendererFromJSON(n.renderer),this._defaultQueryJSON=new p.A({outSpatialReference:s}).toJSON();let g=null;if(null!=n.fullExtent){const e=d.A.fromJSON(n.fullExtent);await(0,u.initializeProjection)(e.spatialReference,s),g=(0,u.project)(e,s)}return this._tileManager=new ht({loadTile:(e,t)=>this._fetcher.fetch(e,t),synchronizer:this._actionSynchronizer,extent:g}),this.addHandles((0,a.wB)((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),a.Vh),null!=this._renderer&&await this._renderer.load(),mn}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),mn}async onElevationChange(e){return mn}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return mn;const n=await r.createUpdateLayerViewOpacityCommand(e);return await n.execute(),mn}async onRendererChange(e){const{_context:t}=this,r=await this._createDestroyRendererCommand();await r.execute();const n=t.symbolRendererFactory.createSymbolRendererFromJSON(e);this._renderer=n,await this._renderer.load();const i=[];this._tileManager.forEachTile((e=>{i.push(n.createAddCommand(e))}));const s=await Promise.all(i),a=t.joinPipelineCommands(s);return await a.execute(),mn}async _createDestroyRendererCommand(){const e=this._renderer;if(null==e)return g.create(this._renderCommandContext);const t=await e.createDestroyCommand();return t.appendPipelineStateCommand((()=>{(0,_e.vA)(this._renderer===e),this._renderer=null})),t}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,n=this._renderer;let i;return i=null!=n?await n.createAddCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),i.appendPipelineStateCommand((()=>{r.addTile(e)})),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let n;return n=null!=r?await r.createRemoveCommand(e):g.create(this._renderCommandContext),n.appendPipelineStateCommand((()=>{t.removeTile(e)})),n}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let n;return n=null!=r?await r.createUpdateVisibilityCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}async _createCommand(e){switch(e.type){case Je.ADD:return await this._createAddFeatureDataCommand(e.data);case Je.REMOVE:return await this._createRemoveFeatureDataCommand(e.data.id);case Je.UPDATE_VISIBILITY:return await this._createUpdateFeatureDataVisibilityCommand(e.data)}}};(0,n._)([(0,o.MZ)()],fn.prototype,"updating",null),fn=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],fn);const pn=fn,mn={result:void 0}},86305:(e,t,r)=>{r.d(t,{i3:()=>i}),r(38954);var n=r(51850);function i(e){return null!=e?.dist}r(17352),r(62258),(0,n.vt)()},87582:(e,t,r)=>{r(62258);var n=r(65215);r(86305),n.R6},95696:(e,t,r)=>{r.d(t,{A:()=>u});var n,i=r(90237),s=r(69540),a=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),c=r(40608);let d=class extends(s.A.ClonableMixin(a.A)){static{n=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new n}};(0,i._)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],d.prototype,"type",void 0),(0,i._)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],d.prototype,"origin",void 0),d=n=(0,i._)([(0,c.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],d);const u=d},96576:(e,t,r)=>{r.d(t,{A:()=>f});var n,i=r(90237),s=r(4718),a=r(10107),o=(r(44208),r(53966),r(93223)),l=r(40608),c=r(92438),d=r(63988),u=r(49849);let h=n=class extends((0,d.h)(c.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map((r=>r.collectRequiredFields(e,t))))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){return this.symbols.reduce(((e,t)=>e+JSON.stringify(t)),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new n({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"description",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"label",void 0),(0,i._)([(0,a.MZ)(u.Wp)],h.prototype,"symbol",void 0),(0,i._)([(0,o.e)({simple:"simple"})],h.prototype,"type",void 0),h=n=(0,i._)([(0,l.$)("esri.renderers.SimpleRenderer")],h);const f=h}}]);
319
+ }`)}},65215:(e,t,r)=>{r.d(t,{HE:()=>n,R6:()=>i}),r(51850);class n{constructor(e){this.layerViewUid=e}}class i extends n{constructor(e,t){super(e),this.graphicUid=t}}},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>a});var n=r(67076),i=r(90360),s=r(41214);function a(e,t){return l(e,null,t)}const o=(0,i.C)({types:s.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new n.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):o(e,t,r):null}},66208:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(53655);function i(e,t){const r=(0,n.SH)(e,t),i=r.queryResult.featureResult,s=r.queryResult.queryGeometry,a=r.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=s,i.queryGeometryType=a),i}},69418:(e,t,r)=>{r.d(t,{S:()=>c,z:()=>l});var n=r(83047),i=r(21325),s=r(43334),a=r(58512),o=r(92722);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this._options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.A}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||(0,i.aI)(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,n.G9)(this._options.sourceSpatialReference)/(0,n.G9)(e.spatialReference);if(1!==t)for(const r of e.features){if(!(0,s.N3)(r))continue;const e=r.geometry.coords;for(let r=2;r<e.length;r+=3)e[r]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new s.Om(null,{},null,0)}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.A}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.A}}},72385:(e,t,r)=>{function n(){return new Float32Array(3)}function i(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(e,t,r){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}function a(){return n()}function o(){return s(1,1,1)}function l(){return s(1,0,0)}function c(){return s(0,1,0)}function d(){return s(0,0,1)}r.d(t,{fA:()=>s,o8:()=>i,vt:()=>n});const u=a(),h=o(),f=l(),p=c(),m=d();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:p,UNIT_Z:m,ZEROS:u,clone:i,create:n,fromValues:s,ones:o,unitX:l,unitY:c,unitZ:d,zeros:a},Symbol.toStringTag,{value:"Module"}))},73681:(e,t,r)=>{r.d(t,{n:()=>l});var n=r(49186),i=r(53966),s=r(46140),a=r(95466),o=r(55674);class l{static async from(e,t,r){const a=e.dictionary_version?s.R.parse(e.dictionary_version):null,d=new Set(e.itemsNames),u={};if(t)for(const e in t)u[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)u.hasOwnProperty(t.name)||(u[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))h.delete(e);h.size&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const f=await(0,o.xR)(e.expression,null,u);if(!f)throw new n.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const p=!a||!a.greaterEqual(4,0);p&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:a});const m=new c(r,p);return new l(p,d,f,m)}constructor(e,t,r,n){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=n}get itemNames(){return this._itemNames}evaluate(e,t,r,n){try{return this._reader.bind(e,r,n),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new a.A(e);const t=e.map((e=>({...e,type:"esriFieldTypeString"})));return new a.A(t)}}class c extends o.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t?"":""+this._boundTarget.attributes[t.name]}}},75503:(e,t,r)=>{r.d(t,{E:()=>I,w:()=>o});var n=r(4576),i=r(21818),s=(r(44208),r(3694)),a=r(11006);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),x.prune(),C.prune(),S.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(b(e,r))for(w.clear();r;){for(let i=0,s=r.children.length;i<s;i++){const s=r.children[i],a=r.leaf?n(s):s;b(e,a)&&(r.leaf?t(s):_(e,a)?l(s,t):w.push(s))}r=w.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!b(e,t))return!1;for(w.clear();t;){for(let n=0,i=t.children.length;n<i;n++){const i=t.children[n],s=t.leaf?r(i):i;if(b(e,s)){if(t.leaf||_(e,s))return!0;w.push(i)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new T([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,a=0,o=!1;const l=this._toBBox(e);for(C.clear(),S.clear();r||C.length>0;){if(r||(r=C.pop(),s=C.data[C.length-1],a=S.pop()??0,o=!0),r.leaf&&(t=(0,n.qh)(r.children,(0,i.zI)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),C.push(r),this._condense(C),this;o||r.leaf||!_(r,l)?s?(a++,r=s.children[a],o=!1):r=null:(C.push(r),S.push(a),a=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,n){const i=r-t+1;let s=this._maxEntries;if(i<=s){const n=new T(e.slice(t,r+1));return c(n,this._toBBox),n}n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/s**(n-1)));const a=new O([]);a.height=n;const o=Math.ceil(i/s),l=o*Math.ceil(Math.sqrt(s));v(e,t,r,l,this._compareMinX);for(let i=t;i<=r;i+=l){const t=Math.min(i+l-1,r);v(e,i,t,o,this._compareMinY);for(let r=i;r<=t;r+=o){const i=Math.min(r+o-1,t);a.children.push(this._build(e,r,i,n-1))}}return c(a,this._toBBox),a}_insert(e,t,r){const n=this._toBBox,i=r?e:n(e);C.clear();const s=function(e,t,r,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==r;){let r,n=1/0,i=1/0;for(let s=0,a=t.children.length;s<a;s++){const a=t.children[s],o=p(a),l=g(e,a)-o;l<i?(i=l,n=o<n?o:n,r=a):l===i&&o<n&&(n=o,r=a)}t=r||t.children[0]}return t}(i,this._data,t,C);for(s.children.push(e),u(s,i);t>=0&&C.data[t].children.length>this._maxEntries;)this._split(C,t),t--;!function(e,t,r){for(let n=r;n>=0;n--)u(t.data[n],e)}(i,C,t)}_split(e,t){const r=e.data[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const s=this._chooseSplitIndex(r,i,n);if(!s)return;const a=r.children.splice(s,r.children.length-s),o=r.leaf?new T(a):new O(a);o.height=r.height,c(r,this._toBBox),c(o,this._toBBox),t?e.data[t-1].children.push(o):this._splitRoot(r,o)}_splitRoot(e,t){this._data=new O([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,i,s;n=i=1/0;for(let a=t;a<=r-t;a++){const t=d(e,0,a,this._toBBox),o=d(e,a,r,this._toBBox),l=y(t,o),c=p(t)+p(o);l<n?(n=l,s=a,i=c<i?c:i):l===n&&c<i&&(i=c,s=a)}return s}_chooseSplitAxis(e,t,r){const n=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);const i=this._toBBox,s=d(e,0,t,i),a=d(e,r-t,r,i);let o=m(s)+m(a);for(let n=t;n<r-t;n++){const t=e.children[n];u(s,e.leaf?i(t):t),o+=m(s)}for(let n=r-t-1;n>=t;n--){const t=e.children[n];u(a,e.leaf?i(t):t),o+=m(a)}return o}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const i=e.data[t-1],s=i.children;s.splice((0,n.qh)(s,r,s.length,i.indexHint),1)}else this.clear();else c(r,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let r=e;for(x.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,i.zI)(e));else x.pushArray(r.children);r=x.pop()??null}}function c(e,t){d(e,0,e.children.length,t,e)}function d(e,t,r,n,i){i||(i=new T([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a<r;a++)s=e.children[a],u(i,e.leaf?n(s):s);return i}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,r,n,i){const s=[t,r];for(;s.length;){const t=s.pop(),r=s.pop();if(t-r<=n)continue;const o=r+Math.ceil((t-r)/n/2)*n;(0,a.q)(e,o,r,t,i),s.push(r,o,o,t)}}const w=new s.A,x=new s.A,C=new s.A,S=new s.A({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class T extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class O extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(90237),i=r(66552),s=r(25482),a=r(10107),o=(r(44208),r(53966),r(87811),r(93223)),l=r(40608);const c=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends s.A{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,o.e)(c),(0,a.MZ)({json:{write:{isRequired:!0}}})],d.prototype,"type",void 0),d=(0,n._)([(0,l.$)("esri.layers.support.Domain")],d);const u=d},77548:(e,t,r)=>{r.d(t,{tk:()=>u,BR:()=>d,wI:()=>c,Ov:()=>o,W_:()=>l,TU:()=>a,XX:()=>s});var n=r(70333),i=r(78888);r(5503),r(36563),r(36708),new WeakMap;const s={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function o(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function c(e,t){const r=n.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const a=`${e.slice(0,s)}/rest/info`,o=null!=t?t.signal:null,{data:l}=await(0,i.A)(a,{query:{f:"json"},responseType:"json",signal:o});return l?.owningSystemUrl||null}function d(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function u(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}},80451:(e,t,r)=>{r.d(t,{rS:()=>g,gK:()=>m}),r(44208);var n,i=r(53177),s=r(76357),a=r(90237),o=(r(53966),r(87811),r(49186),r(93223)),l=r(40608);let c=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,a._)([(0,o.e)({inherited:"inherited"})],c.prototype,"type",void 0),c=n=(0,a._)([(0,l.$)("esri.layers.support.InheritedDomain")],c);const d=c;var u,h=r(10107);let f=class extends s.A{static{u=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new u({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],f.prototype,"maxValue",void 0),(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],f.prototype,"minValue",void 0),(0,a._)([(0,o.e)({range:"range"})],f.prototype,"type",void 0),f=u=(0,a._)([(0,l.$)("esri.layers.support.RangeDomain")],f);const p=f,m={key:"type",base:s.A,typeMap:{range:p,"coded-value":i.A,inherited:d}};function g(e){if(!e?.type)return null;switch(e.type){case"range":return p.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return d.fromJSON(e)}return null}},80893:(e,t,r)=>{r.d(t,{IJ:()=>p,Jf:()=>_,Pk:()=>g,eW:()=>f,gW:()=>y,kS:()=>m});var n=r(78888),i=r(84952),s=r(65864),a=r(17136),o=r(21325),l=r(10536),c=r(66208),d=r(58501);const u="Layer does not support extent calculation.";function h(e,t){const r=e.geometry,n=e.toJSON();delete n.compactGeometryEnabled,delete n.defaultSpatialReferenceEnabled;const i=n;let a,l,c;if(null!=r&&(l=r.spatialReference,c=(0,o.YX)(l),i.geometryType=(0,s.$B)(r),i.geometry=function(e,t){if(t&&"extent"===e.type)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&"point"===e.type)return`${e.x},${e.y}`;const r=e.toJSON();return delete r.spatialReference,JSON.stringify(r)}(r,e.compactGeometryEnabled),i.inSR=c),n.groupByFieldsForStatistics&&(i.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(i.objectIds=n.objectIds.join(",")),n.orderByFields&&(i.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(t?.returnCountOnly||t?.returnExtentOnly||t?.returnIdsOnly)?delete i.outFields:n.outFields.includes("*")?i.outFields="*":i.outFields=n.outFields.join(","),n.outSR?(i.outSR=(0,o.YX)(n.outSR),a=e.outSpatialReference):r&&(n.returnGeometry||n.returnCentroid)&&(i.outSR=i.inSR,a=l),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(i.outStatistics=JSON.stringify(n.outStatistics)),n.fullText&&(i.fullText=JSON.stringify(n.fullText)),n.pixelSize&&(i.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(e.defaultSpatialReferenceEnabled&&null!=l&&null!=e.quantizationParameters?.extent&&l.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,i.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(i.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(i.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(i.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:r}=e;null==t&&null==r||(i.time=t===r?t:`${t??"null"},${r??"null"}`),delete n.timeExtent}return e.defaultSpatialReferenceEnabled&&null!=l&&null!=a&&l.equals(a)&&(i.defaultSR=i.inSR,delete i.inSR,delete i.outSR),i}async function f(e,t,r,n){const i=null!=t.timeExtent&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",n);return(0,d.q)(t,r,i.data),i}async function p(e,t,r,n){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:r.createFeatureResult()};const i=await m(e,t,n),s=i;return s.data=(0,c.m)(i.data,r),s}function m(e,t,r){return b(e,t,"pbf",r)}function g(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",r,{returnIdsOnly:!0})}function y(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",r,{returnIdsOnly:!0,returnCountOnly:!0})}async function _(e,t,r){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:{count:0,extent:null}};const n=await b(e,t,"json",r,{returnExtentOnly:!0,returnCountOnly:!0}),i=n.data;if(i.hasOwnProperty("extent"))return n;if(i.features)throw new Error(u);if(i.hasOwnProperty("count"))throw new Error(u);return n}async function b(e,t,r,s={},o={}){const c="string"==typeof e?(0,i.An)(e):e,d=t.geometry?[t.geometry]:[],u=await(0,a.el)(d,null,{signal:s.signal}),f=u?.[0];null!=f&&((t=t.clone()).geometry=f);const p=(0,l.z)({...c.query,f:r,...o,...h(t,o)});return(0,n.A)((0,i.fj)(c.path,(m=o,null==t.formatOf3DObjects||m.returnCountOnly||m.returnExtentOnly||m.returnIdsOnly?"query":"query3d")),{...s,responseType:"pbf"===r?"array-buffer":"json",query:{...p,...s.query}});var m}},85071:(e,t,r)=>{r.r(t),r.d(t,{default:()=>pn});var n=r(90237),i=r(65529),s=r(74887),a=r(36708),o=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),d=r(5443),u=r(80586),h=r(16930),f=r(68298),p=r(61956),m=r(65494);class g{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new g(e,e.createRenderCommandBuffer(),t)}}function y(e){return 0===e.length?null:e.reduce(((e,t)=>(e.append(t),e)))}var _=r(68197),b=r(18574),v=r(87403),w=r(28975);function x(){return new b.A({material:new w.N({color:new _.A("red")})})}var C=r(9093),S=r(51850),I=r(91829),A=r(6847),T=r(83047),O=r(58083),R=(r(87317),r(70328)),P=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var E=r(37585),M=r(48163),D=r(34727),F=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const V=[];{const e=16;for(let t=0;t<360;t+=360/e)V.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}var j,B;(B=j||(j={}))[B.Left=0]="Left",B[B.Center=1]="Center",B[B.Right=2]="Right",Object.freeze({left:0,center:.5,right:1});const L=Object.freeze({"bottom-left":(0,M.fA)(0,0),bottom:(0,M.fA)(.5,0),"bottom-right":(0,M.fA)(1,0),left:(0,M.fA)(0,.5),center:(0,M.fA)(.5,.5),right:(0,M.fA)(1,.5),"top-left":(0,M.fA)(0,1),top:(0,M.fA)(.5,1),"top-right":(0,M.fA)(1,1)});var U=r(9762),z=r(27993);function N(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function k(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function q(e,t){const r=t.viewSpatialReference,n=t.renderSpatialReference,{extent:i}=e,s=(0,P.gX)(i),a=(0,S.vt)();return(0,z.F)([s[0],s[1],0],r,a,n),a}var H=r(97146);function G(e){const t=new Map;for(const[r,n]of e)t.set(r,{...n,indices:(0,H.Dg)(n.indices)});return t}var $=r(40804),Y=(r(48833),r(63907));const Z=(0,I.CN)(.25,.25,.75,.75);function W(e){return"cross"===e||"x"===e}function X(e,t=128,r=.5*t,n=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return te(e,K(r,r,t/2))}(t,r);case"square":return function(e,t){return J(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return Q(e,t,!1,r)}(t,r,n);case"x":return function(e,t,r=0){return Q(e,t,!0,r)}(t,r,n);case"kite":return function(e,t){return J(e,t,!0)}(t,r);case"triangle":return function(e,t){return te(e,ee(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,n=t/2,i=e/2,s=.8*r,a=K(i,(e-t)/2-s,Math.sqrt(s*s+n*n)),o=ee(i,r,n);return te(e,((e,t)=>Math.max(o(e,t),-a(e,t))))}(t,r)}}function J(e,t,r){return r&&(t/=Math.SQRT2),te(e,((n,i)=>{let s=n-.5*e+.25,a=.5*e-i-.75;if(r){const e=(s+a)/Math.SQRT2;a=(a-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(a))-.5*t}))}function Q(e,t,r,n=0){t-=n,r&&(t*=Math.SQRT2);const i=.5*t;return te(e,((t,s)=>{let a,o=t-.5*e,l=.5*e-s-1;if(r){const e=(o+l)/Math.SQRT2;l=(l-o)/Math.SQRT2,o=e}return o=Math.abs(o),l=Math.abs(l),a=o>l?o>i?Math.sqrt((o-i)*(o-i)+l*l):l:l>i?Math.sqrt(o*o+(l-i)*(l-i)):o,a-=n/2,a}))}function K(e,t,r){return(n,i)=>{const s=n-e,a=i-t;return Math.sqrt(s*s+a*a)-r}}function ee(e,t,r){const n=Math.sqrt(t*t+r*r);return(i,s)=>{const a=Math.abs(i-e)-r,o=s-e+t/2+.75,l=(t*a+r*o)/n,c=-o;return Math.max(l,c)}}function te(e,t){const r=new Uint8Array(4*e*e);for(let n=0;n<e;n++)for(let i=0;i<e;i++){const s=i+e*n;let a=t(i,n);a=a/e+.5,(0,$.U)(a,r,4*s)}return r}var re=r(46610),ne=r(46540);class ie{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.getOrCreateSharedTexture("circle-icon",(()=>function(e,t=128,r=.5*t,n=0){return{data:X(e,t,r,n),parameters:{mipmap:!1,wrap:{s:Y.pF.CLAMP_TO_EDGE,t:Y.pF.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle")));this._iconTextureID=t;const r={anchorPosition:L.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:Z,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:W("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r;if(null==t)throw new Error("expected material not to be null");const i=await this._createGeometry(e);if(null==i)return r.createPipelineCommand();const s=q(e,r);return r.createPipelineCommand(n.addDirectRendererGeometry(e.id,i,s))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:n}=r,{featureCount:i}=e;if(0===i||null==t)return null;const s=N(e),a=k(e),o=function(e,t){const r=e.length/3,n=t.viewSpatialReference,i=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,U.projectBuffer)(e,n,0,s,i,0,r))throw new Error("Failed to project coordinates");return s}(await n.applyElevationAlignmentTo(a),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),d=new Float64Array([24,24]),u=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),p=new Uint32Array(i);for(let e=0;e<i;++e)p[e]=e;const m=new Uint32Array(i);for(let e=0;e<i;++e)m[e]=0;const g=new re.n(o,p,3,!0),y=new re.n(l,m,3,!0),_=new re.n(h,m,2,!0),b=new re.n(c,m,4,!0),v=new re.n(f,m,1,!0),w=new re.n(d,m,2,!0),x=new re.n(u,m,4,!0),S=[[ne.r.POSITION,g],[ne.r.NORMAL,y],[ne.r.UV0,_],[ne.r.COLOR,b],[ne.r.ROTATION,v],[ne.r.SIZE,w],[ne.r.CENTEROFFSETANDDISTANCE,x]],I=new Uint8Array(i);return e.getVisibilityArray(I),{attributes:G(S),objectAndLayerIdColor:void 0,transformation:(0,C.vt)(),materialId:t,objectIds:s,visibilities:I}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(n.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r,{featureCount:i,id:s}=e;if(null==t||0===i)return r.createPipelineCommand();const a=await this._createGeometry(e);if(null==a)return r.createPipelineCommand();const o=q(e,r);return r.createPipelineCommand(n.updateDirectRendererGeometry(s,a,o))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let n;return n=null!=e?await r.releaseSharedTexture("circle-icon"):g.create(r),n.appendPipelineStateCommand((()=>this._destroy())),n}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=_.A.toUnitRGB(r),n=r.a*e;return[t[0],t[1],t[2],n]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return ae;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=se){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=se){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const n=(0,I.o8)(I.Un);return null!=e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),null!=t?n[3]=t:null!=e&&e.length>3&&(n[3]=e[3]),r&&(n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r),n}(null!=e?_.A.toUnitRGB(e):S.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??A.r;var e}}const se={hasIntrinsicColor:!1},ae=I.uY;class oe{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,n=[];for(const i of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(i);null!=t&&(n.push(t.load()),r.push(t))}await Promise.all(n),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const n=e.joinPipelineCommands(await Promise.all(r));return n.appendPipelineStateCommand((()=>this._destroy())),n}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(n))}}class le{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createAddCommand(e);return n.appendPipelineStateCommand((()=>this._featureData.set(e.id,e))),n}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return n.appendPipelineStateCommand((()=>this._featureData.delete(e))),n}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const n=[];for(const t of e.values())n.push(r.createUpdateElevationCommand(t));const i=await Promise.all(n);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const n=[];for(const e of r.keys())n.push(this.createRemoveCommand(e));n.push(e.createDestroyCommand());const i=await Promise.all(n);return t.joinPipelineCommands(i)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var ce,de,ue=r(48353),he=r(30809),fe=r(8887),pe=r(38954),me=r(72385),ge=(r(4197),r(11868)),ye=r(240);r(71351),(de=ce||(ce={})).length=function(e,t){const r=e[t],n=e[t+1],i=e[t+2];return Math.sqrt(r*r+n*n+i*i)},de.normalize=function(e,t){const r=e[t],n=e[t+1],i=e[t+2],s=1/Math.sqrt(r*r+n*n+i*i);e[t]*=s,e[t+1]*=s,e[t+2]*=s},de.scale=function(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r},de.add=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]+r[n],i[s+1]=e[t+1]+r[n+1],i[s+2]=e[t+2]+r[n+2]},de.subtract=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]-r[n],i[s+1]=e[t+1]-r[n+1],i[s+2]=e[t+2]-r[n+2]},r(87170);var _e=r(620);r(75039);const be=ce,ve=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)ve[6*e+t]=e;const we=new Array(36);for(let e=0;e<6;e++)we[6*e]=0,we[6*e+1]=1,we[6*e+2]=2,we[6*e+3]=2,we[6*e+4]=3,we[6*e+5]=0;const xe=(0,me.fA)(-.5,0,-.5),Ce=(0,me.fA)(.5,0,-.5),Se=(0,me.fA)(0,0,.5),Ie=(0,me.fA)(0,.5,0),Ae=(0,me.vt)(),Te=(0,me.vt)(),Oe=(0,me.vt)(),Re=(0,me.vt)(),Pe=(0,me.vt)();(0,pe.d)(Ae,xe,Ie),(0,pe.d)(Te,xe,Ce),(0,pe.e)(Oe,Ae,Te),(0,pe.n)(Oe,Oe),(0,pe.d)(Ae,Ce,Ie),(0,pe.d)(Te,Ce,Se),(0,pe.e)(Re,Ae,Te),(0,pe.n)(Re,Re),(0,pe.d)(Ae,Se,Ie),(0,pe.d)(Te,Se,xe),(0,pe.e)(Pe,Ae,Te),(0,pe.n)(Pe,Pe),Oe[0],Oe[1],Oe[2],Re[0],Re[1],Re[2],Pe[0],Pe[1],Pe[2],(0,S.vt)();var Ee=r(4576),Me=r(69397),De=r(24151);r(62258),r(65215),r(86305),r(16396),(0,S.vt)(),(0,I.vt)(),r(87582);var Fe=r(57917);function Ve(e,t){const r=(e,r,n=!1)=>({levels:e.map((e=>{const i=G(r(e.tesselation));return n&&function(e){const t=e,r=t.get(ne.r.POSITION).data,n=t.get(ne.r.NORMAL).data;if(n){const t=je(e,ne.r.NORMAL).data;for(let e=0;e<n.length;e+=3){const r=n[e+1];t[e+1]=-n[e+2],t[e+2]=r}}if(r){const t=je(e,ne.r.POSITION).data;for(let e=0;e<r.length;e+=3){const n=r[e+1];t[e+1]=-r[e+2],t[e+2]=n}}}(i),{components:[{attributes:i,objectAndLayerIdColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}}))});switch(e){case"cone":return r(Be,(e=>function(e,t,r,n,i=!0,s=!0){let a=0;const o=t,l=e;let c=(0,me.fA)(0,a,0),d=(0,me.fA)(0,a+l,0),u=(0,me.fA)(0,-1,0),h=(0,me.fA)(0,1,0);n&&(a=l,d=(0,me.fA)(0,0,0),c=(0,me.fA)(0,a,0),u=(0,me.fA)(0,1,0),h=(0,me.fA)(0,-1,0));const f=[d,c],p=[u,h],m=r+2,g=Math.sqrt(l*l+o*o);if(n)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),n=(0,me.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,me.fA)(l*Math.cos(t)/g,-o/g,l*Math.sin(t)/g);p.push(i)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),n=(0,me.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,me.fA)(l*Math.cos(t)/g,o/g,l*Math.sin(t)/g);p.push(i)}const y=new Array,_=new Array;if(i){for(let e=3;e<f.length;e++)y.push(1),y.push(e-1),y.push(e),_.push(0),_.push(0),_.push(0);y.push(f.length-1),y.push(2),y.push(1),_.push(0),_.push(0),_.push(0)}if(s){for(let e=3;e<f.length;e++)y.push(e),y.push(e-1),y.push(0),_.push(e),_.push(e-1),_.push(1);y.push(0),y.push(2),y.push(f.length-1),_.push(1),_.push(2),_.push(p.length-1)}const b=(0,ge.oe)(3*m);for(let e=0;e<m;e++)b[3*e]=f[e][0],b[3*e+1]=f[e][1],b[3*e+2]=f[e][2];const v=(0,ge.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[[ne.r.POSITION,new re.n(b,y,3,!0)],[ne.r.NORMAL,new re.n(v,_,3,!0)]]}(1,.5,e,!1)),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],(e=>function(e,t,r){const n=e;let i,s;if(r)i=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],s=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=n*(1+Math.sqrt(5))/2;i=[-n,e,0,n,e,0,-n,-e,0,n,-e,0,0,-n,e,0,n,e,0,-n,-e,0,n,-e,e,0,-n,e,0,n,-e,0,-n,-e,0,n],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<i.length;t+=3)be.scale(i,t,e/be.length(i,t));let a={};function o(t,r){t>r&&([t,r]=[r,t]);const n=t.toString()+"."+r.toString();if(a[n])return a[n];let s=i.length;return i.length+=3,be.add(i,3*t,i,3*r,i,s),be.scale(i,s,e/be.length(i,s)),s/=3,a[n]=s,s}for(let e=0;e<t;e++){const e=s.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=s[r],n=s[r+1],i=s[r+2],a=o(e,n),l=o(n,i),c=o(i,e),d=4*r;t[d]=e,t[d+1]=a,t[d+2]=c,t[d+3]=n,t[d+4]=l,t[d+5]=a,t[d+6]=i,t[d+7]=c,t[d+8]=l,t[d+9]=a,t[d+10]=l,t[d+11]=c}s=t,a={}}const l=(0,ge.Wz)(i);for(let e=0;e<l.length;e+=3)be.normalize(l,e);return[[ne.r.POSITION,new re.n((0,ge.Wz)(i),s,3,!0)],[ne.r.NORMAL,new re.n(l,s,3,!0)]]}(.5,e,!0)));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function je(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Fe.S)(r.data)},e.set(t,r)),r}const Be=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var Le=r(89192),Ue=r(88076),ze=r(74810);class Ne{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:ze.Bt,ambient:S.Un,diffuse:S.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=I.Un,r.isInstanced=!0,this._isPrimitive){const e=new Ue.fs;e.layerOpacity=t,r={...r,cullFace:ke((0,Ue.ty)(e))}}const n=await e.createMaterial({type:"default",parameters:r}),i=this._symbolLayer.resource;this._primitive=i&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(i?.primitive)?i.primitive:he.r;const s=Ve(this._primitive,n);this._lodRendererId=await e.createLodRenderer(s),this._primitiveMaterialId=n,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,n=r.renderCommandContext,i=[];return null!=e&&i.push(n.destroyLodRenderer(e)),null!=t&&i.push(n.destroyMaterial(t)),new g(n,n.mergeRenderCommandBuffers(i),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:n}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:i}=e;if(0===i)return t.createPipelineCommand();const s=this._isPrimitive,a=this._primitive||he.r,o=(0,R.vt)((0,fe.Fq)(a)),l=(0,S.ci)((0,R.Ej)(o)),c=(0,S.ci)((0,fe.Bb)(l,{isPrimitive:s,width:100,depth:null,height:null})),d=new Float64Array(16*i),u=new Float64Array(16*i),h=k(e),f=await n.applyElevationAlignmentTo(h);for(let e=0;e<i;++e){const t=e,r=f[3*e+0],n=f[3*e+1],i=f[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ge),a=this._computeLocalTransform(c,l,He);this._writeMatrixToTypedBuffer(d,t,a),this._writeMatrixToTypedBuffer(u,t,s)}const p=N(e),m=new Uint8Array(i);e.getVisibilityArray(m);const g={featureIds:new Uint32Array(p),visibility:m,localTransforms:d,globalTransforms:u};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,g))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,n=this._primitiveMaterialId;if(null==n)return t.createPipelineCommand();const i=this._getLayerOpacity();let s={layerOpacity:i};if(this._isPrimitive){const e=new Ue.fs;e.layerOpacity=i,s={...s,cullFace:ke((0,Ue.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:n,parameters:s}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:n,mainThreadDelegate:i}=t,{featureCount:s,id:a}=e;if(null==r||0===s)return t.createPipelineCommand();const o=new Float64Array(16*s),l=k(e),c=await i.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],n=c[3*e+1],i=c[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ge);this._writeMatrixToTypedBuffer(o,t,s)}return t.createPipelineCommand(n.updateLodInstancesData(r,a,o))}_writeMatrixToTypedBuffer(e,t,r){let n=16*t;for(let t=0;t<16;t++)e[n++]=r[t]}_computeGlobalTransform(e,t,r,n,i){return qe[0]=e,qe[1]=t,qe[2]=r,(0,ue.l)(n,qe,i,this._context.renderSpatialReference),i}_computeLocalTransform(e,t,r){return(0,O.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const n=function(e=S.Un,t,r,n=1){const i=new Array(3);if(null==t||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,s=0;for(let a=2;a>=0;a--){const o=e[a],l=null!=o,c=0===a&&!n&&!l,d=r[a];let u;"symbol-value"===o||c?u=0!==d?t[a]/d:1:l&&"proportional"!==o&&isFinite(o)&&(u=0!==d?o/d:1),null!=u&&(i[a]=u,n=u,s=Math.max(s,Math.abs(u)))}for(let e=2;e>=0;e--)null==i[e]?i[e]=n:0===i[e]&&(i[e]=.001*s)}for(let e=2;e>=0;e--)i[e]/=n;return(0,S.ci)(i)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===n[0]&&1===n[1]&&1===n[2]||(0,O.hs)(r,r,n)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function ke(e){return e?Le.s2.None:Le.s2.Back}const qe=(0,S.vt)(),He=(0,C.vt)(),Ge=(0,C.vt)();class $e{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new ie(x(),this._context),this._symbols[1]=new Ne(new v.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),n=await Promise.all(r.map((async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))}))),i=t.joinPipelineCommands(n);return i.appendPipelineStateCommand((()=>this._featureDataPartitioning.set(e.id,r))),i}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))}))),a=r.joinPipelineCommands(s);return a.appendPipelineStateCommand((()=>t.delete(e))),a}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e.id);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))})));return r.joinPipelineCommands(s)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const n=this._symbols[t];null!=n&&n.loaded&&r.push(n.createUpdateLayerViewOpacityCommand(e))}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))}));r.push(...e)}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const n=await Promise.all(r);return t.joinPipelineCommands(n)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=N(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,n=[[],[]];for(let e=0;e<r;++e)n[t[e]%2].push(e);return n.map(((t,r)=>new Ye(r,e.subset(new Uint32Array(t))))).filter((e=>e.features.featureCount>0))}}class Ye{constructor(e,t){this.index=e,this.features=t}}class Ze{constructor(e,t,r,n,i,s,a){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=n,this.renderCommandContext=i,this.layerInfo=s,this.layerViewInfo=a,this.symbolRendererFactory=new We(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new g(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter((e=>null!=e)).reduce(((e,t)=>(e.append(t),e)))}}class We{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,m.L)(e??Xe)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new le(t,this.context);case"unique-value":return new $e(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON(Xe)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new oe(e,this.context);case"picture-marker":return new ie(x(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new ie(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const Xe={type:"simple"};var Je,Qe,Ke,et=r(69622),tt=r(60999),rt=r(32587);class nt{constructor(e,t){this._joinCommands=e,this._createCommand=t,this._executing=new Set,this._nextEvents=new Map}async enqueueActions(e){const{_executing:t}=this;return e.every((e=>!t.has(e.tileId)))?await this._executeActions(e):await this._scheduleActions(e)}async _scheduleActions(e){const{_nextEvents:t}=this,r=new Set(e.map((e=>t.get(e.tileId))).filter(Ee.Ru));let n;if(0!==r.size){const i=new Array,s=new Array;for(const e of r)i.push(e.actions),s.push(e.resolver);i.push(e);for(const e of i)for(const r of e)t.delete(r.tileId);const a=i.reduce(at);n=new it(a),n.resolver.promise.then((()=>{for(const e of s)e.resolve()}),(e=>{for(const t of s)t.reject(e)}))}else n=new it(e);for(const e of n.actions)t.set(e.tileId,n);return this._validate(),await n.resolver.promise}async _executeActions(e){const t=e.map((e=>e.tileId)),{_executing:r}=this;for(const e of t)r.add(e);this._validate();try{const t=(await Promise.allSettled(e.map(this._createCommand))).map((e=>"fulfilled"===e.status?e.value:null)).filter(Ee.Ru);if(0===t.length)return;const r=this._joinCommands(t);await(r?.execute())}finally{for(const e of t)r.delete(e);this._executeTails(t)}}_executeTails(e){const{_nextEvents:t}=this,r=new Set(e.map((e=>t.get(e))).filter(Ee.Ru));if(0===r.size)return;const{_executing:n}=this;for(const e of r)if(!e.actions.some((e=>n.has(e.tileId)))){for(const r of e.actions)t.delete(r.tileId);this._executeActions(e.actions).then((()=>{e.resolver.resolve()}),(t=>{e.resolver.reject(t)}))}}_validate(){const{_nextEvents:e}=this,t=Array.from(new Set(e.values()));if(0!==t.length&&t.some((t=>t.actions.some((({tileId:r})=>e.get(r)!==t)))))throw new Error("Mismatch between map and event")}}class it{constructor(e){this.actions=e,this.resolver=(0,s.Tw)()}}class st{constructor(e,t,r){this.tileId=e,this.type=t,this.data=r}toString(){return`${this.tileId}: ${this.type}`}}function at(e,t){const r=new Array(e.length).fill(!0),n=new Array(t.length).fill(!0);e:for(let i=0;i<e.length;++i){const s=e[i];for(let e=0;e<t.length;++e)if(n[e])switch(ot(s,t[e])){case Qe.NONE:break;case Qe.OVERWRITE:r[i]=!1;continue e;case Qe.REDUNDANT:n[e]=!1;break;case Qe.ANNIHILATE:r[i]=!1,n[e]=!1;continue e}}const i=new Array;for(let t=0;t<e.length;++t)r[t]&&i.push(e[t]);for(let e=0;e<t.length;++e)n[e]&&i.push(t[e]);return i}function ot(e,t){if(e.tileId!==t.tileId)return Qe.NONE;if(e.type===Je.ADD&&t.type===Je.REMOVE)return Qe.ANNIHILATE;if(e.type===Je.ADD&&t.type===Je.UPDATE_VISIBILITY)return Qe.REDUNDANT;if(e.type===Je.REMOVE&&t.type===Je.ADD)return Qe.ANNIHILATE;if(e.type===Je.UPDATE_VISIBILITY&&t.type===Je.REMOVE)return Qe.OVERWRITE;if(e.type===Je.UPDATE_VISIBILITY&&t.type===Je.UPDATE_VISIBILITY)return Qe.OVERWRITE;throw new Error("Impossible sequence of actions")}(Ke=Je||(Je={})).ADD="ADD",Ke.REMOVE="REMOVE",Ke.UPDATE_VISIBILITY="UPDATE_VISIBILITY",function(e){e.NONE="NONE",e.ANNIHILATE="ANNIHILATE",e.OVERWRITE="OVERWRITE",e.REDUNDANT="REDUNDANT"}(Qe||(Qe={}));var lt=r(24326);function ct(e=""){return`${e}${(0,lt.c)()}`}r(37539),new Float64Array(3);class dt{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=ct(`featureDataSubset-${e.id}-`)}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Me.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let n=0;n<r.length;++n)r[n]=t[e[n]];return new dt(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let n=0;n<t;++n)this.getEnabled(n)&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class ut{constructor(e){this._tile=e,this.id=ct(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get featureCount(){return this._tile.featureCount}get usedMemory(){return Me.qK+(0,Me.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every((e=>e))}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new dt(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const n of this._allFeatureIndices())t[n]&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:n}=this;for(const i of t)e[r++]=Number(n[i]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let ht=class extends et.A{constructor(e){super(e),this._updatingCount=0,this.extent=null,this._tileHandles=new rt.A,this._wanted=new rt.A}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updatingCount>0}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,P.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const n of t.values())null==r.get(n.id)?.featureData&&e.push(n);return e}async onTileTreeChange(e){++this._updatingCount;try{const{added:t,removed:r}=e,n=this._tileHandles,{_boundingRect:i}=this,s=null!=i?t.filter((e=>(0,P.HY)(i,e.extent))):t,a=this._wanted,o=new Array;for(const{id:e}of r)a.delete(e);for(const e of s)a.set(e.id,e);const l=this._missingTiles;for(const e of r){const{id:t}=e;if(l.some((t=>ft(t,e)||ft(e,t))))continue;const r=n.get(t);null!=r&&o.push(this._removeTile(r))}for(const e of s)o.push(this._addTile(e));const c=await Promise.allSettled(o);for(const e of c)"rejected"===e.status&&console.error(e.reason)}finally{--this._updatingCount}}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;null!=t&&await this.synchronizer.enqueueActions([new st(e.id,Je.REMOVE,t)])}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!mt(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const n=new pt(e,(0,tt.UT)((async t=>{const r=await this.loadTile(e,t);return(0,s.Te)(t),new ut(r)})));this._tileHandles.set(n.id,n);try{await n.loadTask.promise}catch(e){return void(0,s.jH)(e)}(function(e){if(!mt(e))throw new Error})(n),await this._onTileLoad(n)}async _onTileLoad(e){const{_wanted:t,_tileHandles:r,_missingTiles:n}=this,i=e.descriptor,s=new Array,a=new Set;for(const o of r.values()){if(o===e)continue;const{descriptor:l,id:c}=o;if(t.has(c)||n.some((e=>ft(e,l)||ft(l,e)))){if(mt(o)){if(ft(i,l)){const e=o.featureData;for(const t of e.objectIds())a.add(t)}if(ft(l,i)){const t=e.featureData,r=new Set(t.objectIds()),{featureData:n}=o;n.disableObjectIds(r),s.push(new st(c,Je.UPDATE_VISIBILITY,n)),this._validateRemoval(n,r)}}}else{r.delete(c),o.loadTask.abort();const{featureData:e}=o;null!=e&&s.push(new st(c,Je.REMOVE,e))}}a.size>0&&(e.featureData.disableObjectIds(a),this._validateRemoval(e.featureData,a)),this._validate(),s.push(new st(e.id,Je.ADD,e.featureData)),await this.synchronizer.enqueueActions(s)}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!mt(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:n}=e[t];for(let i=t+1;i<e.length;++i){const{featureData:t,objectIds:s}=e[i];for(const e of s)if(n.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function ft({lij:[e,t,r]},{lij:[n,i,s]}){const a=n-e;return a>=0&&t===i>>a&&r===s>>a}(0,n._)([(0,o.MZ)()],ht.prototype,"updating",null),(0,n._)([(0,o.MZ)({constructOnly:!0})],ht.prototype,"loadTile",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],ht.prototype,"synchronizer",void 0),(0,n._)([(0,o.MZ)()],ht.prototype,"_updatingCount",void 0),(0,n._)([(0,o.MZ)()],ht.prototype,"extent",void 0),(0,n._)([(0,o.MZ)()],ht.prototype,"_boundingRect",null),(0,n._)([(0,o.MZ)()],ht.prototype,"_missingTiles",null),ht=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],ht);class pt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function mt(e){return null!=e.featureData}var gt=r(75503),yt=r(27647),_t=r(92722);class bt{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Me.qK+Me.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new vt(this._index,this._view,e)}}class vt extends bt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,yt.Q)(new _t.A,this._geometryOverride,e.hasZ,e.hasM)}}class wt{constructor(e,t){this.featureData=e,this.bounds=t}}class xt{constructor(){this._tileBounds=new Map,this.events=new i.A,this.featureAdapter=Ct.shared}get usedMemory(){return Me.qK+Me.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new gt.w(9,(t=>e.getBounds(t))),n=new Array;for(let e=0;e<t;++e)n[e]=e;r.load(n),this._tileBounds.set(e.id,new wt(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all((r=>{t.getEnabled(r)&&e(new bt(r,t))}))}forEachInBounds(e,t){St.minX=e[0],St.minY=e[1],St.maxX=e[2],St.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(St,(r=>{e.getEnabled(r)&&t(new bt(r,e))}))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:a,maxX:o,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,a),n=Math.min(n,o),i=Math.min(i,l)}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:e}}}class Ct{static{this.shared=new Ct}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const St=new gt.E;var It=r(80893);class At{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const n=Me.ez+t.reduce(((e,{usedMemory:t})=>e+t),0),i=3*Me.RS;this.usedMemory=Me.qK+n+i,this.featureCount=t.reduce(((e,t)=>e+t.featureCount),0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttribute(n,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(n,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:n,featurePageIndex:i}=this._translateIndex(e);this._pages[n].getCoordinates(i,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getCentroid(n,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getObjectIdsArray(e,i,n);return n}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getCoordinatesArray(e,i,n);return n}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,n=new Array;for(const i of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(i);r!==e&&(0!==n.length&&t.push({pageIndex:r,indices:n}),r=e,n=[]),n.push(s)}0!==n.length&&t.push({pageIndex:r,indices:n})}const{_pages:r}=this;for(const{pageIndex:e,indices:n}of t)yield{page:r[e],indices:n}}}var Tt=r(49186),Ot=r(51624),Rt=r(62577),Pt=r(95466),Et=r(53655);class Mt{constructor(e){this._reader=new Ot.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return Dt(e.getMessage());e.skip()}Vt()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:n}}=this,i=r.get(t)?.index;if(null==i)return;const s=n[e*r.fields.length+i],a=this._reader;return a.move(s),jt(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,n=e*t.fields.length,i=this._reader,s={};for(const e of t.fields){const t=r[n+e.index];i.move(t),s[e.name]=jt(i)}return s}getCoordinates(e,t,r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;n.move(s[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=(0,S.vt)();return this.getCoordinates(e,t),new _t.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Bt);const[n,i,s]=Bt,a=[n,i];return t&&(a[3]=s),r&&(a[t?4:3]=0),new _t.A([],a)}getBounds(e){this.getCoordinates(e,Bt);const[t,r]=Bt,n=new gt.E;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,Bt);const[t,r,n]=Bt;return(0,R.fA)(t,r,n,t,r,n)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{objectIdFieldName:i,attributeIndices:s,fieldsIndex:a}=this._index,o=a.get(i).index,l=a.fields.length;for(const i of t){const t=s[i*l+o];n.move(t),e[r++]=jt(n)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;for(const i of t){const t=s[i];n.move(t),r=this._readCoordinates(a,o,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:n,fieldsIndex:i}=this._index,s=i.get(r).index,a=i.fields.length;for(const r of e){const e=n[r*a+s];t.move(e),yield jt(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[n,i,s],a,o){const l=this._reader,c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)3===l.tag()?(l.getUInt32(),a[o++]=n+e*l.getSInt64(),a[o++]=i+t*l.getSInt64(),a[o++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return o}}function Dt(e){for(;e.next();){if(1===e.tag())return Ft(e.getMessage());e.skip()}Vt()}function Ft(e){let t,r,n=!1,i=!1,s=0;const a=new Array,o=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&Vt();break;case 9:n=e.getBool()??!1;break;case 12:t=(0,Rt.Q1)(e.processMessage(Et.ae));break;case 13:{const t=e.processMessage(Et.cn);t.index=s++,a.push(t);break}case 15:{o.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:i=e.getBool()??!1;break;default:e.skip()}const c=new Pt.A(a);return null!=t&&i&&null!=r&&c.has(r)||Vt(),{transform:t,exceededTransferLimit:n,fieldsIndex:c,objectIdFieldName:r,featureIndices:o,attributeIndices:l}}function Vt(){const e=new Tt.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function jt(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const Bt=(0,S.vt)();class Lt{constructor(e,t,r,n,i){this.spatialReference=e,this.url=r,this.objectIdField=n,this.capabilities=i;const{supportsMaxRecordCountFactor:s,maxRecordCount:a}=this.capabilities.query,o=s?4:1,l=(a??8e3)*o;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=o,c.num=this._pageSize,c.outFields=[n],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:n}=this,i=(0,P.w1)(e.extent,r),a=this._baseQuery.clone();a.geometry=i;const o=new Array;let l=0,c=!1,d=1;for(;!c;){const e=[];for(let r=0;r<d;++r)e.push(this._fetchPage(a,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&o.push(e)}d=Math.min(d+1,4)}return new At(e,o,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,It.kS)(this.url,n,{signal:r})).data;return(0,s.Te)(r),new Mt(i)}}var Ut=r(29920),zt=r(77690),Nt=r(29242);var kt=r(13030),qt=r(78662),Ht=r(1843),Gt=r(49255),$t=r(40268),Yt=r(16943),Zt=r(25634),Wt=r(11725),Xt=r(13464),Jt=r(77194);class Qt{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var Kt=r(59907),er=r(43616),tr=r(13259),rr=r(97220),nr=r(98958),ir=r(59643),sr=r(33524),ar=r(90644);class or extends nr.w{constructor(e,t){super(e,t,new rr.$(tr.H,(()=>r.e(8241).then(r.bind(r,48241))))),this.primitiveType=t.occlusionPass?Y.WR.POINTS:Y.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:n,output:i,depthTestEnabled:s,occlusionPass:a}=e,o=t===ir.Y.NONE,l=t===ir.Y.ColorAlpha,c=i===Gt.V.Highlight,d=s&&!n&&!l&&!a&&!c;return(0,ar.Ey)({blending:(0,Gt.RN)(i)?o?ar.RC:(0,sr.ez)(t):null,depthTest:s&&!n?{func:Y.MT.LEQUAL}:null,depthWrite:d?ar.Uy:null,drawBuffers:(0,sr.m6)(t,i),colorWrite:ar.kn,polygonOffset:r?lr:null})}}const lr={factor:0,units:-4};var cr=r(53466),dr=r(22911),ur=r(51976),hr=r(35256);class fr extends hr.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.textureCoordinateType=cr.I.None,this.emissionSource=dr.ZX.None,this.discardInvisibleFragments=!0,this.hasVvInstancing=!1,this.snowCover=!1}}(0,n._)([(0,ur.W)()],fr.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"occlusionTestEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"signedDistanceFieldEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"vvSize",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"vvColor",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasVerticalOffset",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasScreenSizePerspective",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasRotation",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"debugDrawLabelBorder",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"hasPolygonOffset",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"depthTestEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"pixelSnappingEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"draped",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"terrainDepthTest",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"cullAboveTerrain",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"occlusionPass",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"occludedFragmentFade",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"horizonCullingEnabled",void 0),(0,n._)([(0,ur.W)()],fr.prototype,"isFocused",void 0);var pr=r(49788);class mr extends Wt.im{constructor(e,t){super(e,Ur),this.produces=new Map([[Xt.N.HUD_MATERIAL,e=>(0,Gt.Mb)(e)&&!this.parameters.drawAsLabel],[Xt.N.LABEL_MATERIAL,e=>(0,Gt.Mb)(e)&&this.parameters.drawAsLabel],[Xt.N.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[Xt.N.DRAPED_MATERIAL,e=>this.parameters.draped&&(0,Gt.Mb)(e)]]),this._visible=!0,this._configuration=new fr(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===Xt.N.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===Xt.N.OCCLUSION_PIXELS,(0,Gt.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!F.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,n,i,s){const{options:{selectionMode:a,hud:o,excludeLabels:l},point:c,camera:d}=r,{parameters:u}=this;if(!a||!o||l&&u.isLabel||!e.visible||!c)return;const h=e.attributes.get(ne.r.FEATUREATTRIBUTE),f=null==h?null:(0,I.ci)(h.data,Dr),{scaleX:p,scaleY:m}=qr(f,u,d.pixelRatio);(0,zt.z0)(Tr,t),e.attributes.has(ne.r.FEATUREATTRIBUTE)&&function(e){const t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+n*n),u=1/Math.sqrt(i*i+s*s+a*a),h=1/Math.sqrt(o*o+l*l+c*c);e[0]=t*d,e[1]=r*d,e[2]=n*d,e[3]=i*u,e[4]=s*u,e[5]=a*u,e[6]=o*h,e[7]=l*h,e[8]=c*h}(Tr);const g=e.attributes.get(ne.r.POSITION),y=e.attributes.get(ne.r.SIZE),_=e.attributes.get(ne.r.NORMAL),b=e.attributes.get(ne.r.ROTATION),v=e.attributes.get(ne.r.CENTEROFFSETANDDISTANCE);(0,_e.vA)(g.size>=3);const w=(0,tr.c)(u),x="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<g.data.length/g.size;e++){const n=e*g.size;(0,pe.i)(vr,g.data[n],g.data[n+1],g.data[n+2]),(0,pe.t)(vr,vr,t),(0,pe.t)(vr,vr,d.viewMatrix);const i=e*v.size;if((0,pe.i)(Er,v.data[i],v.data[i+1],v.data[i+2]),!x&&(vr[0]+=Er[0],vr[1]+=Er[1],0!==Er[2])){const e=Er[2];(0,pe.n)(Er,vr),(0,pe.d)(vr,vr,(0,pe.h)(Er,Er,e))}const a=e*_.size;if((0,pe.i)(wr,_.data[a],_.data[a+1],_.data[a+2]),yr(wr,Tr,d,Fr),Hr(this.parameters,vr,Fr,d,br),d.applyProjection(vr,xr),xr[0]>-1){x&&(Er[0]||Er[1])&&(xr[0]+=Er[0]*d.pixelRatio,0!==Er[1]&&(xr[1]+=(0,Jt.m0)(Er[1],br.factorAlignment)*d.pixelRatio),d.unapplyProjection(xr,vr)),xr[0]+=this.parameters.screenOffset[0]*d.pixelRatio,xr[1]+=this.parameters.screenOffset[1]*d.pixelRatio,xr[0]=Math.floor(xr[0]),xr[1]=Math.floor(xr[1]);const t=e*y.size;Br[0]=y.data[t],Br[1]=y.data[t+1],(0,Jt.MD)(Br,br.factor,Br);const n=Vr*d.pixelRatio;let i=0;u.textureIsSignedDistanceField&&(i=Math.min(u.outlineSize,.5*Br[0])*d.pixelRatio/2),Br[0]*=p,Br[1]*=m;const a=e*b.size,o=u.rotation+b.data[a];if(_r(c,xr[0],xr[1],Br,n,i,o,u,w)){const e=r.ray;if((0,pe.t)(Sr,vr,(0,O.B8)(Rr,d.viewMatrix)),xr[0]=c[0],xr[1]=c[1],d.unprojectFromRenderScreen(xr,vr)){const t=(0,S.vt)();(0,pe.c)(t,e.direction);const r=1/(0,pe.l)(t);(0,pe.h)(t,t,r),s((0,pe.j)(e.origin,vr)*r,t,-1,!0,1,Sr)}}}}}intersectDraped(e,t,r,n,i,s){const a=e.attributes.get(ne.r.POSITION),o=e.attributes.get(ne.r.SIZE),l=e.attributes.get(ne.r.ROTATION),c=this.parameters,d=(0,tr.c)(c),u=e.attributes.get(ne.r.FEATUREATTRIBUTE),h=null==u?null:(0,I.ci)(u.data,Dr),{scaleX:f,scaleY:p}=qr(h,c,e.screenToWorldRatio),m=jr*e.screenToWorldRatio;for(let t=0;t<a.data.length/a.size;t++){const r=t*a.size,u=a.data[r],h=a.data[r+1],g=t*o.size;Br[0]=o.data[g],Br[1]=o.data[g+1];let y=0;c.textureIsSignedDistanceField&&(y=Math.min(c.outlineSize,.5*Br[0])*e.screenToWorldRatio/2),Br[0]*=f,Br[1]*=p;const _=t*l.size,b=c.rotation+l.data[_];_r(n,u,h,Br,m,y,b,c,d)&&i(s.dist,s.normal,-1,!1)}}createBufferWriter(){return new kr}applyShaderOffsetsView(e,t,r,n,i,s,a){const o=yr(t,r,i,Fr);return this._applyVerticalGroundOffsetView(e,o,i,a),Hr(this.parameters,a,o,i,s),this._applyPolygonOffsetView(a,o,n[3],i,a),this._applyCenterOffsetView(a,n,a),a}applyShaderOffsetsNDC(e,t,r,n,i){return this._applyCenterOffsetNDC(e,t,r,n),null!=i&&(0,pe.c)(i,n),this._applyPolygonOffsetNDC(n,t,r,n),n}_applyPolygonOffsetView(e,t,r,n,i){const s=n.aboveGround?1:-1;let a=Math.sign(r);0===a&&(a=s);const o=s*a;if(this.parameters.shaderPolygonOffset<=0)return(0,pe.c)(i,e);const l=(0,D.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/n.viewport[2];return(0,pe.h)(i,e,o>0?c:1/c),i}_applyVerticalGroundOffsetView(e,t,r,n){const i=(0,pe.l)(e),s=r.aboveGround?1:-1,a=r.computeRenderPixelSizeAtDist(i)*$t.R,o=(0,pe.h)(vr,t.normal,s*a);return(0,pe.g)(n,e,o),n}_applyCenterOffsetView(e,t,r){const n="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,pe.c)(r,e),n&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,pe.n)(wr,r),(0,pe.g)(r,r,(0,pe.h)(wr,wr,t[2])))),r}_applyCenterOffsetNDC(e,t,r,n){const i="screen"!==this.parameters.centerOffsetUnits;return n!==e&&(0,pe.c)(n,e),i||(n[0]+=t[0]/r.fullWidth*2,n[1]+=t[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,t,r,n){const i=this.parameters.shaderPolygonOffset;if(e!==n&&(0,pe.c)(n,e),i){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);n[2]-=(s||e)*i}return n}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,n=e[3]>=pr.Q||t>=pr.Q&&r[3]>=pr.Q;return this._visible&&n}createGLMaterial(e){return new gr(e)}calculateRelativeScreenBounds(e,t,r=(0,P.vt)()){return function(e,t,r,n){n[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,n[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class gr extends Zt.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(or,e)}}function yr(e,t,r,n){return function(e){return function(e){return e instanceof Float32Array&&e.length>=16}(e)||function(e){return Array.isArray(e)&&e.length>=16}(e)}(t)&&(t=(0,zt.z0)(Or,t)),(0,pe.q)(n.normal,e,t),(0,pe.t)(n.normal,n.normal,r.viewInverseTransposeMatrix),n.cosAngle=(0,pe.f)(Cr,Lr),n}function _r(e,t,r,n,i,s,a,o,l){let c=t-i-n[0]*l[0],d=c+n[0]+2*i,u=r-i-n[1]*l[1],h=u+n[1]+2*i;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&null!=f&&(c+=n[0]*f[0],u+=n[1]*f[1],d-=n[0]*(1-f[2]),h-=n[1]*(1-f[3]),c-=s,d+=s,u-=s,h+=s),(0,E.hZ)(Ar,t,r),(0,E.e$)(Ir,e,Ar,(0,D.kU)(a)),Ir[0]>c&&Ir[0]<d&&Ir[1]>u&&Ir[1]<h}const br=new class{constructor(){this.factor=new Qt,this.factorAlignment=new Qt}},vr=(0,S.vt)(),wr=(0,S.vt)(),xr=(0,I.vt)(),Cr=(0,S.vt)(),Sr=(0,S.vt)(),Ir=(0,M.vt)(),Ar=(0,M.vt)(),Tr=(0,Nt.vt)(),Or=(0,Nt.vt)(),Rr=(0,C.vt)(),Pr=(0,I.vt)(),Er=(0,S.vt)(),Mr=(0,S.vt)(),Dr=(0,I.vt)(),Fr={normal:Cr,cosAngle:0},Vr=1,jr=2,Br=(0,M.fA)(0,0),Lr=(0,S.fA)(0,0,1);class Ur extends Zt.NV{constructor(){super(...arguments),this.renderOccluded=Wt.m$.Occlude,this.isDecoration=!1,this.color=(0,I.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,M.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,I.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,I.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const zr=(0,Ht.BP)().vec3f(ne.r.POSITION).vec3f(ne.r.NORMAL).vec2i16(ne.r.UVI).vec4u8(ne.r.COLOR).vec2f(ne.r.SIZE).f32(ne.r.ROTATION).vec4f(ne.r.CENTEROFFSETANDDISTANCE).vec4f(ne.r.FEATUREATTRIBUTE),Nr=zr.clone().vec4u8(ne.r.OLIDCOLOR);class kr{constructor(){this.vertexBufferLayout=(0,Yt.E)()?Nr:zr}elementCount(e){return 6*e.get(ne.r.POSITION).indices.length}write(e,t,r,n,i,s){const{position:a,normal:o,uvi:l,color:c,size:d,rotation:u,centerOffsetAndDistance:h,featureAttribute:f}=i;(0,Kt.Hk)(r.get(ne.r.POSITION),e,a,s,6),(0,Kt.p1)(r.get(ne.r.NORMAL),t,o,s,6);const p=r.get(ne.r.UVI)?.data;let m=0,g=0,y=-1-tr.f,_=-1-tr.f;p&&p.length>=4&&(m=p[0],g=p[1],y=-1-p[2],_=-1-p[3]);let b=r.get(ne.r.POSITION).indices.length,v=s;for(let e=0;e<b;++e)l.set(v,0,m),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,g),v++;(0,Kt.tb)(r.get(ne.r.COLOR),4,c,s,6);const{data:w,indices:x}=r.get(ne.r.SIZE);b=x.length,v=s;for(let e=0;e<b;++e){const t=w[2*x[e]],r=w[2*x[e]+1];for(let e=0;e<6;++e)d.set(v,0,t),d.set(v,1,r),v++}if((0,Kt.uO)(r.get(ne.r.ROTATION),u,s,6),r.get(ne.r.CENTEROFFSETANDDISTANCE)?(0,Kt.Ut)(r.get(ne.r.CENTEROFFSETANDDISTANCE),h,s,6):(0,Kt.Pq)(h,s,6*b),r.get(ne.r.FEATUREATTRIBUTE)?(0,Kt.Ut)(r.get(ne.r.FEATUREATTRIBUTE),f,s,6):(0,Kt.Pq)(f,s,6*b),null!=n){const e=r.get(ne.r.POSITION)?.indices;if(e){const t=e.length,r=i.getField(ne.r.OLIDCOLOR,kt.XP);(0,Kt.vx)(n,r,t,s,6)}}return{numVerticesPerItem:6,numItems:b}}intersect(e,t,r,n,i,s,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:u}=n;if(!o||!l||c&&t.isLabel||!d)return;const h=this.vertexBufferLayout.createView(e),f=h.getField(ne.r.POSITION,kt.xs),p=h.getField(ne.r.NORMAL,kt.xs),m=h.getField(ne.r.ROTATION,kt.Y$),g=h.getField(ne.r.SIZE,kt.gH),y=h.getField(ne.r.FEATUREATTRIBUTE,kt.Eq),_=h.getField(ne.r.CENTEROFFSETANDDISTANCE,kt.Eq),b="screen"===t.centerOffsetUnits,v=(0,tr.c)(t);if(null==f||null==p||null==m||null==g||null==_)return;const w=null==y?null:y.getVec(0,Dr),{scaleX:x,scaleY:C}=qr(w,t,u.pixelRatio),I=f.count/6;for(let e=0;e<I;e++){const i=6*e;if(f.getVec(i,vr),null!=r&&(0,pe.g)(vr,vr,r),(0,pe.t)(vr,vr,u.viewMatrix),_.getVec(i,Pr),(0,pe.i)(Er,Pr[0],Pr[1],Pr[2]),!b&&(vr[0]+=Er[0],vr[1]+=Er[1],0!==Er[2])){const e=Er[2];(0,pe.n)(Er,vr),(0,pe.d)(vr,vr,(0,pe.h)(Er,Er,e))}if(p.getVec(i,wr),yr(wr,Tr,u,Fr),Hr(t,vr,Fr,u,br),u.applyProjection(vr,xr),xr[0]>-1){b&&(Er[0]||Er[1])&&(xr[0]+=Er[0]*u.pixelRatio,0!==Er[1]&&(xr[1]+=(0,Jt.m0)(Er[1],br.factorAlignment)*u.pixelRatio),u.unapplyProjection(xr,vr)),xr[0]+=t.screenOffset[0]*u.pixelRatio,xr[1]+=t.screenOffset[1]*u.pixelRatio,xr[0]=Math.floor(xr[0]),xr[1]=Math.floor(xr[1]),g.getVec(i,Br),(0,Jt.MD)(Br,br.factor,Br);const r=Vr*u.pixelRatio;let s=0;t.textureIsSignedDistanceField&&(s=Math.min(t.outlineSize,.5*Br[0])*u.pixelRatio/2),Br[0]*=x,Br[1]*=C;const o=m.get(i),l=t.rotation+o;if(_r(d,xr[0],xr[1],Br,r,s,l,t,v)){const t=n.ray;if((0,pe.t)(Sr,vr,(0,O.B8)(Rr,u.viewMatrix)),xr[0]=d[0],xr[1]=d[1],u.unprojectFromRenderScreen(xr,vr)){const r=(0,S.vt)();(0,pe.c)(r,t.direction);const n=1/(0,pe.l)(r);(0,pe.h)(r,r,n),a((0,pe.j)(t.origin,vr)*n,r,e,!0,1,Sr)}}}}}}function qr(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,qt.VC)(Mr,t,e),{scaleX:Mr[0]*r,scaleY:Mr[1]*r})}function Hr(e,t,r,n,i){if(!e.verticalOffset?.screenLength)return e.screenSizePerspective||e.screenSizePerspectiveAlignment?Gr(e,i,(0,pe.l)(t),r.cosAngle):(i.factor.scale=1,i.factorAlignment.scale=1),t;const s=(0,pe.l)(t),a=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=(0,er.kE)(n,s,e.verticalOffset,r.cosAngle,a);return Gr(e,i,s,r.cosAngle),(0,pe.h)(r.normal,r.normal,o),(0,pe.g)(t,t,r.normal)}function Gr(e,t,r,n){null!=e.screenSizePerspective?(0,Jt.cJ)(n,r,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?(0,Jt.cJ)(n,r,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}class $r{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this._sharedTextures=new Map,this.globalViewingMode=e===De.RT.Global}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async getOrCreateSharedTexture(e,t){const{data:r,parameters:n}=t(),i=await this._mainThreadDelegate.createTexture(r,n);return this._sharedTextures.set(e,i),i}async releaseSharedTexture(e){const t=this._sharedTextures,r=t.get(e);if(null==r)return g.create(this);const n=this._destroyTexture(r);return new g(this,n,[()=>t.delete(e)])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,n=ct("material");let i,s;switch(t){case"default":i=new Ue.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,materialId:n,parameters:e.parameters};break;case"hud":i=new mr(r,this.globalViewingMode),s={type:t,materialId:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),n}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(n,e,i,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(n,e,i,s,r)}addDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=ct("lod-renderer"),r=new Set,n={levels:e.levels.map((e=>({components:e.components.map((e=>{const t=e.attributes.get(ne.r.POSITION);if(!t||0===t.indices.length)throw new Error("positions attribute expected");const n=(0,H.tM)(t.indices.length/3),i=new Ut.j(n,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:i.bbMax,bbMin:i.bbMin}}})),minScreenSpaceRadius:e.minScreenSpaceRadius})))};return await this._mainThreadDelegate.createLodRenderer(t,n,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:n,objectIds:i}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let a=null;if(e.transformation&&t)(0,O.C)(Yr,e.transformation),Yr[12]-=t[0],Yr[13]-=t[1],Yr[14]-=t[2],a=Yr;else{if(t)throw new Error("not implemented");e.transformation&&(a=e.transformation)}let o=null;a&&((0,O.B8)(Zr,Yr),(0,O.mg)(Zr,Zr),o=Zr);const l=e.attributes,c=s.elementCount(l),d=s.vertexBufferLayout.stride/4;c>Math.floor(Wr/d)&&console.warn("geometry with very large number of elements encountered");const u=s.vertexBufferLayout.createBuffer(c),h=s.write(a,o,l,e.objectAndLayerIdColor,u,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(n.length!==h.numItems||i.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:u.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:i,visibilities:n,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const Yr=(0,C.vt)(),Zr=(0,C.vt)(),Wr=4194304;var Xr=r(73941),Jr=r(98764),Qr=r(65806);const Kr=(0,S.vt)();var en=r(88582),tn=r(17352),rn=r(97937);function nn(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const sn=2**50;function an(e,t,r,n){return e.operations.setAltitudeAt(e.value,t,r,n)}function on(e,t,r){return e.operations.elevate(e.value,t,r.value)}const ln=(0,S.vt)();(0,S.vt)();var cn=r(44280),dn=r(32114);function un(e){return"point"===e.type}class hn{constructor(e,t,r,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(n),this.referenceEllipsoid=(0,Xr.tO)(t),this.sphericalPCPF=(0,Jr.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return function(e,t){return e.operations.getExtent(e.value,t),t}(this._coordinateSystem,(0,P.vt)())}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return an(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){!function(e,t,r,n){t!==n&&(0,O.C)(n,t),(0,pe.i)(ln,n[12],n[13],n[14]),an(e,ln,r,ln),n[12]=ln[0],n[13]=ln[1],n[14]=ln[2]}(this._coordinateSystem,t,e,t)}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,en._.Z,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,n){return e.operations.axisAt(e.value,t,r,n)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,en._.X,dn.rq.get()),n=this.worldBasisAtPosition(e,en._.Y,dn.rq.get()),i=this.worldBasisAtPosition(e,en._.Z,dn.rq.get());return(0,O.hZ)(t,r[0],r[1],r[2],0,n[0],n[1],n[2],0,i[0],i[1],i[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,dn.rq.get()),n=this.worldBasisAtPosition(e,en._.Y,dn.rq.get()),i=(0,cn.EJ)(t,n,r);return(0,D.KJ)(i)}intersectManifoldClosestSilhouette(e,t,r){return on(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){on(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=dn.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,n)?(0,pe.c)(r,n):null}intersectInfiniteManifold(e,t,r){if(this.viewingMode===De.RT.Global)return this.intersectManifold(e,t,r);on(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,i=dn.rq.get();return(0,ye.Ui)(n.plane,e,i)?(0,pe.c)(r,i):null}toRenderCoords(e,t,r){return un(e)?(0,Qr.g)(e,t,this.spatialReference):(0,z.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return un(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,z.F)(e,t,Kr,r.spatialReference)&&(r.x=Kr[0],r.y=Kr[1],r.z=Kr[2],!0)}(e,this.spatialReference,t)?t:null):(0,z.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case De.RT.Local:return new hn(De.RT.Local,t,(0,T.GA)(t),nn(tn.b,(0,tn.f)([0,0,0],[sn,0,0],[0,sn,0])));case De.RT.Global:return new hn(De.RT.Global,t,1,function(e){return nn(rn.s,(0,rn.f)(0,0,0,(0,Xr.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,T.KX)(e)/(0,T.KX)(t)}}let fn=class extends i.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new xt,this._actionSynchronizer=new nt(y,(e=>this._createCommand(e))),this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:n,layerViewInfo:i}){const s=h.A.fromJSON(e);this._viewSpatialReference=s;const o=h.A.fromJSON(t);this._fetcher=new Lt(this._viewSpatialReference,p.A.fromJSON(n.baseQuery),n.url,n.objectIdField,n.capabilities),this._queryEngine=new f.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:n.objectIdField,fieldsIndex:n.fieldIndex,availableFields:[n.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:n.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const n={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",n,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const l=hn.create(r,o),c=new $r(r,this._mainThreadDelegate);this._renderCommandContext=c;const m=new Ze(s,o,this._mainThreadDelegate,l,c,n,i);this._context=m,this._renderer=m.symbolRendererFactory.createSymbolRendererFromJSON(n.renderer),this._defaultQueryJSON=new p.A({outSpatialReference:s}).toJSON();let g=null;if(null!=n.fullExtent){const e=d.A.fromJSON(n.fullExtent);await(0,u.initializeProjection)(e.spatialReference,s),g=(0,u.project)(e,s)}return this._tileManager=new ht({loadTile:(e,t)=>this._fetcher.fetch(e,t),synchronizer:this._actionSynchronizer,extent:g}),this.addHandles((0,a.wB)((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),a.Vh),null!=this._renderer&&await this._renderer.load(),mn}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),mn}async onElevationChange(e){return mn}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return mn;const n=await r.createUpdateLayerViewOpacityCommand(e);return await n.execute(),mn}async onRendererChange(e){const{_context:t}=this,r=await this._createDestroyRendererCommand();await r.execute();const n=t.symbolRendererFactory.createSymbolRendererFromJSON(e);this._renderer=n,await this._renderer.load();const i=[];this._tileManager.forEachTile((e=>{i.push(n.createAddCommand(e))}));const s=await Promise.all(i),a=t.joinPipelineCommands(s);return await a.execute(),mn}async _createDestroyRendererCommand(){const e=this._renderer;if(null==e)return g.create(this._renderCommandContext);const t=await e.createDestroyCommand();return t.appendPipelineStateCommand((()=>{(0,_e.vA)(this._renderer===e),this._renderer=null})),t}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,n=this._renderer;let i;return i=null!=n?await n.createAddCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),i.appendPipelineStateCommand((()=>{r.addTile(e)})),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let n;return n=null!=r?await r.createRemoveCommand(e):g.create(this._renderCommandContext),n.appendPipelineStateCommand((()=>{t.removeTile(e)})),n}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let n;return n=null!=r?await r.createUpdateVisibilityCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}async _createCommand(e){switch(e.type){case Je.ADD:return await this._createAddFeatureDataCommand(e.data);case Je.REMOVE:return await this._createRemoveFeatureDataCommand(e.data.id);case Je.UPDATE_VISIBILITY:return await this._createUpdateFeatureDataVisibilityCommand(e.data)}}};(0,n._)([(0,o.MZ)()],fn.prototype,"updating",null),fn=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],fn);const pn=fn,mn={result:void 0}},86305:(e,t,r)=>{r.d(t,{i3:()=>i}),r(38954);var n=r(51850);function i(e){return null!=e?.dist}r(17352),r(62258),(0,n.vt)()},87582:(e,t,r)=>{r(62258);var n=r(65215);r(86305),n.R6},95696:(e,t,r)=>{r.d(t,{A:()=>u});var n,i=r(90237),s=r(69540),a=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),c=r(40608);let d=class extends(s.A.ClonableMixin(a.A)){static{n=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new n}};(0,i._)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],d.prototype,"type",void 0),(0,i._)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],d.prototype,"origin",void 0),d=n=(0,i._)([(0,c.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],d);const u=d},96576:(e,t,r)=>{r.d(t,{A:()=>f});var n,i=r(90237),s=r(4718),a=r(10107),o=(r(44208),r(53966),r(93223)),l=r(40608),c=r(92438),d=r(63988),u=r(49849);let h=n=class extends((0,d.h)(c.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map((r=>r.collectRequiredFields(e,t))))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){return this.symbols.reduce(((e,t)=>e+JSON.stringify(t)),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new n({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"description",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"label",void 0),(0,i._)([(0,a.MZ)(u.Wp)],h.prototype,"symbol",void 0),(0,i._)([(0,o.e)({simple:"simple"})],h.prototype,"type",void 0),h=n=(0,i._)([(0,l.$)("esri.renderers.SimpleRenderer")],h);const f=h}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6187],{46187:(t,e,o)=>{o.r(e),o.d(e,{default:()=>r});var r=async function(t={}){var e,o,r,_=t,p=new Promise(((t,r)=>{e=t,o=r})),n="";try{n=new URL(".","").href}catch{}r=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)};var i,c,a,y,s,P,g,u,f,b=console.log.bind(console),E=console.error.bind(console),d=!1;function T(t,e){t||N(e)}function O(){var t=i.buffer;c=new Int8Array(t),y=new Int16Array(t),a=new Uint8Array(t),s=new Int32Array(t),P=new Uint32Array(t),g=new Float32Array(t),f=new Float64Array(t),u=new BigInt64Array(t),new BigUint64Array(t)}var m,h=0,S=null;function N(t){E(t="Aborted("+t+")"),d=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}async function l(t,e){try{var o=await async function(t){try{var e=await r(t);return new Uint8Array(e)}catch{}return function(){throw"both async and sync fetching of the wasm failed"}()}(t);return await WebAssembly.instantiate(o,e)}catch(t){E(`failed to asynchronously prepare wasm: ${t}`),N(t)}}var v="undefined"!=typeof TextDecoder?new TextDecoder:void 0,M=(t,e=0,o=NaN)=>{for(var r=e+o,_=e;t[_]&&!(_>=r);)++_;if(_-e>16&&t.buffer&&v)return v.decode(t.subarray(e,_));for(var p="";e<_;){var n=t[e++];if(128&n){var i=63&t[e++];if(192!=(224&n)){var c=63&t[e++];if((n=224==(240&n)?(15&n)<<12|i<<6|c:(7&n)<<18|i<<12|c<<6|63&t[e++])<65536)p+=String.fromCharCode(n);else{var a=n-65536;p+=String.fromCharCode(55296|a>>10,56320|1023&a)}}else p+=String.fromCharCode((31&n)<<6|i)}else p+=String.fromCharCode(n)}return p},j=(t,e)=>t?M(a,t,e):"",D=[0,31,60,91,121,152,182,213,244,274,305,335],A=[0,31,59,90,120,151,181,212,243,273,304,334],R=(t,e,o,r)=>{if(!(r>0))return 0;for(var _=o,p=o+r-1,n=0;n<t.length;++n){var i=t.charCodeAt(n);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++n)),i<=127){if(o>=p)break;e[o++]=i}else if(i<=2047){if(o+1>=p)break;e[o++]=192|i>>6,e[o++]=128|63&i}else if(i<=65535){if(o+2>=p)break;e[o++]=224|i>>12,e[o++]=128|i>>6&63,e[o++]=128|63&i}else{if(o+3>=p)break;e[o++]=240|i>>18,e[o++]=128|i>>12&63,e[o++]=128|i>>6&63,e[o++]=128|63&i}}return e[o]=0,o-_},C=(t,e,o)=>R(t,a,e,o),G=(t,e)=>Math.ceil(t/e)*e,I=t=>{var e=(t-i.buffer.byteLength+65535)/65536|0;try{return i.grow(e),O(),1}catch(t){}},L={},U=()=>{if(!U.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(var e in L)void 0===L[e]?delete t[e]:t[e]=L[e];var o=[];for(var e in t)o.push(`${e}=${t[e]}`);U.strings=o}return U.strings},w=t=>{for(var e=0,o=0;o<t.length;++o){var r=t.charCodeAt(o);r<=127?e++:r<=2047?e+=2:r>=55296&&r<=57343?(e+=4,++o):e+=3}return e},F=[null,[],[]],Y=(t,e)=>{var o=F[t];0===e||10===e?((1===t?b:E)(M(o)),o.length=0):o.push(e)},X=[];_.getValue=function(t,e="i8"){switch(e.endsWith("*")&&(e="*"),e){case"i1":case"i8":return c[t];case"i16":return y[t>>1];case"i32":return s[t>>2];case"i64":return u[t>>3];case"float":return g[t>>2];case"double":return f[t>>3];case"*":return P[t>>2];default:N(`invalid type for getValue: ${e}`)}},_.UTF8ToString=j;var x={c:function(t,e,o){return 0},o:(t,e,o)=>{},i:function(t,e,o){return 0},d:function(t,e,o,r){},m:t=>{},l:(t,e)=>{},n:(t,e,o)=>{},j:()=>N(""),p:function(t,e){t=(t=>t<-9007199254740992||t>9007199254740992?NaN:Number(t))(t);var o=new Date(1e3*t);s[e>>2]=o.getSeconds(),s[e+4>>2]=o.getMinutes(),s[e+8>>2]=o.getHours(),s[e+12>>2]=o.getDate(),s[e+16>>2]=o.getMonth(),s[e+20>>2]=o.getFullYear()-1900,s[e+24>>2]=o.getDay();var r=0|(t=>((t=>t%4==0&&(t%100!=0||t%400==0))(t.getFullYear())?D:A)[t.getMonth()]+t.getDate()-1)(o);s[e+28>>2]=r,s[e+36>>2]=-60*o.getTimezoneOffset();var _=new Date(o.getFullYear(),0,1),p=new Date(o.getFullYear(),6,1).getTimezoneOffset(),n=_.getTimezoneOffset(),i=0|(p!=n&&o.getTimezoneOffset()==Math.min(n,p));s[e+32>>2]=i},q:(t,e,o,r)=>{var _=(new Date).getFullYear(),p=new Date(_,0,1),n=new Date(_,6,1),i=p.getTimezoneOffset(),c=n.getTimezoneOffset(),a=Math.max(i,c);P[t>>2]=60*a,s[e>>2]=Number(i!=c);var y=t=>{var e=t>=0?"-":"+",o=Math.abs(t);return`UTC${e}${String(Math.floor(o/60)).padStart(2,"0")}${String(o%60).padStart(2,"0")}`},g=y(i),u=y(c);c<i?(C(g,o,17),C(u,r,17)):(C(g,r,17),C(u,o,17))},r:()=>Date.now(),k:t=>{var e=a.length,o=2147483648;if((t>>>=0)>o)return!1;for(var r=1;r<=4;r*=2){var _=e*(1+.2/r);_=Math.min(_,t+100663296);var p=Math.min(o,G(Math.max(t,_),65536));if(I(p))return!0}return!1},f:(t,e)=>{var o=0,r=0;for(var _ of U()){var p=e+o;P[t+r>>2]=p,o+=C(_,p,1/0)+1,r+=4}return 0},g:(t,e)=>{var o=U();P[t>>2]=o.length;var r=0;for(var _ of o)r+=w(_)+1;return P[e>>2]=r,0},a:t=>52,h:(t,e,o,r)=>52,e:function(t,e,o,r){return 70},b:(t,e,o,r)=>{for(var _=0,p=0;p<o;p++){var n=P[e>>2],i=P[e+4>>2];e+=8;for(var c=0;c<i;c++)Y(t,a[n+c]);_+=i}return P[r>>2]=_,0}},H=await async function(){h++;var t={a:x};m??=_.locateFile?function(t){return _.locateFile?_.locateFile(t,n):n+t}("pe-wasm.wasm"):new URL("pe-wasm.wasm","").href;try{return function(t){return function(t){return H=t.exports,i=H.s,O(),function(){if(0==--h&&S){var t=S;S=null,t()}}(),H}(t.instance)}(await async function(t,e,o){if("function"==typeof WebAssembly.instantiateStreaming)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,o)}catch(t){E(`wasm streaming compile failed: ${t}`),E("falling back to ArrayBuffer instantiation")}return l(e,o)}(0,m,t))}catch(t){return o(t),Promise.reject(t)}}();H.t,_._webidl_free=H.u,_._webidl_malloc=H.v;var z=_._emscripten_bind_PeObject_getCode_0=H.w,Z=_._emscripten_bind_PeObject_getName_1=H.x,W=_._emscripten_bind_PeObject_getType_0=H.y,B=_._emscripten_bind_PeCoordsys_isEqual_1=H.z,q=_._emscripten_bind_PeCoordsys_getCode_0=H.A,K=_._emscripten_bind_PeCoordsys_getName_1=H.B,k=_._emscripten_bind_PeCoordsys_getType_0=H.C,V=_._emscripten_bind_PeUnit_getUnitFactor_0=H.D,$=_._emscripten_bind_PeUnit_getCode_0=H.E,J=_._emscripten_bind_PeUnit_getName_1=H.F,Q=_._emscripten_bind_PeUnit_getType_0=H.G,tt=_._emscripten_bind_VoidPtr___destroy___0=H.H,et=_._emscripten_bind_PeAngunit_getCode_0=H.I,ot=_._emscripten_bind_PeAngunit_getName_1=H.J,rt=_._emscripten_bind_PeAngunit_getType_0=H.K,_t=_._emscripten_bind_PeAngunit_getUnitFactor_0=H.L,pt=_._emscripten_bind_PeDatum_getSpheroid_0=H.M,nt=_._emscripten_bind_PeDatum_getCode_0=H.N,it=_._emscripten_bind_PeDatum_getName_1=H.O,ct=_._emscripten_bind_PeDatum_getType_0=H.P,at=_._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=H.Q,yt=_._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=H.R,st=_._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=H.S,Pt=_._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=H.T,gt=_._emscripten_bind_PeDefs_get_PE_DD_MAX_0=H.U,ut=_._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=H.V,ft=_._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=H.W,bt=_._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=H.X,Et=_._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=H.Y,dt=_._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=H.Z,Tt=_._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=H._,Ot=_._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=H.$,mt=_._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=H.aa,ht=_._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=H.ba,St=_._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=H.ca,Nt=_._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=H.da,lt=_._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=H.ea,vt=_._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=H.fa,Mt=_._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=H.ga,jt=_._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=H.ha,Dt=_._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=H.ia,At=_._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=H.ja,Rt=_._emscripten_bind_PeDefs_get_PE_PARM_X0_0=H.ka,Ct=_._emscripten_bind_PeDefs_get_PE_PARM_ND_0=H.la,Gt=_._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=H.ma,It=_._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=H.na,Lt=_._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=H.oa,Ut=_._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=H.pa,wt=_._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=H.qa,Ft=_._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=H.ra,Yt=_._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=H.sa,Xt=_._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=H.ta,xt=_._emscripten_bind_PeDouble_PeDouble_1=H.ua,Ht=_._emscripten_bind_PeDouble_get_val_0=H.va,zt=_._emscripten_bind_PeDouble_set_val_1=H.wa,Zt=_._emscripten_bind_PeDouble___destroy___0=H.xa,Wt=_._emscripten_bind_PeFactory_initialize_1=H.ya,Bt=_._emscripten_bind_PeFactory_factoryByType_2=H.za,qt=_._emscripten_bind_PeFactory_fromString_2=H.Aa,Kt=_._emscripten_bind_PeFactory_getCode_1=H.Ba,kt=_._emscripten_bind_PeGCSExtent_PeGCSExtent_6=H.Ca,Vt=_._emscripten_bind_PeGCSExtent_getLLon_0=H.Da,$t=_._emscripten_bind_PeGCSExtent_getSLat_0=H.Ea,Jt=_._emscripten_bind_PeGCSExtent_getRLon_0=H.Fa,Qt=_._emscripten_bind_PeGCSExtent_getNLat_0=H.Ga,te=_._emscripten_bind_PeGCSExtent___destroy___0=H.Ha,ee=_._emscripten_bind_PeGeogcs_Delete_0=H.Ia,oe=_._emscripten_bind_PeGeogcs_cloneAlterUnits_1=H.Ja,re=_._emscripten_bind_PeGeogcs_getDatum_0=H.Ka,_e=_._emscripten_bind_PeGeogcs_getPrimem_0=H.La,pe=_._emscripten_bind_PeGeogcs_getUnit_0=H.Ma,ne=_._emscripten_bind_PeGeogcs_isEqual_1=H.Na,ie=_._emscripten_bind_PeGeogcs_getCode_0=H.Oa,ce=_._emscripten_bind_PeGeogcs_getName_1=H.Pa,ae=_._emscripten_bind_PeGeogcs_getType_0=H.Qa,ye=_._emscripten_bind_PeGeogtran_isEqual_1=H.Ra,se=_._emscripten_bind_PeGeogtran_getGeogcs1_0=H.Sa,Pe=_._emscripten_bind_PeGeogtran_getGeogcs2_0=H.Ta,ge=_._emscripten_bind_PeGeogtran_getParameters_0=H.Ua,ue=_._emscripten_bind_PeGeogtran_loadConstants_0=H.Va,fe=_._emscripten_bind_PeGeogtran_getCode_0=H.Wa,be=_._emscripten_bind_PeGeogtran_getName_1=H.Xa,Ee=_._emscripten_bind_PeGeogtran_getType_0=H.Ya,de=_._emscripten_bind_PeGTlistExtended_getGTlist_6=H.Za,Te=_._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=H._a,Oe=_._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=H.$a,me=_._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=H.ab,he=_._emscripten_bind_PeGTlistExtendedEntry_Delete_1=H.bb,Se=_._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=H.cb,Ne=_._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=H.db,le=_._emscripten_bind_PeHorizon_getNump_0=H.eb,ve=_._emscripten_bind_PeHorizon_getKind_0=H.fb,Me=_._emscripten_bind_PeHorizon_getInclusive_0=H.gb,je=_._emscripten_bind_PeHorizon_getSize_0=H.hb,De=_._emscripten_bind_PeHorizon_getCoord_0=H.ib,Ae=_._emscripten_bind_PeInteger_PeInteger_1=H.jb,Re=_._emscripten_bind_PeInteger_get_val_0=H.kb,Ce=_._emscripten_bind_PeInteger_set_val_1=H.lb,Ge=_._emscripten_bind_PeInteger___destroy___0=H.mb,Ie=_._emscripten_bind_PeLineType_geodetic_distance_10=H.nb,Le=_._emscripten_bind_PeLineType_geodetic_coordinate_9=H.ob,Ue=_._emscripten_bind_PeLineType_geodesic_coordinate_8=H.pb,we=_._emscripten_bind_PeLineType_great_elliptic_distance_9=H.qb,Fe=_._emscripten_bind_PeMath_phi_to_eta_2=H.rb,Ye=_._emscripten_bind_PeMath_eta_to_phi_2=H.sb,Xe=_._emscripten_bind_PeMath_phi_to_phig_2=H.tb,xe=_._emscripten_bind_PeMath_q_3=H.ub,He=_._emscripten_bind_PeMath_q90_2=H.vb,ze=_._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=H.wb,Ze=_._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=H.xb,We=_._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=H.yb,Be=_._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=H.zb,qe=_._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=H.Ab,Ke=_._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=H.Bb,ke=_._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=H.Cb,Ve=_._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=H.Db,$e=_._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=H.Eb,Je=_._emscripten_bind_PeParameter_getValue_0=H.Fb,Qe=_._emscripten_bind_PeParameter_getCode_0=H.Gb,to=_._emscripten_bind_PeParameter_getName_1=H.Hb,eo=_._emscripten_bind_PeParameter_getType_0=H.Ib,oo=_._emscripten_bind_PePCSInfo_getCentralMeridian_0=H.Jb,ro=_._emscripten_bind_PePCSInfo_getDomainMinx_0=H.Kb,_o=_._emscripten_bind_PePCSInfo_getDomainMiny_0=H.Lb,po=_._emscripten_bind_PePCSInfo_getDomainMaxx_0=H.Mb,no=_._emscripten_bind_PePCSInfo_getDomainMaxy_0=H.Nb,io=_._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=H.Ob,co=_._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=H.Pb,ao=_._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=H.Qb,yo=_._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=H.Rb,so=_._emscripten_bind_PePCSInfo_isDensificationNeeded_0=H.Sb,Po=_._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=H.Tb,go=_._emscripten_bind_PePCSInfo_isPannableRectangle_0=H.Ub,uo=_._emscripten_bind_PePCSInfo_generate_2=H.Vb,fo=_._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=H.Wb,bo=_._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=H.Xb,Eo=_._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=H.Yb,To=_._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=H.Zb,Oo=_._emscripten_bind_PePrimem_getLongitude_0=H._b,mo=_._emscripten_bind_PePrimem_getCode_0=H.$b,ho=_._emscripten_bind_PePrimem_getName_1=H.ac,So=_._emscripten_bind_PePrimem_getType_0=H.bc,No=_._emscripten_bind_PeProjcs_Delete_0=H.cc,lo=_._emscripten_bind_PeProjcs_getGeogcs_0=H.dc,vo=_._emscripten_bind_PeProjcs_getProjection_0=H.ec,Mo=_._emscripten_bind_PeProjcs_getParameters_0=H.fc,jo=_._emscripten_bind_PeProjcs_getUnit_0=H.gc,Do=_._emscripten_bind_PeProjcs_loadConstants_0=H.hc,Ao=_._emscripten_bind_PeProjcs_horizonGcsGenerate_0=H.ic,Ro=_._emscripten_bind_PeProjcs_horizonPcsGenerate_0=H.jc,Co=_._emscripten_bind_PeProjcs_isEqual_1=H.kc,Go=_._emscripten_bind_PeProjcs_getCode_0=H.lc,Io=_._emscripten_bind_PeProjcs_getName_1=H.mc,Lo=_._emscripten_bind_PeProjcs_getType_0=H.nc,Uo=_._emscripten_bind_PeSpheroid_getAxis_0=H.oc,wo=_._emscripten_bind_PeSpheroid_getFlattening_0=H.pc,Fo=_._emscripten_bind_PeSpheroid_getCode_0=H.qc,Yo=_._emscripten_bind_PeSpheroid_getName_1=H.rc,Xo=_._emscripten_bind_PeSpheroid_getType_0=H.sc,xo=_._emscripten_bind_PeVersion_version_string_0=H.tc;function Ho(){}function zo(t){return(t||Ho).__cache__}function Zo(t,e){var o=zo(e),r=o[t];return r||((r=Object.create((e||Ho).prototype)).ptr=t,o[t]=r)}_._pe_getPeGTlistExtendedEntrySize=H.uc,_._pe_getPeGTlistExtendedGTsSize=H.vc,_._pe_getPeHorizonSize=H.wc,_._pe_geog_to_geog=H.xc,_._pe_geog_to_proj=H.yc,_._pe_geog_to_dd=H.zc,_._pe_dd_to_geog=H.Ac,_._pe_geog_to_ddm=H.Bc,_._pe_ddm_to_geog=H.Cc,_._pe_geog_to_dms=H.Dc,_._pe_dms_to_geog=H.Ec,_._pe_geog_to_mgrs_extended=H.Fc,_._pe_mgrs_to_geog_extended=H.Gc,_._pe_geog_to_usng=H.Hc,_._pe_usng_to_geog=H.Ic,_._pe_geog_to_utm=H.Jc,_._pe_utm_to_geog=H.Kc,_._pe_object_to_string_ext=H.Lc,_._pe_proj_to_geog_center=H.Mc,function t(){h>0||h>0?S=t:(_.calledRun=!0,d||((t=>{for(;t.length>0;)t.shift()(_)})(X),H.t(),e(_)))}(),Ho.prototype=Object.create(Ho.prototype),Ho.prototype.constructor=Ho,Ho.prototype.__class__=Ho,Ho.__cache__={},_.WrapperObject=Ho,_.getCache=zo,_.wrapPointer=Zo,_.castObject=function(t,e){return Zo(t.ptr,e)},_.NULL=Zo(0),_.destroy=function(t){if(!t.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";t.__destroy__(),delete zo(t.__class__)[t.ptr]},_.compare=function(t,e){return t.ptr===e.ptr},_.getPointer=function(t){return t.ptr},_.getClass=function(t){return t.__class__};var Wo={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(Wo.needed){for(var t=0;t<Wo.temps.length;t++)_._webidl_free(Wo.temps[t]);Wo.temps.length=0,_._webidl_free(Wo.buffer),Wo.buffer=0,Wo.size+=Wo.needed,Wo.needed=0}Wo.buffer||(Wo.size+=128,Wo.buffer=_._webidl_malloc(Wo.size),T(Wo.buffer)),Wo.pos=0},alloc(t,e){T(Wo.buffer);var o,r=e.BYTES_PER_ELEMENT,p=t.length*r;return p=G(p,8),Wo.pos+p>=Wo.size?(T(p>0),Wo.needed+=p,o=_._webidl_malloc(p),Wo.temps.push(o)):(o=Wo.buffer+Wo.pos,Wo.pos+=p),o},copy(t,e,o){o/=e.BYTES_PER_ELEMENT;for(var r=0;r<t.length;r++)e[o+r]=t[r]}};function Bo(t){if("string"==typeof t){var e=(t=>{var e=w(t)+1,o=new Array(e);return R(t,o,0,o.length),o})(t),o=Wo.alloc(e,c);return Wo.copy(e,c,o),o}return t}function qo(t){if("object"==typeof t){var e=Wo.alloc(t,c);return Wo.copy(t,c,e),e}return t}function Ko(){throw"cannot construct a PeObject, no constructor in IDL"}function ko(){throw"cannot construct a PeCoordsys, no constructor in IDL"}function Vo(){throw"cannot construct a PeUnit, no constructor in IDL"}function $o(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Jo(){throw"cannot construct a PeAngunit, no constructor in IDL"}function Qo(){throw"cannot construct a PeDatum, no constructor in IDL"}function tr(){throw"cannot construct a PeDefs, no constructor in IDL"}function er(t){t&&"object"==typeof t&&(t=t.ptr),this.ptr=xt(t),zo(er)[this.ptr]=this}function or(){throw"cannot construct a PeFactory, no constructor in IDL"}function rr(t,e,o,r,_,p){t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),r&&"object"==typeof r&&(r=r.ptr),_&&"object"==typeof _&&(_=_.ptr),p&&"object"==typeof p&&(p=p.ptr),this.ptr=kt(t,e,o,r,_,p),zo(rr)[this.ptr]=this}function _r(){throw"cannot construct a PeGeogcs, no constructor in IDL"}function pr(){throw"cannot construct a PeGeogtran, no constructor in IDL"}function nr(){throw"cannot construct a PeGTlistExtended, no constructor in IDL"}function ir(){throw"cannot construct a PeGTlistExtendedEntry, no constructor in IDL"}function cr(){throw"cannot construct a PeGTlistExtendedGTs, no constructor in IDL"}function ar(){throw"cannot construct a PeHorizon, no constructor in IDL"}function yr(t){t&&"object"==typeof t&&(t=t.ptr),this.ptr=Ae(t),zo(yr)[this.ptr]=this}function sr(){throw"cannot construct a PeLineType, no constructor in IDL"}function Pr(){throw"cannot construct a PeMath, no constructor in IDL"}function gr(){throw"cannot construct a PeNotationMgrs, no constructor in IDL"}function ur(){throw"cannot construct a PeNotationUtm, no constructor in IDL"}function fr(){throw"cannot construct a PeParameter, no constructor in IDL"}function br(){throw"cannot construct a PePCSInfo, no constructor in IDL"}function Er(){throw"cannot construct a PePrimem, no constructor in IDL"}function dr(){throw"cannot construct a PeProjcs, no constructor in IDL"}function Tr(){throw"cannot construct a PeSpheroid, no constructor in IDL"}function Or(){throw"cannot construct a PeVersion, no constructor in IDL"}return Ko.prototype=Object.create(Ho.prototype),Ko.prototype.constructor=Ko,Ko.prototype.__class__=Ko,Ko.__cache__={},_.PeObject=Ko,Ko.prototype.getCode=Ko.prototype.getCode=function(){var t=this.ptr;return z(t)},Ko.prototype.getName=Ko.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(Z(e,t))},Ko.prototype.getType=Ko.prototype.getType=function(){var t=this.ptr;return W(t)},ko.prototype=Object.create(Ko.prototype),ko.prototype.constructor=ko,ko.prototype.__class__=ko,ko.__cache__={},_.PeCoordsys=ko,ko.prototype.isEqual=ko.prototype.isEqual=function(t){var e=this.ptr;return t&&"object"==typeof t&&(t=t.ptr),!!B(e,t)},ko.prototype.getCode=ko.prototype.getCode=function(){var t=this.ptr;return q(t)},ko.prototype.getName=ko.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(K(e,t))},ko.prototype.getType=ko.prototype.getType=function(){var t=this.ptr;return k(t)},Vo.prototype=Object.create(Ko.prototype),Vo.prototype.constructor=Vo,Vo.prototype.__class__=Vo,Vo.__cache__={},_.PeUnit=Vo,Vo.prototype.getUnitFactor=Vo.prototype.getUnitFactor=function(){var t=this.ptr;return V(t)},Vo.prototype.getCode=Vo.prototype.getCode=function(){var t=this.ptr;return $(t)},Vo.prototype.getName=Vo.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(J(e,t))},Vo.prototype.getType=Vo.prototype.getType=function(){var t=this.ptr;return Q(t)},$o.prototype=Object.create(Ho.prototype),$o.prototype.constructor=$o,$o.prototype.__class__=$o,$o.__cache__={},_.VoidPtr=$o,$o.prototype.__destroy__=$o.prototype.__destroy__=function(){var t=this.ptr;tt(t)},Jo.prototype=Object.create(Vo.prototype),Jo.prototype.constructor=Jo,Jo.prototype.__class__=Jo,Jo.__cache__={},_.PeAngunit=Jo,Jo.prototype.getCode=Jo.prototype.getCode=function(){var t=this.ptr;return et(t)},Jo.prototype.getName=Jo.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(ot(e,t))},Jo.prototype.getType=Jo.prototype.getType=function(){var t=this.ptr;return rt(t)},Jo.prototype.getUnitFactor=Jo.prototype.getUnitFactor=function(){var t=this.ptr;return _t(t)},Qo.prototype=Object.create(Ko.prototype),Qo.prototype.constructor=Qo,Qo.prototype.__class__=Qo,Qo.__cache__={},_.PeDatum=Qo,Qo.prototype.getSpheroid=Qo.prototype.getSpheroid=function(){var t=this.ptr;return Zo(pt(t),Tr)},Qo.prototype.getCode=Qo.prototype.getCode=function(){var t=this.ptr;return nt(t)},Qo.prototype.getName=Qo.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(it(e,t))},Qo.prototype.getType=Qo.prototype.getType=function(){var t=this.ptr;return ct(t)},tr.prototype=Object.create(Ho.prototype),tr.prototype.constructor=tr,tr.prototype.__class__=tr,tr.__cache__={},_.PeDefs=tr,tr.prototype.get_PE_BUFFER_MAX=tr.prototype.get_PE_BUFFER_MAX=function(){var t=this.ptr;return at(t)},Object.defineProperty(tr.prototype,"PE_BUFFER_MAX",{get:tr.prototype.get_PE_BUFFER_MAX}),tr.prototype.get_PE_NAME_MAX=tr.prototype.get_PE_NAME_MAX=function(){var t=this.ptr;return yt(t)},Object.defineProperty(tr.prototype,"PE_NAME_MAX",{get:tr.prototype.get_PE_NAME_MAX}),tr.prototype.get_PE_MGRS_MAX=tr.prototype.get_PE_MGRS_MAX=function(){var t=this.ptr;return st(t)},Object.defineProperty(tr.prototype,"PE_MGRS_MAX",{get:tr.prototype.get_PE_MGRS_MAX}),tr.prototype.get_PE_USNG_MAX=tr.prototype.get_PE_USNG_MAX=function(){var t=this.ptr;return Pt(t)},Object.defineProperty(tr.prototype,"PE_USNG_MAX",{get:tr.prototype.get_PE_USNG_MAX}),tr.prototype.get_PE_DD_MAX=tr.prototype.get_PE_DD_MAX=function(){var t=this.ptr;return gt(t)},Object.defineProperty(tr.prototype,"PE_DD_MAX",{get:tr.prototype.get_PE_DD_MAX}),tr.prototype.get_PE_DMS_MAX=tr.prototype.get_PE_DMS_MAX=function(){var t=this.ptr;return ut(t)},Object.defineProperty(tr.prototype,"PE_DMS_MAX",{get:tr.prototype.get_PE_DMS_MAX}),tr.prototype.get_PE_DDM_MAX=tr.prototype.get_PE_DDM_MAX=function(){var t=this.ptr;return ft(t)},Object.defineProperty(tr.prototype,"PE_DDM_MAX",{get:tr.prototype.get_PE_DDM_MAX}),tr.prototype.get_PE_UTM_MAX=tr.prototype.get_PE_UTM_MAX=function(){var t=this.ptr;return bt(t)},Object.defineProperty(tr.prototype,"PE_UTM_MAX",{get:tr.prototype.get_PE_UTM_MAX}),tr.prototype.get_PE_PARM_MAX=tr.prototype.get_PE_PARM_MAX=function(){var t=this.ptr;return Et(t)},Object.defineProperty(tr.prototype,"PE_PARM_MAX",{get:tr.prototype.get_PE_PARM_MAX}),tr.prototype.get_PE_TYPE_NONE=tr.prototype.get_PE_TYPE_NONE=function(){var t=this.ptr;return dt(t)},Object.defineProperty(tr.prototype,"PE_TYPE_NONE",{get:tr.prototype.get_PE_TYPE_NONE}),tr.prototype.get_PE_TYPE_GEOGCS=tr.prototype.get_PE_TYPE_GEOGCS=function(){var t=this.ptr;return Tt(t)},Object.defineProperty(tr.prototype,"PE_TYPE_GEOGCS",{get:tr.prototype.get_PE_TYPE_GEOGCS}),tr.prototype.get_PE_TYPE_PROJCS=tr.prototype.get_PE_TYPE_PROJCS=function(){var t=this.ptr;return Ot(t)},Object.defineProperty(tr.prototype,"PE_TYPE_PROJCS",{get:tr.prototype.get_PE_TYPE_PROJCS}),tr.prototype.get_PE_TYPE_GEOGTRAN=tr.prototype.get_PE_TYPE_GEOGTRAN=function(){var t=this.ptr;return mt(t)},Object.defineProperty(tr.prototype,"PE_TYPE_GEOGTRAN",{get:tr.prototype.get_PE_TYPE_GEOGTRAN}),tr.prototype.get_PE_TYPE_COORDSYS=tr.prototype.get_PE_TYPE_COORDSYS=function(){var t=this.ptr;return ht(t)},Object.defineProperty(tr.prototype,"PE_TYPE_COORDSYS",{get:tr.prototype.get_PE_TYPE_COORDSYS}),tr.prototype.get_PE_TYPE_UNIT=tr.prototype.get_PE_TYPE_UNIT=function(){var t=this.ptr;return St(t)},Object.defineProperty(tr.prototype,"PE_TYPE_UNIT",{get:tr.prototype.get_PE_TYPE_UNIT}),tr.prototype.get_PE_TYPE_LINUNIT=tr.prototype.get_PE_TYPE_LINUNIT=function(){var t=this.ptr;return Nt(t)},Object.defineProperty(tr.prototype,"PE_TYPE_LINUNIT",{get:tr.prototype.get_PE_TYPE_LINUNIT}),tr.prototype.get_PE_STR_OPTS_NONE=tr.prototype.get_PE_STR_OPTS_NONE=function(){var t=this.ptr;return lt(t)},Object.defineProperty(tr.prototype,"PE_STR_OPTS_NONE",{get:tr.prototype.get_PE_STR_OPTS_NONE}),tr.prototype.get_PE_STR_AUTH_NONE=tr.prototype.get_PE_STR_AUTH_NONE=function(){var t=this.ptr;return vt(t)},Object.defineProperty(tr.prototype,"PE_STR_AUTH_NONE",{get:tr.prototype.get_PE_STR_AUTH_NONE}),tr.prototype.get_PE_STR_AUTH_TOP=tr.prototype.get_PE_STR_AUTH_TOP=function(){var t=this.ptr;return Mt(t)},Object.defineProperty(tr.prototype,"PE_STR_AUTH_TOP",{get:tr.prototype.get_PE_STR_AUTH_TOP}),tr.prototype.get_PE_STR_NAME_CANON=tr.prototype.get_PE_STR_NAME_CANON=function(){var t=this.ptr;return jt(t)},Object.defineProperty(tr.prototype,"PE_STR_NAME_CANON",{get:tr.prototype.get_PE_STR_NAME_CANON}),tr.prototype.get_PE_STR_FMT_WKT=tr.prototype.get_PE_STR_FMT_WKT=function(){var t=this.ptr;return Dt(t)},Object.defineProperty(tr.prototype,"PE_STR_FMT_WKT",{get:tr.prototype.get_PE_STR_FMT_WKT}),tr.prototype.get_PE_STR_FMT_WKT2=tr.prototype.get_PE_STR_FMT_WKT2=function(){var t=this.ptr;return At(t)},Object.defineProperty(tr.prototype,"PE_STR_FMT_WKT2",{get:tr.prototype.get_PE_STR_FMT_WKT2}),tr.prototype.get_PE_PARM_X0=tr.prototype.get_PE_PARM_X0=function(){var t=this.ptr;return Rt(t)},Object.defineProperty(tr.prototype,"PE_PARM_X0",{get:tr.prototype.get_PE_PARM_X0}),tr.prototype.get_PE_PARM_ND=tr.prototype.get_PE_PARM_ND=function(){var t=this.ptr;return Ct(t)},Object.defineProperty(tr.prototype,"PE_PARM_ND",{get:tr.prototype.get_PE_PARM_ND}),tr.prototype.get_PE_TRANSFORM_1_TO_2=tr.prototype.get_PE_TRANSFORM_1_TO_2=function(){var t=this.ptr;return Gt(t)},Object.defineProperty(tr.prototype,"PE_TRANSFORM_1_TO_2",{get:tr.prototype.get_PE_TRANSFORM_1_TO_2}),tr.prototype.get_PE_TRANSFORM_2_TO_1=tr.prototype.get_PE_TRANSFORM_2_TO_1=function(){var t=this.ptr;return It(t)},Object.defineProperty(tr.prototype,"PE_TRANSFORM_2_TO_1",{get:tr.prototype.get_PE_TRANSFORM_2_TO_1}),tr.prototype.get_PE_TRANSFORM_P_TO_G=tr.prototype.get_PE_TRANSFORM_P_TO_G=function(){var t=this.ptr;return Lt(t)},Object.defineProperty(tr.prototype,"PE_TRANSFORM_P_TO_G",{get:tr.prototype.get_PE_TRANSFORM_P_TO_G}),tr.prototype.get_PE_TRANSFORM_G_TO_P=tr.prototype.get_PE_TRANSFORM_G_TO_P=function(){var t=this.ptr;return Ut(t)},Object.defineProperty(tr.prototype,"PE_TRANSFORM_G_TO_P",{get:tr.prototype.get_PE_TRANSFORM_G_TO_P}),tr.prototype.get_PE_HORIZON_RECT=tr.prototype.get_PE_HORIZON_RECT=function(){var t=this.ptr;return wt(t)},Object.defineProperty(tr.prototype,"PE_HORIZON_RECT",{get:tr.prototype.get_PE_HORIZON_RECT}),tr.prototype.get_PE_HORIZON_POLY=tr.prototype.get_PE_HORIZON_POLY=function(){var t=this.ptr;return Ft(t)},Object.defineProperty(tr.prototype,"PE_HORIZON_POLY",{get:tr.prototype.get_PE_HORIZON_POLY}),tr.prototype.get_PE_HORIZON_LINE=tr.prototype.get_PE_HORIZON_LINE=function(){var t=this.ptr;return Yt(t)},Object.defineProperty(tr.prototype,"PE_HORIZON_LINE",{get:tr.prototype.get_PE_HORIZON_LINE}),tr.prototype.get_PE_HORIZON_DELTA=tr.prototype.get_PE_HORIZON_DELTA=function(){var t=this.ptr;return Xt(t)},Object.defineProperty(tr.prototype,"PE_HORIZON_DELTA",{get:tr.prototype.get_PE_HORIZON_DELTA}),er.prototype=Object.create(Ho.prototype),er.prototype.constructor=er,er.prototype.__class__=er,er.__cache__={},_.PeDouble=er,er.prototype.get_val=er.prototype.get_val=function(){var t=this.ptr;return Ht(t)},er.prototype.set_val=er.prototype.set_val=function(t){var e=this.ptr;t&&"object"==typeof t&&(t=t.ptr),zt(e,t)},Object.defineProperty(er.prototype,"val",{get:er.prototype.get_val,set:er.prototype.set_val}),er.prototype.__destroy__=er.prototype.__destroy__=function(){var t=this.ptr;Zt(t)},or.prototype=Object.create(Ho.prototype),or.prototype.constructor=or,or.prototype.__class__=or,or.__cache__={},_.PeFactory=or,or.prototype.initialize=or.prototype.initialize=function(t){Wo.prepare(),t=t&&"object"==typeof t?t.ptr:Bo(t),Wt(t)},or.prototype.factoryByType=or.prototype.factoryByType=function(t,e){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),Zo(Bt(t,e),Ko)},or.prototype.fromString=or.prototype.fromString=function(t,e){return Wo.prepare(),t&&"object"==typeof t&&(t=t.ptr),e=e&&"object"==typeof e?e.ptr:Bo(e),Zo(qt(t,e),Ko)},or.prototype.getCode=or.prototype.getCode=function(t){return t&&"object"==typeof t&&(t=t.ptr),Kt(t)},rr.prototype=Object.create(Ho.prototype),rr.prototype.constructor=rr,rr.prototype.__class__=rr,rr.__cache__={},_.PeGCSExtent=rr,rr.prototype.getLLon=rr.prototype.getLLon=function(){var t=this.ptr;return Vt(t)},rr.prototype.getSLat=rr.prototype.getSLat=function(){var t=this.ptr;return $t(t)},rr.prototype.getRLon=rr.prototype.getRLon=function(){var t=this.ptr;return Jt(t)},rr.prototype.getNLat=rr.prototype.getNLat=function(){var t=this.ptr;return Qt(t)},rr.prototype.__destroy__=rr.prototype.__destroy__=function(){var t=this.ptr;te(t)},_r.prototype=Object.create(ko.prototype),_r.prototype.constructor=_r,_r.prototype.__class__=_r,_r.__cache__={},_.PeGeogcs=_r,_r.prototype.Delete=_r.prototype.Delete=function(){var t=this.ptr;ee(t)},_r.prototype.cloneAlterUnits=_r.prototype.cloneAlterUnits=function(t){var e=this.ptr;return t&&"object"==typeof t&&(t=t.ptr),Zo(oe(e,t),_r)},_r.prototype.getDatum=_r.prototype.getDatum=function(){var t=this.ptr;return Zo(re(t),Qo)},_r.prototype.getPrimem=_r.prototype.getPrimem=function(){var t=this.ptr;return Zo(_e(t),Er)},_r.prototype.getUnit=_r.prototype.getUnit=function(){var t=this.ptr;return Zo(pe(t),Jo)},_r.prototype.isEqual=_r.prototype.isEqual=function(t){var e=this.ptr;return t&&"object"==typeof t&&(t=t.ptr),!!ne(e,t)},_r.prototype.getCode=_r.prototype.getCode=function(){var t=this.ptr;return ie(t)},_r.prototype.getName=_r.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(ce(e,t))},_r.prototype.getType=_r.prototype.getType=function(){var t=this.ptr;return ae(t)},pr.prototype=Object.create(Ko.prototype),pr.prototype.constructor=pr,pr.prototype.__class__=pr,pr.__cache__={},_.PeGeogtran=pr,pr.prototype.isEqual=pr.prototype.isEqual=function(t){var e=this.ptr;return t&&"object"==typeof t&&(t=t.ptr),!!ye(e,t)},pr.prototype.getGeogcs1=pr.prototype.getGeogcs1=function(){var t=this.ptr;return Zo(se(t),_r)},pr.prototype.getGeogcs2=pr.prototype.getGeogcs2=function(){var t=this.ptr;return Zo(Pe(t),_r)},pr.prototype.getParameters=pr.prototype.getParameters=function(){var t=this.ptr;return ge(t)},pr.prototype.loadConstants=pr.prototype.loadConstants=function(){var t=this.ptr;return!!ue(t)},pr.prototype.getCode=pr.prototype.getCode=function(){var t=this.ptr;return fe(t)},pr.prototype.getName=pr.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(be(e,t))},pr.prototype.getType=pr.prototype.getType=function(){var t=this.ptr;return Ee(t)},nr.prototype=Object.create(Ho.prototype),nr.prototype.constructor=nr,nr.prototype.__class__=nr,nr.__cache__={},_.PeGTlistExtended=nr,nr.prototype.getGTlist=nr.prototype.getGTlist=function(t,e,o,r,_,p){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),r&&"object"==typeof r&&(r=r.ptr),_&&"object"==typeof _&&(_=_.ptr),p&&"object"==typeof p&&(p=p.ptr),Zo(de(t,e,o,r,_,p),ir)},nr.prototype.get_PE_GTLIST_OPTS_COMMON=nr.prototype.get_PE_GTLIST_OPTS_COMMON=function(){var t=this.ptr;return Te(t)},Object.defineProperty(nr.prototype,"PE_GTLIST_OPTS_COMMON",{get:nr.prototype.get_PE_GTLIST_OPTS_COMMON}),ir.prototype=Object.create(Ho.prototype),ir.prototype.constructor=ir,ir.prototype.__class__=ir,ir.__cache__={},_.PeGTlistExtendedEntry=ir,ir.prototype.getEntries=ir.prototype.getEntries=function(){var t=this.ptr;return Zo(Oe(t),cr)},ir.prototype.getSteps=ir.prototype.getSteps=function(){var t=this.ptr;return me(t)},ir.prototype.Delete=ir.prototype.Delete=function(t){t&&"object"==typeof t&&(t=t.ptr),he(t)},cr.prototype=Object.create(Ho.prototype),cr.prototype.constructor=cr,cr.prototype.__class__=cr,cr.__cache__={},_.PeGTlistExtendedGTs=cr,cr.prototype.getDirection=cr.prototype.getDirection=function(){var t=this.ptr;return Se(t)},cr.prototype.getGeogtran=cr.prototype.getGeogtran=function(){var t=this.ptr;return Zo(Ne(t),pr)},ar.prototype=Object.create(Ho.prototype),ar.prototype.constructor=ar,ar.prototype.__class__=ar,ar.__cache__={},_.PeHorizon=ar,ar.prototype.getNump=ar.prototype.getNump=function(){var t=this.ptr;return le(t)},ar.prototype.getKind=ar.prototype.getKind=function(){var t=this.ptr;return ve(t)},ar.prototype.getInclusive=ar.prototype.getInclusive=function(){var t=this.ptr;return Me(t)},ar.prototype.getSize=ar.prototype.getSize=function(){var t=this.ptr;return je(t)},ar.prototype.getCoord=ar.prototype.getCoord=function(){var t=this.ptr;return De(t)},yr.prototype=Object.create(Ho.prototype),yr.prototype.constructor=yr,yr.prototype.__class__=yr,yr.__cache__={},_.PeInteger=yr,yr.prototype.get_val=yr.prototype.get_val=function(){var t=this.ptr;return Re(t)},yr.prototype.set_val=yr.prototype.set_val=function(t){var e=this.ptr;t&&"object"==typeof t&&(t=t.ptr),Ce(e,t)},Object.defineProperty(yr.prototype,"val",{get:yr.prototype.get_val,set:yr.prototype.set_val}),yr.prototype.__destroy__=yr.prototype.__destroy__=function(){var t=this.ptr;Ge(t)},sr.prototype=Object.create(Ho.prototype),sr.prototype.constructor=sr,sr.prototype.__class__=sr,sr.__cache__={},_.PeLineType=sr,sr.prototype.geodetic_distance=sr.prototype.geodetic_distance=function(t,e,o,r,_,p,n,i,c,a){t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),r&&"object"==typeof r&&(r=r.ptr),_&&"object"==typeof _&&(_=_.ptr),p&&"object"==typeof p&&(p=p.ptr),n&&"object"==typeof n&&(n=n.ptr),i&&"object"==typeof i&&(i=i.ptr),c&&"object"==typeof c&&(c=c.ptr),a&&"object"==typeof a&&(a=a.ptr),Ie(t,e,o,r,_,p,n,i,c,a)},sr.prototype.geodetic_coordinate=sr.prototype.geodetic_coordinate=function(t,e,o,r,_,p,n,i,c){t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),r&&"object"==typeof r&&(r=r.ptr),_&&"object"==typeof _&&(_=_.ptr),p&&"object"==typeof p&&(p=p.ptr),n&&"object"==typeof n&&(n=n.ptr),i&&"object"==typeof i&&(i=i.ptr),c&&"object"==typeof c&&(c=c.ptr),Le(t,e,o,r,_,p,n,i,c)},sr.prototype.geodesic_coordinate=sr.prototype.geodesic_coordinate=function(t,e,o,r,_,p,n,i){t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),r&&"object"==typeof r&&(r=r.ptr),_&&"object"==typeof _&&(_=_.ptr),p&&"object"==typeof p&&(p=p.ptr),n&&"object"==typeof n&&(n=n.ptr),i&&"object"==typeof i&&(i=i.ptr),Ue(t,e,o,r,_,p,n,i)},sr.prototype.great_elliptic_distance=sr.prototype.great_elliptic_distance=function(t,e,o,r,_,p,n,i,c){t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),r&&"object"==typeof r&&(r=r.ptr),_&&"object"==typeof _&&(_=_.ptr),p&&"object"==typeof p&&(p=p.ptr),n&&"object"==typeof n&&(n=n.ptr),i&&"object"==typeof i&&(i=i.ptr),c&&"object"==typeof c&&(c=c.ptr),we(t,e,o,r,_,p,n,i,c)},Pr.prototype=Object.create(Ho.prototype),Pr.prototype.constructor=Pr,Pr.prototype.__class__=Pr,Pr.__cache__={},_.PeMath=Pr,Pr.prototype.phi_to_eta=Pr.prototype.phi_to_eta=function(t,e){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),Fe(t,e)},Pr.prototype.eta_to_phi=Pr.prototype.eta_to_phi=function(t,e){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),Ye(t,e)},Pr.prototype.phi_to_phig=Pr.prototype.phi_to_phig=function(t,e){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),Xe(t,e)},Pr.prototype.q=Pr.prototype.q=function(t,e,o){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),o&&"object"==typeof o&&(o=o.ptr),xe(t,e,o)},Pr.prototype.q90=Pr.prototype.q90=function(t,e){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),He(t,e)},gr.prototype=Object.create(Ho.prototype),gr.prototype.constructor=gr,gr.prototype.__class__=gr,gr.__cache__={},_.PeNotationMgrs=gr,gr.prototype.get_PE_MGRS_STYLE_NEW=gr.prototype.get_PE_MGRS_STYLE_NEW=function(){var t=this.ptr;return ze(t)},Object.defineProperty(gr.prototype,"PE_MGRS_STYLE_NEW",{get:gr.prototype.get_PE_MGRS_STYLE_NEW}),gr.prototype.get_PE_MGRS_STYLE_OLD=gr.prototype.get_PE_MGRS_STYLE_OLD=function(){var t=this.ptr;return Ze(t)},Object.defineProperty(gr.prototype,"PE_MGRS_STYLE_OLD",{get:gr.prototype.get_PE_MGRS_STYLE_OLD}),gr.prototype.get_PE_MGRS_STYLE_AUTO=gr.prototype.get_PE_MGRS_STYLE_AUTO=function(){var t=this.ptr;return We(t)},Object.defineProperty(gr.prototype,"PE_MGRS_STYLE_AUTO",{get:gr.prototype.get_PE_MGRS_STYLE_AUTO}),gr.prototype.get_PE_MGRS_180_ZONE_1_PLUS=gr.prototype.get_PE_MGRS_180_ZONE_1_PLUS=function(){var t=this.ptr;return Be(t)},Object.defineProperty(gr.prototype,"PE_MGRS_180_ZONE_1_PLUS",{get:gr.prototype.get_PE_MGRS_180_ZONE_1_PLUS}),gr.prototype.get_PE_MGRS_ADD_SPACES=gr.prototype.get_PE_MGRS_ADD_SPACES=function(){var t=this.ptr;return qe(t)},Object.defineProperty(gr.prototype,"PE_MGRS_ADD_SPACES",{get:gr.prototype.get_PE_MGRS_ADD_SPACES}),ur.prototype=Object.create(Ho.prototype),ur.prototype.constructor=ur,ur.prototype.__class__=ur,ur.__cache__={},_.PeNotationUtm=ur,ur.prototype.get_PE_UTM_OPTS_NONE=ur.prototype.get_PE_UTM_OPTS_NONE=function(){var t=this.ptr;return Ke(t)},Object.defineProperty(ur.prototype,"PE_UTM_OPTS_NONE",{get:ur.prototype.get_PE_UTM_OPTS_NONE}),ur.prototype.get_PE_UTM_OPTS_NS=ur.prototype.get_PE_UTM_OPTS_NS=function(){var t=this.ptr;return ke(t)},Object.defineProperty(ur.prototype,"PE_UTM_OPTS_NS",{get:ur.prototype.get_PE_UTM_OPTS_NS}),ur.prototype.get_PE_UTM_OPTS_NS_STRICT=ur.prototype.get_PE_UTM_OPTS_NS_STRICT=function(){var t=this.ptr;return Ve(t)},Object.defineProperty(ur.prototype,"PE_UTM_OPTS_NS_STRICT",{get:ur.prototype.get_PE_UTM_OPTS_NS_STRICT}),ur.prototype.get_PE_UTM_OPTS_ADD_SPACES=ur.prototype.get_PE_UTM_OPTS_ADD_SPACES=function(){var t=this.ptr;return $e(t)},Object.defineProperty(ur.prototype,"PE_UTM_OPTS_ADD_SPACES",{get:ur.prototype.get_PE_UTM_OPTS_ADD_SPACES}),fr.prototype=Object.create(Ko.prototype),fr.prototype.constructor=fr,fr.prototype.__class__=fr,fr.__cache__={},_.PeParameter=fr,fr.prototype.getValue=fr.prototype.getValue=function(){var t=this.ptr;return Je(t)},fr.prototype.getCode=fr.prototype.getCode=function(){var t=this.ptr;return Qe(t)},fr.prototype.getName=fr.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(to(e,t))},fr.prototype.getType=fr.prototype.getType=function(){var t=this.ptr;return eo(t)},br.prototype=Object.create(Ho.prototype),br.prototype.constructor=br,br.prototype.__class__=br,br.__cache__={},_.PePCSInfo=br,br.prototype.getCentralMeridian=br.prototype.getCentralMeridian=function(){var t=this.ptr;return oo(t)},br.prototype.getDomainMinx=br.prototype.getDomainMinx=function(){var t=this.ptr;return ro(t)},br.prototype.getDomainMiny=br.prototype.getDomainMiny=function(){var t=this.ptr;return _o(t)},br.prototype.getDomainMaxx=br.prototype.getDomainMaxx=function(){var t=this.ptr;return po(t)},br.prototype.getDomainMaxy=br.prototype.getDomainMaxy=function(){var t=this.ptr;return no(t)},br.prototype.getNorthPoleLocation=br.prototype.getNorthPoleLocation=function(){var t=this.ptr;return io(t)},br.prototype.getNorthPoleGeometry=br.prototype.getNorthPoleGeometry=function(){var t=this.ptr;return co(t)},br.prototype.getSouthPoleLocation=br.prototype.getSouthPoleLocation=function(){var t=this.ptr;return ao(t)},br.prototype.getSouthPoleGeometry=br.prototype.getSouthPoleGeometry=function(){var t=this.ptr;return yo(t)},br.prototype.isDensificationNeeded=br.prototype.isDensificationNeeded=function(){var t=this.ptr;return!!so(t)},br.prototype.isGcsHorizonMultiOverlap=br.prototype.isGcsHorizonMultiOverlap=function(){var t=this.ptr;return!!Po(t)},br.prototype.isPannableRectangle=br.prototype.isPannableRectangle=function(){var t=this.ptr;return!!go(t)},br.prototype.generate=br.prototype.generate=function(t,e){return t&&"object"==typeof t&&(t=t.ptr),e&&"object"==typeof e&&(e=e.ptr),Zo(uo(t,e),br)},br.prototype.get_PE_PCSINFO_OPTION_NONE=br.prototype.get_PE_PCSINFO_OPTION_NONE=function(){var t=this.ptr;return fo(t)},Object.defineProperty(br.prototype,"PE_PCSINFO_OPTION_NONE",{get:br.prototype.get_PE_PCSINFO_OPTION_NONE}),br.prototype.get_PE_PCSINFO_OPTION_DOMAIN=br.prototype.get_PE_PCSINFO_OPTION_DOMAIN=function(){var t=this.ptr;return bo(t)},Object.defineProperty(br.prototype,"PE_PCSINFO_OPTION_DOMAIN",{get:br.prototype.get_PE_PCSINFO_OPTION_DOMAIN}),br.prototype.get_PE_POLE_OUTSIDE_BOUNDARY=br.prototype.get_PE_POLE_OUTSIDE_BOUNDARY=function(){var t=this.ptr;return Eo(t)},Object.defineProperty(br.prototype,"PE_POLE_OUTSIDE_BOUNDARY",{get:br.prototype.get_PE_POLE_OUTSIDE_BOUNDARY}),br.prototype.get_PE_POLE_POINT=br.prototype.get_PE_POLE_POINT=function(){var t=this.ptr;return To(t)},Object.defineProperty(br.prototype,"PE_POLE_POINT",{get:br.prototype.get_PE_POLE_POINT}),Er.prototype=Object.create(Ko.prototype),Er.prototype.constructor=Er,Er.prototype.__class__=Er,Er.__cache__={},_.PePrimem=Er,Er.prototype.getLongitude=Er.prototype.getLongitude=function(){var t=this.ptr;return Oo(t)},Er.prototype.getCode=Er.prototype.getCode=function(){var t=this.ptr;return mo(t)},Er.prototype.getName=Er.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(ho(e,t))},Er.prototype.getType=Er.prototype.getType=function(){var t=this.ptr;return So(t)},dr.prototype=Object.create(ko.prototype),dr.prototype.constructor=dr,dr.prototype.__class__=dr,dr.__cache__={},_.PeProjcs=dr,dr.prototype.Delete=dr.prototype.Delete=function(){var t=this.ptr;No(t)},dr.prototype.getGeogcs=dr.prototype.getGeogcs=function(){var t=this.ptr;return Zo(lo(t),_r)},dr.prototype.getProjection=dr.prototype.getProjection=function(){var t=this.ptr;return Zo(vo(t),Ko)},dr.prototype.getParameters=dr.prototype.getParameters=function(){var t=this.ptr;return Mo(t)},dr.prototype.getUnit=dr.prototype.getUnit=function(){var t=this.ptr;return Zo(jo(t),Vo)},dr.prototype.loadConstants=dr.prototype.loadConstants=function(){var t=this.ptr;return!!Do(t)},dr.prototype.horizonGcsGenerate=dr.prototype.horizonGcsGenerate=function(){var t=this.ptr;return Zo(Ao(t),ar)},dr.prototype.horizonPcsGenerate=dr.prototype.horizonPcsGenerate=function(){var t=this.ptr;return Zo(Ro(t),ar)},dr.prototype.isEqual=dr.prototype.isEqual=function(t){var e=this.ptr;return t&&"object"==typeof t&&(t=t.ptr),!!Co(e,t)},dr.prototype.getCode=dr.prototype.getCode=function(){var t=this.ptr;return Go(t)},dr.prototype.getName=dr.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(Io(e,t))},dr.prototype.getType=dr.prototype.getType=function(){var t=this.ptr;return Lo(t)},Tr.prototype=Object.create(Ko.prototype),Tr.prototype.constructor=Tr,Tr.prototype.__class__=Tr,Tr.__cache__={},_.PeSpheroid=Tr,Tr.prototype.getAxis=Tr.prototype.getAxis=function(){var t=this.ptr;return Uo(t)},Tr.prototype.getFlattening=Tr.prototype.getFlattening=function(){var t=this.ptr;return wo(t)},Tr.prototype.getCode=Tr.prototype.getCode=function(){var t=this.ptr;return Fo(t)},Tr.prototype.getName=Tr.prototype.getName=function(t){var e=this.ptr;return Wo.prepare(),"object"==typeof t&&(t=qo(t)),j(Yo(e,t))},Tr.prototype.getType=Tr.prototype.getType=function(){var t=this.ptr;return Xo(t)},Or.prototype=Object.create(Ho.prototype),Or.prototype.constructor=Or,Or.prototype.__class__=Or,Or.__cache__={},_.PeVersion=Or,Or.prototype.version_string=Or.prototype.version_string=function(){var t=this.ptr;return j(xo(t))},_.ensureCache=Wo,_.ensureString=Bo,_.ensureInt8=qo,_.ensureInt16=function(t){if("object"==typeof t){var e=Wo.alloc(t,y);return Wo.copy(t,y,e),e}return t},_.ensureInt32=function(t){if("object"==typeof t){var e=Wo.alloc(t,s);return Wo.copy(t,s,e),e}return t},_.ensureFloat32=function(t){if("object"==typeof t){var e=Wo.alloc(t,g);return Wo.copy(t,g,e),e}return t},_.ensureFloat64=function(t){if("object"==typeof t){var e=Wo.alloc(t,f);return Wo.copy(t,f,e),e}return t},p}}}]);