@arcgis/core 4.25.0-next.20220818 → 4.25.0-next.20220821

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 (89) hide show
  1. package/analysis/LengthDimension.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0b1d39dc063c4c3385e2.js +1 -0
  4. package/assets/esri/core/workers/chunks/{59a04f1640cd2b710028.js → 0c625803648e554f1fcf.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{50985ec72b9e4557d371.js → 0f1fae79b5311d55c0da.js} +1 -1
  6. package/assets/esri/core/workers/chunks/1a360d839c4eb83aaa02.js +1 -0
  7. package/assets/esri/core/workers/chunks/3381b5454cd530cf940a.js +1 -0
  8. package/assets/esri/core/workers/chunks/3900c702242358c5d00e.js +1 -0
  9. package/assets/esri/core/workers/chunks/43f84cb852c9ab5e742f.js +1 -0
  10. package/assets/esri/core/workers/chunks/4637bfd3deff50b03f2e.js +1 -0
  11. package/assets/esri/core/workers/chunks/4d5bdf18feeb9c8cb6ff.js +1 -0
  12. package/assets/esri/core/workers/chunks/5c2574365af4a484cd4b.js +1 -0
  13. package/assets/esri/core/workers/chunks/70179a003b5e52a99e10.js +1 -0
  14. package/assets/esri/core/workers/chunks/77a38124ef155a1b0f3e.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ab0ce16ced3532f0e429.js → 81418b47acb4ef68daf7.js} +1 -1
  16. package/assets/esri/core/workers/chunks/88b5ce63c4706d0954dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/{064a4baa576964efa238.js → 9809878b87595ac77dc4.js} +1 -1
  18. package/assets/esri/core/workers/chunks/9dbe94a70624a5592690.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d013daa46de022f0db4d.js → a0750175b499a89fd07d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/be4a8a4b2804188817b3.js +1 -0
  21. package/assets/esri/core/workers/chunks/da13db62d54cbca350c3.js +1 -0
  22. package/assets/esri/core/workers/chunks/e472e4f4a2f046846258.js +1 -0
  23. package/assets/esri/core/workers/chunks/f351cccf879ba295acbc.js +1 -0
  24. package/chunks/boundedPlane.js +1 -1
  25. package/chunks/pe.js +1 -1
  26. package/core/Identifiable.js +1 -1
  27. package/geometry/Circle.js +1 -1
  28. package/geometry/Extent.js +1 -1
  29. package/geometry/Mesh.js +1 -1
  30. package/geometry/Multipoint.js +1 -1
  31. package/geometry/Point.js +1 -1
  32. package/geometry/geometryEngine.js +1 -1
  33. package/geometry/geometryEngineAsync.js +1 -1
  34. package/geometry/projection.js +1 -1
  35. package/geometry/support/aaBoundingBox.js +1 -1
  36. package/geometry/support/boundsUtils.js +1 -1
  37. package/geometry/support/centroid.js +1 -1
  38. package/geometry/support/cut.js +1 -1
  39. package/geometry/support/extentUtils.js +1 -1
  40. package/geometry/support/geodesicUtils.js +1 -1
  41. package/geometry/support/heightModelInfoUtils.js +1 -1
  42. package/geometry/support/meshUtils/primitives.js +1 -1
  43. package/geometry/support/quantizationUtils.js +1 -1
  44. package/interfaces.d.ts +60 -84
  45. package/layers/DimensionLayer.js +1 -1
  46. package/layers/support/ExportImageServiceParameters.js +1 -1
  47. package/layers/support/imageryRendererUtils.js +1 -1
  48. package/package.json +1 -1
  49. package/renderers/support/rasterRendererHelper.js +1 -1
  50. package/support/revision.js +1 -1
  51. package/symbols/cim/CIMResourceManager.js +1 -1
  52. package/symbols/cim/cimAnalyzer.js +1 -1
  53. package/symbols/cim/quantizeTime.js +5 -0
  54. package/views/2d/engine/webgl/TextureManager.js +1 -1
  55. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +5 -0
  56. package/views/2d/engine/webgl/animatedFormats/apng.js +1 -1
  57. package/views/2d/engine/webgl/animatedFormats/gif.js +1 -1
  58. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  59. package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
  60. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  61. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  62. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  63. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  64. package/views/3d/analysis/support/measurementUtils.js +1 -1
  65. package/views/3d/terrain/PlanarPatch.js +1 -1
  66. package/views/3d/terrain/SphericalPatch.js +1 -1
  67. package/views/3d/terrain/TerrainSurface.js +1 -1
  68. package/views/3d/terrain/Tile.js +1 -1
  69. package/views/3d/terrain/interfaces.js +1 -1
  70. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  71. package/widgets/Bookmarks.js +1 -1
  72. package/widgets/Search/SearchViewModel.js +1 -1
  73. package/assets/esri/core/workers/chunks/229bfbf3faa789f40b7e.js +0 -1
  74. package/assets/esri/core/workers/chunks/2e715520e5badbe570ac.js +0 -1
  75. package/assets/esri/core/workers/chunks/40098b3be512ad8461f8.js +0 -1
  76. package/assets/esri/core/workers/chunks/420ae87ba8dc74fd05f5.js +0 -1
  77. package/assets/esri/core/workers/chunks/46c836fc575251f1ff34.js +0 -1
  78. package/assets/esri/core/workers/chunks/481532ce4871b0d94587.js +0 -1
  79. package/assets/esri/core/workers/chunks/5fa78a6745ef14c7c4d1.js +0 -1
  80. package/assets/esri/core/workers/chunks/606f45a93c707054c521.js +0 -1
  81. package/assets/esri/core/workers/chunks/78e59b29e59b10f64aa9.js +0 -1
  82. package/assets/esri/core/workers/chunks/7be7c53727cb1bc73a64.js +0 -1
  83. package/assets/esri/core/workers/chunks/8d3fba983c360e1fdabf.js +0 -1
  84. package/assets/esri/core/workers/chunks/a69d194526bdc489b30b.js +0 -1
  85. package/assets/esri/core/workers/chunks/b59855826d235cba0889.js +0 -1
  86. package/assets/esri/core/workers/chunks/bff5812e3797c8e42ac0.js +0 -1
  87. package/assets/esri/core/workers/chunks/d6e177749bde46ab57fc.js +0 -1
  88. package/assets/esri/core/workers/chunks/d9c8a8bed6b34ed57faf.js +0 -1
  89. package/views/2d/engine/webgl/animatedFormats/BaseAnimatableTextureResource.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8163],{95401:(e,t,n)=>{n.d(t,{e:()=>a});var r,o,i,s={exports:{}};r=s,o=function(){function e(e,n,o){o=o||2;var i,s,a,c,u,p,h,f=n&&n.length,g=f?n[0]*o:e.length,x=t(e,0,g,o,!0),d=[];if(!x||x.next===x.prev)return d;if(f&&(x=l(e,n,x,o)),e.length>80*o){i=a=e[0],s=c=e[1];for(var m=o;m<g;m+=o)(u=e[m])<i&&(i=u),(p=e[m+1])<s&&(s=p),u>a&&(a=u),p>c&&(c=p);h=0!==(h=Math.max(a-i,c-s))?1/h:0}return r(x,d,o,i,s,h),d}function t(e,t,n,r,o){var i,s;if(o===F(e,t,n,r)>0)for(i=t;i<n;i+=r)s=Z(i,e[i],e[i+1],s);else for(i=n-r;i>=t;i-=r)s=Z(i,e[i],e[i+1],s);if(s&&v(s,s.next)){var a=s.next;M(s),s=a}return s}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!v(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{var o=r.prev;if(M(r),(r=t=o)===r.next)break;n=!0}}while(n||r!==t);return t}function r(e,t,l,c,u,p,h){if(e){!h&&p&&f(e,c,u,p);for(var g,x,d=e;e.prev!==e.next;)if(g=e.prev,x=e.next,p?i(e,c,u,p):o(e))t.push(g.i/l),t.push(e.i/l),t.push(x.i/l),M(e),e=x.next,d=x.next;else if((e=x)===d){h?1===h?r(e=s(n(e),t,l),t,l,c,u,p,2):2===h&&a(e,t,l,c,u,p):r(n(e),t,l,c,u,p,1);break}}}function o(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(d(t.x,t.y,n.x,n.y,r.x,r.y,o.x,o.y)&&y(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function i(e,t,n,r){var o=e.prev,i=e,s=e.next;if(y(o,i,s)>=0)return!1;for(var a=o.x<i.x?o.x<s.x?o.x:s.x:i.x<s.x?i.x:s.x,l=o.y<i.y?o.y<s.y?o.y:s.y:i.y<s.y?i.y:s.y,c=o.x>i.x?o.x>s.x?o.x:s.x:i.x>s.x?i.x:s.x,u=o.y>i.y?o.y>s.y?o.y:s.y:i.y>s.y?i.y:s.y,p=g(a,l,t,n,r),h=g(c,u,t,n,r),f=e.prevZ,x=e.nextZ;f&&f.z>=p&&x&&x.z<=h;){if(f!==e.prev&&f!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,x!==e.prev&&x!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,x.x,x.y)&&y(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;f&&f.z>=p;){if(f!==e.prev&&f!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;x&&x.z<=h;){if(x!==e.prev&&x!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,x.x,x.y)&&y(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function s(e,t,r){var o=e;do{var i=o.prev,s=o.next.next;!v(i,s)&&w(i,o,o.next,s)&&A(i,s)&&A(s,i)&&(t.push(i.i/r),t.push(o.i/r),t.push(s.i/r),M(o),M(o.next),o=e=s),o=o.next}while(o!==e);return n(o)}function a(e,t,o,i,s,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=T(l,c);return l=n(l,l.next),u=n(u,u.next),r(l,t,o,i,s,a),void r(u,t,o,i,s,a)}c=c.next}l=l.next}while(l!==e)}function l(e,r,o,i){var s,a,l,u=[];for(s=0,a=r.length;s<a;s++)(l=t(e,r[s]*i,s<a-1?r[s+1]*i:e.length,i,!1))===l.next&&(l.steiner=!0),u.push(x(l));for(u.sort(c),s=0;s<u.length;s++)o=n(o=p(u[s],o),o.next);return o}function c(e,t){return e.x-t.x}function u(e){if(e.next.prev===e)return e;let t=e;for(;;){const n=t.next;if(n.prev===t||n===t||n===e)break;t=n}return t}function p(e,t){var r=function(e,t){var n,r=t,o=e.x,i=e.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>s){if(s=a,a===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(o===s)return n;var l,c=n,u=n.x,p=n.y,f=1/0;r=n;do{o>=r.x&&r.x>=u&&o!==r.x&&d(i<p?o:s,i,u,p,i<p?s:o,i,r.x,r.y)&&(l=Math.abs(i-r.y)/(o-r.x),A(r,e)&&(l<f||l===f&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,f=l)),r=r.next}while(r!==c);return n}(e,t);if(!r)return t;var o=T(r,e),i=n(r,r.next);let s=u(o);return n(s,s.next),i=u(i),u(t===r?i:t)}function h(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function f(e,t,n,r){var o=e;do{null===o.z&&(o.z=g(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,s,a,l,c=1;do{for(n=e,e=null,i=null,s=0;n;){for(s++,r=n,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(o=n,n=n.nextZ,a--):(o=r,r=r.nextZ,l--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,c*=2}while(s>1)}(o)}function g(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*o)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*o)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function d(e,t,n,r,o,i,s,a){return(o-s)*(t-a)-(e-s)*(i-a)>=0&&(e-s)*(r-a)-(n-s)*(t-a)>=0&&(n-s)*(i-a)-(o-s)*(r-a)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&w(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||v(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,n,r){var o=C(y(e,t,n)),i=C(y(e,t,r)),s=C(y(n,r,e)),a=C(y(n,r,t));return o!==i&&s!==a||!(0!==o||!b(e,n,t))||!(0!==i||!b(e,r,t))||!(0!==s||!b(n,e,r))||!(0!==a||!b(n,t,r))}function b(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function C(e){return e>0?1:e<0?-1:0}function A(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function T(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function Z(e,t,n,r){var o=new _(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function M(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function F(e,t,n,r){for(var o=0,i=t,s=n-r;i<n;i+=r)o+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return o}return e.deviation=function(e,t,n,r){var o=t&&t.length,i=o?t[0]*n:e.length,s=Math.abs(F(e,0,i,n));if(o)for(var a=0,l=t.length;a<l;a++){var c=t[a]*n,u=a<l-1?t[a+1]*n:e.length;s-=Math.abs(F(e,c,u,n))}var p=0;for(a=0;a<r.length;a+=3){var h=r[a]*n,f=r[a+1]*n,g=r[a+2]*n;p+=Math.abs((e[h]-e[g])*(e[f+1]-e[h+1])-(e[h]-e[f])*(e[g+1]-e[h+1]))}return 0===s&&0===p?0:Math.abs((p-s)/s)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,o=0;o<e.length;o++){for(var i=0;i<e[o].length;i++)for(var s=0;s<t;s++)n.vertices.push(e[o][i][s]);o>0&&(r+=e[o-1].length,n.holes.push(r))}return n},e},void 0!==(i=o())&&(r.exports=i);const a=s.exports},62540:(e,t,n)=>{n.d(t,{Z:()=>y});var r,o=n(43697),i=n(96674),s=n(22974),a=n(92604),l=n(5600),c=n(90578),u=n(52011),p=n(75215),h=n(65542),f=n(60746),g=n(71630);const x="esri.geometry.support.MeshComponent",d=a.Z.getLogger(x);let m=r=class extends i.wq{constructor(e){super(e),this.faces=null,this.material=null,this.shading="source",this.trustSourceNormals=!1}static from(e){return(0,p.TJ)(r,e)}castFaces(e){return(0,g.X)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},d)}castMaterial(e){return(0,p.TJ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?f.Z:h.Z,e)}clone(){return new r({faces:(0,s.d9)(this.faces),shading:this.shading,material:(0,s.d9)(this.material),trustSourceNormals:this.trustSourceNormals})}cloneWithDeduplication(e,t){const n={faces:(0,s.d9)(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(e,t):null,trustSourceNormals:this.trustSourceNormals};return new r(n)}};(0,o._)([(0,l.Cb)({json:{write:!0}})],m.prototype,"faces",void 0),(0,o._)([(0,c.p)("faces")],m.prototype,"castFaces",null),(0,o._)([(0,l.Cb)({type:h.Z,json:{write:!0}})],m.prototype,"material",void 0),(0,o._)([(0,c.p)("material")],m.prototype,"castMaterial",null),(0,o._)([(0,l.Cb)({type:String,json:{write:!0}})],m.prototype,"shading",void 0),(0,o._)([(0,l.Cb)({type:Boolean})],m.prototype,"trustSourceNormals",void 0),m=r=(0,o._)([(0,u.j)(x)],m);const y=m},65542:(e,t,n)=>{n.d(t,{Z:()=>h});var r,o=n(43697),i=n(22303),s=n(96674),a=n(70586),l=n(5600),c=(n(67676),n(80442),n(75215),n(52011)),u=n(81118);let p=r=class extends s.wq{constructor(e){super(e),this.color=null,this.colorTexture=null,this.normalTexture=null,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const n=(0,a.pC)(e)?e.get(this):null;if(n)return n;const o=new r(this.clonePropertiesWithDeduplication(t));return(0,a.pC)(e)&&e.set(this,o),o}clonePropertiesWithDeduplication(e){return{color:(0,a.pC)(this.color)?this.color.clone():null,colorTexture:(0,a.pC)(this.colorTexture)?this.colorTexture.cloneWithDeduplication(e):null,normalTexture:(0,a.pC)(this.normalTexture)?this.normalTexture.cloneWithDeduplication(e):null,alphaMode:this.alphaMode,alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided,colorTextureTransform:(0,a.pC)(this.colorTextureTransform)?this.colorTextureTransform:null,normalTextureTransform:(0,a.pC)(this.normalTextureTransform)?this.normalTextureTransform:null}}};(0,o._)([(0,l.Cb)({type:i.Z,json:{write:!0}})],p.prototype,"color",void 0),(0,o._)([(0,l.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"colorTexture",void 0),(0,o._)([(0,l.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"normalTexture",void 0),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:!0}})],p.prototype,"alphaMode",void 0),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:!0}})],p.prototype,"alphaCutoff",void 0),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:!0}})],p.prototype,"doubleSided",void 0),(0,o._)([(0,l.Cb)()],p.prototype,"colorTextureTransform",void 0),(0,o._)([(0,l.Cb)()],p.prototype,"normalTextureTransform",void 0),p=r=(0,o._)([(0,c.j)("esri.geometry.support.MeshMaterial")],p);const h=p},60746:(e,t,n)=>{n.d(t,{Z:()=>h});var r,o=n(43697),i=n(22303),s=n(70586),a=n(5600),l=(n(67676),n(80442),n(75215),n(52011)),c=n(65542),u=n(81118);let p=r=class extends c.Z{constructor(e){super(e),this.emissiveColor=null,this.emissiveTexture=null,this.occlusionTexture=null,this.metallic=1,this.roughness=1,this.metallicRoughnessTexture=null}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const n=(0,s.pC)(e)?e.get(this):null;if(n)return n;const o=new r(this.clonePropertiesWithDeduplication(t));return(0,s.pC)(e)&&e.set(this,o),o}clonePropertiesWithDeduplication(e){return{...super.clonePropertiesWithDeduplication(e),emissiveColor:(0,s.pC)(this.emissiveColor)?this.emissiveColor.clone():null,emissiveTexture:(0,s.pC)(this.emissiveTexture)?this.emissiveTexture.cloneWithDeduplication(e):null,occlusionTexture:(0,s.pC)(this.occlusionTexture)?this.occlusionTexture.cloneWithDeduplication(e):null,metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:(0,s.pC)(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.cloneWithDeduplication(e):null,occlusionTextureTransform:(0,s.pC)(this.occlusionTextureTransform)?this.occlusionTextureTransform:null,emissiveTextureTransform:(0,s.pC)(this.emissiveTextureTransform)?this.emissiveTextureTransform:null,metallicRoughnessTextureTransform:(0,s.pC)(this.metallicRoughnessTextureTransform)?this.metallicRoughnessTextureTransform:null}}};(0,o._)([(0,a.Cb)({type:i.Z,json:{write:!0}})],p.prototype,"emissiveColor",void 0),(0,o._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"emissiveTexture",void 0),(0,o._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"occlusionTexture",void 0),(0,o._)([(0,a.Cb)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],p.prototype,"metallic",void 0),(0,o._)([(0,a.Cb)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],p.prototype,"roughness",void 0),(0,o._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"metallicRoughnessTexture",void 0),(0,o._)([(0,a.Cb)()],p.prototype,"occlusionTextureTransform",void 0),(0,o._)([(0,a.Cb)()],p.prototype,"emissiveTextureTransform",void 0),(0,o._)([(0,a.Cb)()],p.prototype,"metallicRoughnessTextureTransform",void 0),p=r=(0,o._)([(0,l.j)("esri.geometry.support.MeshMaterialMetallicRoughness")],p);const h=p},81118:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(43697),o=(n(80442),n(96674)),i=n(5600),s=(n(67676),n(75215)),a=n(71715),l=n(52011),c=n(30556),u=n(25929);n(22021);let p=null,h=!0;var f;const g=new WeakMap;let x=0,d=f=class extends o.wq{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:(0,u.t)(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const r=e.getContext("2d").getImageData(0,0,e.width,e.height),o={type:"canvas-element",imageData:this._encodeImageData(r)};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:(0,u.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else{const r={type:"image-data",imageData:this._encodeImageData(e)};t[n]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=this._decodeImageData(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return this._decodeImageData(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const e=this.data,t=this.url;if(e instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(e.getContext("2d").getImageData(0,0,e.width,e.height));if(e instanceof ImageData)return this._imageDataContainsTransparent(e);if(t){const e=t.substr(t.length-4,4).toLowerCase(),n=t.substr(0,15).toLocaleLowerCase();if(".png"===e||"data:image/png;"===n)return!0}return!1}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(g.has(this.data)||g.set(this.data,++x),t(g.get(this.data))):t()}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new f(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return"string"==typeof this.wrap?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(e){let t="";for(let n=0;n<e.data.length;n++)t+=String.fromCharCode(e.data[n]);return{data:btoa(t),width:e.width,height:e.height}}_decodeImageData(e){const t=atob(e.data),n=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return function(e,t,n,r){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(h)try{return new ImageData(e,t,n)}catch(e){h=!1}const o=function(e,t,n){return n||(p||(p=document.createElement("canvas"),p.width=1,p.height=1),n=p),n.getContext("2d").createImageData(e,t)}(t,n,void 0);return o.data.set(e,0),o}(n,e.width,e.height)}_imageDataContainsTransparent(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}static from(e){return"string"==typeof e?new f({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new f({data:e}):(0,s.TJ)(f,e)}};(0,r._)([(0,i.Cb)({type:String,json:{write:u.w}})],d.prototype,"url",null),(0,r._)([(0,i.Cb)({json:{write:{overridePolicy(){return{enabled:!this.url}}}}}),(0,i.Cb)()],d.prototype,"data",null),(0,r._)([(0,c.c)("data")],d.prototype,"writeData",null),(0,r._)([(0,a.r)("data")],d.prototype,"readData",null),(0,r._)([(0,i.Cb)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],d.prototype,"transparent",null),(0,r._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"wrap",void 0),(0,r._)([(0,i.Cb)({readOnly:!0})],d.prototype,"contentHash",null),d=f=(0,r._)([(0,l.j)("esri.geometry.support.MeshTexture")],d);const m=d},71630:(e,t,n)=>{n.d(t,{Q:()=>f,X:()=>x});var r,o=n(43697),i=n(96674),s=n(22974),a=n(92604),l=n(5600),c=n(90578),u=n(52011);const p="esri.geometry.support.MeshVertexAttributes",h=a.Z.getLogger(p);let f=r=class extends i.wq{constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return x(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},h)}castPosition(e){return e&&e instanceof Float32Array&&h.warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),x(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},h)}castUv(e){return x(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},h)}castNormal(e){return x(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},h)}castTangent(e){return x(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},h)}clone(){const e={position:(0,s.d9)(this.position),uv:(0,s.d9)(this.uv),normal:(0,s.d9)(this.normal),tangent:(0,s.d9)(this.tangent),color:(0,s.d9)(this.color)};return new r(e)}clonePositional(){const e={position:(0,s.d9)(this.position),normal:(0,s.d9)(this.normal),tangent:(0,s.d9)(this.tangent),uv:this.uv,color:this.color};return new r(e)}};function g(e,t,n,r){const{loggerTag:o,stride:i}=t;return e.length%i!=0?(r.error(o,`Invalid array length, expected a multiple of ${i}`),new n([])):e}function x(e,t,n,r,o){if(!e)return e;if(e instanceof t)return g(e,r,t,o);for(const i of n)if(e instanceof i)return g(new t(e),r,t,o);if(Array.isArray(e))return g(new t(e),r,t,o);{const r=n.map((e=>`'${e.name}'`));return o.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function d(e,t,n){t[n]=function(e){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n];return t}(e)}(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"color",void 0),(0,o._)([(0,c.p)("color")],f.prototype,"castColor",null),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:d}})],f.prototype,"position",void 0),(0,o._)([(0,c.p)("position")],f.prototype,"castPosition",null),(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"uv",void 0),(0,o._)([(0,c.p)("uv")],f.prototype,"castUv",null),(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"normal",void 0),(0,o._)([(0,c.p)("normal")],f.prototype,"castNormal",null),(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"tangent",void 0),(0,o._)([(0,c.p)("tangent")],f.prototype,"castTangent",null),f=r=(0,o._)([(0,u.j)(p)],f)},47545:(e,t,n)=>{n.d(t,{d:()=>o});var r=n(22021);function o(e,t,n){const o=e.byteLength/(4*t),c=new Uint32Array(e,0,o*t);let u=new Uint32Array(o);const p=n?.minReduction??0,h=n?.originalIndices||null,f=h?h.length:0,g=n?.componentOffsets||null;let x=0;if(g)for(let e=0;e<g.length-1;e++){const t=g[e+1]-g[e];t>x&&(x=t)}else x=o;const d=Math.floor(1.1*x)+1;(null==l||l.length<2*d)&&(l=new Uint32Array((0,r.Sf)(2*d)));for(let e=0;e<2*d;e++)l[e]=0;let m=0;const y=!!g&&!!h,v=y?f:o,w=y?new Uint32Array(f):null,b=1.96;let C=0!==p?Math.ceil(4*b*b/(p*p)*p*(1-p)):v,A=1,T=g?g[1]:v;for(let e=0;e<v;e++){if(e===C){const t=1-m/e;if(t+b*Math.sqrt(t*(1-t)/e)<p)return null;C*=2}if(e===T){for(let e=0;e<2*d;e++)l[e]=0;if(h)for(let e=g[A-1];e<g[A];e++)w[e]=u[h[e]];T=g[++A]}const n=y?h[e]:e,r=n*t,o=a(c,r,t);let s=o%d,f=m;for(;0!==l[2*s+1];){if(l[2*s]===o){const e=l[2*s+1]-1;if(i(c,r,e*t,t)){f=u[e];break}}s++,s>=d&&(s-=d)}f===m&&(l[2*s]=o,l[2*s+1]=n+1,m++),u[n]=f}if(0!==p&&1-m/o<p)return null;if(y){for(let e=g[A-1];e<w.length;e++)w[e]=u[h[e]];u=w}const Z=new Uint32Array(t*m);m=0;for(let e=0;e<v;e++)u[e]===m&&(s(c,(y?h[e]:e)*t,Z,m*t,t),m++);if(h&&!y){const e=new Uint32Array(f);for(let t=0;t<e.length;t++)e[t]=u[h[t]];u=e}return{buffer:Z.buffer,indices:u,uniqueCount:m}}function i(e,t,n,r){for(let o=0;o<r;o++)if(e[t+o]!==e[n+o])return!1;return!0}function s(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}function a(e,t,n){let r=0;for(let o=0;o<n;o++)r=e[t+o]+r|0,r=r+(r<<11)+(r>>>2)|0;return r>>>0}let l=null},38163:(e,t,n)=>{n.r(t),n.d(t,{meshFeatureSetFromJSON:()=>Ie});var r,o,i=n(38171),s=n(70586),a=n(6570),l=n(43697),c=n(20102),u=n(3920),p=n(83379),h=n(92604),f=n(609),g=n(95330),x=n(17445),d=n(5600),m=(n(67676),n(80442),n(75215),n(52011)),y=n(65617),v=n(9361),w=n(94139),b=n(38913),C=n(3709),A=n(62540),T=n(2674),Z=n(71630),M=n(95401),_=n(86662),F=n(47545);function R(e,t,n){const o=e.length,i=new Array(o),s=new Array(o),a=new Array(o);let l=0,c=0,u=0,p=0;for(let t=0;t<o;++t)p+=e[t].length;const h=new Float64Array(3*p);let f=0;for(let p=o-1;p>=0;p--){const g=e[p],x=n===r.CCW_IS_HOLE&&D(g);if(x&&1!==o)i[l++]=g;else{let e=g.length;for(let t=0;t<l;++t)e+=i[t].length;const n={index:f,pathLengths:new Array(l+1),count:e,holeIndices:new Array(l)};n.pathLengths[0]=g.length,g.length>0&&(a[u++]={index:f,count:g.length}),f=x?L(g,g.length-1,-1,h,f,g.length,t):L(g,0,1,h,f,g.length,t);for(let e=0;e<l;++e){const r=i[e];n.holeIndices[e]=f,n.pathLengths[e+1]=r.length,r.length>0&&(a[u++]={index:f,count:r.length}),f=L(r,0,1,h,f,r.length,t)}l=0,n.count>0&&(s[c++]=n)}}for(let e=0;e<l;++e){const n=i[e];n.length>0&&(a[u++]={index:f,count:n.length}),f=L(n,0,1,h,f,n.length,t)}return c<o&&(s.length=c),u<o&&(a.length=u),{position:h,polygons:s,outlines:a}}function L(e,t,n,r,o,i,s){o*=3;for(let a=0;a<i;++a){const i=e[t];r[o++]=i[0],r[o++]=i[1],r[o++]=s?i[2]:0,t+=n}return o/3}function D(e){return!(0,_.bu)(e,!1,!1)}(o=r||(r={}))[o.NONE=0]="NONE",o[o.CCW_IS_HOLE=1]="CCW_IS_HOLE";var I=n(44547),E=n(13442),O=n(66459);const P=h.Z.getLogger("esri.geometry.support.meshUtils.centerAt");const S=(0,y.c)(),j=(0,y.c)();var z=n(17452);function N(e){const t=(0,z.Yd)(e.url);return n=>{const r=(0,z.PF)(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return e.files.get(o)??n}}async function U(e,t){return e instanceof Blob?W.fromBlob(e):"string"==typeof e?new W(e):Array.isArray(e)?async function(e,t){const n=new Map;let r=null;const o=await(0,g.WW)(e.map((async e=>({name:e.name,source:await U(e instanceof Blob?e:e.source,t)})))),i=[];for(const e of o)e&&((0,g.Hc)(t)?e.source.dispose():i.push(e));(0,g.k_)(t);for(const{name:e,source:t}of i)((0,s.Wi)(r)||/\.(gltf|glb)/i.test(e))&&(r=t.url),n.set(e,t.url),t.files&&t.files.forEach(((e,t)=>n.set(t,e)));if((0,s.Wi)(r))throw new c.Z("mesh-load-external:missing-files","Missing files to load external mesh source");return new W(r,(()=>i.forEach((({source:e})=>e.dispose()))),n)}(e,t):async function(e,t){const{default:r}=await(0,g.Hl)(Promise.resolve().then(n.bind(n,3172)),t),o="string"==typeof e.multipart[0]?await Promise.all(e.multipart.map((async e=>(await r(e,{responseType:"array-buffer"})).data))):e.multipart;return W.fromBlob(new Blob(o))}(e,t)}class W{constructor(e,t=(()=>{}),n=new Map){this.url=e,this.dispose=t,this.files=n}static fromBlob(e){const t=URL.createObjectURL(e);return new W(t,(()=>URL.revokeObjectURL(t)))}}var k=n(21787),$=n(46521),H=n(13598),B=n(17896),G=n(24678),q=n(56493);function Y(e,t){if(e)for(let n=0;n<e.length;n+=3)for(let r=0;r<3;r++)e[n+r]+=t[r]}const X=(0,y.c)(),K=(0,H.c)(),J=(0,$.c)(),V={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function Q(e,t,n){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null==t)return;const n="number"==typeof t?[t,t,t]:[null!=t.width?t.width:1,null!=t.depth?t.depth:1,null!=t.height?t.height:1];re[0]=n[0],re[4]=n[1],re[8]=n[2];for(let t=0;t<e.position.length;t+=3){for(let n=0;n<3;n++)ne[n]=e.position[t+n];(0,B.t)(ne,ne,re);for(let n=0;n<3;n++)e.position[t+n]=ne[n]}if(n[0]!==n[1]||n[1]!==n[2]){re[0]=1/n[0],re[4]=1/n[1],re[8]=1/n[2];for(let t=0;t<e.normal.length;t+=3){for(let n=0;n<3;n++)ne[n]=e.normal[t+n];(0,B.t)(ne,ne,re),(0,B.n)(ne,ne);for(let n=0;n<3;n++)e.normal[t+n]=ne[n]}}}(e,n&&n.size);const{vertexAttributes:r,transform:o}=(0,O.w1)(e,t,n);return{vertexAttributes:new Z.Q({...r,uv:e.uv}),transform:o,components:[new A.Z({faces:e.faces,material:n&&n.material||null})],spatialReference:t.spatialReference}}const ee={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},te={south:0,east:1,north:2,west:3,up:4,down:5},ne=(0,y.c)(),re=(0,$.c)();var oe=n(52138);const ie=h.Z.getLogger("esri.geometry.support.meshUtils.rotate");function se(e,t,n,r=y.Z){if(!(0,s.Wi)(e)){(0,oe.d)(ue,(0,C.WH)(t),(0,C.ZZ)(t));for(let t=0;t<e.length;t+=n){for(let n=0;n<3;n++)ae[n]=e[t+n]-r[n];(0,B.m)(ae,ae,ue);for(let n=0;n<3;n++)e[t+n]=ae[n]+r[n]}}}const ae=(0,y.c)(),le=(0,y.c)(),ce=(0,C.Ue)(),ue=(0,H.c)(),pe=(0,$.c)(),he=(0,y.c)(),fe=h.Z.getLogger("esri.geometry.support.meshUtils.scale");function ge(e,t,n=y.Z){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)xe[t]=e[r+t]-n[t];(0,B.g)(xe,xe,t);for(let t=0;t<3;t++)e[r+t]=xe[t]+n[t]}}const xe=(0,y.c)(),de=(0,y.c)(),me=(0,y.c)();var ye;const ve="esri.geometry.Mesh";let we=ye=class extends((0,u.p)(p.Z.LoadableMixin((0,f.v)(v.Z)))){constructor(e){super(e),this.components=null,this.transform=null,this.external=null,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new Z.Q,this.type="mesh"}initialize(){((0,s.Wi)(this.external)||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add((0,x.YP)((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone())),transform:(0,s.pC)(this.transform)?this.transform.clone():null})),(()=>this._set("external",null)),{once:!0,sync:!0}))}))}get hasExtent(){return!this.loaded&&(0,s.pC)(this.external)&&(0,s.pC)(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const e=this.vertexAttributes.position,t=this.spatialReference;if(0===e.length||this.components&&0===this.components.length)return{extent:new a.Z({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t}),center:new w.Z({x:0,y:0,z:0,spatialReference:t})};const n=(0,s.pC)(this.transform)?this.transform.project(e,t):e;let r=1/0,o=1/0,i=1/0,l=-1/0,c=-1/0,u=-1/0,p=0,h=0,f=0;const g=n.length,x=1/(g/3);let d=0;for(;d<g;){const e=n[d++],t=n[d++],s=n[d++];r=Math.min(r,e),o=Math.min(o,t),i=Math.min(i,s),l=Math.max(l,e),c=Math.max(c,t),u=Math.max(u,s),p+=x*e,h+=x*t,f+=x*s}return{extent:new a.Z({xmin:r,ymin:o,zmin:i,xmax:l,ymax:c,zmax:u,spatialReference:t}),center:new w.Z({x:p,y:h,z:f,spatialReference:t})}}get anchor(){if((0,s.pC)(this.transform))return this.transform.getOriginPoint(this.spatialReference);const e=this._boundingInfo;return new w.Z({x:e.center.x,y:e.center.y,z:e.extent.zmin,spatialReference:this.spatialReference})}get origin(){return(0,s.pC)(this.transform)?this.transform.getOriginPoint(this.spatialReference):this._boundingInfo.center}get extent(){return!this.loaded&&(0,s.pC)(this.external)&&(0,s.pC)(this.external.extent)?this.external.extent.clone():this._boundingInfo.extent}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(A.Z.from(e)),this.notifyChange("components")):h.Z.getLogger(this.declaredClass).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}h.Z.getLogger(this.declaredClass).error("removeComponent()","Provided component is not part of the list of components")}else h.Z.getLogger(this.declaredClass).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,n,r){return(0,C.uT)(be.x,e,Ce),(0,C.uT)(be.y,t,Ae),(0,C.uT)(be.z,n,Te),(0,C.qC)(Ce,Ae,Ce),(0,C.qC)(Ce,Te,Ce),function(e,t,n){if(!e.vertexAttributes||!e.vertexAttributes.position||0===t[3])return;const r=e.spatialReference;if((0,s.pC)(e.transform)){null!=n?.geographic&&n.geographic!==e.transform.geographic&&ie.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`);const o=n?.origin??e.transform.getOriginPoint(r);!function(e,t,n){const r=(0,B.s)(ae,n.x,n.y,n.z),o=(0,B.b)(ae,r,e.origin);e.applyLocalInverse(o,le),e.rotation=(0,C.qC)(e.rotation,t,(0,C.Ue)()),e.applyLocalInverse(o,o),(0,B.b)(o,o,le),e.translation=(0,B.a)((0,y.c)(),e.translation,o)}(e.transform,t,o)}else{const r=n?.origin??e.origin;(0,E.h)(e.spatialReference,n)?function(e,t,n){const r=e.spatialReference,o=(0,G.rS)(r),i=he;(0,I.KC)(n,i,o)||(0,I.KC)(e.origin,i,o);const a=e.vertexAttributes.position,l=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,u=new Float64Array(a.length),p=(0,s.pC)(l)?new Float32Array(l.length):null,h=(0,s.pC)(c)?new Float32Array(c.length):null;(0,I.Bm)(o,i,ue,o),(0,k.f)(pe,ue);const f=ce;(0,B.t)((0,C.ZZ)(ce),(0,C.ZZ)(t),pe),f[3]=t[3],(0,q.XO)(a,r,u),(0,s.pC)(l)&&(0,q.Iz)(l,a,u,r,p),(0,s.pC)(c)&&(0,q.wi)(c,a,u,r,h),se(u,f,3,i),(0,q.To)(u,a,r),(0,s.pC)(l)&&(se(p,f,3),(0,q.Yk)(p,a,u,r,l)),(0,s.pC)(c)&&(se(h,f,4),(0,q.M2)(h,a,u,r,c)),e.vertexAttributesChanged()}(e,t,r):function(e,t,n){const r=he;if(!(0,I.KC)(n,r,e.spatialReference)){const t=e.origin;r[0]=t.x,r[1]=t.y,r[2]=t.z,ie.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid}).`)}se(e.vertexAttributes.position,t,3,r),se(e.vertexAttributes.normal,t,3),se(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,r)}}(this,Ce,r),this}offset(e,t,n,r){return this.loaded?(Ze[0]=e,Ze[1]=t,Ze[2]=n,function(e,t,n){var r,o;e.vertexAttributes&&e.vertexAttributes.position&&((0,s.pC)(e.transform)?(null!=n?.geographic&&n.geographic!==e.transform.geographic&&h.Z.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`),function(e,t){const n=e.origin;e.origin=(0,B.a)((0,y.c)(),n,t)}(e.transform,t)):(0,E.h)(e.spatialReference,n)?function(e,t){const n=e.spatialReference,r=e.vertexAttributes.position,o=e.vertexAttributes.normal,i=e.vertexAttributes.tangent,a=new Float64Array(r.length),l=(0,s.pC)(o)?new Float32Array(o.length):null,c=(0,s.pC)(i)?new Float32Array(i.length):null,u=e.extent.center,p=X;(0,I.Bm)(n,[u.x,u.y,u.z],K,(0,G.rS)(n)),(0,k.f)(J,K),(0,B.t)(p,t,J),(0,q.XO)(r,n,a),(0,s.pC)(o)&&(0,q.Iz)(o,r,a,n,l),(0,s.pC)(i)&&(0,q.wi)(i,r,a,n,c),Y(a,p),(0,q.To)(a,r,n),(0,s.pC)(o)&&(0,q.Yk)(l,r,a,n,o),(0,s.pC)(i)&&(0,q.M2)(c,r,a,n,i),e.vertexAttributesChanged()}(e,t):(o=t,Y((r=e).vertexAttributes.position,o),r.vertexAttributesChanged()))}(this,Ze,r),this):(h.Z.getLogger(this.declaredClass).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(function(e,t,n){if(!e.vertexAttributes||!e.vertexAttributes.position)return;const r=e.spatialReference;if((0,s.pC)(e.transform)){null!=n?.geographic&&n.geographic!==e.transform.geographic&&fe.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`);const o=n?.origin??e.transform.getOriginPoint(r);!function(e,t,n){const r=(0,B.s)(xe,n.x,n.y,n.z),o=(0,B.b)(xe,r,e.origin);e.applyLocalInverse(o,de);const i=(0,B.g)((0,y.c)(),e.scale,t);e.scale=i,e.applyLocalInverse(o,o),(0,B.b)(o,o,de),e.translation=(0,B.a)((0,y.c)(),e.translation,o)}(e.transform,t,o)}else{const r=(0,E.h)(e.spatialReference,n),o=n&&n.origin||e.origin;r?function(e,t,n){const r=e.spatialReference,o=(0,G.rS)(r),i=me;(0,I.KC)(n,i,o)||(0,I.KC)(e.origin,i,o);const a=e.vertexAttributes.position,l=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,u=new Float64Array(a.length),p=(0,s.pC)(l)?new Float32Array(l.length):null,h=(0,s.pC)(c)?new Float32Array(c.length):null;(0,q.XO)(a,r,u),(0,s.pC)(l)&&(0,q.Iz)(l,a,u,r,p),(0,s.pC)(c)&&(0,q.wi)(c,a,u,r,h),ge(u,t,i),(0,q.To)(u,a,r),(0,s.pC)(l)&&(0,q.Yk)(p,a,u,r,l),(0,s.pC)(c)&&(0,q.M2)(h,a,u,r,c),e.vertexAttributesChanged()}(e,t,o):function(e,t,n){const r=me;if(!(0,I.KC)(n,r,e.spatialReference)){const t=e.origin;r[0]=t.x,r[1]=t.y,r[2]=t.z,fe.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid}).`)}ge(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,o)}}(this,e,t),this):(h.Z.getLogger(this.declaredClass).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(function(e,t,n){if(!e.vertexAttributes||!e.vertexAttributes.position)return;const r=n?.origin??e.origin;(0,s.pC)(e.transform)?(null!=n?.geographic&&n.geographic!==e.transform.geographic&&P.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`),function(e,t,n){const r=t.x-n.x,o=t.y-n.y,i=t.hasZ&&n.hasZ?t.z-n.z:0,s=e.origin;e.origin=[s[0]+r,s[1]+o,s[2]+i]}(e.transform,t,r)):(0,E.h)(e.spatialReference,n)?function(e,t,n){const r=(0,O.FF)(e.vertexAttributes,n,{geographic:!0}),{position:o,normal:i,tangent:s}=(0,O.iv)(r,t,{geographic:!0});e.vertexAttributes.position=o,e.vertexAttributes.normal=i,e.vertexAttributes.tangent=s,e.vertexAttributesChanged()}(e,t,r):function(e,t,n){const r=j,o=S;if((0,I.KC)(t,o,e.spatialReference)){if(!(0,I.KC)(n,r,e.spatialReference)){const t=e.origin;r[0]=t.x,r[1]=t.y,r[2]=t.z,P.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid}).`)}(function(e,t,n){if(e)for(let r=0;r<e.length;r+=3)for(let o=0;o<3;o++)e[r+o]+=t[o]-n[o]})(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else P.error(`Failed to project centerAt location (wkid:${t.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid})`)}(e,t,r)}(this,e,t),this):(h.Z.getLogger(this.declaredClass).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){return(0,s.pC)(this.external)&&this.addResolvingPromise(async function(e,t,r){const{loadGLTFMesh:o}=await(0,g.Hl)(Promise.all([n.e(2631),n.e(2133),n.e(9070)]).then(n.bind(n,99070)),r),i=await U(t,r),a=o(new w.Z({x:0,y:0,z:0,spatialReference:e.spatialReference}),i.url,{resolveFile:N(i),useTransform:!0,signal:(0,s.pC)(r)?r.signal:null});a.then((()=>i.dispose()),(()=>i.dispose()));const{vertexAttributes:l,components:c}=await a;e.vertexAttributes=l,e.components=c}(this,this.external.source,e)),Promise.resolve(this)}clone(){const e=this.components?new Map:null,t=this.components?new Map:null,n={components:this.components?this.components.map((n=>n.cloneWithDeduplication(e,t))):null,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:(0,s.pC)(this.transform)?this.transform.clone():null,external:(0,s.pC)(this.external)?{source:this.external.source,extent:(0,s.pC)(this.external.extent)?this.external.extent.clone():null}:null};return new ye(n)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const{toBinaryGLTF:t}=await n.e(7277).then(n.bind(n,7277));return t(this,e)}static createBox(e,t){if(!(e instanceof w.Z))return h.Z.getLogger(ve).error(".createBox()","expected location to be a Point instance"),null;const n=new ye(Q(function(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=ee,r=4*e.length,o=new Float64Array(3*r),i=new Float32Array(3*r),s=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,u=0,p=0;for(let r=0;r<e.length;r++){const h=e[r],f=l/3;for(const e of t)a[p++]=f+e;const g=h.corners;for(let e=0;e<4;e++){const t=g[e];let r=0;s[u++]=.25*n[e][0]+h.uvOrigin[0],s[u++]=h.uvOrigin[1]-.25*n[e][1];for(let e=0;e<3;e++)0!==h.axis[e]?(o[l++]=.5*h.axis[e],i[c++]=h.axis[e]):(o[l++]=.5*t[r++],i[c++]=0)}}return{position:o,normal:i,uv:s,faces:a}}(),e,t));return t&&t.imageFace&&"all"!==t.imageFace?function(e,t){const n=e.components[0],r=n.faces,o=te[t],i=6*o,a=new Uint32Array(6),l=new Uint32Array(r.length-6);let c=0,u=0;for(let e=0;e<r.length;e++)e>=i&&e<i+6?a[c++]=r[e]:l[u++]=r[e];if((0,s.pC)(e.vertexAttributes.uv)){const t=new Float32Array(e.vertexAttributes.uv),n=4*o*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[n+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new A.Z({faces:a,material:n.material}),new A.Z({faces:l})],e}(n,t.imageFace):n}static createSphere(e,t){return e instanceof w.Z?new ye(Q(function(e=0){const t=Math.round(8*2**e),n=2*t,r=(t-1)*(n+1)+2*n,o=new Float64Array(3*r),i=new Float32Array(3*r),s=new Float32Array(2*r),a=new Uint32Array((t-1)*n*2*3);let l=0,c=0,u=0,p=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,h=Math.cos(r),f=Math.sin(r);ne[2]=f;const g=0===e||e===t,x=g?n-1:n;for(let r=0;r<=x;r++){const f=r/x*2*Math.PI;ne[0]=-Math.sin(f)*h,ne[1]=Math.cos(f)*h;for(let e=0;e<3;e++)o[l]=.5*ne[e],i[l]=ne[e],++l;s[c++]=(r+(g?.5:0))/n,s[c++]=e/t,0!==e&&r!==n&&(e!==t&&(a[u++]=p,a[u++]=p+1,a[u++]=p-n),1!==e&&(a[u++]=p,a[u++]=p-n,a[u++]=p-n-1)),p++}}return{position:o,normal:i,uv:s,faces:a}}(t&&t.densificationFactor||0),e,t)):(h.Z.getLogger(ve).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof w.Z?new ye(Q(function(e=0){const t=Math.round(16*2**e),n=4*(t+1)+2*t,r=new Float64Array(3*n),o=new Float32Array(3*n),i=new Float32Array(2*n),s=new Uint32Array(4*t*3);let a=0,l=0,c=0,u=0,p=0;for(let e=0;e<=5;e++){const n=0===e||5===e,h=e<=1||e>=4,f=2===e||4===e,g=n?t-1:t;for(let x=0;x<=g;x++){const d=x/g*2*Math.PI,m=n?0:.5;ne[0]=m*Math.sin(d),ne[1]=m*-Math.cos(d),ne[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=ne[t],o[l++]=h?2===t?e<=1?1:-1:0:2===t?0:ne[t]/m;i[c++]=(x+(n?.5:0))/t,i[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,f||0===e||x===t||(5!==e&&(s[u++]=p,s[u++]=p+1,s[u++]=p-t),1!==e&&(s[u++]=p,s[u++]=p-t,s[u++]=p-t-1)),p++}}return{position:r,normal:o,uv:i,faces:s}}(t&&t.densificationFactor||0),e,t)):(h.Z.getLogger(ve).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){if(!(e instanceof w.Z))return h.Z.getLogger(ve).error(".createPlane()","expected location to be a Point instance"),null;const n=t?.facing??"up",r=function(e,t){const n="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}(n,t?.size);return new ye(Q(function(e){const t=V.facingAxisOrderSwap[e],n=V.position,r=V.normal,o=new Float64Array(n.length),i=new Float32Array(r.length);let s=0;for(let e=0;e<4;e++){const e=s;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,u=l>=0?1:-1;o[s]=n[e+c]*u,i[s]=r[e+c]*u,s++}}return{position:o,normal:i,uv:new Float32Array(V.uv),faces:new Uint32Array(V.faces),isPlane:!0}}(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof b.Z))return h.Z.getLogger(ve).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const n=function(e){const t=R(e.rings,e.hasZ,r.CCW_IS_HOLE),n=[];let o=0,i=0;for(const e of t.polygons){const r=e.count,s=e.index,a=new Float64Array(t.position.buffer,3*s*t.position.BYTES_PER_ELEMENT,3*r),l=e.holeIndices.map((e=>e-s)),c=new Uint32Array((0,M.e)(a,l,3));n.push({position:a,faces:c}),o+=a.length,i+=c.length}const s=function(e,t,n){if(1===e.length)return e[0];const r=new Float64Array(t),o=new Uint32Array(n);let i=0,s=0,a=0;for(const t of e){for(let e=0;e<t.position.length;e++)r[i++]=t.position[e];for(let e=0;e<t.faces.length;e++)o[s++]=t.faces[e]+a;a=i/3}return{position:r,faces:o}}(n,o,i),a=(0,F.d)(s.position.buffer,6,{originalIndices:s.faces});return s.position=new Float64Array(a.buffer),s.faces=a.indices,s}(e);return new ye({vertexAttributes:new Z.Q({position:n.position}),components:[new A.Z({faces:n.faces,shading:"flat",material:t&&t.material||null})],spatialReference:e.spatialReference})}static async createFromGLTF(e,t,r){if(!(e instanceof w.Z))throw h.Z.getLogger(ve).error(".createfromGLTF()","expected location to be a Point instance"),new c.Z("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:o}=await(0,g.Hl)(Promise.all([n.e(2631),n.e(2133),n.e(9070)]).then(n.bind(n,99070)),r);return new ye(await o(e,t,r))}static createWithExternalSource(e,t,n){const r=n?.extent??null,o=n?.transform.clone()??new T.Z;o.origin=[e.x,e.y,e.z??0];const i=e.spatialReference;return new ye({external:{source:t,extent:r},transform:o,spatialReference:i})}static createIncomplete(e,t){const n=t?.transform.clone()??new T.Z;n.origin=[e.x,e.y,e.z??0];const r=e.spatialReference,o=new ye({transform:n,spatialReference:r});return o.addResolvingPromise(Promise.reject(new c.Z("mesh-incomplete","Mesh resources are not complete"))),o}};(0,l._)([(0,d.Cb)({type:[A.Z],json:{write:!0}})],we.prototype,"components",void 0),(0,l._)([(0,d.Cb)({type:T.Z,json:{write:!0}})],we.prototype,"transform",void 0),(0,l._)([(0,d.Cb)({constructOnly:!0})],we.prototype,"external",void 0),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"hasExtent",null),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"_boundingInfo",null),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"anchor",null),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"origin",null),(0,l._)([(0,d.Cb)({readOnly:!0,json:{read:!1}})],we.prototype,"extent",null),(0,l._)([(0,d.Cb)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],we.prototype,"hasZ",void 0),(0,l._)([(0,d.Cb)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],we.prototype,"hasM",void 0),(0,l._)([(0,d.Cb)({type:Z.Q,nonNullable:!0,json:{write:!0}})],we.prototype,"vertexAttributes",void 0),we=ye=(0,l._)([(0,m.j)(ve)],we);const be={x:(0,y.f)(1,0,0),y:(0,y.f)(0,1,0),z:(0,y.f)(0,0,1)},Ce=(0,C.Ue)(),Ae=(0,C.Ue)(),Te=(0,C.Ue)(),Ze=(0,y.c)(),Me=we;var _e,Fe;!function(e){e.featureGUID="featureGUID",e.assetName="assetName",e.hash="hash",e.type="type",e.conversionStatus="conversionStatus",e.flags="flags",e.complexity="complexity",e.size="size",e.seqNo="seqNo",e.sourceHash="sourceHash",e.assetURL="assetURL"}(_e||(_e={})),function(e){e.SUBMITTED="SUBMITTED",e.INPROGRESS="INPROGRESS",e.FAILED="FAILED",e.COMPLETED="COMPLETED"}(Fe||(Fe={}));var Re,Le,De=n(74889);function Ie(e,t,n){const r=n.features;n.features=[],delete n.geometryType;const o=De.default.fromJSON(n);o.geometryType="mesh";const a=o.spatialReference,l=(0,s.Wi)(e.outFields)||!e.outFields.length?()=>({}):(c=e.outFields.includes("*")?null:new Set(e.outFields),({attributes:e})=>{if(!e)return{};if(!c)return e;for(const t in e)c.has(t)||delete e[t];return e});var c;for(const e of r){const n=Ee(e,a,t);(0,s.pC)(n)&&o.features.push(new i.Z({geometry:n,attributes:l(e)}))}return o}function Ee(e,t,n){const{status:r,source:o}=function(e){if(!e.assetMappings)return{status:Re.FAILED};const t=[],n=new Map;for(const r of e.assetMappings){const e=r[_e.seqNo],o=r[_e.assetName],i=r[_e.assetURL],s=r[_e.conversionStatus];if(s===Fe.FAILED)return{status:Re.FAILED};if(s!==Fe.COMPLETED)return{status:Re.PENDING};if(null==e)t.push({name:o,source:i});else{const r=n.get(o);let s;r?s=r.multipart:(s=[],t.push({name:o,source:{multipart:s}}),n.set(o,{multipart:s})),s[e]=i}}return{status:Re.COMPLETED,source:t}}(e);if(r===Re.FAILED)return null;const i=function({attributes:e},t,{transformFieldRoles:n}){return new w.Z({x:e[n.originX],y:e[n.originY],z:e[n.originZ],spatialReference:t})}(e,t,n),s=a.Z.fromJSON(e.geometry);s.spatialReference=t;const l=function({attributes:e,assetMappings:t},{transformFieldRoles:n}){return new T.Z({translation:[e[n.translationX],e[n.translationY],e[n.translationZ]],rotation:(0,C.uT)([e[n.rotationX],e[n.rotationY],e[n.rotationZ]],e[n.rotationDeg]),scale:[e[n.scaleX],e[n.scaleY],e[n.scaleZ]],geographic:!t[_e.flags]?.includes("PROJECT_VERTICES")})}(e,n);return r===Re.PENDING?Me.createIncomplete(i,{extent:s,transform:l}):Me.createWithExternalSource(i,o,{extent:s,transform:l})}(Le=Re||(Re={}))[Le.FAILED=0]="FAILED",Le[Le.PENDING=1]="PENDING",Le[Le.COMPLETED=2]="COMPLETED"}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8163],{95401:(e,t,n)=>{n.d(t,{e:()=>a});var r,o,i,s={exports:{}};r=s,o=function(){function e(e,n,o){o=o||2;var i,s,a,c,u,p,h,f=n&&n.length,g=f?n[0]*o:e.length,x=t(e,0,g,o,!0),d=[];if(!x||x.next===x.prev)return d;if(f&&(x=l(e,n,x,o)),e.length>80*o){i=a=e[0],s=c=e[1];for(var m=o;m<g;m+=o)(u=e[m])<i&&(i=u),(p=e[m+1])<s&&(s=p),u>a&&(a=u),p>c&&(c=p);h=0!==(h=Math.max(a-i,c-s))?1/h:0}return r(x,d,o,i,s,h),d}function t(e,t,n,r,o){var i,s;if(o===F(e,t,n,r)>0)for(i=t;i<n;i+=r)s=Z(i,e[i],e[i+1],s);else for(i=n-r;i>=t;i-=r)s=Z(i,e[i],e[i+1],s);if(s&&v(s,s.next)){var a=s.next;M(s),s=a}return s}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!v(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{var o=r.prev;if(M(r),(r=t=o)===r.next)break;n=!0}}while(n||r!==t);return t}function r(e,t,l,c,u,p,h){if(e){!h&&p&&f(e,c,u,p);for(var g,x,d=e;e.prev!==e.next;)if(g=e.prev,x=e.next,p?i(e,c,u,p):o(e))t.push(g.i/l),t.push(e.i/l),t.push(x.i/l),M(e),e=x.next,d=x.next;else if((e=x)===d){h?1===h?r(e=s(n(e),t,l),t,l,c,u,p,2):2===h&&a(e,t,l,c,u,p):r(n(e),t,l,c,u,p,1);break}}}function o(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(d(t.x,t.y,n.x,n.y,r.x,r.y,o.x,o.y)&&y(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function i(e,t,n,r){var o=e.prev,i=e,s=e.next;if(y(o,i,s)>=0)return!1;for(var a=o.x<i.x?o.x<s.x?o.x:s.x:i.x<s.x?i.x:s.x,l=o.y<i.y?o.y<s.y?o.y:s.y:i.y<s.y?i.y:s.y,c=o.x>i.x?o.x>s.x?o.x:s.x:i.x>s.x?i.x:s.x,u=o.y>i.y?o.y>s.y?o.y:s.y:i.y>s.y?i.y:s.y,p=g(a,l,t,n,r),h=g(c,u,t,n,r),f=e.prevZ,x=e.nextZ;f&&f.z>=p&&x&&x.z<=h;){if(f!==e.prev&&f!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,x!==e.prev&&x!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,x.x,x.y)&&y(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;f&&f.z>=p;){if(f!==e.prev&&f!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;x&&x.z<=h;){if(x!==e.prev&&x!==e.next&&d(o.x,o.y,i.x,i.y,s.x,s.y,x.x,x.y)&&y(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function s(e,t,r){var o=e;do{var i=o.prev,s=o.next.next;!v(i,s)&&w(i,o,o.next,s)&&A(i,s)&&A(s,i)&&(t.push(i.i/r),t.push(o.i/r),t.push(s.i/r),M(o),M(o.next),o=e=s),o=o.next}while(o!==e);return n(o)}function a(e,t,o,i,s,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=T(l,c);return l=n(l,l.next),u=n(u,u.next),r(l,t,o,i,s,a),void r(u,t,o,i,s,a)}c=c.next}l=l.next}while(l!==e)}function l(e,r,o,i){var s,a,l,u=[];for(s=0,a=r.length;s<a;s++)(l=t(e,r[s]*i,s<a-1?r[s+1]*i:e.length,i,!1))===l.next&&(l.steiner=!0),u.push(x(l));for(u.sort(c),s=0;s<u.length;s++)o=n(o=p(u[s],o),o.next);return o}function c(e,t){return e.x-t.x}function u(e){if(e.next.prev===e)return e;let t=e;for(;;){const n=t.next;if(n.prev===t||n===t||n===e)break;t=n}return t}function p(e,t){var r=function(e,t){var n,r=t,o=e.x,i=e.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>s){if(s=a,a===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(o===s)return n;var l,c=n,u=n.x,p=n.y,f=1/0;r=n;do{o>=r.x&&r.x>=u&&o!==r.x&&d(i<p?o:s,i,u,p,i<p?s:o,i,r.x,r.y)&&(l=Math.abs(i-r.y)/(o-r.x),A(r,e)&&(l<f||l===f&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,f=l)),r=r.next}while(r!==c);return n}(e,t);if(!r)return t;var o=T(r,e),i=n(r,r.next);let s=u(o);return n(s,s.next),i=u(i),u(t===r?i:t)}function h(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function f(e,t,n,r){var o=e;do{null===o.z&&(o.z=g(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,s,a,l,c=1;do{for(n=e,e=null,i=null,s=0;n;){for(s++,r=n,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(o=n,n=n.nextZ,a--):(o=r,r=r.nextZ,l--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,c*=2}while(s>1)}(o)}function g(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*o)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*o)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function d(e,t,n,r,o,i,s,a){return(o-s)*(t-a)-(e-s)*(i-a)>=0&&(e-s)*(r-a)-(n-s)*(t-a)>=0&&(n-s)*(i-a)-(o-s)*(r-a)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&w(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||v(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,n,r){var o=C(y(e,t,n)),i=C(y(e,t,r)),s=C(y(n,r,e)),a=C(y(n,r,t));return o!==i&&s!==a||!(0!==o||!b(e,n,t))||!(0!==i||!b(e,r,t))||!(0!==s||!b(n,e,r))||!(0!==a||!b(n,t,r))}function b(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function C(e){return e>0?1:e<0?-1:0}function A(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function T(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function Z(e,t,n,r){var o=new _(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function M(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function F(e,t,n,r){for(var o=0,i=t,s=n-r;i<n;i+=r)o+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return o}return e.deviation=function(e,t,n,r){var o=t&&t.length,i=o?t[0]*n:e.length,s=Math.abs(F(e,0,i,n));if(o)for(var a=0,l=t.length;a<l;a++){var c=t[a]*n,u=a<l-1?t[a+1]*n:e.length;s-=Math.abs(F(e,c,u,n))}var p=0;for(a=0;a<r.length;a+=3){var h=r[a]*n,f=r[a+1]*n,g=r[a+2]*n;p+=Math.abs((e[h]-e[g])*(e[f+1]-e[h+1])-(e[h]-e[f])*(e[g+1]-e[h+1]))}return 0===s&&0===p?0:Math.abs((p-s)/s)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,o=0;o<e.length;o++){for(var i=0;i<e[o].length;i++)for(var s=0;s<t;s++)n.vertices.push(e[o][i][s]);o>0&&(r+=e[o-1].length,n.holes.push(r))}return n},e},void 0!==(i=o())&&(r.exports=i);const a=s.exports},62540:(e,t,n)=>{n.d(t,{Z:()=>y});var r,o=n(43697),i=n(96674),s=n(22974),a=n(92604),l=n(5600),c=n(90578),u=n(52011),p=n(75215),h=n(65542),f=n(60746),g=n(71630);const x="esri.geometry.support.MeshComponent",d=a.Z.getLogger(x);let m=r=class extends i.wq{constructor(e){super(e),this.faces=null,this.material=null,this.shading="source",this.trustSourceNormals=!1}static from(e){return(0,p.TJ)(r,e)}castFaces(e){return(0,g.X)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},d)}castMaterial(e){return(0,p.TJ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?f.Z:h.Z,e)}clone(){return new r({faces:(0,s.d9)(this.faces),shading:this.shading,material:(0,s.d9)(this.material),trustSourceNormals:this.trustSourceNormals})}cloneWithDeduplication(e,t){const n={faces:(0,s.d9)(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(e,t):null,trustSourceNormals:this.trustSourceNormals};return new r(n)}};(0,o._)([(0,l.Cb)({json:{write:!0}})],m.prototype,"faces",void 0),(0,o._)([(0,c.p)("faces")],m.prototype,"castFaces",null),(0,o._)([(0,l.Cb)({type:h.Z,json:{write:!0}})],m.prototype,"material",void 0),(0,o._)([(0,c.p)("material")],m.prototype,"castMaterial",null),(0,o._)([(0,l.Cb)({type:String,json:{write:!0}})],m.prototype,"shading",void 0),(0,o._)([(0,l.Cb)({type:Boolean})],m.prototype,"trustSourceNormals",void 0),m=r=(0,o._)([(0,u.j)(x)],m);const y=m},65542:(e,t,n)=>{n.d(t,{Z:()=>h});var r,o=n(43697),i=n(22303),s=n(96674),a=n(70586),l=n(5600),c=(n(67676),n(80442),n(75215),n(52011)),u=n(81118);let p=r=class extends s.wq{constructor(e){super(e),this.color=null,this.colorTexture=null,this.normalTexture=null,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const n=(0,a.pC)(e)?e.get(this):null;if(n)return n;const o=new r(this.clonePropertiesWithDeduplication(t));return(0,a.pC)(e)&&e.set(this,o),o}clonePropertiesWithDeduplication(e){return{color:(0,a.pC)(this.color)?this.color.clone():null,colorTexture:(0,a.pC)(this.colorTexture)?this.colorTexture.cloneWithDeduplication(e):null,normalTexture:(0,a.pC)(this.normalTexture)?this.normalTexture.cloneWithDeduplication(e):null,alphaMode:this.alphaMode,alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided,colorTextureTransform:(0,a.pC)(this.colorTextureTransform)?this.colorTextureTransform:null,normalTextureTransform:(0,a.pC)(this.normalTextureTransform)?this.normalTextureTransform:null}}};(0,o._)([(0,l.Cb)({type:i.Z,json:{write:!0}})],p.prototype,"color",void 0),(0,o._)([(0,l.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"colorTexture",void 0),(0,o._)([(0,l.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"normalTexture",void 0),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:!0}})],p.prototype,"alphaMode",void 0),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:!0}})],p.prototype,"alphaCutoff",void 0),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:!0}})],p.prototype,"doubleSided",void 0),(0,o._)([(0,l.Cb)()],p.prototype,"colorTextureTransform",void 0),(0,o._)([(0,l.Cb)()],p.prototype,"normalTextureTransform",void 0),p=r=(0,o._)([(0,c.j)("esri.geometry.support.MeshMaterial")],p);const h=p},60746:(e,t,n)=>{n.d(t,{Z:()=>h});var r,o=n(43697),i=n(22303),s=n(70586),a=n(5600),l=(n(67676),n(80442),n(75215),n(52011)),c=n(65542),u=n(81118);let p=r=class extends c.Z{constructor(e){super(e),this.emissiveColor=null,this.emissiveTexture=null,this.occlusionTexture=null,this.metallic=1,this.roughness=1,this.metallicRoughnessTexture=null}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const n=(0,s.pC)(e)?e.get(this):null;if(n)return n;const o=new r(this.clonePropertiesWithDeduplication(t));return(0,s.pC)(e)&&e.set(this,o),o}clonePropertiesWithDeduplication(e){return{...super.clonePropertiesWithDeduplication(e),emissiveColor:(0,s.pC)(this.emissiveColor)?this.emissiveColor.clone():null,emissiveTexture:(0,s.pC)(this.emissiveTexture)?this.emissiveTexture.cloneWithDeduplication(e):null,occlusionTexture:(0,s.pC)(this.occlusionTexture)?this.occlusionTexture.cloneWithDeduplication(e):null,metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:(0,s.pC)(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.cloneWithDeduplication(e):null,occlusionTextureTransform:(0,s.pC)(this.occlusionTextureTransform)?this.occlusionTextureTransform:null,emissiveTextureTransform:(0,s.pC)(this.emissiveTextureTransform)?this.emissiveTextureTransform:null,metallicRoughnessTextureTransform:(0,s.pC)(this.metallicRoughnessTextureTransform)?this.metallicRoughnessTextureTransform:null}}};(0,o._)([(0,a.Cb)({type:i.Z,json:{write:!0}})],p.prototype,"emissiveColor",void 0),(0,o._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"emissiveTexture",void 0),(0,o._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"occlusionTexture",void 0),(0,o._)([(0,a.Cb)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],p.prototype,"metallic",void 0),(0,o._)([(0,a.Cb)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],p.prototype,"roughness",void 0),(0,o._)([(0,a.Cb)({type:u.Z,json:{write:!0}})],p.prototype,"metallicRoughnessTexture",void 0),(0,o._)([(0,a.Cb)()],p.prototype,"occlusionTextureTransform",void 0),(0,o._)([(0,a.Cb)()],p.prototype,"emissiveTextureTransform",void 0),(0,o._)([(0,a.Cb)()],p.prototype,"metallicRoughnessTextureTransform",void 0),p=r=(0,o._)([(0,l.j)("esri.geometry.support.MeshMaterialMetallicRoughness")],p);const h=p},81118:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(43697),o=(n(80442),n(96674)),i=n(5600),s=(n(67676),n(75215)),a=n(71715),l=n(52011),c=n(30556),u=n(25929);n(22021);let p=null,h=!0;var f;const g=new WeakMap;let x=0,d=f=class extends o.wq{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:(0,u.t)(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const r=e.getContext("2d").getImageData(0,0,e.width,e.height),o={type:"canvas-element",imageData:this._encodeImageData(r)};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:(0,u.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else{const r={type:"image-data",imageData:this._encodeImageData(e)};t[n]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=this._decodeImageData(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return this._decodeImageData(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const e=this.data,t=this.url;if(e instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(e.getContext("2d").getImageData(0,0,e.width,e.height));if(e instanceof ImageData)return this._imageDataContainsTransparent(e);if(t){const e=t.substr(t.length-4,4).toLowerCase(),n=t.substr(0,15).toLocaleLowerCase();if(".png"===e||"data:image/png;"===n)return!0}return!1}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(g.has(this.data)||g.set(this.data,++x),t(g.get(this.data))):t()}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new f(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return"string"==typeof this.wrap?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(e){let t="";for(let n=0;n<e.data.length;n++)t+=String.fromCharCode(e.data[n]);return{data:btoa(t),width:e.width,height:e.height}}_decodeImageData(e){const t=atob(e.data),n=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return function(e,t,n,r){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(h)try{return new ImageData(e,t,n)}catch(e){h=!1}const o=function(e,t,n){return n||(p||(p=document.createElement("canvas"),p.width=1,p.height=1),n=p),n.getContext("2d").createImageData(e,t)}(t,n,void 0);return o.data.set(e,0),o}(n,e.width,e.height)}_imageDataContainsTransparent(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}static from(e){return"string"==typeof e?new f({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new f({data:e}):(0,s.TJ)(f,e)}};(0,r._)([(0,i.Cb)({type:String,json:{write:u.w}})],d.prototype,"url",null),(0,r._)([(0,i.Cb)({json:{write:{overridePolicy(){return{enabled:!this.url}}}}}),(0,i.Cb)()],d.prototype,"data",null),(0,r._)([(0,c.c)("data")],d.prototype,"writeData",null),(0,r._)([(0,a.r)("data")],d.prototype,"readData",null),(0,r._)([(0,i.Cb)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],d.prototype,"transparent",null),(0,r._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"wrap",void 0),(0,r._)([(0,i.Cb)({readOnly:!0})],d.prototype,"contentHash",null),d=f=(0,r._)([(0,l.j)("esri.geometry.support.MeshTexture")],d);const m=d},71630:(e,t,n)=>{n.d(t,{Q:()=>f,X:()=>x});var r,o=n(43697),i=n(96674),s=n(22974),a=n(92604),l=n(5600),c=n(90578),u=n(52011);const p="esri.geometry.support.MeshVertexAttributes",h=a.Z.getLogger(p);let f=r=class extends i.wq{constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return x(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},h)}castPosition(e){return e&&e instanceof Float32Array&&h.warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),x(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},h)}castUv(e){return x(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},h)}castNormal(e){return x(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},h)}castTangent(e){return x(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},h)}clone(){const e={position:(0,s.d9)(this.position),uv:(0,s.d9)(this.uv),normal:(0,s.d9)(this.normal),tangent:(0,s.d9)(this.tangent),color:(0,s.d9)(this.color)};return new r(e)}clonePositional(){const e={position:(0,s.d9)(this.position),normal:(0,s.d9)(this.normal),tangent:(0,s.d9)(this.tangent),uv:this.uv,color:this.color};return new r(e)}};function g(e,t,n,r){const{loggerTag:o,stride:i}=t;return e.length%i!=0?(r.error(o,`Invalid array length, expected a multiple of ${i}`),new n([])):e}function x(e,t,n,r,o){if(!e)return e;if(e instanceof t)return g(e,r,t,o);for(const i of n)if(e instanceof i)return g(new t(e),r,t,o);if(Array.isArray(e))return g(new t(e),r,t,o);{const r=n.map((e=>`'${e.name}'`));return o.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function d(e,t,n){t[n]=function(e){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n];return t}(e)}(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"color",void 0),(0,o._)([(0,c.p)("color")],f.prototype,"castColor",null),(0,o._)([(0,l.Cb)({nonNullable:!0,json:{write:d}})],f.prototype,"position",void 0),(0,o._)([(0,c.p)("position")],f.prototype,"castPosition",null),(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"uv",void 0),(0,o._)([(0,c.p)("uv")],f.prototype,"castUv",null),(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"normal",void 0),(0,o._)([(0,c.p)("normal")],f.prototype,"castNormal",null),(0,o._)([(0,l.Cb)({json:{write:d}})],f.prototype,"tangent",void 0),(0,o._)([(0,c.p)("tangent")],f.prototype,"castTangent",null),f=r=(0,o._)([(0,u.j)(p)],f)},47545:(e,t,n)=>{n.d(t,{d:()=>o});var r=n(22021);function o(e,t,n){const o=e.byteLength/(4*t),c=new Uint32Array(e,0,o*t);let u=new Uint32Array(o);const p=n?.minReduction??0,h=n?.originalIndices||null,f=h?h.length:0,g=n?.componentOffsets||null;let x=0;if(g)for(let e=0;e<g.length-1;e++){const t=g[e+1]-g[e];t>x&&(x=t)}else x=o;const d=Math.floor(1.1*x)+1;(null==l||l.length<2*d)&&(l=new Uint32Array((0,r.Sf)(2*d)));for(let e=0;e<2*d;e++)l[e]=0;let m=0;const y=!!g&&!!h,v=y?f:o,w=y?new Uint32Array(f):null,b=1.96;let C=0!==p?Math.ceil(4*b*b/(p*p)*p*(1-p)):v,A=1,T=g?g[1]:v;for(let e=0;e<v;e++){if(e===C){const t=1-m/e;if(t+b*Math.sqrt(t*(1-t)/e)<p)return null;C*=2}if(e===T){for(let e=0;e<2*d;e++)l[e]=0;if(h)for(let e=g[A-1];e<g[A];e++)w[e]=u[h[e]];T=g[++A]}const n=y?h[e]:e,r=n*t,o=a(c,r,t);let s=o%d,f=m;for(;0!==l[2*s+1];){if(l[2*s]===o){const e=l[2*s+1]-1;if(i(c,r,e*t,t)){f=u[e];break}}s++,s>=d&&(s-=d)}f===m&&(l[2*s]=o,l[2*s+1]=n+1,m++),u[n]=f}if(0!==p&&1-m/o<p)return null;if(y){for(let e=g[A-1];e<w.length;e++)w[e]=u[h[e]];u=w}const Z=new Uint32Array(t*m);m=0;for(let e=0;e<v;e++)u[e]===m&&(s(c,(y?h[e]:e)*t,Z,m*t,t),m++);if(h&&!y){const e=new Uint32Array(f);for(let t=0;t<e.length;t++)e[t]=u[h[t]];u=e}return{buffer:Z.buffer,indices:u,uniqueCount:m}}function i(e,t,n,r){for(let o=0;o<r;o++)if(e[t+o]!==e[n+o])return!1;return!0}function s(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}function a(e,t,n){let r=0;for(let o=0;o<n;o++)r=e[t+o]+r|0,r=r+(r<<11)+(r>>>2)|0;return r>>>0}let l=null},38163:(e,t,n)=>{n.r(t),n.d(t,{meshFeatureSetFromJSON:()=>Ie});var r,o,i=n(38171),s=n(70586),a=n(6570),l=n(43697),c=n(20102),u=n(3920),p=n(83379),h=n(92604),f=n(609),g=n(95330),x=n(17445),d=n(5600),m=(n(67676),n(80442),n(75215),n(52011)),y=n(65617),v=n(9361),w=n(94139),b=n(38913),C=n(3709),A=n(62540),T=n(2674),Z=n(71630),M=n(95401),_=n(86662),F=n(47545);function R(e,t,n){const o=e.length,i=new Array(o),s=new Array(o),a=new Array(o);let l=0,c=0,u=0,p=0;for(let t=0;t<o;++t)p+=e[t].length;const h=new Float64Array(3*p);let f=0;for(let p=o-1;p>=0;p--){const g=e[p],x=n===r.CCW_IS_HOLE&&D(g);if(x&&1!==o)i[l++]=g;else{let e=g.length;for(let t=0;t<l;++t)e+=i[t].length;const n={index:f,pathLengths:new Array(l+1),count:e,holeIndices:new Array(l)};n.pathLengths[0]=g.length,g.length>0&&(a[u++]={index:f,count:g.length}),f=x?L(g,g.length-1,-1,h,f,g.length,t):L(g,0,1,h,f,g.length,t);for(let e=0;e<l;++e){const r=i[e];n.holeIndices[e]=f,n.pathLengths[e+1]=r.length,r.length>0&&(a[u++]={index:f,count:r.length}),f=L(r,0,1,h,f,r.length,t)}l=0,n.count>0&&(s[c++]=n)}}for(let e=0;e<l;++e){const n=i[e];n.length>0&&(a[u++]={index:f,count:n.length}),f=L(n,0,1,h,f,n.length,t)}return c<o&&(s.length=c),u<o&&(a.length=u),{position:h,polygons:s,outlines:a}}function L(e,t,n,r,o,i,s){o*=3;for(let a=0;a<i;++a){const i=e[t];r[o++]=i[0],r[o++]=i[1],r[o++]=s?i[2]:0,t+=n}return o/3}function D(e){return!(0,_.bu)(e,!1,!1)}(o=r||(r={}))[o.NONE=0]="NONE",o[o.CCW_IS_HOLE=1]="CCW_IS_HOLE";var I=n(44547),E=n(13442),O=n(66459);const P=h.Z.getLogger("esri.geometry.support.meshUtils.centerAt");const S=(0,y.c)(),j=(0,y.c)();var z=n(17452);function N(e){const t=(0,z.Yd)(e.url);return n=>{const r=(0,z.PF)(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return e.files.get(o)??n}}async function U(e,t){return e instanceof Blob?W.fromBlob(e):"string"==typeof e?new W(e):Array.isArray(e)?async function(e,t){const n=new Map;let r=null;const o=await(0,g.WW)(e.map((async e=>({name:e.name,source:await U(e instanceof Blob?e:e.source,t)})))),i=[];for(const e of o)e&&((0,g.Hc)(t)?e.source.dispose():i.push(e));(0,g.k_)(t);for(const{name:e,source:t}of i)((0,s.Wi)(r)||/\.(gltf|glb)/i.test(e))&&(r=t.url),n.set(e,t.url),t.files&&t.files.forEach(((e,t)=>n.set(t,e)));if((0,s.Wi)(r))throw new c.Z("mesh-load-external:missing-files","Missing files to load external mesh source");return new W(r,(()=>i.forEach((({source:e})=>e.dispose()))),n)}(e,t):async function(e,t){const{default:r}=await(0,g.Hl)(Promise.resolve().then(n.bind(n,3172)),t),o="string"==typeof e.multipart[0]?await Promise.all(e.multipart.map((async e=>(await r(e,{responseType:"array-buffer"})).data))):e.multipart;return W.fromBlob(new Blob(o))}(e,t)}class W{constructor(e,t=(()=>{}),n=new Map){this.url=e,this.dispose=t,this.files=n}static fromBlob(e){const t=URL.createObjectURL(e);return new W(t,(()=>URL.revokeObjectURL(t)))}}var k=n(21787),$=n(46521),H=n(13598),B=n(17896),G=n(24678),q=n(56493);function Y(e,t){if(e)for(let n=0;n<e.length;n+=3)for(let r=0;r<3;r++)e[n+r]+=t[r]}const X=(0,y.c)(),K=(0,H.c)(),J=(0,$.c)(),V={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function Q(e,t,n){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null==t)return;const n="number"==typeof t?[t,t,t]:[null!=t.width?t.width:1,null!=t.depth?t.depth:1,null!=t.height?t.height:1];re[0]=n[0],re[4]=n[1],re[8]=n[2];for(let t=0;t<e.position.length;t+=3){for(let n=0;n<3;n++)ne[n]=e.position[t+n];(0,B.t)(ne,ne,re);for(let n=0;n<3;n++)e.position[t+n]=ne[n]}if(n[0]!==n[1]||n[1]!==n[2]){re[0]=1/n[0],re[4]=1/n[1],re[8]=1/n[2];for(let t=0;t<e.normal.length;t+=3){for(let n=0;n<3;n++)ne[n]=e.normal[t+n];(0,B.t)(ne,ne,re),(0,B.n)(ne,ne);for(let n=0;n<3;n++)e.normal[t+n]=ne[n]}}}(e,n?.size);const{vertexAttributes:r,transform:o}=(0,O.w1)(e,t,n);return{vertexAttributes:new Z.Q({...r,uv:e.uv}),transform:o,components:[new A.Z({faces:e.faces,material:n&&n.material||null})],spatialReference:t.spatialReference}}const ee={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},te={south:0,east:1,north:2,west:3,up:4,down:5},ne=(0,y.c)(),re=(0,$.c)();var oe=n(52138);const ie=h.Z.getLogger("esri.geometry.support.meshUtils.rotate");function se(e,t,n,r=y.Z){if(!(0,s.Wi)(e)){(0,oe.d)(ue,(0,C.WH)(t),(0,C.ZZ)(t));for(let t=0;t<e.length;t+=n){for(let n=0;n<3;n++)ae[n]=e[t+n]-r[n];(0,B.m)(ae,ae,ue);for(let n=0;n<3;n++)e[t+n]=ae[n]+r[n]}}}const ae=(0,y.c)(),le=(0,y.c)(),ce=(0,C.Ue)(),ue=(0,H.c)(),pe=(0,$.c)(),he=(0,y.c)(),fe=h.Z.getLogger("esri.geometry.support.meshUtils.scale");function ge(e,t,n=y.Z){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)xe[t]=e[r+t]-n[t];(0,B.g)(xe,xe,t);for(let t=0;t<3;t++)e[r+t]=xe[t]+n[t]}}const xe=(0,y.c)(),de=(0,y.c)(),me=(0,y.c)();var ye;const ve="esri.geometry.Mesh";let we=ye=class extends((0,u.p)(p.Z.LoadableMixin((0,f.v)(v.Z)))){constructor(e){super(e),this.components=null,this.transform=null,this.external=null,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new Z.Q,this.type="mesh"}initialize(){((0,s.Wi)(this.external)||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add((0,x.YP)((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone())),transform:(0,s.pC)(this.transform)?this.transform.clone():null})),(()=>this._set("external",null)),{once:!0,sync:!0}))}))}get hasExtent(){return!this.loaded&&(0,s.pC)(this.external)&&(0,s.pC)(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const e=this.vertexAttributes.position,t=this.spatialReference;if(0===e.length||this.components&&0===this.components.length)return{extent:new a.Z({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t}),center:new w.Z({x:0,y:0,z:0,spatialReference:t})};const n=(0,s.pC)(this.transform)?this.transform.project(e,t):e;let r=1/0,o=1/0,i=1/0,l=-1/0,c=-1/0,u=-1/0,p=0,h=0,f=0;const g=n.length,x=1/(g/3);let d=0;for(;d<g;){const e=n[d++],t=n[d++],s=n[d++];r=Math.min(r,e),o=Math.min(o,t),i=Math.min(i,s),l=Math.max(l,e),c=Math.max(c,t),u=Math.max(u,s),p+=x*e,h+=x*t,f+=x*s}return{extent:new a.Z({xmin:r,ymin:o,zmin:i,xmax:l,ymax:c,zmax:u,spatialReference:t}),center:new w.Z({x:p,y:h,z:f,spatialReference:t})}}get anchor(){if((0,s.pC)(this.transform))return this.transform.getOriginPoint(this.spatialReference);const e=this._boundingInfo;return new w.Z({x:e.center.x,y:e.center.y,z:e.extent.zmin,spatialReference:this.spatialReference})}get origin(){return(0,s.pC)(this.transform)?this.transform.getOriginPoint(this.spatialReference):this._boundingInfo.center}get extent(){return!this.loaded&&(0,s.pC)(this.external)&&(0,s.pC)(this.external.extent)?this.external.extent.clone():this._boundingInfo.extent}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(A.Z.from(e)),this.notifyChange("components")):h.Z.getLogger(this.declaredClass).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}h.Z.getLogger(this.declaredClass).error("removeComponent()","Provided component is not part of the list of components")}else h.Z.getLogger(this.declaredClass).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,n,r){return(0,C.uT)(be.x,e,Ce),(0,C.uT)(be.y,t,Ae),(0,C.uT)(be.z,n,Te),(0,C.qC)(Ce,Ae,Ce),(0,C.qC)(Ce,Te,Ce),function(e,t,n){if(!e.vertexAttributes||!e.vertexAttributes.position||0===t[3])return;const r=e.spatialReference;if((0,s.pC)(e.transform)){null!=n?.geographic&&n.geographic!==e.transform.geographic&&ie.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`);const o=n?.origin??e.transform.getOriginPoint(r);!function(e,t,n){const r=(0,B.s)(ae,n.x,n.y,n.z),o=(0,B.b)(ae,r,e.origin);e.applyLocalInverse(o,le),e.rotation=(0,C.qC)(e.rotation,t,(0,C.Ue)()),e.applyLocalInverse(o,o),(0,B.b)(o,o,le),e.translation=(0,B.a)((0,y.c)(),e.translation,o)}(e.transform,t,o)}else{const r=n?.origin??e.origin;(0,E.h)(e.spatialReference,n)?function(e,t,n){const r=e.spatialReference,o=(0,G.rS)(r),i=he;(0,I.KC)(n,i,o)||(0,I.KC)(e.origin,i,o);const a=e.vertexAttributes.position,l=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,u=new Float64Array(a.length),p=(0,s.pC)(l)?new Float32Array(l.length):null,h=(0,s.pC)(c)?new Float32Array(c.length):null;(0,I.Bm)(o,i,ue,o),(0,k.f)(pe,ue);const f=ce;(0,B.t)((0,C.ZZ)(ce),(0,C.ZZ)(t),pe),f[3]=t[3],(0,q.XO)(a,r,u),(0,s.pC)(l)&&(0,q.Iz)(l,a,u,r,p),(0,s.pC)(c)&&(0,q.wi)(c,a,u,r,h),se(u,f,3,i),(0,q.To)(u,a,r),(0,s.pC)(l)&&(se(p,f,3),(0,q.Yk)(p,a,u,r,l)),(0,s.pC)(c)&&(se(h,f,4),(0,q.M2)(h,a,u,r,c)),e.vertexAttributesChanged()}(e,t,r):function(e,t,n){const r=he;if(!(0,I.KC)(n,r,e.spatialReference)){const t=e.origin;r[0]=t.x,r[1]=t.y,r[2]=t.z,ie.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid}).`)}se(e.vertexAttributes.position,t,3,r),se(e.vertexAttributes.normal,t,3),se(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,r)}}(this,Ce,r),this}offset(e,t,n,r){return this.loaded?(Ze[0]=e,Ze[1]=t,Ze[2]=n,function(e,t,n){var r,o;e.vertexAttributes&&e.vertexAttributes.position&&((0,s.pC)(e.transform)?(null!=n?.geographic&&n.geographic!==e.transform.geographic&&h.Z.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`),function(e,t){const n=e.origin;e.origin=(0,B.a)((0,y.c)(),n,t)}(e.transform,t)):(0,E.h)(e.spatialReference,n)?function(e,t){const n=e.spatialReference,r=e.vertexAttributes.position,o=e.vertexAttributes.normal,i=e.vertexAttributes.tangent,a=new Float64Array(r.length),l=(0,s.pC)(o)?new Float32Array(o.length):null,c=(0,s.pC)(i)?new Float32Array(i.length):null,u=e.extent.center,p=X;(0,I.Bm)(n,[u.x,u.y,u.z],K,(0,G.rS)(n)),(0,k.f)(J,K),(0,B.t)(p,t,J),(0,q.XO)(r,n,a),(0,s.pC)(o)&&(0,q.Iz)(o,r,a,n,l),(0,s.pC)(i)&&(0,q.wi)(i,r,a,n,c),Y(a,p),(0,q.To)(a,r,n),(0,s.pC)(o)&&(0,q.Yk)(l,r,a,n,o),(0,s.pC)(i)&&(0,q.M2)(c,r,a,n,i),e.vertexAttributesChanged()}(e,t):(o=t,Y((r=e).vertexAttributes.position,o),r.vertexAttributesChanged()))}(this,Ze,r),this):(h.Z.getLogger(this.declaredClass).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(function(e,t,n){if(!e.vertexAttributes||!e.vertexAttributes.position)return;const r=e.spatialReference;if((0,s.pC)(e.transform)){null!=n?.geographic&&n.geographic!==e.transform.geographic&&fe.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`);const o=n?.origin??e.transform.getOriginPoint(r);!function(e,t,n){const r=(0,B.s)(xe,n.x,n.y,n.z),o=(0,B.b)(xe,r,e.origin);e.applyLocalInverse(o,de);const i=(0,B.g)((0,y.c)(),e.scale,t);e.scale=i,e.applyLocalInverse(o,o),(0,B.b)(o,o,de),e.translation=(0,B.a)((0,y.c)(),e.translation,o)}(e.transform,t,o)}else{const r=(0,E.h)(e.spatialReference,n),o=n&&n.origin||e.origin;r?function(e,t,n){const r=e.spatialReference,o=(0,G.rS)(r),i=me;(0,I.KC)(n,i,o)||(0,I.KC)(e.origin,i,o);const a=e.vertexAttributes.position,l=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,u=new Float64Array(a.length),p=(0,s.pC)(l)?new Float32Array(l.length):null,h=(0,s.pC)(c)?new Float32Array(c.length):null;(0,q.XO)(a,r,u),(0,s.pC)(l)&&(0,q.Iz)(l,a,u,r,p),(0,s.pC)(c)&&(0,q.wi)(c,a,u,r,h),ge(u,t,i),(0,q.To)(u,a,r),(0,s.pC)(l)&&(0,q.Yk)(p,a,u,r,l),(0,s.pC)(c)&&(0,q.M2)(h,a,u,r,c),e.vertexAttributesChanged()}(e,t,o):function(e,t,n){const r=me;if(!(0,I.KC)(n,r,e.spatialReference)){const t=e.origin;r[0]=t.x,r[1]=t.y,r[2]=t.z,fe.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid}).`)}ge(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,o)}}(this,e,t),this):(h.Z.getLogger(this.declaredClass).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(function(e,t,n){if(!e.vertexAttributes||!e.vertexAttributes.position)return;const r=n?.origin??e.origin;(0,s.pC)(e.transform)?(null!=n?.geographic&&n.geographic!==e.transform.geographic&&P.warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`),function(e,t,n){const r=t.x-n.x,o=t.y-n.y,i=t.hasZ&&n.hasZ?t.z-n.z:0,s=e.origin;e.origin=[s[0]+r,s[1]+o,s[2]+i]}(e.transform,t,r)):(0,E.h)(e.spatialReference,n)?function(e,t,n){const r=(0,O.FF)(e.vertexAttributes,n,{geographic:!0}),{position:o,normal:i,tangent:s}=(0,O.iv)(r,t,{geographic:!0});e.vertexAttributes.position=o,e.vertexAttributes.normal=i,e.vertexAttributes.tangent=s,e.vertexAttributesChanged()}(e,t,r):function(e,t,n){const r=j,o=S;if((0,I.KC)(t,o,e.spatialReference)){if(!(0,I.KC)(n,r,e.spatialReference)){const t=e.origin;r[0]=t.x,r[1]=t.y,r[2]=t.z,P.error(`Failed to project specified origin (wkid:${n.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid}).`)}(function(e,t,n){if(e)for(let r=0;r<e.length;r+=3)for(let o=0;o<3;o++)e[r+o]+=t[o]-n[o]})(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else P.error(`Failed to project centerAt location (wkid:${t.spatialReference.wkid}) to mesh spatial reference (wkid:${e.spatialReference.wkid})`)}(e,t,r)}(this,e,t),this):(h.Z.getLogger(this.declaredClass).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){return(0,s.pC)(this.external)&&this.addResolvingPromise(async function(e,t,r){const{loadGLTFMesh:o}=await(0,g.Hl)(Promise.all([n.e(2631),n.e(2133),n.e(9070)]).then(n.bind(n,99070)),r),i=await U(t,r),a=o(new w.Z({x:0,y:0,z:0,spatialReference:e.spatialReference}),i.url,{resolveFile:N(i),useTransform:!0,signal:(0,s.pC)(r)?r.signal:null});a.then((()=>i.dispose()),(()=>i.dispose()));const{vertexAttributes:l,components:c}=await a;e.vertexAttributes=l,e.components=c}(this,this.external.source,e)),Promise.resolve(this)}clone(){let e=null;if(this.components){const t=new Map,n=new Map;e=this.components.map((e=>e.cloneWithDeduplication(t,n)))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:(0,s.pC)(this.transform)?this.transform.clone():null,external:(0,s.pC)(this.external)?{source:this.external.source,extent:(0,s.pC)(this.external.extent)?this.external.extent.clone():null}:null};return new ye(t)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const{toBinaryGLTF:t}=await n.e(7277).then(n.bind(n,7277));return t(this,e)}static createBox(e,t){if(!(e instanceof w.Z))return h.Z.getLogger(ve).error(".createBox()","expected location to be a Point instance"),null;const n=new ye(Q(function(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=ee,r=4*e.length,o=new Float64Array(3*r),i=new Float32Array(3*r),s=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,u=0,p=0;for(let r=0;r<e.length;r++){const h=e[r],f=l/3;for(const e of t)a[p++]=f+e;const g=h.corners;for(let e=0;e<4;e++){const t=g[e];let r=0;s[u++]=.25*n[e][0]+h.uvOrigin[0],s[u++]=h.uvOrigin[1]-.25*n[e][1];for(let e=0;e<3;e++)0!==h.axis[e]?(o[l++]=.5*h.axis[e],i[c++]=h.axis[e]):(o[l++]=.5*t[r++],i[c++]=0)}}return{position:o,normal:i,uv:s,faces:a}}(),e,t));return t&&t.imageFace&&"all"!==t.imageFace?function(e,t){const n=e.components[0],r=n.faces,o=te[t],i=6*o,a=new Uint32Array(6),l=new Uint32Array(r.length-6);let c=0,u=0;for(let e=0;e<r.length;e++)e>=i&&e<i+6?a[c++]=r[e]:l[u++]=r[e];if((0,s.pC)(e.vertexAttributes.uv)){const t=new Float32Array(e.vertexAttributes.uv),n=4*o*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[n+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new A.Z({faces:a,material:n.material}),new A.Z({faces:l})],e}(n,t.imageFace):n}static createSphere(e,t){return e instanceof w.Z?new ye(Q(function(e=0){const t=Math.round(8*2**e),n=2*t,r=(t-1)*(n+1)+2*n,o=new Float64Array(3*r),i=new Float32Array(3*r),s=new Float32Array(2*r),a=new Uint32Array((t-1)*n*2*3);let l=0,c=0,u=0,p=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,h=Math.cos(r),f=Math.sin(r);ne[2]=f;const g=0===e||e===t,x=g?n-1:n;for(let r=0;r<=x;r++){const f=r/x*2*Math.PI;ne[0]=-Math.sin(f)*h,ne[1]=Math.cos(f)*h;for(let e=0;e<3;e++)o[l]=.5*ne[e],i[l]=ne[e],++l;s[c++]=(r+(g?.5:0))/n,s[c++]=e/t,0!==e&&r!==n&&(e!==t&&(a[u++]=p,a[u++]=p+1,a[u++]=p-n),1!==e&&(a[u++]=p,a[u++]=p-n,a[u++]=p-n-1)),p++}}return{position:o,normal:i,uv:s,faces:a}}(t&&t.densificationFactor||0),e,t)):(h.Z.getLogger(ve).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof w.Z?new ye(Q(function(e=0){const t=Math.round(16*2**e),n=4*(t+1)+2*t,r=new Float64Array(3*n),o=new Float32Array(3*n),i=new Float32Array(2*n),s=new Uint32Array(4*t*3);let a=0,l=0,c=0,u=0,p=0;for(let e=0;e<=5;e++){const n=0===e||5===e,h=e<=1||e>=4,f=2===e||4===e,g=n?t-1:t;for(let x=0;x<=g;x++){const d=x/g*2*Math.PI,m=n?0:.5;ne[0]=m*Math.sin(d),ne[1]=m*-Math.cos(d),ne[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=ne[t],o[l++]=h?2===t?e<=1?1:-1:0:2===t?0:ne[t]/m;i[c++]=(x+(n?.5:0))/t,i[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,f||0===e||x===t||(5!==e&&(s[u++]=p,s[u++]=p+1,s[u++]=p-t),1!==e&&(s[u++]=p,s[u++]=p-t,s[u++]=p-t-1)),p++}}return{position:r,normal:o,uv:i,faces:s}}(t&&t.densificationFactor||0),e,t)):(h.Z.getLogger(ve).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){if(!(e instanceof w.Z))return h.Z.getLogger(ve).error(".createPlane()","expected location to be a Point instance"),null;const n=t?.facing??"up",r=function(e,t){const n="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}(n,t?.size);return new ye(Q(function(e){const t=V.facingAxisOrderSwap[e],n=V.position,r=V.normal,o=new Float64Array(n.length),i=new Float32Array(r.length);let s=0;for(let e=0;e<4;e++){const e=s;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,u=l>=0?1:-1;o[s]=n[e+c]*u,i[s]=r[e+c]*u,s++}}return{position:o,normal:i,uv:new Float32Array(V.uv),faces:new Uint32Array(V.faces),isPlane:!0}}(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof b.Z))return h.Z.getLogger(ve).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const n=function(e){const t=R(e.rings,e.hasZ,r.CCW_IS_HOLE),n=[];let o=0,i=0;for(const e of t.polygons){const r=e.count,s=e.index,a=new Float64Array(t.position.buffer,3*s*t.position.BYTES_PER_ELEMENT,3*r),l=e.holeIndices.map((e=>e-s)),c=new Uint32Array((0,M.e)(a,l,3));n.push({position:a,faces:c}),o+=a.length,i+=c.length}const s=function(e,t,n){if(1===e.length)return e[0];const r=new Float64Array(t),o=new Uint32Array(n);let i=0,s=0,a=0;for(const t of e){for(let e=0;e<t.position.length;e++)r[i++]=t.position[e];for(let e=0;e<t.faces.length;e++)o[s++]=t.faces[e]+a;a=i/3}return{position:r,faces:o}}(n,o,i),a=(0,F.d)(s.position.buffer,6,{originalIndices:s.faces});return s.position=new Float64Array(a.buffer),s.faces=a.indices,s}(e);return new ye({vertexAttributes:new Z.Q({position:n.position}),components:[new A.Z({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference})}static async createFromGLTF(e,t,r){if(!(e instanceof w.Z))throw h.Z.getLogger(ve).error(".createfromGLTF()","expected location to be a Point instance"),new c.Z("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:o}=await(0,g.Hl)(Promise.all([n.e(2631),n.e(2133),n.e(9070)]).then(n.bind(n,99070)),r);return new ye(await o(e,t,r))}static createWithExternalSource(e,t,n){const r=n?.extent??null,o=n?.transform?.clone()??new T.Z;o.origin=[e.x,e.y,e.z??0];const i=e.spatialReference;return new ye({external:{source:t,extent:r},transform:o,spatialReference:i})}static createIncomplete(e,t){const n=t?.transform?.clone()??new T.Z;n.origin=[e.x,e.y,e.z??0];const r=e.spatialReference,o=new ye({transform:n,spatialReference:r});return o.addResolvingPromise(Promise.reject(new c.Z("mesh-incomplete","Mesh resources are not complete"))),o}};(0,l._)([(0,d.Cb)({type:[A.Z],json:{write:!0}})],we.prototype,"components",void 0),(0,l._)([(0,d.Cb)({type:T.Z,json:{write:!0}})],we.prototype,"transform",void 0),(0,l._)([(0,d.Cb)({constructOnly:!0})],we.prototype,"external",void 0),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"hasExtent",null),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"_boundingInfo",null),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"anchor",null),(0,l._)([(0,d.Cb)({readOnly:!0})],we.prototype,"origin",null),(0,l._)([(0,d.Cb)({readOnly:!0,json:{read:!1}})],we.prototype,"extent",null),(0,l._)([(0,d.Cb)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],we.prototype,"hasZ",void 0),(0,l._)([(0,d.Cb)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],we.prototype,"hasM",void 0),(0,l._)([(0,d.Cb)({type:Z.Q,nonNullable:!0,json:{write:!0}})],we.prototype,"vertexAttributes",void 0),we=ye=(0,l._)([(0,m.j)(ve)],we);const be={x:(0,y.f)(1,0,0),y:(0,y.f)(0,1,0),z:(0,y.f)(0,0,1)},Ce=(0,C.Ue)(),Ae=(0,C.Ue)(),Te=(0,C.Ue)(),Ze=(0,y.c)(),Me=we;var _e,Fe;!function(e){e.featureGUID="featureGUID",e.assetName="assetName",e.hash="hash",e.type="type",e.conversionStatus="conversionStatus",e.flags="flags",e.complexity="complexity",e.size="size",e.seqNo="seqNo",e.sourceHash="sourceHash",e.assetURL="assetURL"}(_e||(_e={})),function(e){e.SUBMITTED="SUBMITTED",e.INPROGRESS="INPROGRESS",e.FAILED="FAILED",e.COMPLETED="COMPLETED"}(Fe||(Fe={}));var Re,Le,De=n(74889);function Ie(e,t,n){const r=n.features;n.features=[],delete n.geometryType;const o=De.default.fromJSON(n);o.geometryType="mesh";const a=o.spatialReference,l=(0,s.Wi)(e.outFields)||!e.outFields.length?()=>({}):(c=e.outFields.includes("*")?null:new Set(e.outFields),({attributes:e})=>{if(!e)return{};if(!c)return e;for(const t in e)c.has(t)||delete e[t];return e});var c;for(const e of r){const n=Ee(e,a,t);(0,s.pC)(n)&&o.features.push(new i.Z({geometry:n,attributes:l(e)}))}return o}function Ee(e,t,n){const{status:r,source:o}=function(e){if(!e.assetMappings)return{status:Re.FAILED};const t=[],n=new Map;for(const r of e.assetMappings){const e=r[_e.seqNo],o=r[_e.assetName],i=r[_e.assetURL],s=r[_e.conversionStatus];if(s===Fe.FAILED)return{status:Re.FAILED};if(s!==Fe.COMPLETED)return{status:Re.PENDING};if(null==e)t.push({name:o,source:i});else{const r=n.get(o);let s;r?s=r.multipart:(s=[],t.push({name:o,source:{multipart:s}}),n.set(o,{multipart:s})),s[e]=i}}return{status:Re.COMPLETED,source:t}}(e);if(r===Re.FAILED)return null;const i=function({attributes:e},t,{transformFieldRoles:n}){return new w.Z({x:e[n.originX],y:e[n.originY],z:e[n.originZ],spatialReference:t})}(e,t,n),s=a.Z.fromJSON(e.geometry);s.spatialReference=t;const l=function({attributes:e,assetMappings:t},{transformFieldRoles:n}){return new T.Z({translation:[e[n.translationX],e[n.translationY],e[n.translationZ]],rotation:(0,C.uT)([e[n.rotationX],e[n.rotationY],e[n.rotationZ]],e[n.rotationDeg]),scale:[e[n.scaleX],e[n.scaleY],e[n.scaleZ]],geographic:!t[_e.flags]?.includes("PROJECT_VERTICES")})}(e,n);return r===Re.PENDING?Me.createIncomplete(i,{extent:s,transform:l}):Me.createWithExternalSource(i,o,{extent:s,transform:l})}(Le=Re||(Re={}))[Le.FAILED=0]="FAILED",Le[Le.PENDING=1]="PENDING",Le[Le.COMPLETED=2]="COMPLETED"}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6920],{53073:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(75148),s=n(91136),a=n(90961),i=n(90658),l=n(8667);class o extends s.Z{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new a.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===i.dj.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?i.dj.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(null===e.geometry)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":{const t=(0,i.SV)(this._relationGeom),n=(0,i.SV)(e.geometry);return(0,l.kK)(t,n)}case"esriSpatialRelIntersects":return(0,l.kK)(this._relationGeom,e.geometry);case"esriSpatialRelContains":return(0,l.r3)(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return(0,l.Nm)(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return(0,l.uh)(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return(0,l.W4)(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return(0,l.jU)(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return(0,l.LV)(this._relationGeom,e.geometry,this._relationString)}}async _fetchAndRefineFeatures(e,t,n){const r=new a.Z([],e,!1,null),s=Math.min(t,e.length);await this._parent._getFeatures(r,-1,s,n),this._checkCancelled(n);const l=[];for(let t=0;t<s;t++){const n=this._parent._featureFromCache(e[t]);l.push(await this.executeSpatialRelationTest(n))}for(let n=0;n<t;n++)!0===l[n]?this._idstates[e[n]]=i.dj.InFeatureSet:this._idstates[e[n]]=i.dj.NotInFeatureSet;return"success"}async _getFilteredSet(e,t,n,r,s){await this._ensureLoaded();const i=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,n,r,s);let l;return this._checkCancelled(s),l=null!==t?new a.Z(i._candidates.slice(0).concat(i._known.slice(0)),[],i._ordered,this._clonePageDefinition(i.pagesDefinition)):new a.Z(i._candidates.slice(0),i._known.slice(0),i._ordered,this._clonePageDefinition(i.pagesDefinition)),l}async _stat(e,t,n,r,s,a,i){if(""!==n)return{calculated:!1};const l=await this._parent._stat(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s,a,i);return!1===l.calculated?null===s&&""===n&&null===r?this._manualStat(e,t,a,i):{calculated:!1}:l}async _canDoAggregates(e,t,n,r,s){return""===n&&null===r&&null!==this._parent&&this._parent._canDoAggregates(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,a,i){if(null===this._parent)throw new Error("Should never be called");return this._parent._getAggregatePagesDataSourceDefinition(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s,a,i)}static registerAction(){s.Z._featuresetFunctions.intersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelIntersects",relationGeom:e})},s.Z._featuresetFunctions.envelopeIntersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelEnvelopeIntersects",relationGeom:e})},s.Z._featuresetFunctions.contains=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelContains",relationGeom:e})},s.Z._featuresetFunctions.overlaps=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelOverlaps",relationGeom:e})},s.Z._featuresetFunctions.within=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelWithin",relationGeom:e})},s.Z._featuresetFunctions.touches=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelTouches",relationGeom:e})},s.Z._featuresetFunctions.crosses=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelCrosses",relationGeom:e})},s.Z._featuresetFunctions.relate=function(e,t){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelRelation",relationGeom:e,relationString:t})}}}},75148:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(91136),s=n(90961),a=n(90658);class i extends r.Z{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new s.Z([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=a.Bj.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return a.dj.NotInFeatureSet}async _getFeature(){throw new Error("No Feature Found in EmptySet")}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new Error("Fetch and Refine should not be called in this featureset")}async _getFilteredSet(){return new s.Z([],[],!1,null)}_stat(e,t,n,r,s,a,i){return this._manualStat(e,t,a,i)}async _canDoAggregates(){return!1}}},91136:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(48039);class s{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}nextBatch(e){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((t=>this.nextBatch(e)),(t=>this.nextBatch(e)));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise(((r,s)=>{this._parent._getSet(this._progress).then((a=>{let i=a._known.length-1;if("GETPAGES"===a._known[a._known.length-1]&&(i-=1),this._lastId+e>i&&a._known.length>0&&"GETPAGES"===a._known[a._known.length-1])this._parent._expandPagedSet(a,this._parent._maxQueryRate(),0,0,this._progress).then((n=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,s)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}));else{if(i>=this._lastId+e||0===a._candidates.length){for(let t=0;t<e;t++){const e=t+this._lastId+1;if(e>=a._known.length)break;n[t]=a._known[e]}return this._lastId+=n.length,0===n.length&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then((e=>{t.hasset=!0,this._parent._mainSetInUse=null,r(e)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))}this._parent._refineSetBlock(a,this._parent._maxProcessingRate(),this._progress).then((()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,s)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))}}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))})),!1===t.hasset&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((e=>this.next()),(e=>this.next()));const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise(((t,n)=>{this._parent._getSet(this._progress).then((r=>{this._lastId<r._known.length-1?"GETPAGES"===r._known[this._lastId+1]?this._parent._expandPagedSet(r,this._parent._maxQueryRate(),0,0,this._progress).then((t=>(e.hasset=!0,this._parent._mainSetInUse=null,this.next()))).then(t,n):(this._lastId+=1,this._parent._getFeature(r,r._known[this._lastId],this._progress).then((n=>{e.hasset=!0,this._parent._mainSetInUse=null,t(n)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}))):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then((()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)})):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}))})),!1===e.hasset&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(-1!==this._parent._totalCount)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if("GETPAGES"===e._known[e._candidates.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}var a=n(90961),i=n(90658),l=n(95002),o=n(95330),u=n(41534),c=n(8667),h=n(82971),d=n(99514);class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=i.Bj.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return void 0===t?this[e]:(void 0!==this[e]&&(this[e]=t),this)}end(){return null!==this._parent&&!0===this._parent._transparent?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return!0===this._parent.loaded?(this._initialiseFeatureSet(),this):(await this._parent.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new h.Z({wkid:4326}),this.geometryType=i.Qk.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some((t=>(t&&t.name.toLowerCase()===e&&(n=t),!!n)))),n}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=new d.Z(this.fields)),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(null!==e&&e.aborted)throw new Error("Operation has been cancelled.")}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,s){return null!==this._parent&&this._parent._canDoAggregates(e,t,n,r,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,a,i){if(null===this._parent)throw new Error("Should never be called");return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,s,a,i)}async _getAgregagtePhysicalPage(e,t,n){if(null===this._parent)throw new Error("Should never be called");return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===i.Bj.NotEvaluated){if(null!==r.Z.applicationCache){const e=r.Z.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==e)return e}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==r.Z.applicationCache&&r.Z.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw null!==r.Z.applicationCache&&r.Z.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:i.Bj.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:i.Bj.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:i.Bj.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(!0===await this._runDatabaseProbe(t.testwhere))return t.thetype;return i.Bj.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new Error("Not Implemented")}isTable(){return this._parent.isTable()}_featureFromCache(e){if(void 0!==this._featureCache[e])return this._featureCache[e]}_isInFeatureSet(e){return i.dj.Unknown}_getSet(e){throw new Error("Not implemented in abstract class")}async _getFeature(e,t,n){if(this._checkCancelled(n),void 0!==this._featureFromCache(t))return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),void 0!==this._featureFromCache(t))return this._featureFromCache(t);throw new Error("Feature Not Found")}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new a.Z([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const t of e)void 0!==this._featureFromCache(t)&&r.push(this._featureFromCache(t));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,s){throw new Error("Not implemented in abstract class")}async _refineSetBlock(e,t,n){if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate()))return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let s=r-e._candidates.length;if(0===e._candidates.length)return e;if(s>=t)return e;if(await this._refineIfParentKnown(e,t-s,n),this._checkCancelled(n),this._refineKnowns(e,t-s),s=r-e._candidates.length,s<t&&e._candidates.length>0){const r=t-s,a=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(a,a.length>r?r:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-s),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n<e.length;n++)this._isPhysicalFeature(e[n])&&t.push(e[n]);return t}_isPhysicalFeature(e){return null===this._parent||this._parent._isPhysicalFeature(e)}_refineKnowns(e,t){let n=0,r=null;const s=[];t=this._maxQueryRate();for(let a=0;a<e._candidates.length&&"GETPAGES"!==e._candidates[a];a++){let l=!1;const o=this._candidateIdTransform(e._candidates[a]);o!==e._candidates[a]&&(l=!0);const u=this._isInFeatureSet(o);if(u===i.dj.InFeatureSet)!0===l?e._known.includes(o)||(e._known.push(o),n+=1):(e._known.push(e._candidates[a]),n+=1),null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a});else if(u===i.dj.NotInFeatureSet)null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),n+=1;else if(u===i.dj.Unknown&&(n+=1,!0===e._ordered))break;if(n>=t)break}null!==r&&s.push(r);for(let t=s.length-1;t>=0;t--)e._candidates.splice(s[t].start,s[t].end-s[t].start+1)}_refineIfParentKnown(e,t,n){const r=new a.Z([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if("GETPAGES"===e._known[r])return!0;if(void 0===this._featureCache[e._known[r]]&&(n+=1,n>=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=0;r<e._candidates.length;r++){if("GETPAGES"===e._candidates[r])return!0;if(n+=1,n>=t)break}return!1}async _expandPagedSet(e,t,n,r,s){if(null===this._parent)throw new Error("Parent Paging not implemented");return this._parent._expandPagedSet(e,t,n,r,s)}async _expandPagedSetFeatureSet(e,t,n,r,s){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]&&(r=1),0===r&&e._candidates.length>0&&"GETPAGES"===e._candidates[e._candidates.length-1]&&(r=2),0===r)return"finished";const a=await this._getPage(e,r,s);return n+a<t?this._expandPagedSet(e,t,n+a,0,s):"success"}async _getPage(e,t,n){const r=1===t?e._known:e._candidates;if(e.pagesDefinition.internal.set.length>e.pagesDefinition.resultOffset||!0===e.pagesDefinition.internal.fullyResolved){r.length=r.length-1;let t=0;for(let n=0;n<e.pagesDefinition.resultRecordCount&&!(e.pagesDefinition.resultOffset+n>=e.pagesDefinition.internal.set.length);n++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+n],t++;e.pagesDefinition.resultOffset+=t;let n=!1;return!0===e.pagesDefinition.internal.fullyResolved&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(n=!0),!1===n&&r.push("GETPAGES"),t}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return null===this._parent?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let s=await this._stat(e,t,"",null,null,n,r);return!1===s.calculated&&(s=await this._manualStat(e,t,n,r)),s.result}async _manualStat(e,t,n,r){let s=null;switch(e.toLowerCase()){case"count":return s=await(0,l.QX)(this,r),{calculated:!0,result:s};case"distinct":return s=await(0,l.EB)(this,t,n),{calculated:!0,result:s};case"avg":case"mean":return s=await(0,l.J6)(this,t,r),{calculated:!0,result:s};case"stdev":return s=await(0,l.m)(this,t,r),{calculated:!0,result:s};case"variance":return s=await(0,l.CA)(this,t,r),{calculated:!0,result:s};case"sum":return s=await(0,l.Sm)(this,t,r),{calculated:!0,result:s};case"min":return s=await(0,l.VV)(this,t,r),{calculated:!0,result:s};case"max":return s=await(0,l.Fp)(this,t,r),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,s,a,i){const l=await this._parent._stat(e,t,n,r,s,a,i);return!1===l.calculated?null===s&&""===n&&null===r?this._manualStat(e,t,a,i):{calculated:!1}:l}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise(((e,r)=>{this._unionShapeInBatches(n,t,e,r)}))}_unionAllGeom(e){return new Promise(((t,n)=>{const r=this.iterator(this._defaultTracker(e));this._unionShapeInBatches([],r,t,n)}))}_unionShapeInBatches(e,t,n,r){t.next().then((s=>{try{null!==s&&null!==s.geometry&&e.push(s.geometry),e.length>30||null===s&&e.length>1?(0,c.G0)(e).then((a=>{try{null===s?n(a):(e=[a],this._unionShapeInBatches(e,t,n,r))}catch(e){r(e)}}),r):null===s?1===e.length?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(e){r(e)}}),r)}iterator(e){return new s(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise(((r,s)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,s,0)}))}_reduceImpl(e,t,n,r,s,a,i){try{if(++i>1e3)return void setTimeout((()=>{i=0,this._reduceImpl(e,t,n,r,s,a,i)}));e.next().then((l=>{try{if(null===l)s(n);else{const u=t(n,l,r,this);(0,o.y8)(u)?u.then((n=>{this._reduceImpl(e,t,n,r+1,s,a,i)}),a):this._reduceImpl(e,t,u,r+1,s,a,i)}}catch(e){a(e)}}),a)}catch(e){a(e)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=(0,i.EI)(e);return this.reduce(((e,n)=>null===n.geometry?0:t?(0,c.Y4)(n.geometry,r).then((t=>e+t)):(0,c.CJ)(n.geometry,r).then((t=>e+t))),0,n)}sumLength(e,t=!1,n){const r=(0,i.Lz)(e);return this.reduce(((e,n)=>null===n.geometry?0:t?(0,c.kQ)(n.geometry,r).then((t=>e+t)):(0,c.sz)(n.geometry,r).then((t=>e+t))),0,n)}_substituteVars(e,t){if(null!==t){const n={};for(const e in t)n[e.toLowerCase()]=t[e];e.parameters=n}}async distinct(e,t=1e3,n=null,r){await this.load();const s=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(s,n),this.calculateStatistic("distinct",s,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",u.WhereClause.create("1",this.getFieldsIndex()),-1,this._defaultTracker(e))}_defaultTracker(e){return e||{aborted:!1}}forEach(e,t){return new Promise(((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)}))}_forEachImpl(e,t,n,r,s,a){try{if(++a>1e3)return void setTimeout((()=>{a=0,this._forEachImpl(e,t,n,r,s,a)}),0);e.next().then((i=>{try{if(null===i)r(n);else{const l=t(i);null==l?this._forEachImpl(e,t,n,r,s,a):(0,o.y8)(l)?l.then((()=>{try{this._forEachImpl(e,t,n,r,s,a)}catch(e){s(e)}}),s):this._forEachImpl(e,t,n,r,s,a)}}catch(e){s(e)}}),s)}catch(e){s(e)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let e=0;e<this.fields.length;e++)t.layerDefinition.fields.push((0,i.Sh)(this.fields[e]));return this.reduce(((e,n)=>{const r={geometry:n.geometry&&n.geometry.toJSON(),attributes:{}};for(const e in n.attributes)r.attributes[e]=n.attributes[e];return t.featureSet.features.push(r),1}),0,e).then((()=>t))}castToText(){return"object, FeatureSet"}queryAttachments(e,t,n,r,s){return this._parent.queryAttachments(e,t,n,r,s)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map((e=>({name:e.name,code:e.id}))):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push((0,i.Sh)(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===i.q2[this.geometryType]?"":i.q2[this.geometryType],fields:e}}async convertToText(e,t){if("schema"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if("featureset"===e){await this._ensureLoaded();const e=[];await this.reduce(((t,n)=>{const r={geometry:n.geometry?n.geometry.toJSON():null,attributes:n.attributes};return null!==r.geometry&&r.geometry.spatialReference&&delete r.geometry.spatialReference,e.push(r),1}),0,t);const n=this.schema();return n.features=e,n.spatialReference=this.spatialReference.toJSON(),JSON.stringify(n)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return null!==this._parent?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return"keeptype"===e?.featureset?this:"none"===e?.featureset?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if("keeptype"===t?.featureset)return this;if("schema"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if("none"===t?.featureset)return null;await this._ensureLoaded();const n=[];await this.reduce(((e,r)=>{const s={geometry:r.geometry?!0===t?.keepGeometryType?r.geometry:r.geometry.toJSON():null,attributes:r.attributes};return null!==s.geometry&&s.geometry.spatialReference&&!0!==t?.keepGeometryType&&delete s.geometry.spatialReference,n.push(s),1}),0,e);const r=this.schema();return r.features=n,r.spatialReference=!0===t?.keepGeometryType?this.spatialReference:this.spatialReference.toJSON(),r}}_._featuresetFunctions={}},90961:(e,t,n)=>{n.d(t,{Z:()=>r});class r{constructor(e,t,n,r){this._candidates=null,this._known=null,this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}},48039:(e,t,n)=>{n.d(t,{Z:()=>r});class r{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){void 0===this._databaseTypeMetaData[e]&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return"MUSTBESET"===e||void 0===this._databaseTypeMetaData[e]?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return void 0===this._layerInfo[e]?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){void 0!==this._layerInfo[e]&&delete this._layerInfo[e]}}r.applicationCache=null},36515:(e,t,n)=>{n.d(t,{$e:()=>u,DT:()=>f,TE:()=>b,XF:()=>l,bB:()=>o,fz:()=>h,hq:()=>y,oX:()=>d,vR:()=>_,y5:()=>w,zR:()=>i});var r=n(90658),s=n(41534),a=n(17126);function i(e,t){return c(e.parseTree,t,e.parameters)}function l(e,t,n){return c(e,t,n)}function o(e,t,n,a){return s.WhereClause.create(c(e.parseTree,r.Bj.Standardised,e.parameters,t,n),a)}function u(e,t,n="AND"){return s.WhereClause.create("(("+i(e,r.Bj.Standardised)+")"+n+"("+i(t,r.Bj.Standardised)+"))",e.fieldsIndex)}function c(e,t,n,r=null,s=null){let a,i,l,o;switch(e.type){case"interval":return b(c(e.value,t,n,r,s),e.qualifier,e.op);case"case-expression":{let a=" CASE ";"simple"===e.format&&(a+=c(e.operand,t,n,r,s));for(let i=0;i<e.clauses.length;i++)a+=" WHEN "+c(e.clauses[i].operand,t,n,r,s)+" THEN "+c(e.clauses[i].value,t,n,r,s);return null!==e.else&&(a+=" ELSE "+c(e.else,t,n,r,s)),a+=" END ",a}case"parameter":{const r=n[e.value.toLowerCase()];if("string"==typeof r)return"'"+n[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'";if(r instanceof Date)return d(r,t);if(r instanceof Array){const e=[];for(let n=0;n<r.length;n++)"string"==typeof r[n]?e.push("'"+r[n].toString().replace(/'/g,"''")+"'"):r[n]instanceof Date?e.push(d(r[n],t)):e.push(r[n].toString());return e}return r.toString()}case"expression-list":i=[];for(const a of e.value)i.push(c(a,t,n,r,s));return i;case"unary-expression":return" ( NOT "+c(e.expr,t,n,r,s)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+c(e.left,t,n,r,s)+" AND "+c(e.right,t,n,r,s)+") ";case"OR":return" ("+c(e.left,t,n,r,s)+" OR "+c(e.right,t,n,r,s)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,t,n,r,s)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,t,n,r,s)+" IS NOT NULL )";case"IN":return a=[],"expression-list"===e.right.type?(a=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" IN ("+a.join(",")+")) "):(o=c(e.right,t,n,r,s),o instanceof Array?" ("+c(e.left,t,n,r,s)+" IN ("+o.join(",")+")) ":" ("+c(e.left,t,n,r,s)+" IN ("+o+")) ");case"NOT IN":return a=[],"expression-list"===e.right.type?(a=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" NOT IN ("+a.join(",")+")) "):(o=c(e.right,t,n,r,s),o instanceof Array?" ("+c(e.left,t,n,r,s)+" NOT IN ("+o.join(",")+")) ":" ("+c(e.left,t,n,r,s)+" NOT IN ("+o+")) ");case"BETWEEN":return l=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+c(e.left,t,n,r,s)+" LIKE "+c(e.right,t,n,r,s)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,t,n,r,s)+" LIKE "+c(e.right,t,n,r,s)+") ";case"NOT LIKE":return""!==e.escape?" ("+c(e.left,t,n,r,s)+" NOT LIKE "+c(e.right,t,n,r,s)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,t,n,r,s)+" NOT LIKE "+c(e.right,t,n,r,s)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+c(e.left,t,n,r,s)+" "+e.operator+" "+c(e.right,t,n,r,s)+") "}throw new Error("Not Supported Operator "+e.operator);case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return d(e.value,t);case"number":return e.value.toString();case"current-time":return _("date"===e.mode,t);case"column-reference":return r&&r.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"function":{const a=c(e.args,t,n,r,s);return h(e.name,a,t)}}throw new Error("Unsupported sql syntax "+e.type)}function h(e,t,n){switch(e.toLowerCase().trim()){case"abs":if(1!==t.length)throw new Error("Invalid Parameter for call to ABS");return"abs("+t[0]+")";case"ceiling":case"ceil":if(1!==t.length)throw new Error("Invalid Parameter for call to CEILING");switch(n){case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:}return"CEILING("+t[0]+")";case"floor":if(1!==t.length)throw new Error("Invalid Parameter for call to Floor");return"FLOOR("+t[0]+")";case"log":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG");return"LOG("+t[0]+")";case"log10":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG10");return"LOG10("+t[0]+")";case"power":if(2!==t.length)throw new Error("Invalid Parameter for call to POWER");return"POWER("+t[0]+","+t[1]+")";case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new Error("Invalid Parameter for call to ROUND");case"truncate":if(t.length<1||t.length>2)throw new Error("Invalid Parameter for TRUNCATE function");return n===r.Bj.SqlServer?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new Error("Invalid Parameter for CHAR_LENGTH function");switch(n){case r.Bj.SqlServer:return"LEN("+t[0]+")";case r.Bj.Oracle:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"concat":if(t.length<1)throw new Error("Invalid Parameter for CONCAT function");{let e="CONCAT(";for(let n=0;n<t.length;n++)0!==n&&(e+=","),e+=t[n];return e+=")",e}case"lower":case"lcase":if(1!==t.length)throw new Error("Invalid Parameter for Lower function");return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new Error("Invalid Parameter for Upper function");return"UPPER("+t[0]+")";case"substring":{let e="";switch(n){case r.Bj.Oracle:return e="SUBSTR("+t[0]+","+t[1],3===t.length&&(e+=","+t[2]),e+=")",e;case r.Bj.SqlServer:return e=3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")",e;default:return e="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(e+=" FOR "+t[2]),e+=")",e}}case"extract":return"EXTRACT("+t[0].replace(/\'/g,"")+" FROM "+t[1]+")"}throw new Error("Function Not Recognised")}function d(e,t){const n=e instanceof Date?a.ou.fromJSDate(e):a.ou.fromSQL(e),s=0===n.hour&&0===n.minute&&0===n.second&&0===n.millisecond;switch(t){case r.Bj.FILEGDB:case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:return s?`date '${n.toFormat("yyyy-LL-dd")}'`:`date '${n.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case r.Bj.Oracle:return s?`TO_DATE('${n.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${n.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case r.Bj.SqlServer:return`'${n.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case r.Bj.PGDB:return`#${n.toFormat(s?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case r.Bj.Postgres:return`TIMESTAMP '${n.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${n.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function _(e,t){switch(t){case r.Bj.FILEGDB:case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:case r.Bj.Oracle:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP";case r.Bj.SqlServer:return e?"CAST(GETDATE() AS DATE)":"GETDATE()";case r.Bj.PGDB:case r.Bj.Postgres:default:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function f(e,t,n={}){const r={},s={},a={esriFieldTypeSmallInteger:"integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"double",esriFieldTypeDouble:"double",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"integer",oid:"integer",long:"integer","small-integer":"integer",integer:"integer",single:"double",double:"double",date:"date",string:"string"};for(const e of t){const t=a[e.type];r[e.name.toLowerCase()]=void 0===t?"":t}for(const e in n){const t=a[n[e]];s[e.toLowerCase()]=void 0===t?"":t}switch(p(r,e.parseTree,e.parameters,s)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"string":return"string"}return""}function p(e,t,n,r){let s;switch(t.type){case"interval":return"integer";case"case-expression":{const s=[];if("simple"===t.format){for(let a=0;a<t.clauses.length;a++)s.push(p(e,t.clauses[a].value,n,r));null!==t.else&&s.push(p(e,t.else,n,r))}else{for(let a=0;a<t.clauses.length;a++)s.push(p(e,t.else,n,r));null!==t.else&&s.push(p(e,t.else,n,r))}return m(s)}case"parameter":{const e=r[t.value.toLowerCase()];if(void 0===e&&n){const e=n[t.value.toLowerCase()];if(void 0===e)return"";if(null===e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if(e instanceof Date)return"date";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expression-list":{const s=[];for(const a of t.value)s.push(p(e,a,n,r));return s}case"unary-expression":return"boolean";case"binary-expression":switch(t.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==t.right.type)throw new Error("Unsupported RHS for IS");return"boolean";case"*":case"-":case"+":case"/":return m([p(e,t.left,n,r),p(e,t.right,n,r)]);default:throw new Error("Not Supported Operator "+t.operator)}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return null===t.value?"":t.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{const n=e[t.column.toLowerCase()];return void 0===n?"":n}case"function":switch(t.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return s=p(e,t.args,n,r),s instanceof Array?s.length>0?s[0]:"":s;case"sign":return s=p(e,t.args,n,r),s instanceof Array&&(s=m(s)),"integer"===s||"double"===s?s:"double";case"ceiling":case"floor":case"abs":{const s=p(e,t.args,n,r);return s instanceof Array?m(s):s}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new Error("Unsupported sql syntax "+t.type)}const g={boolean:1,string:2,integer:3,double:4,date:5};function m(e){if(e){let t="";for(const n of e)""!==n&&(t=""===t||g[t]<g[n]?n:t);return t}return""}function y(e,t){return S(e.parseTree,t)}function w(e){return"column-reference"===e.parseTree.type}function S(e,t){if(null==e)return!1;switch(e.type){case"when-clause":return S(e.operand,t)||S(e.value,t);case"case-expression":for(const n of e.clauses)if(S(n,t))return!0;return!("simple"!==e.format||!S(e.operand,t))||!(null===e.else||!S(e.else,t));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"string":case"number":return!1;case"expression-list":for(const n of e.value)if(S(n,t))return!0;return!1;case"unary-expression":return S(e.expr,t);case"binary-expression":return S(e.left,t)||S(e.right,t);case"column-reference":return t.toLowerCase()===e.column.toLowerCase();case"function":return S(e.args,t)}return!1}function I(e){let t="";return t+=e.period.toUpperCase(),t}function b(e,t,n){let r="";return r="interval-period"===t.type?I(t):I(t.start)+" TO "+I(t.end),"INTERVAL "+n+" "+e+" "+r}},95002:(e,t,n)=>{n.d(t,{CA:()=>f,EB:()=>w,Fp:()=>d,J6:()=>_,QX:()=>m,Sm:()=>g,VV:()=>h,g3:()=>u,m:()=>p,tj:()=>c});var r=n(90658),s=n(36515);function a(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function i(e){const t=a(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/e.length}function l(e){const t=a(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/(e.length-1)}function o(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function u(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function c(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return function(e,t){const n=[],s={},a=[];for(let i=0;i<e.length;i++){if(void 0!==e[i]&&null!==e[i]){const t=e[i];if((0,r.hj)(t)||(0,r.HD)(t))void 0===s[t]&&(n.push(t),s[t]=1);else{let e=!1;for(let n=0;n<a.length;n++)!0===(0,r.tt)(a[n],t)&&(e=!0);!1===e&&(a.push(t),n.push(t))}}if(n.length>=t&&-1!==t)return n}return n}(t,n);case"avg":case"mean":return a(t);case"min":return Math.min.apply(Math,t);case"sum":return o(t);case"max":return Math.max.apply(Math,t);case"stdev":case"stddev":return Math.sqrt(i(t));case"var":case"variance":return i(t);case"count":return t.length}return 0}async function h(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:Math.min.apply(Math,r)}async function d(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:Math.max.apply(Math,r)}async function _(e,t,n){let r="";!1===(0,s.y5)(t)&&(r=(0,s.DT)(t,e.fields,null));const i=await y(e,t,n,!0);if(0===i.length)return null;const l=a(i);return null===l?l:"integer"===r?function(e){return e=+e,isFinite(e)?e-e%1||(e<0?-0:0===e?e:0):e}(l):l}async function f(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:l(r)}async function p(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:Math.sqrt(l(r))}async function g(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:o(r)}async function m(e,t){return e.iterator(t).count()}async function y(e,t,n,r=!1){const s=e.iterator(n),a=[],i={ticker:0};let l=await s.next();for(;null!==l;){if(i.ticker++,n.aborted)throw new Error("Cancelled");i.ticker%100==0&&(i.ticker=0,await new Promise((e=>{setTimeout(e,0)})));const e=t.calculateValue(l);null===e?!1===r&&(a[a.length]=e):a[a.length]=e,l=await s.next()}return a}async function w(e,t,n=1e3,r=null){const s=e.iterator(r),a=[],i={},l={ticker:0};let o=await s.next();for(;null!==o;){if(l.ticker++,r.aborted)throw new Error("Cancelled");l.ticker%100==0&&(l.ticker=0,await new Promise((e=>{setTimeout(e,0)})));const e=t.calculateValue(o);if(null!=e&&void 0===i[e]&&(a.push(e),i[e]=1),a.length>=n&&-1!==n)return a;o=await s.next()}return a}},64830:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(70586);class s{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,r.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,r.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}},80903:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(50758),s=n(92604),a=n(95330),i=n(64830),l=n(25045);class o{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new i.Z}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((n,r)=>{let s=!0;const i=e=>{(0,a.k_)(t.signal),s&&(s=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let s=0;s<e.length;++s){const o=e[s];(0,a.y8)(o)?this._clientPromises[s]=o.then((e=>(this._clients[s]=new l.default(e,t,(()=>this._ongoingJobsQueue.pop()??null)),i(n),this._clients[s])),(()=>(i(r),null))):(this._clients[s]=new l.default(o,t,(()=>this._ongoingJobsQueue.pop()??null)),this._clientPromises[s]=Promise.resolve(this._clients[s]),i(n))}}))}broadcast(e,t,n){const r=new Array(this._clientPromises.length);for(let s=0;s<this._clientPromises.length;++s){const a=this._clientPromises[s];r[s]=a.then((r=>r?.invoke(e,t,n)))}return r}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject((0,a.zE)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0}invoke(e,t,n){let r;Array.isArray(n)?(s.Z.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:n}):r=n;const i=(0,a.dD)();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:r,deferred:i});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e?.jobAdded()))}return i.promise}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((n=>n.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let n=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((s=>{s&&(t[r]=s.openPort()),0==--n&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},8667:(e,t,n)=>{n.d(t,{CJ:()=>L,Cz:()=>x,D$:()=>k,ED:()=>w,G0:()=>P,Gg:()=>b,LV:()=>I,Nm:()=>S,Sp:()=>E,TE:()=>f,U1:()=>R,W4:()=>m,Y4:()=>B,cv:()=>D,e5:()=>T,f3:()=>C,fS:()=>p,j2:()=>N,jU:()=>_,kK:()=>g,kQ:()=>G,og:()=>F,oq:()=>c,r3:()=>d,rd:()=>A,sz:()=>O,uh:()=>y,wf:()=>v,z7:()=>h}),n(66577);var r=n(78346),s=(n(94139),n(33955));function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function i(e){return e?Array.isArray(e)?e.map(i):e.toJSON?e.toJSON():e:e}function l(e){return Array.isArray(e)?e.map((e=>(0,s.im)(e))):(0,s.im)(e)}let o;async function u(e,t){return(await async function(){return o||(o=(0,r.bA)("geometryEngineWorker",{strategy:"distributed"})),o}()).invoke("executeGEOperation",{operation:e,parameters:i(t)})}async function c(e,t){return l(await u("clip",[a(e),e,t]))}async function h(e,t){return l(await u("cut",[a(e),e,t]))}function d(e,t){return u("contains",[a(e),e,t])}function _(e,t){return u("crosses",[a(e),e,t])}function f(e,t,n){return u("distance",[a(e),e,t,n])}function p(e,t){return u("equals",[a(e),e,t])}function g(e,t){return u("intersects",[a(e),e,t])}function m(e,t){return u("touches",[a(e),e,t])}function y(e,t){return u("within",[a(e),e,t])}function w(e,t){return u("disjoint",[a(e),e,t])}function S(e,t){return u("overlaps",[a(e),e,t])}function I(e,t,n){return u("relate",[a(e),e,t,n])}function b(e){return u("isSimple",[a(e),e])}async function F(e){return l(await u("simplify",[a(e),e]))}async function T(e,t){return l(await u("difference",[a(e),e,t]))}async function E(e,t){return l(await u("symmetricDifference",[a(e),e,t]))}async function v(e,t){return l(await u("intersect",[a(e),e,t]))}async function P(e,t=null){const n=function(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),null!=t&&n.push(t)),n}(e,t);return l(await u("union",[a(n),n]))}async function D(e,t,n,r,s,i){return l(await u("offset",[a(e),e,t,n,r,s,i]))}async function C(e,t,n,r=!1){const s=[a(e),e,t,n,r];return l(await u("buffer",s))}async function A(e,t,n,r,s,i){const o=[a(e),e,t,n,r,s,i];return l(await u("geodesicBuffer",o))}async function R(e,t,n){if(null==e)throw new Error("Illegal Argument Exception");const r=e.spatialReference;n=n??function(e){return"xmin"in e?e.center:"x"in e?e:e.extent.center}(e);const s=e.constructor.fromJSON(await u("rotate",[r,e,t,n]));return s.spatialReference=r,s}async function k(e,t,n,r){return l(await u("generalize",[a(e),e,t,n,r]))}async function x(e,t,n){return l(await u("densify",[a(e),e,t,n]))}async function N(e,t,n,r=0){return l(await u("geodesicDensify",[a(e),e,t,n,r]))}function L(e,t){return u("planarArea",[a(e),e,t])}function O(e,t){return u("planarLength",[a(e),e,t])}function B(e,t,n){return u("geodesicArea",[a(e),e,t,n])}function G(e,t,n){return u("geodesicLength",[a(e),e,t,n])}},94443:(e,t,n)=>{n.d(t,{ME:()=>_,Su:()=>f,tz:()=>d});var r=n(20102),s=n(95330),a=n(70171);const i=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,l={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function o(e){return l[e]??!1}const u=[],c=new Map;function h(e){for(const t of c.keys())p(e.pattern,t)&&c.delete(t)}function d(e){return u.includes(e)||(h(e),u.unshift(e)),{remove(){const t=u.indexOf(e);t>-1&&(u.splice(t,1),h(e))}}}async function _(e){const t=(0,a.Kd)();c.has(e)||c.set(e,async function(e,t){const n=[];for(const r of u)if(p(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(e){n.push(e)}if(n.length)throw new r.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:n});throw new r.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const n=c.get(e);return n&&await g.add(n),n}function f(e){if(!i.test(e))return null;const t=i.exec(e);if(null===t)return null;const[,n,r]=t,s=n+(r?"-"+r.toUpperCase():"");return o(s)?s:o(n)?n:null}function p(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,a.Ze)((()=>{c.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,s.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},99514:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(35671);function s(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function a(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class i{constructor(e){if(this.fields=e,this._fieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;const t=[];for(const i of e){const e=i&&i.name;if(e){const o=l(e);this._fieldsMap.set(e,i),this._fieldsMap.set(o,i),t.push(o),"date"===(n=i).type||"esriFieldTypeDate"===n.type?(this.dateFields.push(i),this._dateFieldsSet.add(i)):(0,r.H7)(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),s(i)||a(i)||(i.editable=null==i.editable||!!i.editable,i.nullable=null==i.nullable||!!i.nullable)}}var n;t.sort(),this.uid=t.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)s(e)||a(e)||e.nullable||void 0!==(0,r.os)(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){return null!=e?this._fieldsMap.get(e)||this._fieldsMap.get(l(e)):void 0}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const t=this.get(e);if(t)return t.name}}function l(e){return e.toLowerCase().trim()}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6920],{53073:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(75148),s=n(91136),a=n(90961),i=n(90658),l=n(8667);class o extends s.Z{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new a.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===i.dj.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?i.dj.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(null===e.geometry)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":{const t=(0,i.SV)(this._relationGeom),n=(0,i.SV)(e.geometry);return(0,l.kK)(t,n)}case"esriSpatialRelIntersects":return(0,l.kK)(this._relationGeom,e.geometry);case"esriSpatialRelContains":return(0,l.r3)(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return(0,l.Nm)(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return(0,l.uh)(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return(0,l.W4)(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return(0,l.jU)(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return(0,l.LV)(this._relationGeom,e.geometry,this._relationString)}}async _fetchAndRefineFeatures(e,t,n){const r=new a.Z([],e,!1,null),s=Math.min(t,e.length);await this._parent._getFeatures(r,-1,s,n),this._checkCancelled(n);const l=[];for(let t=0;t<s;t++){const n=this._parent._featureFromCache(e[t]);l.push(await this.executeSpatialRelationTest(n))}for(let n=0;n<t;n++)!0===l[n]?this._idstates[e[n]]=i.dj.InFeatureSet:this._idstates[e[n]]=i.dj.NotInFeatureSet;return"success"}async _getFilteredSet(e,t,n,r,s){await this._ensureLoaded();const i=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,n,r,s);let l;return this._checkCancelled(s),l=null!==t?new a.Z(i._candidates.slice(0).concat(i._known.slice(0)),[],i._ordered,this._clonePageDefinition(i.pagesDefinition)):new a.Z(i._candidates.slice(0),i._known.slice(0),i._ordered,this._clonePageDefinition(i.pagesDefinition)),l}async _stat(e,t,n,r,s,a,i){if(""!==n)return{calculated:!1};const l=await this._parent._stat(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s,a,i);return!1===l.calculated?null===s&&""===n&&null===r?this._manualStat(e,t,a,i):{calculated:!1}:l}async _canDoAggregates(e,t,n,r,s){return""===n&&null===r&&null!==this._parent&&this._parent._canDoAggregates(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,a,i){if(null===this._parent)throw new Error("Should never be called");return this._parent._getAggregatePagesDataSourceDefinition(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s,a,i)}static registerAction(){s.Z._featuresetFunctions.intersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelIntersects",relationGeom:e})},s.Z._featuresetFunctions.envelopeIntersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelEnvelopeIntersects",relationGeom:e})},s.Z._featuresetFunctions.contains=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelContains",relationGeom:e})},s.Z._featuresetFunctions.overlaps=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelOverlaps",relationGeom:e})},s.Z._featuresetFunctions.within=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelWithin",relationGeom:e})},s.Z._featuresetFunctions.touches=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelTouches",relationGeom:e})},s.Z._featuresetFunctions.crosses=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelCrosses",relationGeom:e})},s.Z._featuresetFunctions.relate=function(e,t){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelRelation",relationGeom:e,relationString:t})}}}},75148:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(91136),s=n(90961),a=n(90658);class i extends r.Z{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new s.Z([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=a.Bj.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return a.dj.NotInFeatureSet}async _getFeature(){throw new Error("No Feature Found in EmptySet")}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new Error("Fetch and Refine should not be called in this featureset")}async _getFilteredSet(){return new s.Z([],[],!1,null)}_stat(e,t,n,r,s,a,i){return this._manualStat(e,t,a,i)}async _canDoAggregates(){return!1}}},91136:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(48039);class s{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}nextBatch(e){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((t=>this.nextBatch(e)),(t=>this.nextBatch(e)));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise(((r,s)=>{this._parent._getSet(this._progress).then((a=>{let i=a._known.length-1;if("GETPAGES"===a._known[a._known.length-1]&&(i-=1),this._lastId+e>i&&a._known.length>0&&"GETPAGES"===a._known[a._known.length-1])this._parent._expandPagedSet(a,this._parent._maxQueryRate(),0,0,this._progress).then((n=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,s)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}));else{if(i>=this._lastId+e||0===a._candidates.length){for(let t=0;t<e;t++){const e=t+this._lastId+1;if(e>=a._known.length)break;n[t]=a._known[e]}return this._lastId+=n.length,0===n.length&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then((e=>{t.hasset=!0,this._parent._mainSetInUse=null,r(e)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))}this._parent._refineSetBlock(a,this._parent._maxProcessingRate(),this._progress).then((()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,s)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))}}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))})),!1===t.hasset&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((e=>this.next()),(e=>this.next()));const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise(((t,n)=>{this._parent._getSet(this._progress).then((r=>{this._lastId<r._known.length-1?"GETPAGES"===r._known[this._lastId+1]?this._parent._expandPagedSet(r,this._parent._maxQueryRate(),0,0,this._progress).then((t=>(e.hasset=!0,this._parent._mainSetInUse=null,this.next()))).then(t,n):(this._lastId+=1,this._parent._getFeature(r,r._known[this._lastId],this._progress).then((n=>{e.hasset=!0,this._parent._mainSetInUse=null,t(n)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}))):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then((()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)})):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}))})),!1===e.hasset&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(-1!==this._parent._totalCount)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if("GETPAGES"===e._known[e._candidates.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}var a=n(90961),i=n(90658),l=n(95002),o=n(95330),u=n(41534),c=n(8667),h=n(82971),d=n(99514);class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=i.Bj.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return void 0===t?this[e]:(void 0!==this[e]&&(this[e]=t),this)}end(){return null!==this._parent&&!0===this._parent._transparent?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return!0===this._parent.loaded?(this._initialiseFeatureSet(),this):(await this._parent.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new h.Z({wkid:4326}),this.geometryType=i.Qk.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some((t=>(t&&t.name.toLowerCase()===e&&(n=t),!!n)))),n}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=new d.Z(this.fields)),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(null!==e&&e.aborted)throw new Error("Operation has been cancelled.")}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,s){return null!==this._parent&&this._parent._canDoAggregates(e,t,n,r,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,a,i){if(null===this._parent)throw new Error("Should never be called");return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,s,a,i)}async _getAgregagtePhysicalPage(e,t,n){if(null===this._parent)throw new Error("Should never be called");return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===i.Bj.NotEvaluated){if(null!==r.Z.applicationCache){const e=r.Z.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==e)return e}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==r.Z.applicationCache&&r.Z.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw null!==r.Z.applicationCache&&r.Z.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:i.Bj.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:i.Bj.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:i.Bj.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(!0===await this._runDatabaseProbe(t.testwhere))return t.thetype;return i.Bj.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new Error("Not Implemented")}isTable(){return this._parent.isTable()}_featureFromCache(e){if(void 0!==this._featureCache[e])return this._featureCache[e]}_isInFeatureSet(e){return i.dj.Unknown}_getSet(e){throw new Error("Not implemented in abstract class")}async _getFeature(e,t,n){if(this._checkCancelled(n),void 0!==this._featureFromCache(t))return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),void 0!==this._featureFromCache(t))return this._featureFromCache(t);throw new Error("Feature Not Found")}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new a.Z([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const t of e)void 0!==this._featureFromCache(t)&&r.push(this._featureFromCache(t));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,s){throw new Error("Not implemented in abstract class")}async _refineSetBlock(e,t,n){if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate()))return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let s=r-e._candidates.length;if(0===e._candidates.length)return e;if(s>=t)return e;if(await this._refineIfParentKnown(e,t-s,n),this._checkCancelled(n),this._refineKnowns(e,t-s),s=r-e._candidates.length,s<t&&e._candidates.length>0){const r=t-s,a=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(a,a.length>r?r:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-s),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n<e.length;n++)this._isPhysicalFeature(e[n])&&t.push(e[n]);return t}_isPhysicalFeature(e){return null===this._parent||this._parent._isPhysicalFeature(e)}_refineKnowns(e,t){let n=0,r=null;const s=[];t=this._maxQueryRate();for(let a=0;a<e._candidates.length&&"GETPAGES"!==e._candidates[a];a++){let l=!1;const o=this._candidateIdTransform(e._candidates[a]);o!==e._candidates[a]&&(l=!0);const u=this._isInFeatureSet(o);if(u===i.dj.InFeatureSet)!0===l?e._known.includes(o)||(e._known.push(o),n+=1):(e._known.push(e._candidates[a]),n+=1),null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a});else if(u===i.dj.NotInFeatureSet)null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),n+=1;else if(u===i.dj.Unknown&&(n+=1,!0===e._ordered))break;if(n>=t)break}null!==r&&s.push(r);for(let t=s.length-1;t>=0;t--)e._candidates.splice(s[t].start,s[t].end-s[t].start+1)}_refineIfParentKnown(e,t,n){const r=new a.Z([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if("GETPAGES"===e._known[r])return!0;if(void 0===this._featureCache[e._known[r]]&&(n+=1,n>=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=0;r<e._candidates.length;r++){if("GETPAGES"===e._candidates[r])return!0;if(n+=1,n>=t)break}return!1}async _expandPagedSet(e,t,n,r,s){if(null===this._parent)throw new Error("Parent Paging not implemented");return this._parent._expandPagedSet(e,t,n,r,s)}async _expandPagedSetFeatureSet(e,t,n,r,s){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]&&(r=1),0===r&&e._candidates.length>0&&"GETPAGES"===e._candidates[e._candidates.length-1]&&(r=2),0===r)return"finished";const a=await this._getPage(e,r,s);return n+a<t?this._expandPagedSet(e,t,n+a,0,s):"success"}async _getPage(e,t,n){const r=1===t?e._known:e._candidates;if(e.pagesDefinition.internal.set.length>e.pagesDefinition.resultOffset||!0===e.pagesDefinition.internal.fullyResolved){r.length=r.length-1;let t=0;for(let n=0;n<e.pagesDefinition.resultRecordCount&&!(e.pagesDefinition.resultOffset+n>=e.pagesDefinition.internal.set.length);n++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+n],t++;e.pagesDefinition.resultOffset+=t;let n=!1;return!0===e.pagesDefinition.internal.fullyResolved&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(n=!0),!1===n&&r.push("GETPAGES"),t}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return null===this._parent?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let s=await this._stat(e,t,"",null,null,n,r);return!1===s.calculated&&(s=await this._manualStat(e,t,n,r)),s.result}async _manualStat(e,t,n,r){let s=null;switch(e.toLowerCase()){case"count":return s=await(0,l.QX)(this,r),{calculated:!0,result:s};case"distinct":return s=await(0,l.EB)(this,t,n),{calculated:!0,result:s};case"avg":case"mean":return s=await(0,l.J6)(this,t,r),{calculated:!0,result:s};case"stdev":return s=await(0,l.m)(this,t,r),{calculated:!0,result:s};case"variance":return s=await(0,l.CA)(this,t,r),{calculated:!0,result:s};case"sum":return s=await(0,l.Sm)(this,t,r),{calculated:!0,result:s};case"min":return s=await(0,l.VV)(this,t,r),{calculated:!0,result:s};case"max":return s=await(0,l.Fp)(this,t,r),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,s,a,i){const l=await this._parent._stat(e,t,n,r,s,a,i);return!1===l.calculated?null===s&&""===n&&null===r?this._manualStat(e,t,a,i):{calculated:!1}:l}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise(((e,r)=>{this._unionShapeInBatches(n,t,e,r)}))}_unionAllGeom(e){return new Promise(((t,n)=>{const r=this.iterator(this._defaultTracker(e));this._unionShapeInBatches([],r,t,n)}))}_unionShapeInBatches(e,t,n,r){t.next().then((s=>{try{null!==s&&null!==s.geometry&&e.push(s.geometry),e.length>30||null===s&&e.length>1?(0,c.G0)(e).then((a=>{try{null===s?n(a):(e=[a],this._unionShapeInBatches(e,t,n,r))}catch(e){r(e)}}),r):null===s?1===e.length?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(e){r(e)}}),r)}iterator(e){return new s(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise(((r,s)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,s,0)}))}_reduceImpl(e,t,n,r,s,a,i){try{if(++i>1e3)return void setTimeout((()=>{i=0,this._reduceImpl(e,t,n,r,s,a,i)}));e.next().then((l=>{try{if(null===l)s(n);else{const u=t(n,l,r,this);(0,o.y8)(u)?u.then((n=>{this._reduceImpl(e,t,n,r+1,s,a,i)}),a):this._reduceImpl(e,t,u,r+1,s,a,i)}}catch(e){a(e)}}),a)}catch(e){a(e)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=(0,i.EI)(e);return this.reduce(((e,n)=>null===n.geometry?0:t?(0,c.Y4)(n.geometry,r).then((t=>e+t)):(0,c.CJ)(n.geometry,r).then((t=>e+t))),0,n)}sumLength(e,t=!1,n){const r=(0,i.Lz)(e);return this.reduce(((e,n)=>null===n.geometry?0:t?(0,c.kQ)(n.geometry,r).then((t=>e+t)):(0,c.sz)(n.geometry,r).then((t=>e+t))),0,n)}_substituteVars(e,t){if(null!==t){const n={};for(const e in t)n[e.toLowerCase()]=t[e];e.parameters=n}}async distinct(e,t=1e3,n=null,r){await this.load();const s=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(s,n),this.calculateStatistic("distinct",s,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=u.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",u.WhereClause.create("1",this.getFieldsIndex()),-1,this._defaultTracker(e))}_defaultTracker(e){return e||{aborted:!1}}forEach(e,t){return new Promise(((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)}))}_forEachImpl(e,t,n,r,s,a){try{if(++a>1e3)return void setTimeout((()=>{a=0,this._forEachImpl(e,t,n,r,s,a)}),0);e.next().then((i=>{try{if(null===i)r(n);else{const l=t(i);null==l?this._forEachImpl(e,t,n,r,s,a):(0,o.y8)(l)?l.then((()=>{try{this._forEachImpl(e,t,n,r,s,a)}catch(e){s(e)}}),s):this._forEachImpl(e,t,n,r,s,a)}}catch(e){s(e)}}),s)}catch(e){s(e)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let e=0;e<this.fields.length;e++)t.layerDefinition.fields.push((0,i.Sh)(this.fields[e]));return this.reduce(((e,n)=>{const r={geometry:n.geometry&&n.geometry.toJSON(),attributes:{}};for(const e in n.attributes)r.attributes[e]=n.attributes[e];return t.featureSet.features.push(r),1}),0,e).then((()=>t))}castToText(){return"object, FeatureSet"}queryAttachments(e,t,n,r,s){return this._parent.queryAttachments(e,t,n,r,s)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map((e=>({name:e.name,code:e.id}))):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push((0,i.Sh)(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===i.q2[this.geometryType]?"":i.q2[this.geometryType],fields:e}}async convertToText(e,t){if("schema"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if("featureset"===e){await this._ensureLoaded();const e=[];await this.reduce(((t,n)=>{const r={geometry:n.geometry?n.geometry.toJSON():null,attributes:n.attributes};return null!==r.geometry&&r.geometry.spatialReference&&delete r.geometry.spatialReference,e.push(r),1}),0,t);const n=this.schema();return n.features=e,n.spatialReference=this.spatialReference.toJSON(),JSON.stringify(n)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return null!==this._parent?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return"keeptype"===e?.featureset?this:"none"===e?.featureset?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if("keeptype"===t?.featureset)return this;if("schema"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if("none"===t?.featureset)return null;await this._ensureLoaded();const n=[];await this.reduce(((e,r)=>{const s={geometry:r.geometry?!0===t?.keepGeometryType?r.geometry:r.geometry.toJSON():null,attributes:r.attributes};return null!==s.geometry&&s.geometry.spatialReference&&!0!==t?.keepGeometryType&&delete s.geometry.spatialReference,n.push(s),1}),0,e);const r=this.schema();return r.features=n,r.spatialReference=!0===t?.keepGeometryType?this.spatialReference:this.spatialReference.toJSON(),r}}_._featuresetFunctions={}},90961:(e,t,n)=>{n.d(t,{Z:()=>r});class r{constructor(e,t,n,r){this._candidates=null,this._known=null,this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}},48039:(e,t,n)=>{n.d(t,{Z:()=>r});class r{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){void 0===this._databaseTypeMetaData[e]&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return"MUSTBESET"===e||void 0===this._databaseTypeMetaData[e]?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return void 0===this._layerInfo[e]?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){void 0!==this._layerInfo[e]&&delete this._layerInfo[e]}}r.applicationCache=null},36515:(e,t,n)=>{n.d(t,{$e:()=>u,DT:()=>f,TE:()=>b,XF:()=>l,bB:()=>o,fz:()=>h,hq:()=>y,oX:()=>d,vR:()=>_,y5:()=>w,zR:()=>i});var r=n(90658),s=n(41534),a=n(17126);function i(e,t){return c(e.parseTree,t,e.parameters)}function l(e,t,n){return c(e,t,n)}function o(e,t,n,a){return s.WhereClause.create(c(e.parseTree,r.Bj.Standardised,e.parameters,t,n),a)}function u(e,t,n="AND"){return s.WhereClause.create("(("+i(e,r.Bj.Standardised)+")"+n+"("+i(t,r.Bj.Standardised)+"))",e.fieldsIndex)}function c(e,t,n,r=null,s=null){let a,i,l,o;switch(e.type){case"interval":return b(c(e.value,t,n,r,s),e.qualifier,e.op);case"case-expression":{let a=" CASE ";"simple"===e.format&&(a+=c(e.operand,t,n,r,s));for(let i=0;i<e.clauses.length;i++)a+=" WHEN "+c(e.clauses[i].operand,t,n,r,s)+" THEN "+c(e.clauses[i].value,t,n,r,s);return null!==e.else&&(a+=" ELSE "+c(e.else,t,n,r,s)),a+=" END ",a}case"parameter":{const r=n[e.value.toLowerCase()];if("string"==typeof r)return"'"+n[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'";if(r instanceof Date)return d(r,t);if(r instanceof Array){const e=[];for(let n=0;n<r.length;n++)"string"==typeof r[n]?e.push("'"+r[n].toString().replace(/'/g,"''")+"'"):r[n]instanceof Date?e.push(d(r[n],t)):e.push(r[n].toString());return e}return r.toString()}case"expression-list":i=[];for(const a of e.value)i.push(c(a,t,n,r,s));return i;case"unary-expression":return" ( NOT "+c(e.expr,t,n,r,s)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+c(e.left,t,n,r,s)+" AND "+c(e.right,t,n,r,s)+") ";case"OR":return" ("+c(e.left,t,n,r,s)+" OR "+c(e.right,t,n,r,s)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,t,n,r,s)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,t,n,r,s)+" IS NOT NULL )";case"IN":return a=[],"expression-list"===e.right.type?(a=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" IN ("+a.join(",")+")) "):(o=c(e.right,t,n,r,s),o instanceof Array?" ("+c(e.left,t,n,r,s)+" IN ("+o.join(",")+")) ":" ("+c(e.left,t,n,r,s)+" IN ("+o+")) ");case"NOT IN":return a=[],"expression-list"===e.right.type?(a=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" NOT IN ("+a.join(",")+")) "):(o=c(e.right,t,n,r,s),o instanceof Array?" ("+c(e.left,t,n,r,s)+" NOT IN ("+o.join(",")+")) ":" ("+c(e.left,t,n,r,s)+" NOT IN ("+o+")) ");case"BETWEEN":return l=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=c(e.right,t,n,r,s)," ("+c(e.left,t,n,r,s)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+c(e.left,t,n,r,s)+" LIKE "+c(e.right,t,n,r,s)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,t,n,r,s)+" LIKE "+c(e.right,t,n,r,s)+") ";case"NOT LIKE":return""!==e.escape?" ("+c(e.left,t,n,r,s)+" NOT LIKE "+c(e.right,t,n,r,s)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,t,n,r,s)+" NOT LIKE "+c(e.right,t,n,r,s)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+c(e.left,t,n,r,s)+" "+e.operator+" "+c(e.right,t,n,r,s)+") "}throw new Error("Not Supported Operator "+e.operator);case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return d(e.value,t);case"number":return e.value.toString();case"current-time":return _("date"===e.mode,t);case"column-reference":return r&&r.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"function":{const a=c(e.args,t,n,r,s);return h(e.name,a,t)}}throw new Error("Unsupported sql syntax "+e.type)}function h(e,t,n){switch(e.toLowerCase().trim()){case"abs":if(1!==t.length)throw new Error("Invalid Parameter for call to ABS");return"abs("+t[0]+")";case"ceiling":case"ceil":if(1!==t.length)throw new Error("Invalid Parameter for call to CEILING");switch(n){case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:}return"CEILING("+t[0]+")";case"floor":if(1!==t.length)throw new Error("Invalid Parameter for call to Floor");return"FLOOR("+t[0]+")";case"log":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG");return"LOG("+t[0]+")";case"log10":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG10");return"LOG10("+t[0]+")";case"power":if(2!==t.length)throw new Error("Invalid Parameter for call to POWER");return"POWER("+t[0]+","+t[1]+")";case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new Error("Invalid Parameter for call to ROUND");case"truncate":if(t.length<1||t.length>2)throw new Error("Invalid Parameter for TRUNCATE function");return n===r.Bj.SqlServer?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new Error("Invalid Parameter for CHAR_LENGTH function");switch(n){case r.Bj.SqlServer:return"LEN("+t[0]+")";case r.Bj.Oracle:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"concat":if(t.length<1)throw new Error("Invalid Parameter for CONCAT function");{let e="CONCAT(";for(let n=0;n<t.length;n++)0!==n&&(e+=","),e+=t[n];return e+=")",e}case"lower":case"lcase":if(1!==t.length)throw new Error("Invalid Parameter for Lower function");return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new Error("Invalid Parameter for Upper function");return"UPPER("+t[0]+")";case"substring":{let e="";switch(n){case r.Bj.Oracle:return e="SUBSTR("+t[0]+","+t[1],3===t.length&&(e+=","+t[2]),e+=")",e;case r.Bj.SqlServer:return e=3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")",e;default:return e="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(e+=" FOR "+t[2]),e+=")",e}}case"extract":return"EXTRACT("+t[0].replace(/\'/g,"")+" FROM "+t[1]+")"}throw new Error("Function Not Recognised")}function d(e,t){const n=e instanceof Date?a.ou.fromJSDate(e):a.ou.fromSQL(e),s=0===n.hour&&0===n.minute&&0===n.second&&0===n.millisecond;switch(t){case r.Bj.FILEGDB:case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:return s?`date '${n.toFormat("yyyy-LL-dd")}'`:`date '${n.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case r.Bj.Oracle:return s?`TO_DATE('${n.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${n.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case r.Bj.SqlServer:return`'${n.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case r.Bj.PGDB:return`#${n.toFormat(s?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case r.Bj.Postgres:return`TIMESTAMP '${n.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${n.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function _(e,t){switch(t){case r.Bj.FILEGDB:case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:case r.Bj.Oracle:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP";case r.Bj.SqlServer:return e?"CAST(GETDATE() AS DATE)":"GETDATE()";case r.Bj.PGDB:case r.Bj.Postgres:default:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function f(e,t,n={}){const r={},s={},a={esriFieldTypeSmallInteger:"integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"double",esriFieldTypeDouble:"double",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"integer",oid:"integer",long:"integer","small-integer":"integer",integer:"integer",single:"double",double:"double",date:"date",string:"string"};for(const e of t){const t=a[e.type];r[e.name.toLowerCase()]=void 0===t?"":t}for(const e in n){const t=a[n[e]];s[e.toLowerCase()]=void 0===t?"":t}switch(p(r,e.parseTree,e.parameters,s)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"string":return"string"}return""}function p(e,t,n,r){let s;switch(t.type){case"interval":return"integer";case"case-expression":{const s=[];if("simple"===t.format){for(let a=0;a<t.clauses.length;a++)s.push(p(e,t.clauses[a].value,n,r));null!==t.else&&s.push(p(e,t.else,n,r))}else{for(let a=0;a<t.clauses.length;a++)s.push(p(e,t.else,n,r));null!==t.else&&s.push(p(e,t.else,n,r))}return m(s)}case"parameter":{const e=r[t.value.toLowerCase()];if(void 0===e&&n){const e=n[t.value.toLowerCase()];if(void 0===e)return"";if(null===e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if(e instanceof Date)return"date";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expression-list":{const s=[];for(const a of t.value)s.push(p(e,a,n,r));return s}case"unary-expression":return"boolean";case"binary-expression":switch(t.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==t.right.type)throw new Error("Unsupported RHS for IS");return"boolean";case"*":case"-":case"+":case"/":return m([p(e,t.left,n,r),p(e,t.right,n,r)]);default:throw new Error("Not Supported Operator "+t.operator)}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return null===t.value?"":t.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{const n=e[t.column.toLowerCase()];return void 0===n?"":n}case"function":switch(t.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return s=p(e,t.args,n,r),s instanceof Array?s.length>0?s[0]:"":s;case"sign":return s=p(e,t.args,n,r),s instanceof Array&&(s=m(s)),"integer"===s||"double"===s?s:"double";case"ceiling":case"floor":case"abs":{const s=p(e,t.args,n,r);return s instanceof Array?m(s):s}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new Error("Unsupported sql syntax "+t.type)}const g={boolean:1,string:2,integer:3,double:4,date:5};function m(e){if(e){let t="";for(const n of e)""!==n&&(t=""===t||g[t]<g[n]?n:t);return t}return""}function y(e,t){return S(e.parseTree,t)}function w(e){return"column-reference"===e.parseTree.type}function S(e,t){if(null==e)return!1;switch(e.type){case"when-clause":return S(e.operand,t)||S(e.value,t);case"case-expression":for(const n of e.clauses)if(S(n,t))return!0;return!("simple"!==e.format||!S(e.operand,t))||!(null===e.else||!S(e.else,t));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"string":case"number":return!1;case"expression-list":for(const n of e.value)if(S(n,t))return!0;return!1;case"unary-expression":return S(e.expr,t);case"binary-expression":return S(e.left,t)||S(e.right,t);case"column-reference":return t.toLowerCase()===e.column.toLowerCase();case"function":return S(e.args,t)}return!1}function I(e){let t="";return t+=e.period.toUpperCase(),t}function b(e,t,n){let r="";return r="interval-period"===t.type?I(t):I(t.start)+" TO "+I(t.end),"INTERVAL "+n+" "+e+" "+r}},95002:(e,t,n)=>{n.d(t,{CA:()=>f,EB:()=>w,Fp:()=>d,J6:()=>_,QX:()=>m,Sm:()=>g,VV:()=>h,g3:()=>u,m:()=>p,tj:()=>c});var r=n(90658),s=n(36515);function a(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function i(e){const t=a(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/e.length}function l(e){const t=a(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/(e.length-1)}function o(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function u(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function c(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return function(e,t){const n=[],s={},a=[];for(let i=0;i<e.length;i++){if(void 0!==e[i]&&null!==e[i]){const t=e[i];if((0,r.hj)(t)||(0,r.HD)(t))void 0===s[t]&&(n.push(t),s[t]=1);else{let e=!1;for(let n=0;n<a.length;n++)!0===(0,r.tt)(a[n],t)&&(e=!0);!1===e&&(a.push(t),n.push(t))}}if(n.length>=t&&-1!==t)return n}return n}(t,n);case"avg":case"mean":return a(t);case"min":return Math.min.apply(Math,t);case"sum":return o(t);case"max":return Math.max.apply(Math,t);case"stdev":case"stddev":return Math.sqrt(i(t));case"var":case"variance":return i(t);case"count":return t.length}return 0}async function h(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:Math.min.apply(Math,r)}async function d(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:Math.max.apply(Math,r)}async function _(e,t,n){let r="";!1===(0,s.y5)(t)&&(r=(0,s.DT)(t,e.fields,null));const i=await y(e,t,n,!0);if(0===i.length)return null;const l=a(i);return null===l?l:"integer"===r?function(e){return e=+e,isFinite(e)?e-e%1||(e<0?-0:0===e?e:0):e}(l):l}async function f(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:l(r)}async function p(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:Math.sqrt(l(r))}async function g(e,t,n){const r=await y(e,t,n,!0);return 0===r.length?null:o(r)}async function m(e,t){return e.iterator(t).count()}async function y(e,t,n,r=!1){const s=e.iterator(n),a=[],i={ticker:0};let l=await s.next();for(;null!==l;){if(i.ticker++,n.aborted)throw new Error("Cancelled");i.ticker%100==0&&(i.ticker=0,await new Promise((e=>{setTimeout(e,0)})));const e=t.calculateValue(l);null===e?!1===r&&(a[a.length]=e):a[a.length]=e,l=await s.next()}return a}async function w(e,t,n=1e3,r=null){const s=e.iterator(r),a=[],i={},l={ticker:0};let o=await s.next();for(;null!==o;){if(l.ticker++,r.aborted)throw new Error("Cancelled");l.ticker%100==0&&(l.ticker=0,await new Promise((e=>{setTimeout(e,0)})));const e=t.calculateValue(o);if(null!=e&&void 0===i[e]&&(a.push(e),i[e]=1),a.length>=n&&-1!==n)return a;o=await s.next()}return a}},64830:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(70586);class s{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,r.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,r.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}},80903:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(50758),s=n(92604),a=n(95330),i=n(64830),l=n(25045);class o{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new i.Z}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((n,r)=>{let s=!0;const i=e=>{(0,a.k_)(t.signal),s&&(s=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let s=0;s<e.length;++s){const o=e[s];(0,a.y8)(o)?this._clientPromises[s]=o.then((e=>(this._clients[s]=new l.default(e,t,(()=>this._ongoingJobsQueue.pop()??null)),i(n),this._clients[s])),(()=>(i(r),null))):(this._clients[s]=new l.default(o,t,(()=>this._ongoingJobsQueue.pop()??null)),this._clientPromises[s]=Promise.resolve(this._clients[s]),i(n))}}))}broadcast(e,t,n){const r=new Array(this._clientPromises.length);for(let s=0;s<this._clientPromises.length;++s){const a=this._clientPromises[s];r[s]=a.then((r=>r?.invoke(e,t,n)))}return r}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject((0,a.zE)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0}invoke(e,t,n){let r;Array.isArray(n)?(s.Z.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:n}):r=n;const i=(0,a.dD)();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:r,deferred:i});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e?.jobAdded()))}return i.promise}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((n=>n.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let n=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((s=>{s&&(t[r]=s.openPort()),0==--n&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},8667:(e,t,n)=>{n.d(t,{CJ:()=>L,Cz:()=>k,D$:()=>x,ED:()=>w,G0:()=>P,Gg:()=>b,LV:()=>I,Nm:()=>S,Sp:()=>E,TE:()=>f,U1:()=>R,W4:()=>m,Y4:()=>B,cv:()=>D,e5:()=>T,f3:()=>C,fS:()=>p,j2:()=>N,jU:()=>_,kK:()=>g,kQ:()=>G,og:()=>F,oq:()=>c,r3:()=>d,rd:()=>A,sz:()=>O,uh:()=>y,wf:()=>v,z7:()=>h}),n(66577);var r=n(78346),s=(n(94139),n(33955));function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function i(e){return e?Array.isArray(e)?e.map(i):e.toJSON?e.toJSON():e:e}function l(e){return Array.isArray(e)?e.map((e=>(0,s.im)(e))):(0,s.im)(e)}let o;async function u(e,t){return(await async function(){return o||(o=(0,r.bA)("geometryEngineWorker",{strategy:"distributed"})),o}()).invoke("executeGEOperation",{operation:e,parameters:i(t)})}async function c(e,t){return l(await u("clip",[a(e),e,t]))}async function h(e,t){return l(await u("cut",[a(e),e,t]))}function d(e,t){return u("contains",[a(e),e,t])}function _(e,t){return u("crosses",[a(e),e,t])}function f(e,t,n){return u("distance",[a(e),e,t,n])}function p(e,t){return u("equals",[a(e),e,t])}function g(e,t){return u("intersects",[a(e),e,t])}function m(e,t){return u("touches",[a(e),e,t])}function y(e,t){return u("within",[a(e),e,t])}function w(e,t){return u("disjoint",[a(e),e,t])}function S(e,t){return u("overlaps",[a(e),e,t])}function I(e,t,n){return u("relate",[a(e),e,t,n])}function b(e){return u("isSimple",[a(e),e])}async function F(e){return l(await u("simplify",[a(e),e]))}async function T(e,t){return l(await u("difference",[a(e),e,t]))}async function E(e,t){return l(await u("symmetricDifference",[a(e),e,t]))}async function v(e,t){return l(await u("intersect",[a(e),e,t]))}async function P(e,t=null){const n=function(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),null!=t&&n.push(t)),n}(e,t);return l(await u("union",[a(n),n]))}async function D(e,t,n,r,s,i){return l(await u("offset",[a(e),e,t,n,r,s,i]))}async function C(e,t,n,r=!1){const s=[a(e),e,t,n,r];return l(await u("buffer",s))}async function A(e,t,n,r,s,i){const o=[a(e),e,t,n,r,s,i];return l(await u("geodesicBuffer",o))}async function R(e,t,n){if(null==e)throw new j;const r=e.spatialReference;if(null==(n=n??function(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}(e)))throw new j;const s=e.constructor.fromJSON(await u("rotate",[r,e,t,n]));return s.spatialReference=r,s}async function x(e,t,n,r){return l(await u("generalize",[a(e),e,t,n,r]))}async function k(e,t,n){return l(await u("densify",[a(e),e,t,n]))}async function N(e,t,n,r=0){return l(await u("geodesicDensify",[a(e),e,t,n,r]))}function L(e,t){return u("planarArea",[a(e),e,t])}function O(e,t){return u("planarLength",[a(e),e,t])}function B(e,t,n){return u("geodesicArea",[a(e),e,t,n])}function G(e,t,n){return u("geodesicLength",[a(e),e,t,n])}class j extends Error{constructor(){super("Illegal Argument Exception")}}},94443:(e,t,n)=>{n.d(t,{ME:()=>_,Su:()=>f,tz:()=>d});var r=n(20102),s=n(95330),a=n(70171);const i=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,l={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function o(e){return l[e]??!1}const u=[],c=new Map;function h(e){for(const t of c.keys())p(e.pattern,t)&&c.delete(t)}function d(e){return u.includes(e)||(h(e),u.unshift(e)),{remove(){const t=u.indexOf(e);t>-1&&(u.splice(t,1),h(e))}}}async function _(e){const t=(0,a.Kd)();c.has(e)||c.set(e,async function(e,t){const n=[];for(const r of u)if(p(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(e){n.push(e)}if(n.length)throw new r.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:n});throw new r.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const n=c.get(e);return n&&await g.add(n),n}function f(e){if(!i.test(e))return null;const t=i.exec(e);if(null===t)return null;const[,n,r]=t,s=n+(r?"-"+r.toUpperCase():"");return o(s)?s:o(n)?n:null}function p(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,a.Ze)((()=>{c.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,s.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},99514:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(35671);function s(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function a(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class i{constructor(e){if(this.fields=e,this._fieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;const t=[];for(const i of e){const e=i&&i.name;if(e){const o=l(e);this._fieldsMap.set(e,i),this._fieldsMap.set(o,i),t.push(o),"date"===(n=i).type||"esriFieldTypeDate"===n.type?(this.dateFields.push(i),this._dateFieldsSet.add(i)):(0,r.H7)(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),s(i)||a(i)||(i.editable=null==i.editable||!!i.editable,i.nullable=null==i.nullable||!!i.nullable)}}var n;t.sort(),this.uid=t.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)s(e)||a(e)||e.nullable||void 0!==(0,r.os)(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){return null!=e?this._fieldsMap.get(e)||this._fieldsMap.get(l(e)):void 0}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const t=this.get(e);if(t)return t.name}}function l(e){return e.toLowerCase().trim()}}}]);