@arcgis/core 5.2.0 → 5.2.2

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 (164) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{67e533748435253aaba6.js → 0284f608d25c654fcc11.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{2d9a1f23ec6ce90723ac.js → 0d99bfb75dcb9fa29080.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0fa29352f2ecf0c515e8.js +1 -0
  5. package/assets/esri/core/workers/chunks/10ad7b35b6800d40444e.js +1 -0
  6. package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +1 -0
  7. package/assets/esri/core/workers/chunks/{10878932826ddb60fac4.js → 1fcc998421c7c16de2ca.js} +1 -1
  8. package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +1 -0
  9. package/assets/esri/core/workers/chunks/251f706d226b1d47ba99.js +1 -0
  10. package/assets/esri/core/workers/chunks/{ba38231193919e093917.js → 2529f12fc16e98c014ca.js} +1 -1
  11. package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
  12. package/assets/esri/core/workers/chunks/2b804b5d7ce10f0f0cf0.js +1 -0
  13. package/assets/esri/core/workers/chunks/3537fe95b83a13b156cc.js +1 -0
  14. package/assets/esri/core/workers/chunks/36f31416132de434ec00.js +1 -0
  15. package/assets/esri/core/workers/chunks/3e29ab5ec136e669b633.js +1 -0
  16. package/assets/esri/core/workers/chunks/{36c780a9527c75b36725.js → 40d7e54529d13fdd2bf1.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{2cb209bc51a19487692d.js → 43aef67452fa6ff8d8f9.js} +2 -2
  18. package/assets/esri/core/workers/chunks/449a2dee17b54946f245.js +1 -0
  19. package/assets/esri/core/workers/chunks/{5d42f0898bf30ae940ea.js → 46071e59290bf06bb614.js} +1 -1
  20. package/assets/esri/core/workers/chunks/46d91cd99558304da0c7.js +1 -0
  21. package/assets/esri/core/workers/chunks/4cf72dcccf2be353a701.js +1 -0
  22. package/assets/esri/core/workers/chunks/{e3a742dc0c291b47ba56.js → 510c2eb78f5e12f77bbc.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{98d1efb6f2439c6344cf.js → 5b2d1c8763a1716677c0.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5bf7de2e2faa55e53629.js +1 -0
  25. package/assets/esri/core/workers/chunks/{042614bf65b7d63025cb.js → 5f49233d5b67a9ad71d7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/604433b02a165d187953.js +1 -0
  27. package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +1 -0
  28. package/assets/esri/core/workers/chunks/{094eb9677cdebfaa9e1b.js → 648d5cdfc3e92be3db55.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{bc6fdd9faf8ed54be0cb.js → 6694e2b27fd6ddf44e21.js} +1 -1
  30. package/assets/esri/core/workers/chunks/70268d790c2f1cb83d43.js +1 -0
  31. package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +1 -0
  32. package/assets/esri/core/workers/chunks/8102f0bf5707c3be3310.js +1 -0
  33. package/assets/esri/core/workers/chunks/{d56fdf5ce5ff53dc0e69.js → 84495695313b01832369.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{31640b41e0ecdff892fa.js → 85b63811ae7bcb6f74b6.js} +2 -2
  35. package/assets/esri/core/workers/chunks/{c4bbe4707e90b7cd0379.js → 8ac4a043a4f185db271f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/8d01dd92f5c897193ab5.js +1 -0
  37. package/assets/esri/core/workers/chunks/900c8569596609183f19.js +2 -0
  38. package/assets/esri/core/workers/chunks/{d1d6154b4af1c9cc497b.js → 934e1f2153e6fad6ed23.js} +1 -1
  39. package/assets/esri/core/workers/chunks/95c9c5677bbe7fd0420a.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b70885deebc6106597ad.js → 983b85727e09c54bede0.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{d20dcd4ce4b0111d924f.js → 9bbc8e5d42921a8050bb.js} +1 -1
  42. package/assets/esri/core/workers/chunks/a07070de96e143a329a4.js +1 -0
  43. package/assets/esri/core/workers/chunks/a17fb26d6ac4895e51a3.js +2 -0
  44. package/assets/esri/core/workers/chunks/{0d52e1b6d38f2670658c.js → a6f74bd1a9c87b9836ca.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{a85cdafbaf1848bb924b.js → a846c94d49df8d4cd5be.js} +1 -1
  46. package/assets/esri/core/workers/chunks/aa4f12fcb9f4ed3dba18.js +1 -0
  47. package/assets/esri/core/workers/chunks/ac10c7d2c4829a150037.js +1 -0
  48. package/assets/esri/core/workers/chunks/{509a74e9334f31b931d4.js → b54ba2bd6b1b90dcc0cc.js} +1 -1
  49. package/assets/esri/core/workers/chunks/bde8f3b3ce5b1d3ee774.js +1 -0
  50. package/assets/esri/core/workers/chunks/c25ae83fd790f181bb42.js +1 -0
  51. package/assets/esri/core/workers/chunks/{dc51dcaa4e2f9a90f5bd.js → c2cbe0f5e8958cf18e58.js} +2 -2
  52. package/assets/esri/core/workers/chunks/c4c55d8a98ba3f51f63c.js +1 -0
  53. package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
  54. package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
  55. package/assets/esri/core/workers/chunks/{2a2a4650dd9b953d317c.js → c93343a91161c4e40c28.js} +1 -1
  56. package/assets/esri/core/workers/chunks/cb4c5544382eb8c4a87f.js +1 -0
  57. package/assets/esri/core/workers/chunks/{2d83ba260dd6bbe38206.js → d05665ddc8d31403aed3.js} +1 -1
  58. package/assets/esri/core/workers/chunks/d24dea0bdb17db07e2b3.js +1 -0
  59. package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +1 -0
  60. package/assets/esri/core/workers/chunks/d4bc6d65dff5d0cc93ba.js +1 -0
  61. package/assets/esri/core/workers/chunks/{3048e74e6246324ce6fc.js → d5916500514a41a4758f.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{aea44253c80493ef5755.js → e7b168ba31142c00f765.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{a504a5e06cb89a620799.js → ec8b7476eac4718eb0ac.js} +1 -1
  64. package/assets/esri/core/workers/chunks/f497968055af459c5da4.js +1 -0
  65. package/assets/esri/core/workers/chunks/{d53cc574a21031436c45.js → f79494829a5b65b5b4c9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{26261b21d1edf476ea49.js → f7ec3b7f2eccd9c4c2e5.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{20ee2f36f0fd0ae01e15.js → f88cbf9b1d1d7400c060.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{bf4d913e523eae2fda28.js → fa7b189e9b2cc8d4a77f.js} +1 -1
  69. package/assets/esri/core/workers/chunks/fcb4707c2e95099b9f30.js +1 -0
  70. package/assets/esri/core/workers/chunks/{735c1dffc3439bdba3cc.js → fd172c96d2b36032a1d9.js} +1 -1
  71. package/config.js +1 -1
  72. package/core/workers.d.ts +1 -0
  73. package/kernel.js +1 -1
  74. package/layers/CSVLayer.js +1 -1
  75. package/layers/SceneLayer.js +1 -1
  76. package/layers/graphics/sources/CSVSource.js +1 -1
  77. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  78. package/layers/graphics/sources/MemorySource.js +2 -2
  79. package/layers/graphics/sources/support/QueryTask.js +1 -1
  80. package/layers/graphics/sources/support/timeQueryUtils.js +2 -0
  81. package/layers/mixins/ArcGISImageService.js +1 -1
  82. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  83. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  84. package/layers/orientedImagery/transformations/utils.js +1 -1
  85. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  86. package/layers/support/TimeInformation.js +1 -1
  87. package/layers/support/timeInfoUtils.js +2 -0
  88. package/package.json +4 -4
  89. package/rest/query/executeAttributeBinsQuery.js +1 -1
  90. package/rest/query/executeForExtent.js +1 -1
  91. package/rest/query/executeForTopCount.js +1 -1
  92. package/rest/query/executeForTopExtents.js +1 -1
  93. package/rest/query/executeForTopIds.js +1 -1
  94. package/rest/query/executeTopFeaturesQuery.js +1 -1
  95. package/rest/query/operations/query.js +1 -1
  96. package/rest/query/operations/queryAttributeBins.js +1 -1
  97. package/rest/query/operations/queryTopFeatures.js +1 -1
  98. package/rest/support/timeUtils.js +1 -1
  99. package/support/timeUtils.js +1 -1
  100. package/symbols/TextSymbol.d.ts +0 -1
  101. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  102. package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
  103. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  104. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  105. package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
  106. package/views/3d/environment/SunLighting.d.ts +10 -8
  107. package/views/3d/environment/VirtualLighting.d.ts +10 -8
  108. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  109. package/webscene/Environment.d.ts +1 -1
  110. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  111. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  112. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  113. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  114. package/widgets/BatchAttributeForm.js +1 -1
  115. package/widgets/FeatureForm.js +1 -1
  116. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  117. package/widgets/FeatureTable/RelationshipColumn.js +1 -1
  118. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  119. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  120. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  121. package/widgets/OrientedImageryViewer/utils.js +1 -1
  122. package/widgets/OrientedImageryViewer.js +2 -2
  123. package/assets/esri/core/workers/chunks/20a698709c3c11ff2c16.js +0 -1
  124. package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
  125. package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
  126. package/assets/esri/core/workers/chunks/2b6684d057d9ad17ac13.js +0 -1
  127. package/assets/esri/core/workers/chunks/2e66c969bf4209c957b5.js +0 -2
  128. package/assets/esri/core/workers/chunks/377595b23379b0c8fe95.js +0 -1
  129. package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +0 -1
  130. package/assets/esri/core/workers/chunks/38d852676677e5697864.js +0 -1
  131. package/assets/esri/core/workers/chunks/3c881b1adc8a5dea9a90.js +0 -1
  132. package/assets/esri/core/workers/chunks/4e6656a5f29e31902fca.js +0 -2
  133. package/assets/esri/core/workers/chunks/50e8943d2c0b96fab2c1.js +0 -1
  134. package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +0 -1
  135. package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +0 -1
  136. package/assets/esri/core/workers/chunks/60c79934799927114074.js +0 -1
  137. package/assets/esri/core/workers/chunks/63b5418a1c3fe0a97a86.js +0 -1
  138. package/assets/esri/core/workers/chunks/6ddc29a144640acb1192.js +0 -1
  139. package/assets/esri/core/workers/chunks/6f73e41e14817acfaead.js +0 -1
  140. package/assets/esri/core/workers/chunks/7dfbc31f3b56728485a4.js +0 -1
  141. package/assets/esri/core/workers/chunks/822f83d7c09ef0a9bbdf.js +0 -1
  142. package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
  143. package/assets/esri/core/workers/chunks/8b8118ab56cc808b5a71.js +0 -1
  144. package/assets/esri/core/workers/chunks/8d86b0cb0e004ad72040.js +0 -1
  145. package/assets/esri/core/workers/chunks/98760040f0c9d47c718d.js +0 -1
  146. package/assets/esri/core/workers/chunks/a2f0894218e665780a21.js +0 -1
  147. package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +0 -1
  148. package/assets/esri/core/workers/chunks/ab6506a3c16f8717fc00.js +0 -1
  149. package/assets/esri/core/workers/chunks/c45edd0a7d57263bb7d6.js +0 -1
  150. package/assets/esri/core/workers/chunks/c52466eb1f3c33ae1f5a.js +0 -1
  151. package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +0 -1
  152. package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +0 -1
  153. package/assets/esri/core/workers/chunks/c80a3b039e510c118399.js +0 -1
  154. package/assets/esri/core/workers/chunks/c88a70f68c8ce8c30e9b.js +0 -1
  155. package/assets/esri/core/workers/chunks/cf1ec61eb2ad147bb931.js +0 -1
  156. package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +0 -1
  157. package/assets/esri/core/workers/chunks/e9cdb0b0f074583edebd.js +0 -1
  158. package/assets/esri/core/workers/chunks/f5cc78291b53931b91e8.js +0 -1
  159. /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
  160. /package/assets/esri/core/workers/chunks/{2cb209bc51a19487692d.js.LICENSE.txt → 43aef67452fa6ff8d8f9.js.LICENSE.txt} +0 -0
  161. /package/assets/esri/core/workers/chunks/{31640b41e0ecdff892fa.js.LICENSE.txt → 85b63811ae7bcb6f74b6.js.LICENSE.txt} +0 -0
  162. /package/assets/esri/core/workers/chunks/{4e6656a5f29e31902fca.js.LICENSE.txt → 900c8569596609183f19.js.LICENSE.txt} +0 -0
  163. /package/assets/esri/core/workers/chunks/{2e66c969bf4209c957b5.js.LICENSE.txt → a17fb26d6ac4895e51a3.js.LICENSE.txt} +0 -0
  164. /package/assets/esri/core/workers/chunks/{dc51dcaa4e2f9a90f5bd.js.LICENSE.txt → c2cbe0f5e8958cf18e58.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9235],{34930(e,t,r){r.d(t,{$Q:()=>l,Sd:()=>u,T5:()=>a,b7:()=>p});var n=r(86211),s=r(5443),i=r(86738),o=r(14140);function a(e,t){if(e.spatialReference.equals(t))return e;let r=(0,n.GA)(e.spatialReference),s=(0,n.GA)(t);if(r===s)return e;let i=r/s;return{x:e.x*i,y:e.y*i}}async function l(e,t,n){if("extent"===n.type)return function(e,t,r){let{width:n,height:s}=e,i=new Uint8Array(n*s),a=t.width/n,l=t.height/s;if(r.width/a<.5||r.height/l<.5)return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]});let{xmin:u,xmax:p,ymin:c,ymax:h}=t,{xmin:m,xmax:f,ymin:g,ymax:d}=r,y=Math.max(u,m),x=Math.min(p,f),w=Math.max(c,g),A=Math.min(h,d),v=.5*a,b=.5*l;if(x-y<v||A-w<b||x<u+v||y>p-v||w>h-b||A<c+b)return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]});let C=Math.max(0,(y-u)/a),M=Math.min(n,Math.max(0,(x-u)/a)),P=Math.max(0,(h-A)/l),T=Math.min(s,Math.max(0,(h-w)/l)),R=Math.round(C),N=Math.round(M)-1,I=Math.round(P),k=Math.round(T)-1;if(R===N&&C%1>.5&&M%1<.5||I===k&&P%1>.5&&T%1<.5)return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]});if(0===R&&0===I&&N===n&&k===s)return e;let S=e.mask;for(let e=I;e<=k;e++)for(let t=R;t<=N;t++){let r=e*n+t;i[r]=S?S[r]:255}return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]})}(e,t,n);let{width:s,height:i}=e,a=new Uint8Array(s*i),{intersectsExecute:l}=await Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1132)]).then(()=>r(25275));if(!l(t,n))return new o.A({pixelType:e.pixelType,width:s,height:i,mask:a,maskIsAlpha:!1,pixels:[...e.pixels]});if("polyline"===n.type)return function(e,t,r){let{width:n,height:s}=e,i=new Uint8Array(n*s),a=t.width/n,l=t.height/s,{xmin:u,ymax:p}=t,{paths:c}=r,h=e.mask;for(let e=0;e<c.length;e++){let t=c[e];for(let e=0;e<t.length-1;e++){let[r,o]=t[e],[c,m]=t[e+1],f=Math.min(o,m),g=Math.max(0,Math.floor((p-Math.max(o,m))/l)),d=Math.min(s-1,Math.floor((p-f)/l));if(!(d<g))if(g===d){let e=Math.min(r,c),t=Math.max(r,c),s=Math.max(0,Math.floor((e-u)/a)),o=Math.min(n-1,Math.floor((t-u)/a));if(o<s)continue;let l=g*n;for(let e=l+s;e<=l+o;e++)i[e]=h?h[e]:255}else{let e=(r-u)/a,t=(c-r)/(m-o)/a,s=l*t;for(let r=g;r<=d;r++){let a=t*(p-r*l-o)+e,u=Math.max(0,Math.floor(s>0?a-s:a)),c=Math.min(n-1,Math.floor(s>0?a:a-s));if(c<u)continue;let m=r*n;for(let e=m+u;e<=m+c;e++)i[e]=h?h[e]:255}}}}return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,pixels:[...e.pixels]})}(e,t,n);let{containsExecute:u}=await Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(6671)]).then(()=>r(30912));return u(n,t)?e:function(e,t,r){if(!e)return e;let{width:n,height:s}=e,i=function(e){let t,{geometry:r,size:n,srcExtent:s,srcMask:i}=e,[o,a]=n,l=s.width/o,u=s.height/a,{xmin:p,ymax:c}=s;if("extent"===r.type){let e=(r.xmin-p)/l,n=(r.xmax-p)/l,s=(c-r.ymax)/u,i=(c-r.ymin)/u;t=[[[e,s],[e,i],[n,i],[n,s],[e,s]]]}else t=r.rings.map(e=>e.map(([e,t])=>[(e-p)/l,(c-t)/u]));return function(e,t,r){let[n,s]=t,i=new OffscreenCanvas(n,s).getContext("2d");i.fillStyle="#f00",i.beginPath(),e.forEach(e=>{i.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)i.lineTo(e[t][0],e[t][1]);i.closePath()}),i.fill();let o=i.getImageData(0,0,n,s).data,a=n*s,l=new Uint8Array(a),u=!1;for(let e=0;e<a;e++)(!r||r[e])&&(o[4*e+3]>127?l[e]=255:u=!0);return u||r?l:void 0}(t,n,i)}({geometry:r,size:[n,s],srcExtent:t,srcMask:e.mask});return new o.A({pixelType:e.pixelType,width:n,height:s,mask:i,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,n)}function u(e,t){let{extent:r}=p(e,t,new i.A({x:e.pixelSize.x,y:e.pixelSize.y,spatialReference:e.spatialReference})),{extent:n}=e.extent;if(r.xmax=Math.min(r.xmax,n.xmax),r.ymax=Math.min(r.ymax,n.ymax),r.xmin<r.xmax&&r.ymin<r.ymax){let{x:t,y:n}=e.pixelSize,s=Math.round(r.width/t),i=Math.round(r.height/n);e.extent=r,e.width=s,e.height=i}}function p(e,t,r,n=!0){let i,o,l,{spatialReference:u}=e,{x:p,y:c}=a(r,u),{xmin:h,xmax:m,ymax:f,ymin:g}="extent"===t.type?t:t.extent,{xmin:d,ymax:y}=e.extent;return n?(h=d+(h>d?p*Math.round((h-d)/p):0),f=y-(f<y?c*Math.round((y-f)/c):0),m=d+(m>d?p*Math.round((m-d)/p):0),g=y-(g<y?c*Math.round((y-g)/c):0),i=new s.A({xmin:h,ymax:f,xmax:m,ymin:g,spatialReference:u}),o=Math.round(i.width/p),l=Math.round(i.height/c)):(o=Math.floor((m-h)/p+.8),l=Math.floor((f-g)/c+.8),h=d+(h>d?p*Math.floor((h-d)/p+.1):0),f=y-(f<y?c*Math.floor((y-f)/c+.1):0),m=h+o*p,g=f-l*c,i=new s.A({xmin:h,ymax:f,xmax:m,ymin:g,spatialReference:u})),{extent:i,width:o,height:l}}},99235(e,t,r){r.d(t,{vt:()=>Un,UD:()=>Vn});var n=r(85334),s=r(49186),i=r(4718),o=r(32198),a=r(91429),l=r(94778),u=r(25482);let p=class extends u.o{constructor(){super(...arguments),this.raster=void 0}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],p.prototype,"raster",void 0),p=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseFunctionArguments")],p);const c=p;var h;let m=h=class extends c{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new h({raster:this.raster,raster2:this.raster2,operation:this.operation})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"operation",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"raster2",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],m.prototype,"rasters",null),m=h=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunctionArguments")],m);const f=m;var g=r(14140),d=r(87186);const y=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let x=class extends u.o{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this.isRoot=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){let e=this.getWebGLProcessorDefinition();if(!e)return null;let t=[e],{parameters:r}=e,n=r.rasters||r.raster&&[r.raster];for(;n?.length;){t.unshift(...n);let e=[];for(let t=0;t<n.length;t++){let{parameters:r}=n[t],s=r.rasters||r.raster&&[r.raster];s?.length&&e.push(...s)}n=e}for(let e=t.length-1;e>=0;e--)t[e].isNoopProcess&&t.splice(e,1);let s=!1;for(let e=0;e<t.length;e++){let r=t[e];r.id=t.length-e-1;let{rasters:n}=r.parameters;s||=null!=n&&n.length>1}let i=t.some(({name:e})=>y.has(e.toLowerCase())),{rawSourceRasterInfos:o}=this;return{functions:t,hasBranches:s,hasFocalFunction:i,isSourceSingleBand:1===o?.[0]?.bandCount}}get neighborhoodSize(){let{rows:e,cols:t}=this._getNeighborhoodSize(),r=this.getImmediateChildFunctions();for(let n of r){let r=n.neighborhoodSize;e=Math.max(e,r.rows),t=Math.max(t,r.cols)}return{rows:e,cols:t}}bind(e,t=!1,r=-1){this.id=r+1;let n=this._getRasterValues(),s=!0;for(let r=0;r<n.length;r++){let i=n[r];if(null!=i&&this._isRasterFunctionValue(i)){let n=i.bind(e,t,this.id+r);if(!n.success)return this._bindingResult=n,n;s&&=n.supportsGPU}}return!this.rasterInfo||t?(this.sourceRasterInfos=this._getSourceRasterInfos(e),this._bindingResult=this._bindSourceRasters(),s&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),s&&this.isRoot&&(this.processInputBandIds(),this.swizzleInputBandIds(this.rawInputBandIds)||(s=this.rawInputBandIds.length<=3))),this._bindingResult.supportsGPU=s,this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult)}queryRasterFunction(e){let t=[this];for(;t.length;){let r=t.pop();if(e(r))return r;let n=r.getImmediateChildFunctions();t.push(...n)}}getImmediateChildFunctions(){return this._getRasterValues().filter(e=>e&&"object"==typeof e&&"bind"in e)}process(e,t){let r=this._getRasterValues(),n=0===r.length?e.pixelBlocks??e.primaryPixelBlocks:r.map(r=>this._readRasterValue(r,e,t));return this._processPixels({...e,pixelBlocks:n},t)}processInputBandIds(){let e=this._getRasterValues().filter(this._isRasterFunctionValue);if(e.length>1){let t=e.map(e=>e.processInputBandIds());return this.rawInputBandIds=[...new Set(t.flat())],this.rawInputBandIds}let t=e[0];if(t)return this.rawInputBandIds=t.processInputBandIds(),this.rawInputBandIds;let{bandCount:r}=this.sourceRasterInfos[0],n=Array.from({length:r},(e,t)=>t);return this.rawInputBandIds=this._getInputBandIds(n),this.rawInputBandIds}swizzleInputBandIds(e){let t=this._getRasterValues().filter(this._isRasterFunctionValue),r=!0;for(let n of t)r=n.swizzleInputBandIds(e)&&r;return!!r&&this._swizzleBandIds(e)}getPrimaryRasters(){let e=[],t=[];return this._getPrimaryRasters(this,e,t),{rasters:e,rasterIds:t}}getWebGLProcessorDefinition(){let e=this._getWebGLParameters(),{raster:t,rasters:r}=this.functionArguments;return r&&Array.isArray(r)&&r.length?(e.rasters=r.map(e=>this._isRasterFunctionValue(e)?e.getWebGLProcessorDefinition():"number"==typeof e?{name:"Constant",parameters:{value:e},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:e},pixelType:"f32",id:-1,isNoopProcess:!1}),e.rasters.some(e=>null!=e)||(e.rasters=null)):this._isRasterFunctionValue(t)&&(e.raster=t.getWebGLProcessorDefinition()),{name:this.functionName,parameters:e,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){let e=[];"Clip"===this.functionName&&e.push(this.functionArguments);let{raster:t,rasters:r}=this.functionArguments;if(r&&Array.isArray(r)&&r.length)r.forEach(t=>{if(this._isRasterFunctionValue(t)){let r=t.getClippingGeometries();e.push(...r)}});else if(this._isRasterFunctionValue(t)){let r=t.getClippingGeometries();e.push(...r)}return e}_getOutputPixelType(e){return"unknown"===this.outputPixelType?e:this.outputPixelType??e}_getWebGLParameters(){return{}}_getInputBandIds(e){return e}_swizzleBandIds(e){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(e=>e&&"object"==typeof e&&"rasterFunction"in e&&e.rasterFunction)}_getNeighborhoodSize(){return{rows:1,cols:1}}_removeStatsHistColormapVAT(e){e.statistics=null,e.histograms=null,e.colormap=null,e.attributeTable=null,e.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){let{rasterArgumentNames:e}=this;return"rasters"===e[0]?this.functionArguments.rasters??[]:e.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(e){let t=this._getRasterValues(),{rasterInfos:r,rasterIds:n}=e;if(0===t.length)return r;let s=t.map(e=>e&&"object"==typeof e&&"bind"in e&&e.rasterInfo?e.rasterInfo:"string"==typeof e&&n.includes(e)?r[n.indexOf(e)]:"number"!=typeof e?r[0]:void 0),i=s.find(e=>e)??r[0];return s.forEach((e,t)=>{void 0===e&&(s[t]=i)}),s}_getPrimaryRasterId(e){return e?.rasterId}_getPrimaryRasters(e,t=[],r=[]){for(let n=0;n<e.sourceRasters.length;n++){let s=e.sourceRasters[n];if("number"!=typeof s)if("bind"in s)this._getPrimaryRasters(s,t,r);else{let e=s,n=this._getPrimaryRasterId(e);if(null==n)continue;r.includes(n)||(this.mainPrimaryRasterId===n?(t.unshift(e),r.unshift(n)):(t.push(e),r.push(n)))}}}_isRasterFunctionValue(e){return"object"==typeof e&&!!e&&"getWebGLProcessorDefinition"in e}_readRasterValue(e,t,r){let{primaryPixelBlocks:n}=t;if(null==e||"$$"===e){let e=n[0];return null==e?null:e.clone()}if("string"==typeof e){let r=t.primaryRasterIds.indexOf(e);return-1===r?null:n[r]}if("number"==typeof e){let t=n[0];if(null==t)return null;let{width:r,height:s,pixelType:i}=t,o=new Float32Array(r*s);o.fill(e);let a=this.sourceRasterInfos[0].bandCount,l=Array(a).fill(o);return new g.A({width:r,height:s,pixelType:i,pixels:l})}return e.process(t,r)}_patchRasterInfo(){let{rasterInfo:e}=this;if(!e?.keyProperties)return;let{bandCount:t,keyProperties:r,statistics:n,histograms:s}=e,i=r.BandProperties;i&&i.length!==t&&(e.keyProperties={...r,BandProperties:void 0}),n&&n.length!==t&&(e.statistics=n.length>t?n.slice(0,t):null),s&&s.length!==t&&(e.histograms=s.length>t?s.slice(0,t):null),r.BAND_COUNT&&Number(r.BAND_COUNT)!==t&&(e.keyProperties={...r,BAND_COUNT:"string"==typeof r.BAND_COUNT?String(t):t})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}}),(0,a.wg)(e=>e?.toLowerCase())],x.prototype,"outputPixelType",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"mainPrimaryRasterId",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"sourceRasters",void 0),(0,o.Cg)([(0,a.MZ)({type:[d.A],json:{write:!0}})],x.prototype,"sourceRasterInfos",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rasterInfo",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"readingBufferSize",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"id",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"isNoopProcess",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"supportsGPU",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rawInputBandIds",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"rawSourceRasterInfos",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"isInputBandIdsSwizzled",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"swizzledBandSelection",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"isBranch",void 0),(0,o.Cg)([(0,a.MZ)()],x.prototype,"isRoot",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"flatWebGLFunctionChain",null),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"neighborhoodSize",null),(0,o.Cg)([(0,a.MZ)()],x.prototype,"_bindingResult",void 0),x=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseRasterFunction")],x);const w=x,A={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},v={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},b={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},C={setNull:50,conditional:78},M={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65,...v,...b,majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75,...C},P=new Map([[b.acos,{domain:[0,Math.PI],isInteger:!1}],[b.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[b.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[b.cos,{domain:[-1,1],isInteger:!1}],[b.sin,{domain:[-1,1],isInteger:!1}],[v.booleanAnd,{domain:[0,1],isInteger:!0}],[v.booleanNot,{domain:[0,1],isInteger:!0}],[v.booleanOr,{domain:[0,1],isInteger:!0}],[v.booleanXOr,{domain:[0,1],isInteger:!0}],[v.equalTo,{domain:[0,1],isInteger:!0}],[v.notEqual,{domain:[0,1],isInteger:!0}],[v.greaterThan,{domain:[0,1],isInteger:!0}],[v.greaterThanEqual,{domain:[0,1],isInteger:!0}],[v.lessThan,{domain:[0,1],isInteger:!0}],[v.lessThanEqual,{domain:[0,1],isInteger:!0}],[v.isNull,{domain:[0,1],isInteger:!0}]]);function T(e){return P.get(e)}const R=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function N(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]+s[e]);return o}function I(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand("f32",s);return i.set(n),i}function k(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=n[e]*n[e]);return i}function S(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]-s[e]);return o}function _(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]*s[e]);return o}function F(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=Math.sign(n[e])*Math.floor(Math.abs(n[e])));return i}function B(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]/s[e]);return o}function j(e,t,r){return B(e,t,"f32")}function Z(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=Math.floor(n[e]/s[e]));return o}function z(e,t,r,n){let s=e[0],i=s.length,o=g.A.createEmptyBand(r,i);if(n===b.atanh){for(let e=0;e<i;e++)if(t[e]){let r=s[e];Math.abs(r)>=1?t[e]=0:o[e]=Math.atanh(r)}return o}let a=n===b.asin?Math.asin:Math.acos;for(let e=0;e<i;e++)if(t[e]){let r=s[e];Math.abs(r)>1?t[e]=0:o[e]=a(r)}return o}function G(e,t,r,n){let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n(s[e]));return o}function E(e,t,r,n){let[s,i]=e,o=s.length,a=g.A.createEmptyBand(r,o);for(let e=0;e<o;e++)(!t||t[e])&&(a[e]=n(s[e],i[e]));return a}function O(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]&s[e]);return o}function D(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]<<s[e]);return o}function V(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=~n[e]);return i}function U(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]|s[e]);return o}function L(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]>>s[e]);return o}function W(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]^s[e]);return o}function $(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]&&s[e]?1:0);return o}function K(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=+!n[e]);return i}function H(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]||s[e]?1:0);return o}function q(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+!!n[e]^!!s[e]);return o}function J(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]===s[e]));return o}function X(e,t,r,n){let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i),a=n===Math.E;for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=a?Math.exp(s[e]):n**s[e]);return o}function Y(e,t,r){return X(e,t,r,10)}function Q(e,t,r){return X(e,t,r,2)}function ee(e,t,r){return X(e,t,r,Math.E)}function te(e,t,r,n){let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(s[e]<=0?t[e]=0:o[e]=n(s[e]));return o}function re(e,t,r){return te(e,t,r,Math.log10)}function ne(e,t,r){return te(e,t,r,Math.log2)}function se(e,t,r){return te(e,t,r,Math.log)}function ie(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]>s[e]));return o}function oe(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]>=s[e]));return o}function ae(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]<s[e]));return o}function le(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=+(n[e]<=s[e]));return o}function ue(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);if(!t)return i;for(let e=0;e<s;e++)i[e]=+!t[e];return i}function pe(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]%s[e]);return o}function ce(e,t,r){let[n]=e,s=n.length,i=g.A.createEmptyBand(r,s);for(let e=0;e<s;e++)(!t||t[e])&&(i[e]=-n[e]);return i}function he(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]===s[e]?0:1);return o}function me(e,t,r){let[n,s]=e,i=n.length,o=g.A.createEmptyBand(r,i),a=new Uint8Array(i);for(let e=0;e<i;e++)(null==t||t[e])&&0===n[e]&&(o[e]=s[e],a[e]=255);return{band:o,mask:a}}function fe(e,t,r){let[n,s,i]=e,o=n.length,a=g.A.createEmptyBand(r,o);for(let e=0;e<o;e++)(!t||t[e])&&(a[e]=n[e]?s[e]:i[e]);return a}function ge(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=s[r];for(let s=1;s<n;s++){let n=e[s][r];t<n&&(t=n)}o[r]=t}return o}function de(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=s[r];for(let s=1;s<n;s++){let n=e[s][r];t>n&&(t=n)}o[r]=t}return o}function ye(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=s[r],i=t;for(let s=1;s<n;s++){let n=e[s][r];i<n?i=n:t>n&&(t=n)}o[r]=i-t}return o}function xe(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=0;for(let s=0;s<n;s++)t+=e[s][r];o[r]=t/n}return o}function we(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r])for(let t=0;t<n;t++){let n=e[t];o[r]+=n[r]}return o}function Ae(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i);for(let r=0;r<i;r++)if(!t||t[r]){let t=new Float32Array(n),s=0;for(let i=0;i<n;i++){let n=e[i];s+=n[r],t[i]=n[r]}s/=n;let i=0;for(let e=0;e<n;e++)i+=(t[e]-s)**2;o[r]=Math.sqrt(i/n)}return o}function ve(e,t,r){let n=e.length;if(n<2)return e[0];let s=Math.floor(n/2),[i]=e,o=i.length,a=g.A.createEmptyBand(r,o),l=new Float32Array(n),u=n%2==1;for(let r=0;r<o;r++)if(!t||t[r]){for(let t=0;t<n;t++)l[t]=e[t][r];l.sort(),a[r]=u?l[s]:(l[s]+l[s-1])/2}return a}function be(e,t,r){let[n,s]=e;if(null==s)return n;let i=n.length,o=g.A.createEmptyBand(r,i);for(let e=0;e<i;e++)(!t||t[e])&&(o[e]=n[e]<s[e]?n[e]:s[e]);return o}function Ce(e,t,r){let n=e.length;if(n<=2)return be(e,t,r);let s=e[0].length,i=g.A.createEmptyBand(r,s),o=new Map;for(let r=0;r<s;r++)if(!t||t[r]){o.clear();for(let t=0;t<n;t++){let n=e[t][r];o.set(n,o.has(n)?o.get(n)+1:1)}let t=0,s=0,a=[];for(let e of o.keys())t=o.get(e),t>s?(s=t,a.length=0,a.push(e)):t===s&&a.push(e);a.length>1&&a.sort((e,t)=>e-t),i[r]=a[0]}return i}function Me(e,t,r){let n=e.length;if(n<=2)return be(e,t,r);let s=e[0].length,i=g.A.createEmptyBand(r,s),o=new Map;for(let r=0;r<s;r++)if(!t||t[r]){o.clear();for(let t=0;t<n;t++){let n=e[t][r];o.set(n,o.has(n)?o.get(n)+1:1)}let t=0,s=e.length,a=[];for(let e of o.keys())t=o.get(e),t<s?(s=t,a.length=0,a.push(e)):t===s&&a.push(e);a.length>1&&a.sort((e,t)=>e-t),i[r]=a[0]}return i}function Pe(e,t,r){let n=e.length;if(n<2)return e[0];let[s]=e,i=s.length,o=g.A.createEmptyBand(r,i),a=new Set;for(let r=0;r<i;r++)if(!t||t[r]){let t;a.clear();for(let s=0;s<n;s++)t=e[s][r],a.add(t);o[r]=a.size}return o}const Te=new Map,Re=new Map,Ne=new Map,Ie=new Map;function ke(){Te.size||(Te.set(4,Math.sqrt),Te.set(6,Math.acos),Te.set(7,Math.asin),Te.set(8,Math.atan),Te.set(9,Math.atanh),Te.set(10,Math.abs),Te.set(21,Math.cos),Te.set(22,Math.cosh),Te.set(48,Math.floor),Te.set(49,Math.ceil),Te.set(51,Math.sin),Te.set(52,Math.sinh),Te.set(56,Math.tan),Te.set(57,Math.tanh),Te.set(59,Math.acosh),Te.set(60,Math.asinh),Te.set(65,Math.floor),Re.set(5,Math.pow),Re.set(61,Math.atan2),Ne.set(1,N),Ne.set(2,S),Ne.set(3,_),Ne.set(11,O),Ne.set(12,D),Ne.set(13,V),Ne.set(14,U),Ne.set(15,L),Ne.set(16,W),Ne.set(17,$),Ne.set(18,K),Ne.set(19,H),Ne.set(20,q),Ne.set(23,B),Ne.set(24,J),Ne.set(25,ee),Ne.set(26,Y),Ne.set(27,Q),Ne.set(28,ie),Ne.set(29,oe),Ne.set(30,F),Ne.set(31,ue),Ne.set(32,I),Ne.set(33,ae),Ne.set(34,le),Ne.set(35,se),Ne.set(36,re),Ne.set(37,ne),Ne.set(44,pe),Ne.set(45,ce),Ne.set(46,he),Ne.set(53,k),Ne.set(64,j),Ne.set(65,Z),Ne.set(76,fe),Ne.set(78,fe),Ie.set(38,Ce),Ie.set(39,ge),Ie.set(40,xe),Ie.set(41,ve),Ie.set(42,de),Ie.set(43,Me),Ie.set(47,ye),Ie.set(54,Ae),Ie.set(55,we),Ie.set(58,Pe),Ie.set(66,Ce),Ie.set(67,ge),Ie.set(68,xe),Ie.set(69,ve),Ie.set(70,de),Ie.set(71,Me),Ie.set(72,ye),Ie.set(73,Ae),Ie.set(74,we),Ie.set(75,Pe))}function Se(e,t,r={}){ke();let n=function(e,t=!1){let r=e.map(e=>e.mask),n=r.filter(e=>null!=e),s=e[0].pixels[0].length;if(0===n.length||t&&n.length!==r.length)return new Uint8Array(s).fill(255);let i=n[0],o=new Uint8Array(i);if(1===n.length)return o;if(!t){for(let e=1;e<n.length;e++){let t=n[e];for(let e=0;e<o.length;e++)o[e]&&(o[e]=t[e]?255:0)}return o}for(let e=1;e<n.length;e++){let t=n[e];for(let e=0;e<o.length;e++)0===o[e]&&(o[e]=t[e]?255:0)}return o}(e,t>=66&&t<=75),{outputPixelType:s="f32"}=r,i=!Ie.has(t)||r.processAsMultiband,o=i?e[0].pixels.length:1,a=[];for(let r=0;r<o;r++){let o,u=Ie.has(t)&&!i?e.flatMap(e=>e.pixels):e.map(e=>e.pixels[r]),p=!0;if(t===C.setNull){let e=me(u,n,s);o=e.band,n=e.mask,p=!1}else Ne.has(t)?o=Ne.get(t)(u,n,"f64"):Te.has(t)?o=t===b.asin||t===b.acos||t===b.atanh?z(u,n,"f64",t):G(u,n,"f64",Te.get(t)):Re.has(t)?o=E(u,n,"f64",Re.get(t)):Ie.has(t)?o=Ie.get(t)(u,n,"f64"):(o=u[0],p=!1);if(p&&t!==v.isNull&&!P.has(t)){let e=g.A.createEmptyBand(s,o.length);n||=new Uint8Array(o.length).fill(255),(0,l.$p)(o,n),(0,l.yM)(o,n,s,e),o=e}a.push(o)}let u=e[0];return new g.A({width:u.width,height:u.height,pixelType:s,mask:t===v.isNull?null:n,pixels:a})}let _e=class extends w{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){let{operation:e}=this.functionArguments;if(e<1||e>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};let t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:t.bandCount<=3}}_processPixels(e){let{pixelBlocks:t}=e;return null==t?.[0]||null==t?.[1]?null:function(e,t,r){return Se(e,t=[null,1,2,3,23,5,44][t]??1,{outputPixelType:r})}(t,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){let{operation:e}=this.functionArguments,t=["","plus","minus","times","divide","power","mod"][e],r=this.outputPixelType??"f32",[n,s]=(0,l.hP)(r),i=(0,l.zw)(r);return i&&(n-=1e-4,s+=1e-4),{imageCount:2,operationName:t,domainRange:[n,s],isOutputRounded:i}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],_e.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:f,json:{write:!0,name:"rasterFunctionArguments"}})],_e.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],_e.prototype,"rasterArgumentNames",void 0),_e=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunction")],_e);const Fe=_e;var Be;let je=Be=class extends c{clone(){return new Be({raster:this.raster})}};je=Be=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunctionArguments")],je);const Ze=je;var ze=r(51181);let Ge=class extends w{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){let e=this.sourceRasterInfos[0];this.isGCS=e.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");let t=e.clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=[{min:-1,max:360,avg:180,stddev:30}],t.bandCount=1,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{extent:r,primaryPixelSizes:n}=e,s=n?.[0]??(r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1});return(0,ze.di)(t,{resolution:s})}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ge.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Ze,json:{write:!0,name:"rasterFunctionArguments"}})],Ge.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Ge.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ge.prototype,"isGCS",void 0),Ge=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunction")],Ge);const Ee=Ge;var Oe=r(66552);const De=new Set(["+","-","*","/","(",")"]);function Ve(e,t){return e.toLowerCase().startsWith("b")?t[parseInt(e.slice(1),10)-1]:parseFloat(e)}function Ue(e,t,r,n){if("number"==typeof r&&"number"==typeof n)return r+n;let s,i,o;"number"==typeof r?(o=n,s=o.length,i=new Float32Array(s),i.fill(r)):(s=r.length,i=r,n.constructor===Number?(o=new Float32Array(s),o.fill(n)):o=n);let a=new Float32Array(s);switch(t){case"+":for(let t=0;t<s;t++)(null==e||e[t])&&(a[t]=i[t]+o[t]);break;case"-":for(let t=0;t<s;t++)(null==e||e[t])&&(a[t]=i[t]-o[t]);break;case"*":for(let t=0;t<s;t++)(null==e||e[t])&&(a[t]=i[t]*o[t]);break;case"/":for(let t=0;t<s;t++)(null==e||e[t])&&o[t]&&(a[t]=i[t]/o[t]);break;case"(":case")":throw Error("encountered error with custom band index equation")}return a}function Le(e,t){e.splice(t,1);let r=0,n=0;do{r=0,n=0;for(let t=0;t<e.length;t++)if("("===e[t])r=t;else if(")"===e[t]){n=t;break}n===r+1&&e.splice(r,2)}while(n===r+1);return e}function We(e){if(1===e.length)return{opIndex:0,numIndex:0};let t=0,r=0;for(let n=0;n<e.length;n++)if("("===e[n])t=n;else if(")"===e[n]){r=n;break}let n=0===r?e:e.slice(t+1,r),s=-1;for(let e=0;e<n.length;e++)if("*"===n[e]||"/"===n[e]){s=e;break}if(s>-1)r>0&&(s+=t+1);else{for(let e=0;e<n.length;e++)if("+"===n[e]||"-"===n[e]){s=e;break}r>0&&(s+=t+1)}let i=0;for(let t=0;t<s;t++)"("===e[t]&&i++;return{opIndex:s,numIndex:s-i}}var $e=r(47520);const Ke=new Oe.J({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function He(e,t){if(!(0,$e.AB)(e))return e;let r,{equation:n,method:s}=t,i=t.bandIndexes.map(e=>e-1),{pixels:o,mask:a}=e;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":r=Je(a,o[i[0]],o[i[1]]);break;case"ndwi":r=Je(a,o[i[1]],o[i[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=t[i],n=r[i];n&&(s[i]=e/n)}return[s]}(a,o[i[0]],o[i[1]]);break;case"ci-g":case"ci-re":r=function(e,t,r){let n=t.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=t[i],n=r[i];n&&(s[i]=e/n-1)}return[s]}(a,o[i[0]],o[i[1]]);break;case"savi":r=function(e,t,r,n){let s=r.length,i=new Float32Array(s);for(let o=0;o<s;o++)if(null==e||e[o]){let e=r[o],s=t[o],a=s+e+n;a&&(i[o]=(s-e)/a*(1+n))}return[i]}(a,o[i[0]],o[i[1]],i[2]+1);break;case"tsavi":r=function(e,t,r,n,s,i){let o=r.length,a=new Float32Array(o),l=-s*n+i*(1+n*n);for(let i=0;i<o;i++)if(null==e||e[i]){let e=r[i],o=t[i],u=s*o+e+l;u&&(a[i]=n*(o-n*e-s)/u)}return[a]}(a,o[i[0]],o[i[1]],i[2]+1,i[3]+1,i[4]+1);break;case"msavi":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=r[i],n=t[i],o=2*n+1;s[i]=.5*(o-Math.sqrt(o*o-8*(n-e)))}return[s]}(a,o[i[0]],o[i[1]]);break;case"gemi":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=r[i],n=t[i];if(1!==e&&n+e+.5!==0){let t=(2*(n*n-e*e)+1.5*n+.5*e)/(n+e+.5);s[i]=t*(1-.25*t)-(e-.125)/(1-e)}}return[s]}(a,o[i[0]],o[i[1]]);break;case"pvi":r=function(e,t,r,n,s){let i=r.length,o=new Float32Array(i),a=1/Math.sqrt(1+n*n);for(let l=0;l<i;l++)if(null==e||e[l]){let e=r[l],i=t[l];o[l]=(i-n*e-s)*a}return[o]}(a,o[i[0]],o[i[1]],i[2]+1,i[3]+1);break;case"gvitm":r=function(e,t){let[r,n,s,i,o,a]=t,l=r.length,u=new Float32Array(l);for(let t=0;t<l;t++)(null==e||e[t])&&(u[t]=-.2848*r[t]-.2435*n[t]-.5436*s[t]+.7243*i[t]+.084*o[t]-.18*a[t]);return[u]}(a,[o[i[0]],o[i[1]],o[i[2]],o[i[3]],o[i[4]],o[i[5]]]);break;case"sultan":r=function(e,t){let[r,n,s,i,o]=t,a=r.length,l=new Float32Array(a),u=new Float32Array(a),p=new Float32Array(a);for(let t=0;t<a;t++)(null==e||e[t])&&(l[t]=o[t]?i[t]/o[t]*100:0,u[t]=r[t]?i[t]/r[t]*100:0,p[t]=s[t]?n[t]/s[t]*(i[t]/s[t])*100:0);return[l,u,p]}(a,[o[i[0]],o[i[1]],o[i[2]],o[i[3]],o[i[4]]]);break;case"vari":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=i+e-s[t];a&&(o[t]=(i-e)/a)}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"mtvi2":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=s[t],l=Math.sqrt((2*e+1)**2-(6*e-5*Math.sqrt(i))-.5);if(l){let r=1.5*(1.2*(e-a)-2.5*(i-a));o[t]=r/l}}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"rtvi-core":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=s[t];o[t]=100*(e-i)-10*(e-a)}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"evi":r=function(e,t){let[r,n,s]=t,i=r.length,o=new Float32Array(i);for(let t=0;t<i;t++)if(null==e||e[t])for(t=0;t<i;t++){let e=r[t],i=n[t],a=e+6*i-7.5*s[t]+1;a&&(o[t]=2.5*(e-i)/a)}return[o]}(a,[o[i[0]],o[i[1]],o[i[2]]]);break;case"wndwi":r=function(e,t,r=.5){let[n,s,i]=t,o=s.length,a=new Float32Array(o);for(let t=0;t<o;t++)if(null==e||e[t])for(t=0;t<o;t++){let e=n[t],o=s[t],l=i[t],u=e+r*o+(1-r)*l;u&&(a[t]=(e-r*o-(1-r)*l)/u)}return[a]}(a,[o[i[0]],o[i[1]],o[i[2]]],i[3]?i[3]+1:.5);break;case"bai":r=function(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i])for(i=0;i<n;i++){let e=(.1-t[i])**2+(.06-r[i])**2;e&&(s[i]=1/e)}return[s]}(a,o[i[0]],o[i[1]]);break;case"custom":r=function(e,t,r){let n,{ops:s,nums:i}=function(e,t){(e=e.replaceAll(" ","")).startsWith("-")&&(e="0"+e),e.startsWith("+")&&(e=e.slice(1));let r=e.split(""),n=[],s=[],i="";for(let e=0;e<r.length;e++){let o=r[e];De.has(o)?(i.length&&s.push(Ve(i,t)),n.push(o),i=""):i=i.concat(o)}return i.length&&s.push(Ve(i,t)),{ops:n,nums:s}}(r,t);if(0===s.length){let e=1===i.length?i[0]:t[0];if(e instanceof Float32Array)return[e];let r=new Float32Array(t[0].length);return"number"==typeof e?r.fill(e):r.set(e),[r]}for(;s.length>0;){let{numIndex:t,opIndex:r}=We(s);if(n=Ue(e,s[r],i[t],i[t+1]),1===s.length)break;s=Le(s,r),i.splice(t,2,n)}return[n]}(a,o,n);break;default:return e}let u,{outputPixelType:p="f32"}=t,c=null!=p&&(0,l.zw)(p);a?(u=new Uint8Array(e.width*e.height),u.set(a)):c&&(u=new Uint8Array(e.width*e.height).fill(255)),c&&(r=r.map(e=>{let t=g.A.createEmptyBand(p,e.length);return(0,l.yM)(e,u,p,t),t}));let h=new g.A({width:e.width,height:e.height,pixelType:p,pixels:r,mask:u});return h.updateStatistics(),h}function qe(e){let t=new Float32Array(9);return t[3*e[0]]=1,t[3*e[1]+1]=1,t[3*e[2]+2]=1,t}function Je(e,t,r){let n=r.length,s=new Float32Array(n);for(let i=0;i<n;i++)if(null==e||e[i]){let e=t[i],n=r[i],o=e+n;o&&(s[i]=(e-n)/o)}return[s]}var Xe,Ye=r(93223);let Qe=Xe=class extends c{constructor(){super(...arguments),this.method="custom"}clone(){return new Xe({method:this.method,bandIndexes:this.bandIndexes,raster:(0,i.o8)(this.raster)})}};(0,o.Cg)([(0,a.MZ)({json:{type:String,write:!0}})],Qe.prototype,"bandIndexes",void 0),(0,o.Cg)([(0,Ye.e)(Ke)],Qe.prototype,"method",void 0),Qe=Xe=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunctionArguments")],Qe);const et=Qe,tt=new Set(["vari","mtvi2","rtvi-core","evi"]);let rt=class extends w{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");let e=this.sourceRasterInfos[0];if(e.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};let t=e.clone();return t.pixelType=this.outputPixelType,t.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(t),t.keyProperties={...t.keyProperties,BandProperties:void 0},this.rasterInfo=t,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return t;let{method:r,bandIndexes:n}=this.functionArguments,s=n.split(" ").map(e=>parseFloat(e));if(this.rasterInfo.storageInfo.isBsqTile){let{rawInputBandIds:e}=this,t=tt.has(this.functionArguments.method)?3:2,r=s.slice(0,t).map(t=>e.indexOf(t-1));s.splice(0,t,...r)}return He(t,{method:r,bandIndexes:s,equation:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let e=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1);2===e.length&&e.push(0);let t,r,n=this.isInputBandIdsSwizzled?[0,1,2]:e,s=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":t=qe([n[0],n[1],0]),r="ndxi";break;case"ndwi":t=qe([n[1],n[0],0]),r="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":t=qe([n[0],n[1],0]),r="sr";break;case"ci-g":case"ci-re":t=qe([n[0],n[1],0]),r="ci";break;case"savi":t=qe([n[0],n[1],0]),r="savi",s[0]=e[2]+1;break;case"tsavi":t=qe([n[0],n[1],0]),r="tsavi",s[0]=e[2]+1,s[1]=e[3]+1,s[2]=e[4]+1;break;case"msavi":t=qe([n[0],n[1],0]),r="msavi";break;case"gemi":t=qe([n[0],n[1],0]),r="gemi";break;case"pvi":t=qe([n[0],n[1],0]),r="tsavi",s[0]=e[2]+1,s[1]=e[3]+1;break;case"vari":t=qe([n[0],n[1],n[2]]),r="vari";break;case"mtvi2":t=qe([n[0],n[1],n[2]]),r="mtvi";break;case"rtvi-core":t=qe([n[0],n[1],n[2]]),r="rtvicore";break;case"evi":t=qe([n[0],n[1],n[2]]),r="evi";break;case"wndwi":t=qe([n[0],n[1],0]),r="wndwi",s[0]=e[3]?e[3]+1:.5;break;case"bai":t=qe([n[1],n[0],0]),r="bai";break;default:t=qe([0,1,2]),r="custom"}return{bandIndexMat3:t,indexType:r,adjustments:s,isOutputRounded:(0,l.zw)(this.outputPixelType)}}_getInputBandIds(e){if("custom"===this.functionArguments.method)return e;let t=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1),r=e.length,n=t.map(e=>e>=r?r-1:e),s=tt.has(this.functionArguments.method)?3:2,i=n.slice(0,s).map(t=>e[t]);return 2===i.length&&i.push(0),i}_swizzleBandIds(e){let t=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1);2===t.length&&t.push(0);let{method:r}=this.functionArguments,n=(["vari","mtvi2","rtvi-core","evi"].includes(r)?t.slice(0,3):"bai"===r||"ndwi"===r?[t[1],t[0]]:t.slice(0,2)).map(t=>e.indexOf(t));return n[2]??=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],rt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:et,json:{write:!0,name:"rasterFunctionArguments"}})],rt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],rt.prototype,"rasterArgumentNames",void 0),rt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunction")],rt);const nt=rt;var st,it=r(65864),ot=r(50498);const at=new Oe.J({1:"outside",2:"inside"},{useNumericKeys:!0});let lt=st=class extends c{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new st({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,o.Cg)([(0,a.MZ)({types:ot.yR,json:{read:it.rS,write:!0}})],lt.prototype,"clippingGeometry",void 0),(0,o.Cg)([(0,a.MZ)({json:{read:at.read,write:at.write}})],lt.prototype,"clippingType",void 0),lt=st=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunctionArguments")],lt);const ut=lt;var pt=r(34930),ct=r(37373);let ht=class extends w{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this.rasterInfo=e;let{functionArguments:t}=this,{clippingGeometry:r,clippingType:n}=t;if(!r)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===n)try{let{spatialReference:t}=e,n="extent"===r.type?(0,ct._l)(r,t):(0,ct.uk)(r,t).extent;n&&(0,pt.Sd)(e,n)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}_getWebGLParameters(){let{clippingGeometry:e,clippingType:t}=this.functionArguments;return{clippingGeometry:e.toJSON(),clippingType:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ht.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:ut,json:{write:!0,name:"rasterFunctionArguments"}})],ht.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],ht.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],ht.prototype,"isNoopProcess",void 0),ht=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunction")],ht);const mt=ht;var ft,gt=r(67369),dt=r(95349),yt=r(36005);let xt=ft=class extends c{castColormapName(e){if(!e)return null;let t=e.toLowerCase();return gt.L7.includes(t)?t:null}readColorRamp(e){return(0,dt.r)(e)}readColorRampName(e,t){if(!e)return null;let r=gt.kH.jsonValues.find(t=>t.toLowerCase()===e.toLowerCase());return r?gt.kH.fromJSON(r):null}clone(){return new ft({colormap:(0,i.o8)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,o.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],xt.prototype,"colormap",void 0),(0,o.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],xt.prototype,"colormapName",void 0),(0,o.Cg)([(0,a.wg)("colormapName")],xt.prototype,"castColormapName",null),(0,o.Cg)([(0,a.MZ)({types:dt.g,json:{write:!0}})],xt.prototype,"colorRamp",void 0),(0,o.Cg)([(0,yt.w)("colorRamp")],xt.prototype,"readColorRamp",null),(0,o.Cg)([(0,a.MZ)({type:gt.kH.apiValues,json:{type:gt.kH.jsonValues,write:gt.kH.write}})],xt.prototype,"colorRampName",void 0),(0,o.Cg)([(0,yt.w)("colorRampName")],xt.prototype,"readColorRampName",null),xt=ft=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunctionArguments")],xt);const wt=xt,At=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],vt=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function bt(e,t){let r=[],n=[];for(let t=0;t<e.length-1;t++)r.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:e[t].slice(1),toColor:e[t+1].slice(1)}),n.push(e[t+1][0]-e[t][0]);let s=e[e.length-1][0];return t??=n,(0,gt.iv)({type:"multipart",colorRamps:r},{numColors:s,weights:t})}let Ct=class extends w{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:t,colormapName:r,colorRamp:n,colorRampName:s}=this.functionArguments;if(!t?.length)if(n)this.colorRamp=n,t=(0,gt.R8)(n,{interpolateAlpha:!0});else if(s){let e=(0,gt.M5)(s);e&&(t=(0,gt.R8)(e),this.colorRamp=(0,dt.r)(e))}else r&&(t=function(e){let t;switch(e){case"elevation":t=bt([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]]);break;case"gray":t=(0,gt.iv)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":t=bt([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":t=At;break;case"ndvi2":t=function(){let e=bt([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let t=e.length;t<256;t++)e.push([6,27,7]);return e}();break;case"ndvi3":t=vt;break;case"random":t=function(){let e=[];for(let t=0;t<256;t++){let t=[];for(let e=0;e<3;e++)t.push(Math.round(255*Math.random()));e.push(t)}return e}()}return t?(t=t.map((e,t)=>[t,...e]),t):null}(r));if(!t?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};let i=this._getOutputPixelType(e.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;let o=e.clone();return o.pixelType=this.outputPixelType,o.colormap=t,o.bandCount=1,this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];return!t||(0,l.zw)(t.pixelType)||(t=t.clone(),t.clamp(this.outputPixelType)),t}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:wt,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Ct.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],Ct.prototype,"isNoopProcess",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ct.prototype,"indexedColormap",void 0),(0,o.Cg)([(0,a.MZ)()],Ct.prototype,"colorRamp",void 0),Ct=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunction")],Ct);const Mt=Ct;var Pt;let Tt=Pt=class extends c{clone(){return new Pt({raster:this.raster})}};Tt=Pt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunctionArguments")],Tt);const Rt=Tt;var Nt=r(4151),It=r(88178);let kt=class extends w{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1||!e.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};let t=e.clone();t.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(t),t.bandCount=3,t.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=t;let r=[...e.colormap].sort((e,t)=>e[0]-t[0]),{indexedColormap:n,offset:s}=(0,$e.zg)({colormap:r});return n?(this.lookup={indexedColormap:n,offset:s},{success:!0,supportsGPU:(0,It.WN)(n)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(e){let t=e.pixelBlocks?.[0];if(!t||!this.lookup)return t;t=t.clone();let r=t.pixels[0],n=t.mask??new Uint8Array(r.length).fill(255),s=new Uint8Array(r.length),i=new Uint8Array(r.length),o=new Uint8Array(r.length),{indexedColormap:a,offset:l}=this.lookup,u=a.length;for(let e=0;e<r.length;e++)if(n[e]){let t=4*(r[e]-l);t<0||t>u-4?n[e]=0:(s[e]=a[t++],i[e]=a[t++],o[e]=a[t++])}return t.pixels=[s,i,o],t.statistics=[new Nt.A(0,255),new Nt.A(0,255),new Nt.A(0,255)],t.pixelType=this.outputPixelType,t}_getWebGLParameters(){return this.lookup}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],kt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Rt,json:{write:!0,name:"rasterFunctionArguments"}})],kt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],kt.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],kt.prototype,"lookup",void 0),kt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunction")],kt);const St=kt;var _t,Ft=r(43937);let Bt=_t=class extends c{constructor(){super(...arguments),this.rasters=[]}writeRasters(e,t){t.rasters=e.map(e=>"number"==typeof e||"string"==typeof e?e:e.toJSON())}clone(){return new _t({rasters:(0,i.o8)(this.rasters)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Bt.prototype,"rasters",void 0),(0,o.Cg)([(0,Ft.K)("rasters")],Bt.prototype,"writeRasters",null),Bt=_t=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunctionArguments")],Bt);const jt=Bt;let Zt=class extends w{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){let{sourceRasterInfos:e}=this,t=e[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);let r=t.clone();if(r.attributeTable=null,r.colormap=null,r.pixelType=this.outputPixelType,r.bandCount=e.map(({bandCount:e})=>e).reduce((e,t)=>e+t),e.every(({statistics:e})=>null!=e&&e.length)){let t=[];e.forEach(({statistics:e})=>null!=e&&t.push(...e)),r.statistics=t}if(e.every(({histograms:e})=>null!=e&&e.length)){let t=[];e.forEach(({histograms:e})=>null!=e&&t.push(...e)),r.histograms=t}r.multidimensionalInfo&&r.multidimensionalInfo.variables.forEach(t=>{let r=e.map(e=>e.multidimensionalInfo?.variables.find(({name:e})=>e===t.name)),n=r.map(e=>e?.statistics?.length?e.statistics:null),s=r.map(e=>e?.histograms?.length?e.histograms:null);t.statistics=n.every(e=>null!=e)?n.flat():null,t.histograms=s.every(e=>null!=e)?s.flat():null}),r.bandCount>1&&(r.colormap=null,r.attributeTable=null);let n=e.every(e=>e.keyProperties.BandProperties?.length)?e.flatMap(e=>e.keyProperties.BandProperties):void 0;return r.keyProperties={...r.keyProperties,BandProperties:n},this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3}}_processPixels(e){let{pixelBlocks:t}=e;return t&&null!=t?.[0]?(0,$e.Wy)(t):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Zt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:jt,json:{write:!0,name:"rasterFunctionArguments"}})],Zt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Zt.prototype,"rasterArgumentNames",void 0),Zt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunction")],Zt);const zt=Zt,Gt=new Oe.J({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),Et=new Oe.J({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});var Ot;let Dt=Ot=class extends c{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new Ot({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};(0,o.Cg)([(0,Ye.e)(Gt)],Dt.prototype,"method",void 0),(0,o.Cg)([(0,Ye.e)(Et)],Dt.prototype,"keepMethod",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Dt.prototype,"raster2",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],Dt.prototype,"rasters",null),Dt=Ot=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunctionArguments")],Dt);const Vt=Dt;var Ut=r(20437);let Lt=class extends w{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){let{method:e}=this.functionArguments,t=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),"categorical"===e){let e=this.sourceRasterInfos.map(e=>e.attributeTable),r=this._getFieldNames(e,"value"),n=e.map(e=>this._getClassFieldName(e));if(null==r[0]||null==r[1]||null==n[0]||null==n[1])return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(t,r,n)}return t.bandCount=1,this.rasterInfo=t,{success:!0,supportsGPU:"difference"===e||"relative-difference"===e}}_processPixels(e){let{pixelBlocks:t}=e;if(null==t?.[0]||null==t?.[1])return null;let{method:r}=this.functionArguments;return function(e,t,r,n){let[s,i]=e,o=(0,l.zw)(r)&&!(0,l.zw)(s.pixelType)&&!(0,l.zw)(i.pixelType),a=[s.mask,i.mask].filter(e=>e),u=g.A.combineBandMasks(a),p=e.map(e=>e.pixels[0]),{width:c,height:h}=s,m=g.A.createEmptyBand(r,c*h);switch(t){case"difference":case"relative-difference":!function(e){let{bands:[t,r],mask:n,isRelative:s,isRoundingNeeded:i,outBand:o}=e,a=t.length;for(let e=0;e<a;e++)if(!n||n[e]){let n=t[e]-r[e];if(s){let s=Math.max(Math.abs(t[e]),Math.abs(r[e]));n=0===s?0:n/s}o[e]=i?Math.round(n):n}}({bands:p,mask:u,outBand:m,isRoundingNeeded:o,isRelative:"relative-difference"===t});break;case"categorical":!function(e){let{bands:[t,r],categoryIndexLookups:[n,s],classNames:[i,o],mask:a,keepMethod:l,outBand:u}=e,p=t.length,c=i.length,h=o.length,m=c*h,f=m+1,g=m+2;for(let e=0;e<p;e++)if(!a||a[e]){let a=t[e],p=r[e],c=n[a],d=s[p],y=i[c],x=o[d];u[e]=null==c||null==d?m:"changed"===l&&y===x?f:"unchanged"===l&&y!==x?g:c*h+d}}({bands:p,mask:u,outBand:m,...n});break;case"euclidean-distance":!function(e){let{pixels:[t,r],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let e=0;e<i;e++)if(!n||n[e]){let n=0;for(let s=0;s<o;s++){let i=t[s][e]-r[s][e];n+=i*i}s[e]=Math.sqrt(n)}}({pixels:e.map(e=>e.pixels),mask:u,outBand:m});break;case"angle-difference":!function(e){let{pixels:[t,r],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let e=0;e<i;e++)if(!n||n[e]){let n=0,i=0,a=0;for(let s=0;s<o;s++){let o=t[s][e],l=r[s][e];n+=o*l,i+=o*o,a+=l*l}let l=Math.sqrt(i*a);s[e]=l?Math.acos(n/l):1.5707963267948966}}({pixels:e.map(e=>e.pixels),mask:u,outBand:m});break;case"band-with-most-change":!function(e){let{pixels:[t,r],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let e=0;e<i;e++)if(!n||n[e]){let n=0,i=0;for(let s=0;s<o;s++){let o=Math.abs(t[s][e]-r[s][e]);o>n&&(n=o,i=s)}s[e]=i}}({pixels:e.map(e=>e.pixels),mask:u,outBand:m})}let f=new g.A({width:c,height:h,pixels:[m],pixelType:r,mask:u});return f.updateStatistics(),f}(t,r,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){let e=this.outputPixelType??"f32",[t,r]=(0,l.hP)(e),n=(0,l.zw)(e);return n&&(t-=1e-4,r+=1e-4),{method:this.functionArguments.method,domainRange:[t,r],isOutputRounded:n}}_updateAttributeTable(e,t,r){let n=this.sourceRasterInfos.map(e=>e.attributeTable),s=n.map((e,r)=>e.features.map(e=>e.attributes[t[r]])),i=n.map((e,t)=>e.features.map(e=>e.attributes[r[t]])),o=s.map(e=>{let t=[];return e.forEach((e,r)=>t[e]=r),t}),{keepMethod:a}=this.functionArguments;this._categoryConfig={categoryIndexLookups:o,classNames:i,keepMethod:a};let l=n[0].clone();l.fields=[new Ut.A({name:"OID",type:"oid"}),new Ut.A({name:"Value",type:"integer"}),new Ut.A({name:"ClassName",type:"string"}),new Ut.A({name:"Class_From",type:"string"}),new Ut.A({name:"Class_To",type:"string"})];let u=this._getFieldNames(n,"red"),p=this._getFieldNames(n,"green"),c=this._getFieldNames(n,"blue"),h=[],m=2===u.length&&2===p.length&&2===c.length;m&&(h.push(...n.map((e,t)=>e.features.map(e=>[e.attributes[u[t]],e.attributes[p[t]],e.attributes[c[t]]]))),l.fields.push(new Ut.A({name:"Red",type:"integer"}),new Ut.A({name:"Green",type:"integer"}),new Ut.A({name:"Blue",type:"integer"})));let f=l.features[0].clone();f.geometry=null;let g=[],[d,y]=s.map(e=>e.length),x=1;for(let e=0;e<d;e++){let t=i[0][e];for(let r=0;r<y;r++){let n=i[1][r];if("changed"===a&&t===n||"unchanged"===a&&t!==n)continue;let s=f.clone();s.attributes={OID:x++,Value:e*y+r,ClassName:t===n?t:`${t} -> ${n}`,Class_From:t,Class_To:n},m&&(s.attributes.Red=h[0][e][0]+h[1][r][0]>>1,s.attributes.Green=h[0][e][1]+h[1][r][1]>>1,s.attributes.Blue=h[0][e][2]+h[1][r][2]>>1),g.push(s)}}if("changed"===a){let e=f.clone();e.attributes={OID:x++,Value:d*y+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},g.push(e)}else if("unchanged"===a){let e=f.clone();e.attributes={OID:x++,Value:d*y+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},g.push(e)}l.features=g,e.attributeTable=l}_getFieldNames(e,t){return e.map(({fields:e})=>e.find(e=>e.name.toLowerCase()===t)?.name).filter(e=>e)}_getClassFieldName(e){return(e.fields.find(e=>"string"===e.type&&e.name.toLowerCase().startsWith("class"))??e.fields.find(e=>"string"===e.type&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??e.fields.find(e=>"string"===e.type))?.name}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Lt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Vt,json:{write:!0,name:"rasterFunctionArguments"}})],Lt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Lt.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Lt.prototype,"_categoryConfig",void 0),Lt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunction")],Lt);const Wt=Lt;var $t;let Kt=$t=class extends c{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new $t({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=$t=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunctionArguments")],Kt);const Ht=Kt;var qt=r(51927);let Jt=class extends w{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){let{sourceRasterInfos:e}=this,t=e[0];if("u8"!==t.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");let r=t.clone();this._removeStatsHistColormapVAT(r),this.rasterInfo=r;let{contrastOffset:n,brightnessOffset:s}=this.functionArguments;return this.lookup=(0,qt.zj)(n,s),{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];return null==t?null:(0,$e.eH)(t,{lut:t.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){let{contrastOffset:e,brightnessOffset:t}=this.functionArguments;return{contrastOffset:e,brightnessOffset:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Jt.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Ht,json:{write:!0,name:"rasterFunctionArguments"}})],Jt.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Jt.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Jt.prototype,"lookup",void 0),Jt=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunction")],Jt);const Xt=Jt;function Yt(e,t,r,n,s){let i=Math.floor(n/2);for(let n=0;n<i;n++)for(let i=0;i<t;i++)e[n*t+i]=e[(s-1-n)*t+i],e[(r-1-n)*t+i]=e[(r-s+n)*t+i];let o=Math.floor(s/2);for(let n=0;n<r;n++){let r=n*t;for(let n=0;n<o;n++)e[r+n]=e[r+s-1-n],e[r+t-n-1]=e[r+t+n-s]}}const Qt=new Map;function er(e,t,r,n,s,i,o){let a=new Float32Array(t*r),l=i.length,u=o?0:n,p=o?n:0,c=o?1:t;for(let o=u;o<r-u;o++){let r=o*t;for(let o=p;o<t-p;o++){if(s&&!s[r+o])continue;let t=0;for(let s=0;s<l;s++)t+=e[r+o+(s-n)*c]*i[s];a[r+o]=t}}return a}function tr(e,t,r,n,s,i,o){let a=new Float32Array(t*r),l=Math.floor(n/2),u=Math.floor(s/2);for(let p=l;p<r-l;p++){let r=p*t;for(let p=u;p<t-u;p++){if(i&&!i[r+p])continue;let c=0;for(let i=0;i<n;i++)for(let n=0;n<s;n++)c+=e[r+p+(i-l)*t+n-u]*o[i*s+n];a[r+p]=c}}return a}var rr;Qt.set(A.none,[0,0,0,0,1,0,0,0,0]),Qt.set(A.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),Qt.set(A.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),Qt.set(A.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),Qt.set(A.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),Qt.set(A.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),Qt.set(A.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),Qt.set(A.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),Qt.set(A.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),Qt.set(A.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),Qt.set(A.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),Qt.set(A.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),Qt.set(A.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),Qt.set(A.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),Qt.set(A.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Qt.set(A.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),Qt.set(A.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),Qt.set(A.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),Qt.set(A.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),Qt.set(A.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),Qt.set(A.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),Qt.set(A.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),Qt.set(A.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let nr=rr=class extends c{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(e){this._set("convolutionType",e);let t=Qt.get(e);if(!t||e===A.userDefined||e===A.none)return;let r=Math.round(Math.sqrt(t.length));this._set("kernel",t),this._set("cols",r),this._set("rows",r)}clone(){return new rr({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,i.o8)(this.raster)})}};(0,o.Cg)([(0,a.MZ)({json:{type:Number,write:!0}})],nr.prototype,"rows",void 0),(0,o.Cg)([(0,a.MZ)({json:{type:Number,write:!0,name:"columns"}})],nr.prototype,"cols",void 0),(0,o.Cg)([(0,a.MZ)({json:{name:"type",type:Number,write:!0}})],nr.prototype,"convolutionType",null),(0,o.Cg)([(0,a.MZ)({json:{type:[Number],write:!0}})],nr.prototype,"kernel",void 0),nr=rr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunctionArguments")],nr);const sr=nr;let ir=class extends w{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}get _normalizedKernel(){let{kernel:e,convolutionType:t}=this.functionArguments,r=e.reduce((e,t)=>e+t);return-1===t||0===r||1===r?e:e.map(e=>e/r)}_bindSourceRasters(){let{convolutionType:e,rows:t,cols:r,kernel:n}=this.functionArguments;if(!Object.values(A).includes(e))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${e}`};if(e!==A.none&&t*r!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};let s=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(s.pixelType);let i=s.clone();i.pixelType=this.outputPixelType;let o=[A.none,A.sharpen,A.sharpen2,A.sharpening3x3,A.sharpening5x5];return(-1===e||"u8"!==this.outputPixelType&&!o.includes(e))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:n.length<=25}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t||this.functionArguments.convolutionType===A.none)return t;let{rows:r,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;return function(e,t){let r=function(e){let t=Math.sqrt(e.length),r=e.slice(0,t),n=[1];for(let r=1;r<t;r++){let s=null;for(let n=0;n<t;n++){let i=e[n+r*t],o=e[n];if(null==s)if(0===o){if(i)return{separable:!1,row:null,col:null}}else s=i/o;else if(i/o!==s)return{separable:!1,row:null,col:null}}if(null==s)return{separable:!1,row:null,col:null};n.push(s)}return{separable:!0,row:r,col:n}}(t.kernel),n=!1!==t.mirrorEdges,s=r.separable?function(e,t,r,n=!0){let{pixels:s,width:i,height:o,pixelType:a,mask:l}=e,u=s.length,p=[],c=t.length,h=r.length,m=Math.floor(c/2),f=Math.floor(h/2);for(let e=0;e<u;e++){let a=er(s[e],i,o,m,l,t,!0);a=er(a,i,o,f,l,r,!1),n&&Yt(a,i,o,c,h),p.push(a)}return new g.A({width:i,height:o,pixelType:a,pixels:p,mask:l})}(e,r.row,r.col,n):function(e,t,r=!0){let{pixels:n,width:s,height:i,pixelType:o,mask:a}=e,l=n.length,u=[],{kernel:p,rows:c,cols:h}=t;for(let e=0;e<l;e++){let t=tr(n[e],s,i,c,h,a,p);r&&Yt(t,s,i,c,h),u.push(t)}return new g.A({width:s,height:i,pixelType:o,pixels:u,mask:a})}(e,t,n),{outputPixelType:i}=t;return i&&s.clamp(i),s}(t,{kernel:s,rows:r,cols:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let e=new Float32Array(25),{rows:t,cols:r}=this.functionArguments,{_normalizedKernel:n}=this;for(let s=0;s<t;s++)for(let t=0;t<r;t++)e[5*s+t]=n[s*r+t];return{kernelRows:t,kernelCols:r,kernel:e,clampRange:(0,l.hP)(this.outputPixelType)}}_getNeighborhoodSize(){let{rows:e,cols:t}=this.functionArguments;return{rows:e,cols:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ir.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:sr,json:{write:!0,name:"rasterFunctionArguments"}})],ir.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],ir.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],ir.prototype,"_normalizedKernel",null),ir=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunction")],ir);const or=ir;var ar;const lr=new Oe.J({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let ur=ar=class extends c{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(e,t){return lr.fromJSON(t.type??t.curvatureType??0)}clone(){return new ar({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({json:{write:{target:"type"}}}),(0,Ye.e)(lr)],ur.prototype,"curvatureType",void 0),(0,o.Cg)([(0,yt.w)("curvatureType",["type","curvatureType"])],ur.prototype,"readCurvatureType",null),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],ur.prototype,"zFactor",void 0),ur=ar=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunctionArguments")],ur);const pr=ur;let cr=class extends w{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");let e=this.sourceRasterInfos[0].clone();return e.pixelType=this.outputPixelType,e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{zFactor:r,curvatureType:n}=this.functionArguments,{extent:s,primaryPixelSizes:i}=e,o=i?.[0]??(s?{x:s.width/t.width,y:s.height/t.height}:{x:1,y:1}),a=this.isGCS&&r>=1?r*ze.rk:r;return(0,ze.E0)(t,{zFactor:a,curvatureType:n,resolution:o})}_getWebGLParameters(){let{zFactor:e,curvatureType:t}=this.functionArguments;return{curvatureType:t,zFactor:this.isGCS&&e>=1?e*ze.rk:e}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],cr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:pr,json:{write:!0,name:"rasterFunctionArguments"}})],cr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],cr.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],cr.prototype,"isGCS",void 0),cr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunction")],cr);const hr=cr;var mr;let fr=mr=class extends c{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=0}clone(){return new mr({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"bandIds",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"bandNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"bandWavelengths",void 0),(0,o.Cg)([(0,Ye.e)({0:"name",1:"wavelength",2:"id"})],fr.prototype,"method",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"missingBandAction",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],fr.prototype,"wavelengthMatchTolerance",void 0),fr=mr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunctionArguments")],fr);const gr=fr;let dr=class extends w{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let{functionArguments:e,sourceRasterInfos:t}=this,r=t[0],{method:n,bandNames:s,bandWavelengths:i,bandIds:o,missingBandAction:a}=e,l=s?.length&&("name"===n||"id"!==n&&!o?.length),u=i?.length&&("wavelength"===n||"id"!==n&&!o?.length),p=1===a,c=l?function(e,t){let r=e.bandInfos.map(({name:e})=>e.toLowerCase()),n=[];for(let e=0;e<t.length;e++){let s=t[e].toLowerCase(),i=r.indexOf(s);if(-1===i&&"nearinfrared"===s&&(i=r.findIndex(e=>e.startsWith("nearinfrared_1")),-1===i&&(i=r.findIndex(e=>e.startsWith("nearinfrared")))),-1===i)return null;n.push(i)}return n}(r,s):u?function(e,t,{wavelengthMatchTolerance:r},n){let{bandInfos:s}=e,i=[];for(let e=0;e<s.length;e++){let{minWavelength:t,maxWavelength:r}=s[e];if(!t||!r)return null;i.push({minWavelength:t,maxWavelength:r})}let o=[];for(let e=0;e<t.length;e++){let s=t[e],a=!1,l=-1,u=Number.MAX_VALUE;for(let e=0;e<i.length;e++){let t=i[e],r=s>=t.minWavelength&&s<=t.maxWavelength,n=Math.abs(s-(t.minWavelength+t.maxWavelength)/2);r?n<u&&(a=!0,l=e,u=n):!a&&n<u&&(l=e,u=n)}if(!a&&r&&u<r&&(a=!0),!a&&n)return null;o.push(l)}return o}(r,i,this.functionArguments,p):function(e,t,r){let{bandCount:n}=e;return!t?.length||r&&t.some(e=>e<0||e>=n)?null:t}(r,o,p);if(null==c)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":u?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=c,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType(r.pixelType);let h=r.clone();h.pixelType=this.outputPixelType,h.bandCount=c.length;let{statistics:m,histograms:f}=h;null!=m&&m.length&&(h.statistics=c.map(e=>m[e]||m[m.length-1])),null!=f&&f.length&&(h.histograms=c.map(e=>f[e]||f[f.length-1])),h.multidimensionalInfo&&h.multidimensionalInfo.variables.forEach(e=>{let{statistics:t,histograms:r}=e;null!=t&&t.length&&(e.statistics=c.map(e=>t[e]||t[t.length-1])),null!=r&&r.length&&(e.histograms=c.map(e=>r[e]||r[r.length-1]))});let g=h.keyProperties?.BandProperties;return g?.length&&(g=c.map(e=>e>=g.length?g[g.length-1]:g[e]),h.keyProperties={...h.keyProperties,BandProperties:g}),this.rasterInfo=h,{success:!0,supportsGPU:h.bandCount<=3}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{bandIds:r}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){let{rawInputBandIds:e}=this;r=r.map(t=>e.indexOf(t))}else{let e=t.pixels.length;r=r.map(t=>t>=e?e-1:t)}return t.extractBands(r)}_getWebGLParameters(){let e;if(this.isInputBandIdsSwizzled)e=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{e=[...this.functionArguments.bandIds],0===e.length?e=[0,1,2]:e.length<3&&(e[1]=e[1]??e[0],e[2]=e[2]??e[1]);for(let t=0;t<3;t++)e[t]=Math.min(e[t],2)}return{bandIndexMat3:qe(e)}}_getInputBandIds(e){let t=e.length;return this.functionArguments.bandIds.map(e=>e>=t?t-1:e).map(t=>e[t])}_swizzleBandIds(e){let t=this.functionArguments.bandIds.map(t=>e.indexOf(t));return this.isInputBandIdsSwizzled=!0,t[1]??=t[0],t[2]??=t[1],this.swizzledBandSelection=t,!1}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],dr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:gr,json:{write:!0,name:"rasterFunctionArguments"}})],dr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],dr.prototype,"rasterArgumentNames",void 0),dr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunction")],dr);const yr=dr;function xr(e,t,r,n){let{pixels:s,width:i,height:o}=e,a=s.length,u=r.startsWith("f"),p=!u,[c,h]=(0,l.hP)(r),m=i*o,f=g.A.createEmptyBand(r,m);for(let e=0;e<o;e++){let r=e*i;for(let e=0;e<i;e++,r++)if(!n||n[r]){let e=0;for(let n=0;n<a;n++)e+=t[n]*s[n][r];u||(e=Math.round(e),p&&(e=e>h?h:e<c?c:e)),f[r]=e}}return f}var wr;let Ar=wr=class extends c{clone(){return new wr({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],Ar.prototype,"conversionParameters",void 0),Ar=wr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunctionArguments")],Ar);const vr=Ar;let br=class extends w{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){let{conversionParameters:e}=this.functionArguments,t=e.reduce((e,t)=>e+t);return e.map(e=>e/t)}_bindSourceRasters(){let{conversionParameters:e}=this.functionArguments;if(!e?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};let t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType;let r=3===e.length||3===t.bandCount&&e.length>3;return t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:r}}_processPixels(e){let t=e.pixelBlocks?.[0];return null==t?null:function(e,t,r){let{width:n,height:s,mask:i,bandMasks:o}=e,a=o?.length?g.A.combineBandMasks(o):i,l=xr(e,t,r,a),u=new g.A({width:n,height:s,pixels:[l],pixelType:r,mask:a});return u.updateStatistics(),u}(t,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],br.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:vr,json:{write:!0,name:"rasterFunctionArguments"}})],br.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],br.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],br.prototype,"_normalizedWeights",null),br=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunction")],br);const Cr=br;var Mr;const Pr=new Oe.J({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Tr=new Oe.J({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let Rr=Mr=class extends c{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Mr({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rr.prototype,"altitude",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rr.prototype,"azimuth",void 0),(0,o.Cg)([(0,a.MZ)(),(0,Ye.e)(Pr)],Rr.prototype,"hillshadeType",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psPower"}})],Rr.prototype,"pixelSizePower",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psZFactor"}})],Rr.prototype,"pixelSizeFactor",void 0),(0,o.Cg)([(0,a.MZ)(),(0,Ye.e)(Tr)],Rr.prototype,"slopeType",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rr.prototype,"zFactor",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Rr.prototype,"removeEdgeEffect",void 0),Rr=Mr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunctionArguments")],Rr);const Nr=Rr;let Ir=class extends w{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");let t=e.clone();return this._removeStatsHistColormapVAT(t),t.pixelType=this.outputPixelType,t.bandCount=1,t.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(!t)return null;let{extent:r,primaryPixelSizes:n}=e,s=n?.[0]??(r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1}),i=(0,ze.PP)(this.functionArguments,s,this.isGCS),o=(0,ze.fw)(t,i);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){let e=(0,ze.PP)(this.functionArguments,{x:1,y:1},this.isGCS),t=(0,ze.ng)(e),{slopeType:r,zFactor:n,pixelSizeFactor:s,pixelSizePower:i}=this.functionArguments,o="scaled"===r,a=(0,l.zw)(this.outputPixelType);return{...t,zFactor:n,gcsFactor:this.isGCS?ze.rk:1,pixelSizeFactor:o?s:0,pixelSizePower:o?i:0,isOutputRounded:a}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ir.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Nr,json:{write:!0,name:"rasterFunctionArguments"}})],Ir.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Ir.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ir.prototype,"isGCS",void 0),Ir=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunction")],Ir);const kr=Ir;var Sr;let _r=Sr=class extends c{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(e,t){t.rasters=e.map(e=>"number"==typeof e||"string"==typeof e?e:e.toJSON())}clone(){return new Sr({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,i.o8)(this.rasters)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],_r.prototype,"operation",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],_r.prototype,"rasters",void 0),(0,o.Cg)([(0,Ft.K)("rasters")],_r.prototype,"writeRasters",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],_r.prototype,"processAsMultiband",void 0),_r=Sr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunctionArguments")],_r);const Fr=_r;let Br=class extends w{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){let{sourceRasterInfos:e}=this,t=e[0],{bandCount:r}=t,{processAsMultiband:n}=this.functionArguments;if(e.some(e=>e.bandCount!==r))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};let{operation:s,rasters:i}=this.functionArguments,o=R[s];if(!(999===o||i.length===o||i.length<=1&&1===o))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${o}`};let a=t.clone();return a.bandCount=999!==o||n?r:1,this._removeStatsHistColormapVAT(a),this._updateStatistics(a),this._updatePixelType(a),this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&o<=3}}_processPixels(e){let{pixelBlocks:t}=e;return null==t||t.some(e=>null==e)?null:Se(t,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){let{operation:e}=this.functionArguments,t=R[e],r=Object.keys(M).find(t=>M[t]===e)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32",[s,i]=(0,l.hP)(n),o=(0,l.zw)(n);return o&&(s-=1e-4,i+=1e-4),{imageCount:t,operationName:r,domainRange:[s,i],isOutputRounded:o}}_updateStatistics(e){let t=this.sourceRasterInfos[0],{operation:r}=this.functionArguments,n=T(r)?.domain;if(n){e.statistics=[];for(let t=0;t<e.bandCount;t++)e.statistics[t]={min:n[0],max:n[1],avg:(n[0]+n[1])/2,stddev:(n[0]+n[1])/10}}else 45===r&&t.statistics?.length&&(e.statistics=t.statistics.map(e=>({min:-e.max,max:-e.min,avg:null==e.avg?void 0:-e.avg,stddev:null==e.stddev?void 0:-e.stddev})))}_updatePixelType(e){let{statistics:t,pixelType:r}=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,{domain:s,isInteger:i}=T(n)??{domain:null,isInteger:!1},o="f32";if(s&&i)o=(0,l.X1)(s[0],s[1]);else if(30===n){let e=t?.[0];o=e?(0,l.X1)(e.min,e.max):(0,l.zw)(r)?r:"s32"}else if(45===n&&(0,l.zw)(r)){let e=t?.map(({max:e})=>-e),n=t?.map(({min:e})=>-e),s=e?.length?Math.min(...e):null,i=n?.length?Math.min(...n):null;o=null!=s&&null!=i?(0,l.X1)(s,i):r.startsWith("s")?r.replace("s","u"):"u1"===r||"u2"===r||"u4"===r?"s8":"u8"===r?"s16":"s32"}e.pixelType=this.outputPixelType=this._getOutputPixelType(o)}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Br.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Fr,json:{write:!0,name:"rasterFunctionArguments"}})],Br.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Br.prototype,"rasterArgumentNames",void 0),Br=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunction")],Br);const jr=Br;var Zr,zr=r(34727);let Gr=Zr=class extends c{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=0}get normalizedNoDataValues(){let{noDataValues:e}=this;if(!e?.length)return null;let t=!1,r=e.map(e=>{if("number"==typeof e)return t=!0,[e];if("string"==typeof e){let r=e.trim().split(" ").filter(e=>""!==e.trim()).map(e=>Number(e));return t||=r.length>0,0===r.length?null:r}return null});return t?r:null}clone(){return new Zr({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Gr.prototype,"includedRanges",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Gr.prototype,"noDataValues",void 0),(0,o.Cg)([(0,a.MZ)()],Gr.prototype,"normalizedNoDataValues",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Gr.prototype,"noDataInterpretation",void 0),Gr=Zr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunctionArguments")],Gr);const Er=Gr;let Or=class extends w{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;this.outputPixelType=this._getOutputPixelType(t),e.pixelType=this.outputPixelType,this.rasterInfo=e;let{includedRanges:r,normalizedNoDataValues:n}=this.functionArguments;if(!r?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let s=[];for(let i=0;i<e.bandCount;i++){let e=(0,$e.Wt)(t,r?.slice(2*i,2*i+2),n?.[i]);if(null==e){s=null;break}s.push(e)}this.lookups=s;let i=null!=n&&n.every(e=>e?.length===n[0]?.length);return{success:!0,supportsGPU:(!r||r.length<=18)&&(!n||i&&n[0].length<=9)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{outputPixelType:r,lookups:n}=this,{includedRanges:s,noDataInterpretation:i,normalizedNoDataValues:o}=this.functionArguments;return(0,$e.dK)(t,{includedRanges:s,noDataValues:o,outputPixelType:r,matchAll:1===i,lookups:n})}_getWebGLParameters(){let{includedRanges:e,normalizedNoDataValues:t}=this.functionArguments,r=new Float32Array(9);r.fill(zr.pq),t?.[0]?.length&&r.set(t[0]);let n=new Float32Array(6);for(let t=0;t<n.length;t+=2)n[t]=e?.[t]??-zr.pq,n[t+1]=e?.[t+1]??zr.pq;return e?.length&&n.set(e),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:r,includedRanges:n}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Or.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Er,json:{write:!0,name:"rasterFunctionArguments"}})],Or.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Or.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Or.prototype,"lookups",void 0),Or=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunction")],Or);const Dr=Or;var Vr;let Ur=Vr=class extends c{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){let{visibleBandID:e,infraredBandID:t,scientificOutput:r}=this;return new Vr({visibleBandID:e,infraredBandID:t,scientificOutput:r})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ur.prototype,"visibleBandID",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ur.prototype,"infraredBandID",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Ur.prototype,"scientificOutput",void 0),Ur=Vr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunctionArguments")],Ur);const Lr=Ur;let Wr=class extends w{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let{scientificOutput:e,visibleBandID:t,infraredBandID:r}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(e?"f32":"u8");let n=this.sourceRasterInfos[0],s=Math.max(t,r);if(n.bandCount<2||s>=n.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(t<0||r<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};let i=n.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};let[o,a,l,u]=e?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:o,max:a,avg:l,stddev:u}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{visibleBandID:r,infraredBandID:n,scientificOutput:s}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){let{rawInputBandIds:e}=this;n=e.indexOf(n),r=e.indexOf(r)}return function(e,t,r,n){let{mask:s,pixels:i,width:o,height:a}=e,l=i[r],u=i[t],p=u.length,c=n?new Uint8Array(p):new Float32Array(p),h=n?100:1,m=n?100.5:0;for(let e=0;e<p;e++)if(null==s||s[e]){let t=l[e],r=u[e],n=t+r;n&&(c[e]=(t-r)/n*h+m)}let f=new g.A({width:o,height:a,mask:s,pixelType:n?"u8":"f32",pixels:[c]});return f.updateStatistics(),f}(t,r,n,!s)}_getWebGLParameters(){let{visibleBandID:e,infraredBandID:t,scientificOutput:r}=this.functionArguments;return{bandIndexMat3:qe(this.isInputBandIdsSwizzled?[0,1,2]:[t,e,0]),scaled:!r}}_getInputBandIds(e){let{visibleBandID:t,infraredBandID:r}=this.functionArguments;return[r,t,0].map(t=>e[t])}_swizzleBandIds(e){let{visibleBandID:t,infraredBandID:r}=this.functionArguments,n=[t,r].map(t=>e.indexOf(t));return n[2]=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Wr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Lr,json:{write:!0,name:"rasterFunctionArguments"}})],Wr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Wr.prototype,"rasterArgumentNames",void 0),Wr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunction")],Wr);const $r=Wr;var Kr;let Hr=Kr=class extends c{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new Kr({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"inputRanges",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"outputValues",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"noDataRanges",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"allowUnmatched",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"replacementValue",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Hr.prototype,"isLastInputRangeInclusive",void 0),Hr=Kr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunctionArguments")],Hr);const qr=Hr;let Jr=class extends w{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;e.bandCount=1;let{statistics:r}=e;this._removeStatsHistColormapVAT(e);let{allowUnmatched:n,replacementValue:s,outputValues:i,inputRanges:o,noDataRanges:a,isLastInputRangeInclusive:u}=this.functionArguments,p="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(t),i?.length){let o=r?.[0];if(n&&null==s){let t=o?.min??i[0],r=o?.max??i[0];t=Math.min.apply(null,[...i,t]),r=Math.max.apply(null,[...i,r]),e.statistics=[{min:t,max:r,avg:o?.avg??0,stddev:o?.stddev??-1}]}else{let t=i[0],r=t;for(let e=0;e<i.length;e++)t=t>i[e]?i[e]:t,r=r>i[e]?r:i[e];n&&null!=s&&(t=Math.min(t,s),r=Math.max(r,s)),e.statistics=[{min:t,max:r,avg:o?.avg??0,stddev:o?.stddev??-1}]}if(p){let{min:r,max:o}=e.statistics[0],a=["u8","s8","u16","s16","u32","s32","f32"],u=a.find(e=>{let[t,n]=(0,l.hP)(e);return r>=t&&o<=n})??"f64";this.outputPixelType=i.some(e=>Math.floor(e)!==e)?"f64"===u?"f64":"f32":n&&null==s&&a.indexOf(t)>a.indexOf(u)?t:u}}return e.pixelType=this.outputPixelType,this.rasterInfo=e,this.lookup=n?null:(0,$e.XU)({srcPixelType:t,inputRanges:o,outputValues:i,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!i||i.length<=9)&&(!a||a.length<=9)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{lookup:r,outputPixelType:n}=this;if(r){let e=(0,$e.eH)(t,{lut:[r.lut],offset:r.offset,outputPixelType:n});return null!=e&&r.mask&&(e.mask=(0,$e.UK)(t.pixels[0],t.mask,r.mask,r.offset,"u8")),e}let{inputRanges:s,outputValues:i,noDataRanges:o,allowUnmatched:a,isLastInputRangeInclusive:l,replacementValue:u}=this.functionArguments;return(0,$e.Ew)(t,{inputRanges:s,outputValues:i,noDataRanges:o,outputPixelType:n,allowUnmatched:a,isLastInputRangeInclusive:l,replacementValue:u})}_getWebGLParameters(){let{allowUnmatched:e,noDataRanges:t,isLastInputRangeInclusive:r}=this.functionArguments,n=this.functionArguments.inputRanges??[],s=this.functionArguments.outputValues??[],i=(0,$e.bL)(n,s,r),o=new Float32Array(18);return o.fill(zr.pq),t?.length&&o.set(t),{allowUnmatched:e,rangeMaps:i,noDataRanges:o,clampRange:(0,l.hP)(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Jr.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:qr,json:{write:!0,name:"rasterFunctionArguments"}})],Jr.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Jr.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Jr.prototype,"lookup",void 0),Jr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunction")],Jr);const Xr=Jr;var Yr;let Qr=Yr=class extends Nr{readColorRamp(e){if("string"==typeof e){let t=gt.kH.jsonValues.find(t=>t.toLowerCase()===e.toLowerCase());return t?(0,gt.M5)(gt.kH.fromJSON(t)):null}return"toJSON"in e?e.toJSON():e}clone(){return new Yr({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Qr.prototype,"colorRamp",void 0),(0,o.Cg)([(0,yt.w)("colorRamp")],Qr.prototype,"readColorRamp",null),(0,o.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],Qr.prototype,"colormap",void 0),Qr=Yr=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunctionArguments")],Qr);const en=Qr;let tn=class extends w{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:t,colormap:r}=this.functionArguments;if(!t&&!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");let n=e.clone();this._removeStatsHistColormapVAT(n),n.pixelType=this.outputPixelType,n.bandCount=3,n.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=n,this.isGCS=n.spatialReference?.isGeographic??!1,r?.length||(r=(0,gt.R8)(t,{interpolateAlpha:!0}));let{indexedColormap:s,offset:i}=(0,$e.zg)({colormap:r});if(!s?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};let o=(0,gt.S2)(s);return this.lookup={indexedColormap:s,offset:i,hsvMap:o},{success:!0,supportsGPU:(0,It.WN)(s)}}_processPixels(e){let t=e.pixelBlocks?.[0];if(!t||!this.lookup)return null;let r=e.primaryPixelSizes?.[0];if(null==r){let{extent:n}=e;r=n?{x:n.width/t.width,y:n.height/t.height}:{x:1,y:1}}let n=(0,ze.PP)(this.functionArguments,r,this.isGCS),s=(0,ze.fw)(t,n),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return(0,ze.SC)(s,t,this.lookup.hsvMap,i),s.pixelType=this.outputPixelType,s}_getWebGLParameters(){let e=(0,ze.PP)(this.functionArguments,{x:1,y:1},this.isGCS),t=(0,ze.ng)(e),{slopeType:r,zFactor:n,pixelSizeFactor:s,pixelSizePower:i}=this.functionArguments,o="scaled"===r,{indexedColormap:a,offset:u}=this.lookup,p=this.sourceRasterInfos[0].statistics?.[0],c=(0,l.zw)(this.outputPixelType);return{...t,indexedColormap:a,offset:u,zFactor:n,gcsFactor:this.isGCS?ze.rk:1,pixelSizeFactor:o?s:0,pixelSizePower:o?i:0,minValue:p?.min??0,maxValue:p?.max??8e3,isOutputRounded:c}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],tn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:en,json:{write:!0,name:"rasterFunctionArguments"}})],tn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],tn.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],tn.prototype,"isGCS",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],tn.prototype,"lookup",void 0),tn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunction")],tn);const rn=tn;var nn;const sn=new Oe.J({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let on=nn=class extends c{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new nn({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,o.Cg)([(0,Ye.e)(sn)],on.prototype,"slopeType",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],on.prototype,"zFactor",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"psPower",write:!0}})],on.prototype,"pixelSizePower",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"psZFactor",write:!0}})],on.prototype,"pixelSizeFactor",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],on.prototype,"removeEdgeEffect",void 0),on=nn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunctionArguments")],on);const an=on;let ln=class extends w{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");let e=this.sourceRasterInfos[0].clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics="percent-rise"===this.functionArguments.slopeType?null:[{min:0,max:90,avg:1,stddev:1}],e.bandCount=1,this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return null;let{zFactor:r,slopeType:n,pixelSizePower:s,pixelSizeFactor:i}=this.functionArguments,{isGCS:o}=this,{extent:a,primaryPixelSizes:l}=e,u=l?.[0]??(a?{x:a.width/t.width,y:a.height/t.height}:{x:1,y:1});return(0,ze.yy)(t,{zFactor:r,slopeType:n,pixelSizePower:s,pixelSizeFactor:i,isGCS:o,resolution:u})}_getWebGLParameters(){let{zFactor:e,slopeType:t,pixelSizeFactor:r,pixelSizePower:n}=this.functionArguments;return{zFactor:this.isGCS&&e>=1?e*ze.rk:e,slopeType:t,pixelSizeFactor:r??0,pixelSizePower:n??0,isOutputRounded:(0,l.zw)(this.outputPixelType)}}_getNeighborhoodSize(){return{rows:3,cols:3}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ln.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:an,json:{write:!0,name:"rasterFunctionArguments"}})],ln.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],ln.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],ln.prototype,"isGCS",void 0),ln=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunction")],ln);const un=ln;var pn;let cn=pn=class extends c{clone(){return new pn({conversionMatrix:[...this.conversionMatrix],raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],cn.prototype,"conversionMatrix",void 0),cn=pn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SpectralConversionFunctionArguments")],cn);const hn=cn;let mn=class extends w{constructor(){super(...arguments),this.functionName="SpectralConversion",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:3===e.bandCount&&9===this.functionArguments.conversionMatrix.length}}_processPixels(e){let t=e.pixelBlocks?.[0];return null==t?null:function(e,t,r){let{width:n,height:s,mask:i,bandMasks:o}=e,a=o?.length?g.A.combineBandMasks(o):i,l=[],u=e.pixels.length;for(let n=0;n<t.length/u;n++){let s=xr(e,t.slice(n*u,(n+1)*u),r,a);l.push(s)}let p=new g.A({width:n,height:s,pixels:l,pixelType:r,mask:a});return p.updateStatistics(),p}(t,this.functionArguments.conversionMatrix,this.outputPixelType)}_getWebGLParameters(){let e=(0,l.hP)(this.outputPixelType),[t,r,n,s,i,o,a,u,p]=this.functionArguments.conversionMatrix;return{weights:[t,s,a,r,i,u,n,o,p],clampRange:e}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],mn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:hn,json:{write:!0,name:"rasterFunctionArguments"}})],mn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],mn.prototype,"rasterArgumentNames",void 0),mn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.SpectralConversionFunction")],mn);const fn=mn,gn=new Oe.J({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function dn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{statisticsType:l,kernelRows:u,kernelCols:p}=t,c="stddev"===l,h=s*i,m=new Float64Array(h),f=new Float64Array(h),g=new Uint32Array(h);for(let e=0;e<i;e++){let t=e*s,r=0,i=0,a=0;for(let e=0;e<p;e++)(!o||o[t+e])&&(r+=n[t+e],c&&(i+=n[t+e]**2),a++);m[t]=r,f[t]=i,g[t]=a;for(let e=1;e<=s-p;e++){let s=t+e-1,l=s+p;o?(o[s]&&(a--,r-=n[s],c&&(i-=n[s]**2)),o[l]&&(a++,r+=n[l],c&&(i+=n[l]**2))):(r-=n[s],r+=n[l],c&&(i-=n[s]**2,i+=n[l]**2)),m[t+e]=r,g[t+e]=a,c&&(f[t+e]=i)}}let d=new Float64Array(h),y=new Float64Array(h),x=new Uint32Array(h),w=u*s;for(let e=0;e<=s-p;e++){let t=0,r=0,n=0;for(let i=0;i<u;i++){let o=i*s+e;t+=m[o],n+=g[o],c&&(r+=f[o])}d[e]=t,y[e]=r,x[e]=n;for(let o=1;o<=i-u;o++){let i=(o-1)*s+e,a=i+w;t-=m[i],t+=m[a],n-=g[i],n+=g[a],c&&(r-=f[i],r+=f[a]),d[o*s+e]=t,y[o*s+e]=r,x[o*s+e]=n}}let A=Math.floor(u/2),v=Math.floor(p/2);for(let e=A;e<i-A;e++){let t=e*s;for(let n=v;n<s-v;n++){let i=(e-A)*s+n-v,l=x[i];if(0===l||r&&(!o||o[t+n]))continue;let u=d[i]/l,p=c?Math.sqrt((y[i]-d[i]*u)/l):u;a[t+n]=p,o&&(o[t+n]=255)}}}function yn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{kernelRows:l,kernelCols:u,statisticsType:p}=t,c=Math.floor(l/2),h=Math.floor(u/2),m="min"===p,f=a.slice(),g=new Uint32Array(s*i);for(let e=c;e<i-c;e++){let t=e*s;for(let e=h;e<s-h;e++){let r=m?Number.MAX_VALUE:-Number.MAX_VALUE,i=0;for(let a=0;a<l;a++)for(let l=0;l<u;l++){let u=t+e+(a-c)*s+l-h;(!o||o[u])&&(r=m?Math.min(r,n[u]):Math.max(r,n[u]),i++)}o?(f[t+e]=0===i?0:r,g[t+e]=i):a[t+e]=0===i?0:r}}if(o)for(let e=c;e<i-c;e++){let t=e*s;for(let e=h;e<s-h;e++)if(g[t+e]){if(r&&o[t+e])continue;a[t+e]=f[t+e],o[t+e]=255}}}function xn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{kernelRows:l,kernelCols:u}=t,p=Math.floor(l/2),c=Math.floor(u/2),h=a.slice(),m=new Uint32Array(s*i);for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++){if(r&&o?.[t+e])continue;let i=[];for(let r=0;r<l;r++)for(let a=0;a<u;a++){let l=t+e+(r-p)*s+a-c;(!o||o[l])&&i.push(n[l])}i.length&&(i.sort((e,t)=>e-t),o?(h[t+e]=i[Math.floor((i.length-1)/2)],m[t+e]=i.length):a[t+e]=i[Math.floor((i.length-1)/2)])}}if(o)for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++)if(m[t+e]){if(r&&o[t+e])continue;a[t+e]=h[t+e],o[t+e]=255}}}function wn(e,t){let{fillNoDataOnly:r}=t,{band:n,width:s,height:i,mask:o,outBand:a}=e;if(r&&!o)return void a.set(n);let{kernelRows:l,kernelCols:u}=t,p=Math.floor(l/2),c=Math.floor(u/2),h="majority"===t.statisticsType,m=l*u,f=a.slice(),g=new Uint32Array(s*i);for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++){if(r&&o?.[t+e])continue;let i=new Map;for(let r=0;r<l;r++)for(let a=0;a<u;a++){let l=t+e+(r-p)*s+a-c;if(o&&!o[l])continue;let u=n[l];i.set(u,i.has(u)?i.get(u)+1:1)}if(0===i.size)continue;let d=0,y=0,x=h?0:m+1;for(let e of i.keys())y=i.get(e),h===y>x&&(x=y,d=e);o?(f[t+e]=d,g[t+e]=i.size):a[t+e]=d}}if(o)for(let e=p;e<i-p;e++){let t=e*s;for(let e=c;e<s-c;e++)if(g[t+e]){if(r&&o[t+e])continue;a[t+e]=f[t+e],o[t+e]=255}}}var An;let vn=An=class extends c{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new An({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:(0,i.o8)(this.raster)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelRows","rows"],reader:(e,t)=>Number(e??t?.kernelRows??3)}}})],vn.prototype,"rows",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(e,t)=>Number(e??t?.kernelCols??3)}}})],vn.prototype,"cols",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],vn.prototype,"fillNoDataOnly",void 0),(0,o.Cg)([(0,a.MZ)({json:{read:{source:["statisticsType","type"],reader:(e,t)=>gn.fromJSON(t?.statisticsType??t?.type)??"min"},write:{target:"type"}}}),(0,Ye.e)(gn)],vn.prototype,"statisticsType",void 0),vn=An=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunctionArguments")],vn);const bn=vn;let Cn=class extends w{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){let{type:e}=this.functionArguments.toJSON();if(e<1||e>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${e}`};let t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);let r=t.clone();r.pixelType=this.outputPixelType;let{statisticsType:n}=this.functionArguments;return"stddev"===n&&this._removeStatsHistColormapVAT(r),this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3&&e<5}}_processPixels(e){let t=e.pixelBlocks?.[0];if(null==t)return t;let{statisticsType:r,rows:n,cols:s,fillNoDataOnly:i}=this.functionArguments;return function(e,t){let{mask:r}=e,{fillNoDataOnly:n}=t;if(n&&!r)return e;let{pixels:s,width:i,height:o,bandMasks:a,pixelType:l}=e,u=s.length,p=i*o,c=[],{kernelRows:h,kernelCols:m,statisticsType:f,mirrorEdges:d}=t;if(n&&!r)return e;let y=t.outputPixelType??l,x=[];for(let e=0;e<u;e++){let l=s[e],u=g.A.createEmptyBand(y,p);n&&u.set(l);let w=(a?.[e]??r)?.slice()??null,A={band:l,width:i,height:o,mask:w,outBand:u};switch(f){case"min":case"max":yn(A,t);break;case"mean":case"stddev":dn(A,t);break;case"median":xn(A,t);break;case"majority":case"minority":wn(A,t)}d&&!n&&Yt(u,i,o,h,m),c.push(u),w&&x.push(w)}let w=x[0]??r;x.length!==u&&(x.length=0),u>1&&a?.length&&(w=g.A.combineBandMasks(a));let A=new g.A({pixelType:y,width:i,height:o,pixels:c,bandMasks:a&&x.length?x:null,mask:w});return A.updateStatistics(),A}(t,{kernelRows:n,kernelCols:s,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:r,mirrorEdges:!0})}_getWebGLParameters(){let{rows:e,cols:t,statisticsType:r,fillNoDataOnly:n}=this.functionArguments;return{fillNoDataOnly:n,kernelRows:e,kernelCols:t,statisticsType:r,clampRange:(0,l.hP)(this.outputPixelType)}}_getNeighborhoodSize(){let{rows:e,cols:t}=this.functionArguments;return{rows:e,cols:t}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Cn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:bn,json:{write:!0,name:"rasterFunctionArguments"}})],Cn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Cn.prototype,"rasterArgumentNames",void 0),Cn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunction")],Cn);const Mn=Cn;var Pn;let Tn=Pn=class extends c{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(e,t){if(!e?.length)return null;let r=[];return e.forEach(e=>{let t={min:e.min,max:e.max,avg:e.avg??e.mean,stddev:e.stddev??e.standardDeviation};r.push(t)}),r}writeStatistics(e,t,r){if(!e?.length)return;let n=[];e.forEach(e=>{let t={...e,mean:e.avg,standardDeviation:e.stddev};delete t.avg,delete t.stddev,n.push(t)}),t[r]=n}clone(){return new Pn({statistics:(0,i.o8)(this.statistics),histograms:(0,i.o8)(this.histograms)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Tn.prototype,"statistics",void 0),(0,o.Cg)([(0,yt.w)("statistics")],Tn.prototype,"readStatistics",null),(0,o.Cg)([(0,Ft.K)("statistics")],Tn.prototype,"writeStatistics",null),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Tn.prototype,"histograms",void 0),Tn=Pn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunctionArguments")],Tn);const Rn=Tn;let Nn=class extends w{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");let t=e.clone(),{statistics:r,histograms:n}=this.functionArguments;return n&&(t.histograms=n),r&&(t.statistics=r),this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Nn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Rn,json:{write:!0,name:"rasterFunctionArguments"}})],Nn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Nn.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Nn.prototype,"indexedColormap",void 0),(0,o.Cg)([(0,a.MZ)()],Nn.prototype,"isNoopProcess",void 0),Nn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunction")],Nn);const In=Nn;var kn;const Sn=new Oe.J({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let _n=kn=class extends c{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(e,t,r){e?.length&&(Array.isArray(e[0])||(e=e.map(e=>[e.min,e.max,e.avg,e.stddev])),t[r]=e)}clone(){return new kn({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,i.o8)(this.statistics),gamma:(0,i.o8)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,i.o8)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],_n.prototype,"computeGamma",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{name:"dra",write:!0}})],_n.prototype,"dynamicRangeAdjustment",void 0),(0,o.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],_n.prototype,"gamma",void 0),(0,o.Cg)([(0,a.MZ)()],_n.prototype,"histograms",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"maxPercent",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"minPercent",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"numberOfStandardDeviations",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"max",write:!0}})],_n.prototype,"outputMax",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{name:"min",write:!0}})],_n.prototype,"outputMin",void 0),(0,o.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_n.prototype,"sigmoidStrengthLevel",void 0),(0,o.Cg)([(0,a.MZ)({json:{type:[[Number]],write:!0}})],_n.prototype,"statistics",void 0),(0,o.Cg)([(0,Ft.K)("statistics")],_n.prototype,"writeStatistics",null),(0,o.Cg)([(0,Ye.e)(Sn)],_n.prototype,"stretchType",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],_n.prototype,"useGamma",void 0),_n=kn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunctionArguments")],_n);const Fn=_n;let Bn=class extends w{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;let e=this.sourceRasterInfos[0],{pixelType:t}=e,{functionArguments:r}=this,{dynamicRangeAdjustment:n,gamma:s,useGamma:i}=r;if(!n&&["u8","u16","s8","s16"].includes(t)){let n=(0,qt.DP)(r.toJSON(),{rasterInfo:e}),o=(0,l.zw)(this.outputPixelType)?"round":"float";this.lookup=(0,qt.RP)({pixelType:t,...n,gamma:i?s:null,rounding:o}),this.cutOffs=n}else n||(this.cutOffs=(0,qt.DP)(r.toJSON(),{rasterInfo:e}));this.outputPixelType=this._getOutputPixelType(t);let o=e.clone();o.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(o),"u8"===this.outputPixelType&&(o.keyProperties.DataType="processed");let{outputMin:a=0,outputMax:u=255}=this.functionArguments;o.statistics=[];for(let e=0;e<o.bandCount;e++)o.statistics[e]={min:a,max:u};return this.rasterInfo=o,{success:!0,supportsGPU:!n}}_processPixels(e,t){let r=e.pixelBlocks?.[0];if(null==r)return r;let{lookup:n}=this;if(n)return(0,$e.eH)(r,{...n,outputPixelType:this.rasterInfo.pixelType});let{functionArguments:s}=this,i=t?.stretchCutoff??this.cutOffs??(0,qt.DP)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:r}),o=s.useGamma?s.gamma:null;return(0,qt._N)(r,{...i,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{outputMin:e=0,outputMax:t=255,gamma:r,useGamma:n}=this.functionArguments,s=this.rasterInfo.bandCount>=2?3:1,i=n&&r?.length?(0,qt.Nh)(s,r):[1,1,1],{minCutOff:o,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===o.length&&(o[1]=o[2]=o[0],a[1]=a[2]=a[0]);let u=a.map((r,n)=>(t-e)/(a[n]-o[n])),p=(0,l.zw)(this.outputPixelType);return{bandCount:s,minOutput:e,maxOutput:t,minCutOff:o,maxCutOff:a,factor:u,useGamma:n,gamma:n&&r?[r[0],r[1]??r[0],r[2]??r[0]]:[1,1,1],gammaCorrection:n?[i[0],i[1]??i[0],i[2]??i[0]]:[1,1,1],stretchType:this.functionArguments.stretchType,isOutputRounded:p,type:"stretch"}}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Bn.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Fn,json:{write:!0,name:"rasterFunctionArguments"}})],Bn.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],Bn.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Bn.prototype,"lookup",void 0),(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],Bn.prototype,"cutOffs",void 0),Bn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunction")],Bn);const jn=Bn;var Zn;let zn=Zn=class extends c{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new Zn({attributeTableAsRecordSet:(0,i.o8)(this.attributeTableAsRecordSet)})}};(0,o.Cg)([(0,a.MZ)({json:{write:!0}})],zn.prototype,"attributeTableAsRecordSet",void 0),zn=Zn=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunctionArguments")],zn);const Gn=zn;let En=class extends w{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){let e=this.sourceRasterInfos[0];if(e.bandCount>1||e.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};let{attributeTableAsRecordSet:t}=this.functionArguments;if(!t)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(e.pixelType);let r=e.clone();return r.pixelType=this.outputPixelType,r.bandCount=1,"thematic"!==r.dataType&&(r.keyProperties=r.keyProperties?{...r.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=r,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};(0,o.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],En.prototype,"functionName",void 0),(0,o.Cg)([(0,a.MZ)({type:Gn,json:{write:!0,name:"rasterFunctionArguments"}})],En.prototype,"functionArguments",void 0),(0,o.Cg)([(0,a.MZ)()],En.prototype,"rasterArgumentNames",void 0),(0,o.Cg)([(0,a.MZ)()],En.prototype,"isNoopProcess",void 0),En=(0,o.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunction")],En);const On=En,Dn=new Map;function Vn(e,t){let{rasterFunctionArguments:r}=e;r&&(r.rasters||[r.raster,r.raster2]).forEach(e=>{e&&"number"!=typeof e&&("string"==typeof e?e.startsWith("http")&&(t.includes(e)||t.push(e)):"rasterFunctionArguments"in e&&Vn(e,t))})}function Un(e,t){t??={};try{if("function"in(e=(0,i.o8)(e))&&"arguments"in e&&e.arguments){let r=Jn(e,new Map,t);if(Yn(r),!r.renderingRule)throw new s.A("raster-function-helper","Unsupported raster function json.");e=r.renderingRule}if("rasterFunction"in e){let r=$n(e=Wn(e),t);return r.isRoot=!0,r}}catch{}throw new s.A("raster-function-helper","unsupported raster function json.")}function Ln(e){return!!(e&&"object"==typeof e&&e.rasterFunction&&e.rasterFunctionArguments)}function Wn(e){let{rasterFunction:t,rasterFunctionArguments:r}=e,n={};for(let e in r){let t=r[e],s=e.toLowerCase();if("rasters"===s&&Array.isArray(t))n.rasters=t.map(e=>Ln(e)?Wn(e):e);else switch(Ln(t)&&(t=Wn(t)),s){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[e[0].toLowerCase()+e.slice(1)]=t}}return"Local"===t&&!n.rasters?.length&&(n.rasters=["$$"]),{...e,rasterFunctionArguments:n}}function $n(e,t){let{rasterFunction:r,rasterFunctionArguments:n}=e,i=e.outputPixelType?.toLowerCase();if(null==r||!Dn.has(r))throw new s.A("raster-function-helper",`unsupported raster function: ${r}`);let o=Dn.get(r),a=("function"==typeof o.ctor?o.ctor:o.ctor.default).fromJSON({...e,outputPixelType:i}),{rasterArgumentNames:l}=a,u=[],p=function(e,t){return"rasters"===t[0]&&Array.isArray(e.rasters)?e.rasters:t.map(t=>e[t])}(n,l),c="rasters"===l[0]||l.length>1,h=[];for(let e=0;e<p.length;e++){let r,n=p[e];null==n||"string"==typeof n&&n.startsWith("$")?u.push(t?.raster):"string"==typeof n?t[n]&&u.push(t[n]):"number"!=typeof n&&"rasterFunction"in n&&(r=$n(n,t),c||(a.functionArguments[l[e]]=r),u.push(r)),c&&h.push(r??n)}if(c&&("rasters"===l[0]?a.functionArguments.rasters=h:l.forEach((e,t)=>{a.functionArguments[e]=h[t]})),t){a.sourceRasters=u;let e=t.raster?.url;e&&(a.mainPrimaryRasterId=e)}return a}function Kn(e,t){if(e&&t)for(let r in e){let n=e[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?Kn(n.arguments,t):"RasterFunctionVariable"===n.type&&null!=t[n.name]&&(n.value=t[n.name]))}}function Hn(e,t){if(!e||"object"!=typeof e)return e;let{value:r}=e;if(!r||"object"!=typeof r)return e.isDataset?"$$":r;if(Array.isArray(r))return 0===r.length?[]:r.map(e=>e&&"object"==typeof e&&"RasterFunctionVariable"===e.type?Hn(e,t):e);if("value"in r&&["number","string","boolean"].includes(typeof r.value))return r.value;if(e.isDataset&&"Scalar"!==r.type)return"$$";if(!("type"in r))return r;let n=r;switch(r.type){case"Scalar":n=r.value;break;case"AlgorithmicColorRamp":n=qn(r);break;case"MultiPartColorRamp":n={type:"multipart",colorRamps:r.ArrayOfColorRamp.map(qn)};break;case"ArgumentArray":if(r.elements?.length&&"RasterStatistics"!==r.elements[0].type){let e=[];for(let n=0;n<r.elements.length;n++){let i=r.elements[n],{type:o}=i;if(o)if("RasterFunctionTemplate"===o){let{renderingRule:r}=Jn(i,t);e.push(r),null!=i._object_id&&t.set(i._object_id,r)}else{if("RasterFunctionVariable"!==o)throw new s.A("raster-function-helper","unsupported raster function json.");{let r=Hn(i,t);e.push(r),null!=i._object_id&&t.set(i._object_id,r)}}else e.push(i)}n=e}else n=r.elements}return null!=r._object_id&&t.set(r._object_id,n),n}function qn(e){let t=e.algorithm??"esriHSVAlgorithm",{FromColor:r,ToColor:s}=e;if(!Array.isArray(r)){let{r:e,g:t,b:s}=(0,n.$)({h:r.Hue,s:r.Saturation,v:r.Value});r=[e,t,s,r.AlphaValue]}if(!Array.isArray(s)){let{r:e,g:t,b:r}=(0,n.$)({h:s.Hue,s:s.Saturation,v:s.Value});s=[e,t,r,s.AlphaValue]}return{type:"algorithmic",algorithm:t,fromColor:r,toColor:s}}function Jn(e,t,r){r&&Kn(e,r);let n={renderingRule:{},templates:t};return Xn(e,n),n}function Xn(e,t){if(!e||!t.renderingRule)return;let{renderingRule:r,templates:n}=t,{function:s,arguments:i,_object_id:o}=e;if(!s||!i)return;null!=o&&n.set(o,r),r.rasterFunction=s.type.replace("Function",""),r.outputPixelType=s.pixelType;let a={};r.rasterFunctionArguments=a;for(let e in i){if("type"===e||"object_id"===e||"_object_ref_id"===e)continue;let t=i[e];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?a[e]=Hn(t,n):(r.rasterFunctionArguments[e]={},Xn(t,{renderingRule:r.rasterFunctionArguments[e],templates:n})),null!=t._object_id&&n.set(t._object_id,a[e])):a[e]=t}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),r.rasterFunction){case"Stretch":!function(e){e.Statistics?.length&&"object"==typeof e.Statistics&&(e.Statistics=e.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),null!=e.NumberOfStandardDeviation&&(e.NumberOfStandardDeviations=e.NumberOfStandardDeviation,delete e.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(e){"randomcolorramp"===e.ColorRamp?.type?.toLowerCase()&&(delete e.ColorRamp,e.ColormapName="Random"),0===e.ColorSchemeType&&delete e.ColorRamp}(a);break;case"Convolution":!function(e){null!=e.ConvolutionType&&(e.Type=e.ConvolutionType,delete e.ConvolutionType)}(a);break;case"Mask":!function(e){e.NoDataValues?.length&&"string"==typeof e.NoDataValues[0]&&(e.NoDataValues=e.NoDataValues.filter(e=>""!==e).map(e=>Number(e)))}(a)}}function Yn(e){let{renderingRule:t,templates:r}=e;if("object"!=typeof t||!t?.rasterFunctionArguments||!r.size)return;let{rasterFunctionArguments:n}=t;for(let e in n){let t=n[e],i="_object_ref_id"===e?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null!=i){if(!r.has(i))throw new s.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);let t=r.get(i);"_object_ref_id"===e?t&&"object"==typeof t&&Object.assign(n,t):n[e]=t;continue}t&&"object"==typeof t&&(t.rasterFunctionArguments&&Yn({renderingRule:t,templates:r}),Array.isArray(t)&&t.forEach((e,n)=>{if(e&&"object"==typeof e)if(null!=e._object_ref_id){if(!r.has(e._object_ref_id))throw new s.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);let o=r.get(i);o&&"object"==typeof o?Object.assign(e,o):t[n]=o}else Yn({renderingRule:e,templates:r})}))}}Dn.set("Arithmetic",{desc:"Arithmetic Function",ctor:Fe,rasterArgumentNames:["rasters"]}),Dn.set("Aspect",{desc:"Aspect Function",ctor:Ee,rasterArgumentNames:["raster"]}),Dn.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:nt,rasterArgumentNames:["raster"]}),Dn.set("Colormap",{desc:"Colormap Function",ctor:Mt,rasterArgumentNames:["raster"]}),Dn.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:St,rasterArgumentNames:["raster"]}),Dn.set("CompositeBand",{desc:"CompositeBand Function",ctor:zt,rasterArgumentNames:["rasters"]}),Dn.set("ComputeChange",{desc:"ComputeChange Function",ctor:Wt,rasterArgumentNames:["rasters"]}),Dn.set("Convolution",{desc:"Convolution Function",ctor:or,rasterArgumentNames:["raster"]}),Dn.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Xt,rasterArgumentNames:["raster"]}),Dn.set("ExtractBand",{desc:"ExtractBand Function",ctor:yr,rasterArgumentNames:["raster"]}),Dn.set("Curvature",{desc:"Curvature Function",ctor:hr,rasterArgumentNames:["raster"]}),Dn.set("Hillshade",{desc:"Hillshade Function",ctor:kr,rasterArgumentNames:["raster"]}),Dn.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:rn,rasterArgumentNames:["raster"]}),Dn.set("Grayscale",{desc:"Grayscale Function",ctor:Cr,rasterArgumentNames:["raster"]}),Dn.set("Clip",{desc:"Clip Function",ctor:mt,rasterArgumentNames:["raster"]}),Dn.set("Local",{desc:"Local Function",ctor:jr,rasterArgumentNames:["rasters"]}),Dn.set("Mask",{desc:"Mask Function",ctor:Dr,rasterArgumentNames:["raster"]}),Dn.set("NDVI",{desc:"NDVI Function",ctor:$r,rasterArgumentNames:["raster"]}),Dn.set("Remap",{desc:"Remap Function",ctor:Xr,rasterArgumentNames:["raster"]}),Dn.set("Slope",{desc:"Slope Function",ctor:un,rasterArgumentNames:["raster"]}),Dn.set("SpectralConversion",{desc:"Spectral Conversion",ctor:fn,rasterArgumentNames:["raster"]}),Dn.set("Statistics",{desc:"Focal Statistics Function",ctor:Mn,rasterArgumentNames:["raster"]}),Dn.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:In,rasterArgumentNames:["raster"]}),Dn.set("Stretch",{desc:"Stretch Function",ctor:jn,rasterArgumentNames:["raster"]}),Dn.set("Table",{desc:"Attribute Table Function",ctor:On,rasterArgumentNames:["raster"]})},37373(e,t,r){r.d(t,{DO:()=>G,FT:()=>B,Hh:()=>b,OM:()=>z,Ps:()=>V,Wo:()=>C,_I:()=>P,_l:()=>S,l0:()=>E,t$:()=>U,uk:()=>_});var n=r(4576),s=r(49186),i=r(86211),o=r(5443),a=r(83290),l=r(86738),u=r(39829),p=r(99917),c=r(16930),h=r(21325);function m(){if(!v)throw new s.A("rasterprojectionhelper-project","projection operator is not loaded")}const f=(e,t,r,n=0)=>{if(1===r[0])return[0,0];let s=1,i=-1,o=1,a=-1;for(let t=0;t<e.length;t+=2)isNaN(e[t])||(s=s>e[t]?e[t]:s,i=i>e[t]?i:e[t],o=o>e[t+1]?e[t+1]:o,a=a>e[t+1]?a:e[t+1]);let{cols:l,rows:u}=t,p=(i-s)/l/r[0],c=(a-o)/u/r[1],h=2*n,m=0,f=!1,g=[0,0];for(let t=0;t<l-3;t++){for(let r=0;r<u-3;r++){let n=t*u*2+2*r,s=(e[n]+e[n+4]+e[n+4*u]+e[n+4*u+4])/4,i=(e[n+1]+e[n+5]+e[n+4*u+1]+e[n+4*u+5])/4,o=Math.abs((s-e[n+2*u+2])/p),a=Math.abs((i-e[n+2*u+3])/c);if(o+a>m&&(m=o+a,g=[o,a]),h&&m>h){f=!0;break}}if(f)break}return g},g={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},d=new Map,y=new Map;let x,w,A,v=!1;async function b(){return x||(x=Promise.withResolvers(),w=await r.e(3276).then(()=>r(83276)),A=await r.e(2158).then(()=>r(12158)),w.projectIsLoaded()||await w.projectLoad(),A.isLoaded()||await A.load(),v=!0,x.resolve()),x.promise}function C(e,t,r,n){let s=e.spatialReference;if(!s||!t||s.equals(t))return e;m();let a=r.center,l=new o.A({xmin:a.x-e.x/2,xmax:a.x+e.x/2,ymin:a.y-e.y/2,ymax:a.y+e.y/2,spatialReference:s}),u=w.projectExecute(l,t,{geographicTransformation:n}),p=B(t);return null==u||null!=p&&u.width>=p?function(e,t,r){let n=(0,i.GA)(t)/(0,i.GA)(r);return{x:e.x*n,y:e.y*n}}(e,s,t):{x:u.width,y:u.height}}function M(e,t=.01){return(0,i.GA)(e)?t/(0,i.GA)(e):0}function P(e,t,r,n=!0){let s=e.spatialReference;if(s.equals(t))return e;m();let i=w.projectExecute(e,t,{geographicTransformation:r});return!n||!i||T([e],[i],s,t),i}function T(e,t,r,n){let s=j(r,!0),i=j(n,!0),o=M(r,500),a=M(n,500);if(o&&null!=s&&null!=i)for(let r=0;r<e.length;r++){let n=t[r];if(!n)continue;let{x:l}=e[r],{x:u}=n;u>=i[1]-a&&Math.abs(l-s[0])<o?n.x-=i[1]-i[0]:u<=i[0]+a&&Math.abs(l-s[1])<o&&(n.x+=i[1]-i[0])}}function R(e){let{inSR:t,outSR:r,preferPE:n}=e;if(t.equals(r)){let{points:t}=k(e,null);return t}return t.isWebMercator&&r.isWGS84||t.isWGS84&&r.isWebMercator?function(e){let{cols:t,rows:r,xres:n,yres:s,usePixelCenter:i,inSR:o,outSR:a}=e,{xmin:u,ymax:c}=e;i&&(u+=n/2,c-=s/2);let h=[],m=[],f=Math.max(t,r);for(let e=0;e<f;e++){let i=u+n*Math.min(t,e),f=c-s*Math.min(r,e),g=(0,p.projectWithoutEngine)(new l.A({x:i,y:f,spatialReference:o}),o,a);e<=t&&h.push(g.x),e<=r&&m.push(g.y)}let g=[];for(let e=0;e<t;e++)for(let t=0;t<r;t++)g.push([h[e],m[t]]);return g}(e):n&&(t.isGeographic||null!=N(t))?function(e){let{inSR:t,outSR:r,datumTransformation:n}=e,{points:s,mask:i}=k(e,N(t));if(!t.isGeographic){let e=t.wkid?a.P.coordsys(t.wkid):a.P.fromString(t.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.c.projToGeog(e,s.length,s)}if(null!=n&&n.steps.length){let e,t=179.9955;if(r.isGeographic&&(e=s.map(([e])=>e>t?1:e<-179.9955?-1:0)),n.steps.forEach(e=>{let t=e.wkid?a.P.geogtran(e.wkid):a.P.fromString(a.a.PE_TYPE_GEOGTRAN,e.wkt);a.d.geogToGeog(t,s.length,s,null,e.isInverse?a.a.PE_TRANSFORM_2_TO_1:a.a.PE_TRANSFORM_1_TO_2)}),e)for(let r=0;r<s.length;r++){let n=e[r],i=s[r][0],o=i>t?1:i<-179.9955?-1:0;n&&o&&n!==o&&(s[r][0]=n>0?i+360:i-360)}}if(!r.isGeographic){let e=N(r,!0);!function(e,t){let[r,n]=t;for(let t=0;t<e.length;t++){let s=e[t][1];(s<r||s>n)&&(e[t]=[NaN,NaN])}}(s,null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90]);let t=r.wkid?a.P.coordsys(r.wkid):a.P.fromString(r.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,r.wkt2||r.wkt);a.c.geogToProj(t,s.length,s)}let o=s;if(i&&s.length!==i.length){o=[];for(let e=0,t=0;e<i.length;e++)i[e]?o.push(s[t++]):o.push([NaN,NaN])}return o}(e):function(e){let{points:t}=k(e,null),{inSR:r,outSR:n,datumTransformation:s}=e,i=t.map(e=>new l.A(e[0],e[1],r)),o=w.projectExecuteMany(i,n,{geographicTransformation:s});return s&&T(i,o,r,n),o.map(e=>e?[e.x,e.y]:[NaN,NaN])}(e)}function N(e,t=!1){let r=e.wkid||e.wkt2||e.wkt;if(!r||e.isGeographic)return null;if(r=String(r),d.has(r)){let e=d.get(r);return t?e?.gcs:e?.pcs}let n=e.wkid?a.P.coordsys(e.wkid):a.P.fromString(e.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,e.wkt2||e.wkt),s=I(n,M(e,1e-4)),i=I(n,0,!0);return d.set(r,{pcs:s,gcs:i}),t?i:s}function I(e,t=0,r=!1){let n=a.b.generate(e),s=r?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!n||!s?.length)return null;let i=!1,o=s.find(e=>1===e.getInclusive()&&1===e.getKind());if(!o){if(o=s.find(e=>1===e.getInclusive()&&0===e.getKind()),!o)return null;i=!0}let l=r?0:+(2===n.getNorthPoleLocation())|(2===n.getSouthPoleLocation()?2:0),u=n.isPannableRectangle(),p=o.getCoord();if(i)return{isEnvelope:i,isPannable:u,vertices:p,coef:null,bbox:[p[0][0]-t,p[0][1]-t,p[1][0]+t,p[1][1]+t],poleLocation:l};let c=0,h=[],[m,f]=p[0],[g,d]=p[0];for(let e=0,t=p.length;e<t;e++){c++,c===t&&(c=0);let[r,n]=p[e],[s,i]=p[c];if(i===n)h.push([r,s,n,i,2]);else{let e=(s-r)/(i-n||1e-4),t=r-e*n;n<i?h.push([e,t,n,i,0]):h.push([e,t,i,n,1])}m=m<r?m:r,f=f<n?f:n,g=g>r?g:r,d=d>n?d:n}return{isEnvelope:!1,isPannable:u,vertices:p,coef:h,bbox:[m,f,g,d],poleLocation:l}}function k(e,t){let r=[],{cols:n,rows:s,xres:i,yres:o,usePixelCenter:a}=e,{xmin:l,ymax:u}=e;if(a&&(l+=i/2,u-=o/2),null==t){for(let e=0;e<n;e++)for(let t=0;t<s;t++)r.push([l+i*e,u-o*t]);return{points:r}}let p=new Uint8Array(n*s);if(t.isEnvelope){let{isPannable:e,bbox:[a,c,h,m]}=t;for(let t=0,f=0;t<n;t++){let n=l+i*t,g=e||n>=a&&n<=h;for(let e=0;e<s;e++,f++){let t=u-o*e;g&&t>=c&&t<=m&&(r.push([n,t]),p[f]=1)}}return{points:r,mask:p}}let c=t.coef,h=[];for(let e=0;e<s;e++){let t=u-o*e,r=[],n=[];for(let e=0;e<c.length;e++){let[s,i,o,a,l]=c[e];if(t===o&&o===a)r.push(s),r.push(i),n.push(2),n.push(2);else if(t>=o&&t<=a){let e=s*t+i;r.push(e),n.push(l)}}let s=r;if(r.length>2){let e=2===n[0]?0:n[0],t=r[0];s=[];for(let i=1;i<n.length;i++)(2!==n[i]||i===n.length-1)&&(n[i]!==e&&(s.push(0===e?Math.min(t,r[i-1]):Math.max(t,r[i-1])),e=n[i],t=r[i]),i===n.length-1&&s.push(0===n[i]?Math.min(t,r[i]):Math.max(t,r[i])));s.sort((e,t)=>e-t)}else r[0]>r[1]&&(s=[r[1],r[0]]);h.push(s)}for(let e=0,t=0;e<n;e++){let n=l+i*e;for(let e=0;e<s;e++,t++){let s=u-o*e,i=h[e];if(2===i.length)n>=i[0]&&n<=i[1]&&(r.push([n,s]),p[t]=1);else if(i.length>2){let e=!1;for(let t=0;t<i.length;t+=2)if(n>=i[t]&&n<=i[t+1]){e=!0;break}e&&(r.push([n,s]),p[t]=1)}}}return{points:r,mask:p}}function S(e,t,r=null,s=!0){let i=e.spatialReference;if(i.equals(t)||!t)return e;let a=z(e),l=B(i,!0),p=B(t);if(0===a||null==l||null==p){let n=F(e,t,r,s);if(n&&null==l&&null!=p&&Math.abs(n.width-p)<M(t)&&w.projectIsLoaded()){let r=N(i);if(null!=r&&0===r.poleLocation&&e.width<(r.bbox[2]-r.bbox[0])/2)return function(e,t){let r=B(t);if(null==r)return null;let{xmin:n,ymin:s,xmax:i,ymax:a}=e,l=e.spatialReference,p=new u.A({spatialReference:l,rings:[[[n,s],[i,s],[i,a],[n,a],[n,s]]]}),c=w.projectExecute(p,t);if(2!==c.rings.length||!c.rings[0].length||!c.rings[1].length)return null;let{rings:h}=c,m=M(l),f=new o.A({spatialReference:t});for(let e=0;e<2;e++){n=i=h[e][0][0],s=a=h[e][0][1];for(let t=0;t<h[e].length;t++)n=n>h[e][t][0]?h[e][t][0]:n,i=i<h[e][t][0]?h[e][t][0]:i,s=s>h[e][t][1]?h[e][t][1]:s,a=a<h[e][t][1]?h[e][t][1]:a;if(0===e)f.ymin=s,f.ymax=a,f.xmin=n,f.xmax=i;else if(f.ymin=Math.min(f.ymin,s),f.ymax=Math.max(f.ymax,a),Math.abs(i-r/2)<m)f.xmin=n,f.xmax+=r;else{if(!(Math.abs(n+r/2)<m))return null;f.xmax=i+r}}return f}(e,t)||n}return n}let c=e.clone().normalize();if(1===c.length&&e.xmax<l&&e.xmax-l/2>M(i)){let{xmin:t,xmax:r}=e;for(let n=0;n<=a;n++){let s=0===n?t:-l/2,u=n===a?r-l*n:l/2;c[n]=new o.A({xmin:s,xmax:u,ymin:e.ymin,ymax:e.ymax,spatialReference:i})}}let h=c.map(e=>F(e,t,r,s)).filter(n.Ru);return 0===h.length?null:function(e,t){let r=B(e[0].spatialReference);if(e.length<2||null==r||(t??=M(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length))return e[0];let{xmin:n,xmax:s,ymin:i,ymax:a}=e[0];for(let t=1;t<e.length;t++){let n=e[t];s=n.xmax+r*t,i=Math.min(i,n.ymin),a=Math.max(a,n.ymax)}return new o.A({xmin:n,xmax:s,ymin:i,ymax:a,spatialReference:e[0].spatialReference})}(h)}function _(e,t,r){if("extent"===e.type){let{xmin:t,ymin:r,xmax:n,ymax:s,spatialReference:i}=e;e=new u.A({rings:[[[t,s],[n,s],[n,r],[t,r],[t,s]]],spatialReference:i})}return e.spatialReference.equals(t)?e:(m(),w.projectExecute(e,t,{geographicTransformation:r}))}function F(e,t,r,n=!0,s=!0){let i=e.spatialReference;if(i.equals(t)||!t)return e;m();let o=w.projectExecute(e,t,{geographicTransformation:r});if(s&&t.isWebMercator&&o&&(o.ymax=Math.min(20037508.342787,o.ymax),o.ymin=Math.max(-20037508.342787,o.ymin),o.ymin>=o.ymax))return null;if(!n||!o)return o;let a=j(i,!0),u=j(t,!0);if(null==a||null==u)return o;let p=M(i,.001),c=M(i,500),h=M(t,.001);if(Math.abs(o.xmin-u[0])<h&&Math.abs(o.xmax-u[1])<h){let n=Math.abs(e.xmin-a[0]),s=Math.abs(a[1]-e.xmax);if(n<p&&s>c){o.xmin=u[0];let n=[];n.push(new l.A(e.xmax,e.ymin,i)),n.push(new l.A(e.xmax,(e.ymin+e.ymax)/2,i)),n.push(new l.A(e.xmax,e.ymax,i));let s=n.map(e=>P(e,t,r)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmax=Math.max.apply(null,s)}if(s<p&&n>c){o.xmax=u[1];let n=[];n.push(new l.A(e.xmin,e.ymin,i)),n.push(new l.A(e.xmin,(e.ymin+e.ymax)/2,i)),n.push(new l.A(e.xmin,e.ymax,i));let s=n.map(e=>P(e,t,r)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmin=Math.min.apply(null,s)}}else{let e=M(t,.001);Math.abs(o.xmin-u[0])<e&&(o.xmin=u[0]),Math.abs(o.xmax-u[1])<e&&(o.xmax=u[1])}return o}function B(e,t=!1){if(!e)return null;let r=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*r:e.wkid&&e.isGeographic?360:2*g[e.wkid]||null}function j(e,t=!1){if(e.isGeographic)return[-180,180];let r=B(e,t);return r?[-r/2,r/2]:null}function Z(e,t,r,n){let s=(e-t)/r;return s-Math.floor(s)===0?n&&--s:s=Math.floor(s),s}function z(e,t=!1){let r=B(e.spatialReference);if(null==r)return 0;let n=t?0:-r/2,s=M(e.spatialReference),i=!t&&Math.abs(e.xmax-r/2)<s?r/2:e.xmax,o=!t&&Math.abs(e.xmin+r/2)<s?-r/2:e.xmin;return Z(i,n,r,!0)-Z(o,n,r,!1)}function G(e){let t=e.storageInfo.origin.x,r=B(e.spatialReference,!0);if(null==r)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};let n=r/2,{nativePixelSize:s,storageInfo:i,extent:o}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:u}=i,p=s.x,c=[],h=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(h?0:n),f=h?r-t:n-t;for(let e=0;e<=a;e++){let e=(o.xmax-t)/p/l,r=e-Math.floor(e)===0?e:Math.ceil(e),n=f/p/l,s=n-Math.floor(n)===0?n:Math.ceil(n),i=Math.floor(m/p/l),a=Math.round(m/p)%l,h=(l-Math.round(f/p)%l)%l;c.push({resolutionX:p,blockWidth:l,datasetColumnCount:r,worldColumnCountFromOrigin:s,leftMargin:a,rightPadding:h,originColumnOffset:i}),p*=u}return{originX:t,halfWorldWidth:n,pyramidsInfo:c,hasGCSSShiftTransform:h}}function E(e){let t=e.isAdaptive&&null==e.spacing,r=e.spacing||[32,32],n=O(e),s={cols:n.size[0]+1,rows:n.size[1]+1},i=n.outofBoundPointCount>0&&n.outofBoundPointCount<n.offsets.length/2,o=n.outofBoundPointCount===n.offsets.length/2||t&&i?[0,0]:f(n.offsets,s,r,4),l=(o[0]+o[1])/2,u=e.projectedExtent.spatialReference,p=e.srcBufferExtent.spatialReference;if(t&&(i||l>4)&&(u.isGeographic||N(u),r=[4,4],n=O({...e,spacing:r}),s={cols:n.size[0]+1,rows:n.size[1]+1},o=f(n.offsets,s,r,4)),n.error=o,r[0]>1&&(n.coefficients=D(n.offsets,s,i)),e.includeGCSGrid&&!u.isGeographic&&!u.isWebMercator)if(p.isGeographic)n.gcsGrid={offsets:n.offsets,coefficients:n.coefficients,spacing:r};else{let t=N(u);if(null!=t&&!t.isEnvelope){let t=function(e){if(!e||e.isGeographic)return e;let t,r=String(e.wkid||e.wkt2||e.wkt);return y.has(r)?t=y.get(r):(t=(e.wkid?a.P.coordsys(e.wkid):a.P.fromString(a.a.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),y.set(r,t)),new c.A({wkid:t})}(u),o=S(e.projectedExtent,t),{offsets:l}=O({...e,srcBufferExtent:o,spacing:r}),p=D(l,s,i);n.gcsGrid={offsets:l,coefficients:p,spacing:r}}}return n}function O(e){let{projectedExtent:t,srcBufferExtent:r,pixelSize:n,datumTransformation:s,rasterTransform:i}=e,o=t.spatialReference,a=r.spatialReference;m();let u,{xmin:p,ymin:c,xmax:h,ymax:f}=t,g=B(a),d=null!=g&&(e.hasWrapAround||"gcs-shift"===i?.type),y=e.spacing||[32,32],x=y[0]*n.x,w=y[1]*n.y,A=1===y[0],v=Math.ceil((h-p)/x-.1/y[0])+ +!A,b=Math.ceil((f-c)/w-.1/y[1])+ +!A,C=R({cols:v,rows:b,xmin:p,ymax:f,xres:x,yres:w,inSR:o,outSR:a,datumTransformation:s,preferPE:y[0]<=4,usePixelCenter:A}),P=[],T=0,I=A?-1:NaN,{xmin:k,xmax:S,ymax:_,width:F,height:j}=r,Z=M(a,500),z=null!=g&&k>0&&S>g/2,G=N(o),E=null!=G&&G.poleLocation>0;for(let e=0;e<v;e++){let t=[];for(let r=0;r<b;r++){let n=C[e*b+r];if(d&&n[0]>S&&n[0]>g/2-Z?n[0]-=g:d&&0===e&&n[0]<0&&z&&!i&&(n[0]+=g),!n||isNaN(n[0])||isNaN(n[1]))P.push(I),P.push(I),t.push(null),T++;else{if(i){let e=i.inverseTransform(new l.A({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}t.push(n),e>0&&d&&u[r]&&n[0]<u[r][0]&&(n[0]+=g,E&&n[0]>S&&n[0]>g&&(n[0]-=g)),P.push((n[0]-k)/F),P.push((_-n[1])/j)}}u=t}return{offsets:P,error:null,coefficients:null,outofBoundPointCount:T,spacing:y,size:A?[v,b]:[v-1,b-1]}}function D(e,t,r){let{cols:n,rows:s}=t,i=new Float32Array((n-1)*(s-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let t=0;t<n-1;t++){for(let r=0;r<s-1;r++){let l=t*s*2+2*r,u=e[l],p=e[l+1],c=e[l+2],h=e[l+3];l+=2*s;let m=e[l],f=e[l+1],g=e[l+2],d=e[l+3],y=0,x=12*(r*(n-1)+t);for(let e=0;e<3;e++)i[x++]=o[y++]*u+o[y++]*c+o[y++]*g;y=0;for(let e=0;e<3;e++)i[x++]=o[y++]*p+o[y++]*h+o[y++]*d;y=0;for(let e=0;e<3;e++)i[x++]=a[y++]*u+a[y++]*m+a[y++]*g;y=0;for(let e=0;e<3;e++)i[x++]=a[y++]*p+a[y++]*f+a[y++]*d}if(r)for(let e=0;e<i.length;e++)isNaN(i[e])&&(i[e]=-1)}return i}function V(e){let{spatialReference:t}=e,r=(0,h.Vp)(t);if(!r)return e;let[n,s]=r.valid,i=s-n,a=0;if(e.xmin<n){let t=n-e.xmin;a=Math.ceil(t/i)}else if(e.xmin>s){let t=e.xmin-s;a=-Math.ceil(t/i)}return new o.A({spatialReference:e.spatialReference,xmin:e.xmin+a*i,ymin:e.ymin,xmax:e.xmax+a*i,ymax:e.ymax})}function U(e,t,r){let{storageInfo:n,pixelSize:s}=t,o=0,a=!1,{pyramidResolutions:u}=n,p="mixed"===n.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,n.tileInfo.dpi/96)):1,c=(e.x+e.y)/2/p;if(null!=u&&u.length){let e=u[u.length-1],n=(e.x+e.y)/2,p=(s.x+s.y)/2;if(c<=p)o=0;else if(c>=n)o=u.length,a=c/n>8;else{let e,t=p;for(let n=1;n<=u.length;n++){if(e=(u[n-1].x+u[n-1].y)/2,c<=e){c===e?o=n:"down"===r?(o=n-1,a=c/t>8):o="up"===r||c-t>e-c||c/t>2?n:n-1;break}t=e}}let h=0===o?s:u[o-1];return a&&Math.min(h.x,h.y)*(0,i.GA)(t.spatialReference)>19567&&(a=!1),{pyramidLevel:o,pyramidResolution:new l.A({x:h.x,y:h.y,spatialReference:t.spatialReference}),excessiveReading:a}}let h=Math.log(e.x/s.x)/Math.LN2,m=Math.log(e.y/s.y)/Math.LN2,f=t.storageInfo.maximumPyramidLevel||0;o="down"===r?Math.floor(Math.min(h,m)):"up"===r?Math.ceil(Math.max(h,m)):Math.round((h+m)/2),o<0?o=0:o>f&&(a=o>f+3,o=f);let g=2**o;return{pyramidLevel:o,pyramidResolution:new l.A({x:g*t.nativePixelSize.x,y:g*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7],{69052(e,t,r){r.d(t,{hr:()=>i});var s=r(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return a(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+n(this.range,e-t,r)}minimalMonotonic(e,t,r){return a(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);let r=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(s)?r:s}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function a(e,t,r,s,i=0,a=!1){return(s-=i)<t?s+=n(e,t-s):s>r&&(s-=n(e,s-r)),a&&s===r&&(s=t),s+i}function n(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const o=new i(0,2*Math.PI),u=(new i(-Math.PI,Math.PI),new i(0,360));r.d(t,["ie",0,u,"uC",0,o])},18370(e,t,r){r.d(t,{z:()=>i});class s{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function i(e){return new s(e)}},82534(e,t,r){function s(){return[0,0,0,1]}function i(e){return[e[0],e[1],e[2],e[3]]}r.d(t,{o8:()=>i,vt:()=>s});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:i,create:s,fromValues:function(e,t,r,s){return[e,t,r,s]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["zK",0,a])},67026(e,t,r){r.d(t,{A6:()=>f,Xd:()=>p,Xr:()=>h,lw:()=>c,x8:()=>l});var s=r(29242),i=r(82534),a=r(51850),n=r(34304),o=r(35522),u=r(78955);function l(e,t,r){r*=.5;let s=Math.sin(r);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(r),e}function p(e,t){let r=2*Math.acos(t[3]),s=Math.sin(r/2);return s>(0,n.FD)()?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),r}function c(e,t,r){let s=t[0],i=t[1],a=t[2],n=t[3],o=r[0],u=r[1],l=r[2],p=r[3];return e[0]=s*p+n*o+i*l-a*u,e[1]=i*p+n*u+a*o-s*l,e[2]=a*p+n*l+s*u-i*o,e[3]=n*p-s*o-i*u-a*l,e}function d(e,t,r,s){let i,a,o,u,l,p=t[0],c=t[1],d=t[2],h=t[3],y=r[0],f=r[1],m=r[2],g=r[3];return a=p*y+c*f+d*m+h*g,a<0&&(a=-a,y=-y,f=-f,m=-m,g=-g),1-a>(0,n.FD)()?(i=Math.acos(a),o=Math.sin(i),u=Math.sin((1-s)*i)/o,l=Math.sin(s*i)/o):(u=1-s,l=s),e[0]=u*p+l*y,e[1]=u*c+l*f,e[2]=u*d+l*m,e[3]=u*h+l*g,e}function h(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function y(e,t){let r,s=t[0]+t[4]+t[8];if(s>0)r=Math.sqrt(s+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);let i=(s+1)%3,a=(s+2)%3;r=Math.sqrt(t[3*s+s]-t[3*i+i]-t[3*a+a]+1),e[s]=.5*r,r=.5/r,e[3]=(t[3*i+a]-t[3*a+i])*r,e[i]=(t[3*i+s]+t[3*s+i])*r,e[a]=(t[3*a+s]+t[3*s+a])*r}return e}function f(e,t,r,s){let i=.5*Math.PI/180;t*=i,r*=i,s*=i;let a=Math.sin(t),n=Math.cos(t),o=Math.sin(r),u=Math.cos(r),l=Math.sin(s),p=Math.cos(s);return e[0]=a*u*p-n*o*l,e[1]=n*o*p+a*u*l,e[2]=n*u*l-a*o*p,e[3]=n*u*p+a*o*l,e}const m=u.C,g=u.hZ,v=u.WQ,S=c,A=u.hs,_=u.Om,x=u.Cc,b=u.Bw,w=b,M=u.m3,I=M,q=u.S8,F=u.t2,R=u.aI,C=(0,a.vt)(),O=(0,a.fA)(1,0,0),T=(0,a.fA)(0,1,0),P=(0,i.vt)(),E=(0,i.vt)(),N=(0,s.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:v,calculateW:function(e,t){let r=t[0],s=t[1],i=t[2];return e[0]=r,e[1]=s,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-s*s-i*i)),e},conjugate:h,copy:m,dot:_,equals:R,exactEquals:F,fromEuler:f,fromMat3:y,getAxisAngle:p,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){let r=t[0],s=t[1],i=t[2],a=t[3],n=r*r+s*s+i*i+a*a,o=n?1/n:0;return e[0]=-r*o,e[1]=-s*o,e[2]=-i*o,e[3]=a*o,e},len:w,length:b,lerp:x,mul:S,multiply:c,normalize:q,random:function(e){let t=n.Ov,r=t(),s=t(),i=t(),a=Math.sqrt(1-r),o=Math.sqrt(r);return e[0]=a*Math.sin(2*Math.PI*s),e[1]=a*Math.cos(2*Math.PI*s),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},rotateX:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u+n*o,e[1]=i*u+a*o,e[2]=a*u-i*o,e[3]=n*u-s*o,e},rotateY:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u-a*o,e[1]=i*u+n*o,e[2]=a*u+s*o,e[3]=n*u-i*o,e},rotateZ:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u+i*o,e[1]=i*u-s*o,e[2]=a*u+n*o,e[3]=n*u-a*o,e},rotationTo:function(e,t,r){let s=(0,o.Om)(t,r);return s<-.999999?((0,o.$A)(C,O,t),(0,o.Il)(C)<1e-6&&(0,o.$A)(C,T,t),(0,o.S8)(C,C),l(e,C,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,o.$A)(C,t,r),e[0]=C[0],e[1]=C[1],e[2]=C[2],e[3]=1+s,q(e,e))},scale:A,set:g,setAxes:function(e,t,r,s){let i=N;return i[0]=r[0],i[3]=r[1],i[6]=r[2],i[1]=s[0],i[4]=s[1],i[7]=s[2],i[2]=-t[0],i[5]=-t[1],i[8]=-t[2],q(e,y(e,i))},setAxisAngle:l,slerp:d,sqlerp:function(e,t,r,s,i,a){return d(P,t,i,a),d(E,r,s,a),d(e,P,E,2*a*(1-a)),e},sqrLen:I,squaredLength:M,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"})),r.d(t,["hZ",0,g,"t2",0,F])},95696(e,t,r){r.d(t,{A:()=>l});var s,i=r(32198),a=r(69540),n=r(25482),o=r(91429),u=r(93223);let l=class extends((0,a.OU)(n.o)){static{s=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new s}};(0,i.Cg)([(0,u.e)({georeferenced:"georeferenced"},{readOnly:!0})],l.prototype,"type",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],l.prototype,"origin",void 0),l=s=(0,i.Cg)([(0,o.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],l)},18251(e,t,r){r.d(t,{A:()=>l});var s=r(32198),i=r(69540),a=r(25482),n=r(91429),o=r(51850),u=r(93223);let l=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.type="local",this.origin=(0,o.vt)()}};(0,s.Cg)([(0,u.e)({local:"local"},{readOnly:!0})],l.prototype,"type",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],l.prototype,"origin",void 0),l=(0,s.Cg)([(0,n.$K)("esri.geometry.support.MeshLocalVertexSpace")],l)},73836(e,t,r){r.d(t,{A:()=>h});var s=r(32198),i=r(69540),a=r(25482),n=r(91429),o=r(58083),u=r(9093),l=r(67026),p=r(82534),c=r(51850),d=r(24770);let h=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.translation=(0,c.vt)(),this.rotationAxis=(0,c.ci)(d.up),this.rotationAngle=0,this.scale=(0,c.fA)(1,1,1)}get rotation(){return(0,d.i4)(this.rotationAxis,this.rotationAngle)}set rotation(e){this.rotationAxis=(0,c.o8)((0,d.yo)(e)),this.rotationAngle=(0,d.g7)(e)}get localMatrix(){let e=(0,u.vt)();return(0,l.x8)(y,(0,d.yo)(this.rotation),(0,d.$I)(this.rotation)),(0,o.o1)(e,y,this.translation,this.scale),e}get localMatrixInverse(){return(0,o.B8)((0,u.vt)(),this.localMatrix)}equals(e){return this===e||null!=e&&(0,o.t2)(this.localMatrix,e.localMatrix)}};(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"translation",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"rotationAxis",void 0),(0,s.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],h.prototype,"rotationAngle",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"scale",void 0),(0,s.Cg)([(0,n.MZ)()],h.prototype,"rotation",null),(0,s.Cg)([(0,n.MZ)()],h.prototype,"localMatrix",null),(0,s.Cg)([(0,n.MZ)()],h.prototype,"localMatrixInverse",null),h=(0,s.Cg)([(0,n.$K)("esri.geometry.support.MeshTransform")],h);const y=(0,p.vt)()},24770(e,t,r){r.d(t,{$I:()=>m,AU:()=>h,g7:()=>f,i4:()=>p,ui:()=>c,vt:()=>l,yo:()=>y});var s=r(34727),i=r(58083),a=r(67026),n=r(82534),o=r(35522),u=r(51850);function l(e=v){return[e[0],e[1],e[2],e[3]]}function p(e,t,r=l()){return(0,o.C)(r,e),r[3]=t,r}function c(e,t=l()){let r=(0,i.l)(S,e);return g(t,(0,s.KJ)((0,a.Xd)(t,r))),t}function d(e,t,r=l()){return(0,a.x8)(S,e,m(e)),(0,a.x8)(A,t,m(t)),(0,a.lw)(S,A,S),g(r,(0,s.KJ)((0,a.Xd)(r,S)))}function h(e,t,r,s=l()){return p(u.Cw,e,_),p(u.JP,t,x),p(u.Cb,r,b),d(_,x,_),d(_,b,s),s}function y(e){return e}function f(e){return e[3]}function m(e){return(0,s.kU)(e[3])}function g(e,t){return e[3]=t,e}const v=[0,0,1,0],S=(0,n.vt)(),A=(0,n.vt)(),_=(l(),l()),x=l(),b=l();r.d(t,["up",0,v])},63579(e,t,r){r.d(t,{Bq:()=>u,Qp:()=>o,WN:()=>m,dK:()=>g,eN:()=>h,fH:()=>f,in:()=>y,yr:()=>l});var s=r(56507),i=r(4576),a=r(17676),n=r(20557);class o{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,i.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(let t of this.parts)e+=t.partHash;return e}async toBlob(e){let{parts:t}=this;if(1===t.length)return t[0].toBlob(e);let r=await Promise.all(t.map(t=>t.toBlob(e)));return(0,a.Te)(e),new Blob(r)}}class u{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){let{data:t}=await(0,s.A)(this.partUrl,{responseType:"blob"});return(0,a.Te)(e),t}}function l(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(d):d(e.files);case"service":return e.assets.some(d);case"loadable":return!0;default:return!1}}(e?.source)}const p=/^(model\/gltf\+json)|(model\/gltf-binary)$/,c=/\.(gltf|glb)/i;function d(e){if(e instanceof File){let{type:t,name:r}=e;return p.test(t)||c.test(r)}return p.test(e.assetMimeType)||c.test(e.assetName)}function h(e,t){if(!e)return!1;let{source:r}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(r,t)}function y(e,t){if(e===t)return!0;let{source:r}=e,{source:s}=t;if(r===s)return!0;if("service"===r.type&&"service"===s.type){if(r.assets.length!==s.assets.length)return!1;let e=(e,t)=>e.assetName<t.assetName?-1:+(e.assetName>t.assetName),t=[...r.assets].sort(e),i=[...s.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(i[e]))return!1;return!0}return!1}function f(e,t){return e instanceof File?(0,n.rq)(e,t):(0,n.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function g(e){return!!e.original}},27615(e,t,r){r.d(t,{CK:()=>u,Hq:()=>o,MW:()=>l,TE:()=>p,yJ:()=>c});var s=r(35522),i=r(86738),a=r(95696),n=r(18251);function o(e){return null!=e.origin}function u(e){return o(e.vertexSpace)}function l(e,t){if(!o(e))return null;let[r,s,a]=e.origin;return new i.A({x:r,y:s,z:a,spatialReference:t})}function p(e,t){let{x:r,y:s,z:i,spatialReference:o}=e,u=[r,s,i??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(o))?new n.A({origin:u}):new a.A({origin:u})}function c(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,s.t2)(e.origin,t.origin))}},52039(e,t,r){r.d(t,{O7:()=>d,el:()=>l});var s=r(69052),i=(r(49186),r(18370)),a=r(17676),n=(r(5443),r(39829)),o=(r(82799),r(16930)),u=(r(80754),r(21325));async function l(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let s=null;for(let t of e)s??=t?.spatialReference;if(!s)return e;let i=(0,u.Vp)(s);if(!i)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(i);return["xmin"in t?t:new n.A(t)]}let[o,l]=i.valid,d=!1;for(let t of e){if(!t)continue;if("point"===t.type){d||=t.x>=l,d||=t.x<=o;continue}let{extent:e}=t;if(null==e){d=!0;break}d||=e.xmin>=l,d||=e.xmin<=o,d||=e.xmax>=l,d||=e.xmax<=o}if(!d)return e;let[{foldInto360Range:h},y]=await(0,a.qr)(Promise.all([p.getImportPromise(),c.getImportPromise()]),r),f=y.fromSpatialReference(s);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=y.fromGeometry(e),r=y.toGeometry(h(t,f),s);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const p=(0,i.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),c=(0,i.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function d(e,t,r){let s=(0,u.Vp)(r);if(null==s)return e;let[i,a]=s.valid,n=2*a,o=0,l=0;t>a?o=Math.ceil(Math.abs(t-a)/n):t<i&&(o=-Math.ceil(Math.abs(t-i)/n)),e>a?l=Math.ceil(Math.abs(e-a)/n):e<i&&(l=-Math.ceil(Math.abs(e-i)/n));let p=e+(o-l)*n,c=p-t;return c>a?p-=n:c<i&&(p+=n),p}function h(e){let t=(0,u.Vp)(e);if(null==t)return null;let[r,i]=t.valid;return new s.hr(r,i)}const y=h(o.A.WGS84);h(o.A.WebMercator),r.d(t,["Y_",0,y])},80754(e,t,r){r.d(t,{kS:()=>l,kd:()=>u});var s=r(82799),i=r(16930),a=r(60408),n=r(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function u(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){if((0,n.Ed)(e))for(let r of function(e){return(0,a.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of r){if((0,n.aO)(e)){let[r,s]=e.c;r[0]+=t,s[0]+=t;continue}if((0,n.FG)(e)){let[r,s]=e.a;r[0]+=t,s[0]+=t;continue}if((0,n.n1)(e)){let[r,s,i]=e.b;r[0]+=t,s[0]+=t,i[0]+=t;continue}e[0]+=t}for(let r of function(e){return(0,a.Bi)(e)?e.rings:e.paths}(e))for(let e of r)e[0]+=t;return e}r.d(t,["j7",0,o])},99352(e,t,r){r.d(t,["F",0,{supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsStatisticsAggregatedIds:!0,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},"P",0,{supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}])},60845(e,t,r){r.r(t),r.d(t,{default:()=>ae});var s=r(32198),i=r(92602),a=r(56507),n=r(4576),o=r(49186),u=r(44208),l=r(66552),p=r(92474),c=r(53966),d=r(93637),h=r(17676),y=r(36708),f=r(84952),m=r(13069),g=r(91429),v=r(5443),S=r(16930),A=r(95696),_=r(27615),x=r(63579),b=r(52106),w=r(86211);function M(e){return"object"==typeof e&&!!e&&"objectId"in e&&!!e.objectId}function I(e){return e.every(M)}function q(e){return"object"==typeof e&&!!e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(q)}var R=r(99917),C=r(65864),O=r(73836),T=r(21325);async function P(e,t,r){let{geometry:s}=t,i={...t.attributes};if(null!=r&&"mesh"===s?.type){let{transformFieldRoles:t}=r,{origin:a,spatialReference:n,vertexSpace:o}=s,u=s.transform??new O.A,l="local"===o.type,p=e.spatialReference,c=p.isGeographic,d=(0,T.aI)(p,n),h=(0,R.isEqualBaseGCS)(n,p)&&(0,R.canProjectWithoutEngine)(n,p);if(!(l&&c&&h||!l&&!c&&d))return null;let y=(0,R.projectWithoutEngine)(a,n,p);if(null==y)return null;if(i[t.originX]=y.x,i[t.originY]=y.y,i[t.originZ]=y.z??0,null!=u){let{translation:e,scale:r,rotation:s}=u,a=l?1:(0,w.KX)(n)/(0,w.KX)(p);i[t.translationX]=e[0]*a,i[t.translationY]=e[2]*a,i[t.translationZ]=-e[1]*a,i[t.scaleX]=r[0],i[t.scaleY]=r[2],i[t.scaleZ]=r[1],i[t.rotationX]=s[0],i[t.rotationY]=s[2],i[t.rotationZ]=-s[1],i[t.rotationDeg]=s[3]}return{attributes:i}}return null==s?{attributes:i}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:i}}async function E(e,t){let r=await Promise.all((t.addAttachments??[]).map(t=>N(e,t))),s=await Promise.all((t.updateAttachments??[]).map(t=>N(e,t))),i=t.deleteAttachments??[];return r.length||s.length||i.length?{adds:r,updates:s,deletes:[...i]}:null}async function N(e,t){let{feature:r,attachment:s}=t,{globalId:i,name:a,contentType:n,data:o,keywords:u,uploadId:l}=s,p={globalId:i};if(r&&("attributes"in r?p.parentGlobalId=r.attributes?.[e.globalIdField]:r.globalId&&(p.parentGlobalId=r.globalId)),l)p.uploadId=l;else if(o){let e=await(0,f._0)(o);e&&(p.contentType=e.mediaType,p.data=e.data),o instanceof File&&(p.name=o.name)}return a&&(p.name=a),n&&(p.contentType=n),u&&(p.keywords=u),p}function D(e){let t=!0===e.success?null:e.error||{code:void 0,description:"Feature edit failed"};return{objectId:e.objectId,globalId:e.globalId,error:t?new o.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}function Q(e,t){return new b.A({attributes:e.attributes,geometry:(0,C.rS)({...e.geometry,spatialReference:t})})}function Z(e,t){return{adds:e?.adds?.map(e=>Q(e,t))||[],updates:e?.updates?.map(e=>({original:Q(e[0],t),current:Q(e[1],t)}))||[],deletes:e?.deletes?.map(e=>Q(e,t))||[],spatialReference:t}}var V=r(64714),J=r(64314),j=r(60694),G=r(15426),U=r(20557),k=r(69622),B=r(76553),z=r(39516),L=r(10107),X=r(64108),$=r(2991);function W(e,t,r,s){let i=s.get(e)?.type,a=s.getTimeZone(e);return`${(0,z.iA)(e)} ${t} ${(0,z.YG)(r,{type:"date"},{type:i,timeZone:a})}`}let Y=class extends k.A{constructor(e){super(e),this.fieldsIndex=null,this.layer=null}getExpression(e){let{layer:t}=this;if(!t)return;if(!(0,B.H)(t))return{type:"where",value:this._getLayerCondition(e)};let r=t.timeInfo,s=t.getAtOrigin("timeInfo","service");return s?r?r!==s&&(r.startField!==s.startField&&(r.startField||s.startField)||r.endField!==s.endField&&(r.endField||s.endField))?{type:"where",value:this._getLayerCondition(e)}:{type:"time",value:(0,$.G)(e)}:void 0:r?{type:"where",value:this._getLayerCondition(e)}:void 0}_getLayerCondition(e){let{fieldsIndex:t,layer:r}=this;if(!t||!r)return;let{timeInfo:s}=r;if(!s)return;let{startField:i,endField:a}=s,{start:n,end:o}=e;if(!n&&!o||!i&&!a)return;let u=i??a,l=a??i;if(u&&l){if(n&&o){if(n.getTime()===o.getTime())return W(u,"==",n,t);if(!i||!a){let e=W(u,">=",n,t),r=W(u,"<=",o,t);return(0,z.mA)(e,r)}let e=W(i,">=",n,t),r=W(a,"<=",o,t);return(0,z.mA)(e,r)}if(n)return W(u,">=",n,t);if(o)return W(l,"<=",o,t)}}};(0,s.Cg)([(0,L.MZ)({constructOnly:!0})],Y.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,L.MZ)({constructOnly:!0})],Y.prototype,"layer",void 0),Y=(0,s.Cg)([(0,X.$)("esri.layers.support.TimeInformation")],Y);var H=r(99199),K=r(96520),ee=r(97552),te=r(79677),re=r(20816);const se=new l.J({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),ie=new l.J({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let ae=class extends p.x_{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer","Annotation Layer","Dimension Layer"]),this.refresh=(0,h.sg)(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([(0,y.wB)(()=>{let e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{layer:e}=this,{capabilities:t,parsedUrl:r,gdbVersion:s,spatialReference:i,fieldsIndex:a,uniqueIdFields:n}=e,o="infoFor3D"in e?e.infoFor3D:null,l="dynamicDataSource"in e?e.dynamicDataSource:null,p=(0,u.A)("featurelayer-pbf")&&t?.query.supportsFormatPBF&&null==o,c=p&&t?.query.supportsFormatPBFWithCurves,d=t?.operations?.supportsQueryAttachments??!1,h=t?.query?.relativeTimeBinWindow??0,y=new Y({fieldsIndex:a,layer:e}),f=r.path;return new J.A({dynamicDataSource:l,fieldsIndex:a,gdbVersion:s,infoFor3D:o,pbfSupported:p,pbfSupportedWithCurves:c,queryAttachmentsSupported:d,relativeTimeBinWindow:h,sourceSpatialReference:i,timeInformation:y,uniqueIdFields:n,url:f})}async addAttachment(e,t,r){await this.load();let{layer:s}=this;await(0,G.VA)(s,"editing");let i=e.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+i+"/addAttachment",o=this._getLayerRequestOptions({query:r}),u=this._getFormDataForAttachment(t,o.query);try{return D((await(0,a.A)(n,{body:u})).data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(i,e)}}async updateAttachment(e,t,r,s){await this.load();let{layer:i}=this;await(0,G.VA)(i,"editing");let n=e.attributes[i.objectIdField],o=i.parsedUrl.path+"/"+n+"/updateAttachment",u=this._getLayerRequestOptions({query:{attachmentId:t,...s}}),l=this._getFormDataForAttachment(r,u.query);try{return D((await(0,a.A)(o,{body:l})).data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(n,e)}}async applyEdits(e,t){await this.load();let{layer:r}=this;await(0,G.VA)(r,"editing");let s="infoFor3D"in r?r.infoFor3D:null,i=null!=s,u=i||(t?.globalIdUsed??!1),l=i?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,p=e.addFeatures?.map(e=>P(this.layer,e,s))??[],c=(await Promise.all(p)).filter(n.Ru),d=e.updateFeatures?.map(e=>P(this.layer,e,s))??[],h=(await Promise.all(d)).filter(n.Ru),y=function(e,t,r){if(!t||0===t.length)return[];if(r&&F(t))return t.map(e=>e.globalId);if(I(t))return t.map(e=>e.objectId);let s=r?e.globalIdField:e.objectIdField;return s?t.map(e=>e.getAttribute(s)):[]}(this.layer,e.deleteFeatures,u);(0,K.u)(c,h,r.spatialReference);let f=await E(this.layer,e),m=r.capabilities.editing.supportsAsyncApplyEdits&&i,g=t?.gdbVersion||r.gdbVersion,v={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:m};await(0,re.ZJ)(this.layer.url,g,!0);let S=(0,re.w5)(this.layer.url,g||null);if(await(0,re.We)(r.url,g,r.historicMoment))throw new o.A("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(v.edits=JSON.stringify([{id:r.layerId,adds:c.length?c:null,updates:h.length?h:null,deletes:y.length?y:null,attachments:f,assetMaps:l}]),v.returnServiceEditsOption=se.toJSON(t?.returnServiceEditsOption),v.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(v.adds=c.length?JSON.stringify(c):null,v.updates=h.length?JSON.stringify(h):null,v.deletes=y.length?u?JSON.stringify(y):y.join(","):null,v.attachments=f&&JSON.stringify(f),v.assetMaps=null==l?void 0:JSON.stringify(l));let A=this._getLayerRequestOptions({method:"post",query:v});S&&(A.authMode="immediate",A.query.returnEditMoment=!0,A.query.sessionId=re.TA);let _,x=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;try{_=m?await this._asyncApplyEdits(x+"/applyEdits",A):await(0,a.A)(x+"/applyEdits",A)}catch(e){if(!function(e){let t=e.details.raw,r=+t.code,s=+t.extendedCode;return 500===r&&(-2147217144===s||-2147467261===s)}(e))throw e;A.authMode="immediate",_=m?await this._asyncApplyEdits(x+"/applyEdits",A):await(0,a.A)(x+"/applyEdits",A)}return this._createEditsResult(_)}async deleteAttachments(e,t,r){await this.load();let{layer:s}=this;await(0,G.VA)(s,"editing");let i=e.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+i+"/deleteAttachments";try{return(await(0,a.A)(n,this._getLayerRequestOptions({query:{attachmentIds:t.join(","),...r},method:"post"}))).data.deleteAttachmentResults.map(D)}catch(e){throw this._createAttachmentErrorResult(i,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await(0,a.A)(`${s}/${r}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,p=o||u;return{id:n,fullExtent:p&&v.A.fromJSON(p),timeExtent:l&&te.A.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();let r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){let t=new Map;if(r.features.forEach(r=>{let s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(let e of r.fields){let r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,j.Wo)(this.layer.url))return"unavailable";let e=(0,f.fj)(this.layer.url,"status"),t=await(0,a.A)(e,{query:{f:"json"}});return ie.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:s}=await r.e(1384).then(()=>r(31384));return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let r=t.url;null!=r&&("layerId"in t&&(r=(0,f.fj)(r,t.layerId.toString())),this._getOrCreateEditInterceptor(r).before=t=>{let r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){let r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}})}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},i.A.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&((0,n.TF)(i.A.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await(0,a.A)(e,t)).data.statusUrl;for(;;){let e=(await(0,a.A)(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,a.A)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new o.A("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new o.A("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,h.Pl)(ne)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};(0,u.A)("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:s}=await(0,a.A)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=s}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new o.A("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=(0,V.F0)(e.geometryType).renderer;(0,d.sM)("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{let{data:r}=await(0,a.A)(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){(0,h.QP)(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let s=e.addFeatures.filter(e=>e.geometry);if(t.length!==s.length+e.updateFeatures.length)throw new o.A("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");let i=[],a=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:s}=t;if((0,_.Hq)(s))i.push(t);else{let s=t.origin,{convertMeshVertexSpace:n}=await Promise.all([r.e(2258),r.e(4548)]).then(()=>r(28846)),o=await n(t,new A.A({origin:[s.x,s.y,s.z??0]}));a.set(o,t),e.geometry=o,i.push(o)}}await this.uploadAssets(i);for(let[e,t]of a)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],r=this.layer.globalIdField,s=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(s),n=i.getAttribute(r);if(0===a.length){c.A.getLogger(this).error(`Skipping feature ${n}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:o}=a.find(x.dK)??a[0];for(let e of o.assets)1===e.parts.length?t.push({globalId:(0,m.yS)(),parentGlobalId:n,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]}):c.A.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){let t=e.data,{layerId:r}=this.layer,s=[],i=null;if(Array.isArray(t))for(let e of t)null!=e.editedFeatures&&s.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=function(e){let t=e?.assetMaps;if(t){for(let e of t.addResults)e.success||c.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(let e of t.updateResults)e.success||c.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`)}let r=e?.attachments,s={addFeatureResults:e?.addResults?.map(D)??[],updateFeatureResults:e?.updateResults?.map(D)??[],deleteFeatureResults:e?.deleteResults?.map(D)??[],addAttachmentResults:r?.addResults?r.addResults.map(D):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(D):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(D):[]};return e?.editMoment&&(s.editMoment=e.editMoment),s}(i);if(s.length>0){a.editedFeatureResults=[];for(let e of s){let{editedFeatures:t}=e,r=t?.spatialReference?new S.A(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:Z(t,r)})}}return a}_createAttachmentErrorResult(e,t){let r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new o.A("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){let r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(let e in t){let s=t[e];null!=s&&(r.set?r.set(e,s):r.append(e,s))}return r}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify(t.dynamicDataSource.toLayerSourceJSON()):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:r,parsedUrl:s}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;let a=(0,U.JZ)(i);if(null==a)return!1;let o=(0,f.fj)(s.path,`../${a.id}`),u=[];for(let t of e){if(!(t.geometry.metadata.getExternalSourcesOnService(s).length>0))return!1;u.push(t)}let l=u.map(e=>e.getAttribute(r)).filter(n.Ru);if(0===l.length)return!1;let{assetMapFieldRoles:{parentGlobalId:p,assetHash:c}}=i,d=new ee.A({where:`${p} IN (${l.map(e=>`'${e}'`)})`,outFields:[c,p],returnGeometry:!1}),{features:h}=await(0,H.s)(o,d);return 0!==h.length&&!u.some(e=>{let t=e.getAttribute(r);if(!t)return!0;let{metadata:i}=e.geometry,a=h.filter(e=>e.getAttribute(p)===t);if(0===a.length)return!0;let n=a.map(e=>e.getAttribute(c));return i.getExternalSourcesOnService(s).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};(0,s.Cg)([(0,g.MZ)()],ae.prototype,"type",void 0),(0,s.Cg)([(0,g.MZ)({constructOnly:!0})],ae.prototype,"layer",void 0),(0,s.Cg)([(0,g.MZ)({constructOnly:!0})],ae.prototype,"supportedSourceTypes",void 0),(0,s.Cg)([(0,g.MZ)({readOnly:!0})],ae.prototype,"queryTask",null),ae=(0,s.Cg)([(0,g.$K)("esri.layers.graphics.sources.FeatureLayerSource")],ae);const ne=1e3},64314(e,t,r){r.d(t,{A:()=>w});var s=r(32198),i=r(69622),a=r(49186),n=r(44208),o=r(17676),u=r(84952),l=r(91429),p=r(21325),c=r(20557),d=r(2272),h=r(99614),y=r(20615),f=r(74910),m=r(78286),g=r(99199),v=r(62815),S=r(63746);class A{constructor(e){this._options=e,this.featureSet={features:[]},this.parseOnly=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._finishVertex=A._finishVertexNonPoint,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._vertex=[],this._part=null,this._parts=null,this._i=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){"string"==typeof e&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:r}of t)r&&(r.spatialReference=e)}feature(){this._attributesClass??=(0,S._)(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push({attributes:new this._attributesClass}),this._options.applyTransform&&this._setVertexTransformer()}centroid([e,t]){this.featureSet.features.at(-1).centroid={x:e,y:t}}geometry(e,t,r){this._previousX=this._previousY=0,this._lengths=r;let s,{hasZ:i,hasM:a}=this.featureSet;switch(i??=!1,a??=!1,this._i=0,this._vertex=[0,0],i&&this._vertex.push(0),a&&this._vertex.push(0),this._finishVertex=A._finishVertexNonPoint,t){case"esriGeometryPoint":this._point={x:0,y:0},s=this._point,this._finishVertex=i?a?A._finishVertexPointXYZM:A._finishVertexPointXYZ:a?A._finishVertexPointXYM:A._finishVertexPointXY;break;case"esriGeometryMultipoint":s={points:[],hasZ:i,hasM:a},this._part=s.points,this._parts=[];break;case"esriGeometryPolyline":s={paths:[],hasZ:i,hasM:a},this._parts=s.paths,this._part=[];break;case"esriGeometryPolygon":s={rings:[],hasZ:i,hasM:a},this._parts=s.rings,this._part=[]}1===e?(this.featureSet.queryGeometry=s,this.featureSet.queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):this.featureSet.features.at(-1).geometry=s}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}curvedGeometry(e,t,r,s){let i,{hasZ:a,hasM:n}=this.featureSet;switch(a??=!1,n??=!1,e){case"esriGeometryPoint":case"esriGeometryMultipoint":throw Error(`Curved ${e} does not make sense`);case"esriGeometryPolyline":i={paths:[],curvePaths:[],hasZ:a,hasM:n},this._parts=i.curvePaths,this._part=[];break;case"esriGeometryPolygon":i={rings:[],curveRings:[],hasZ:a,hasM:n},this._parts=i.curveRings,this._part=[]}this.featureSet.features.at(-1).geometry=i}startCurvedPart(e){this._part.push(this._transform(e))}finishCurvedPart(e){this._parts.push(this._part),this._part=[]}lineSegment(e,t){this._part.push(this._transform(t))}bezierSegment(e,t,r,s){this._part.push({b:[this._transform(t),this._transformXY(r),this._transformXY(s)]})}circularArcSegment(e,t,r){this._part.push({c:[this._transform(t),this._transformXY(r)]})}ellipticArcSegment(e,t,r,s,i,a,n,o){this._part.push({a:[this._transform(t),this._transformXY(r),s,i,a,n,o]})}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexNonPoint(e){let{_part:t,_parts:r,_lengths:s,_vertex:i}=e;t.push([...i]),!(t.length<s[r.length])&&(e._previousX=e._previousY=0,e._part=[],r.push(t))}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:r,transform:s}=this.featureSet,i=r?(0,v.d)(e,t):1;this._transformInPlace??=(0,S.M)(this.featureSet,i),this._transformInPlaceXY??=(0,S.M)({transform:s})}_transform(e){let t=[...e];return this._transformInPlace?.(t),t}_transformXY(e){let t=[e[0],e[1]];return this._transformInPlaceXY?.(t),t}}var _=r(80893),x=r(22671),b=r(97552);let w=class extends i.A{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return(0,u.An)(this.url)}async execute(e,t){let r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){let r,s=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],a=(0,n.A)("featurelayer-pbf-statistics");if(this.pbfSupported&&(!i||a)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves))try{r=await async function(e,t,r,s){let i=(0,d.Dl)(e),a={...r},n=b.A.from(t),o=!n.quantizationParameters;return await(0,_.IJ)(i,n,new A({sourceSpatialReference:n.sourceSpatialReference,applyTransform:o}),a,s)}(this.url,s,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return r??=await(0,g.e)(this.url,s,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(r.fields),r}async featureSetFromJSON(e,t,s){if(!this._queryGet3DObjectFormat(e)||null==this.infoFor3D||!t.features)return x.A.fromJSON(t);let{meshFeatureSetFromJSON:i}=await(0,o.qr)(Promise.all([r.e(2258),r.e(118),r.e(9855)]).then(()=>r(40050)),s);return i(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.I)(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return(0,f.L)(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,m.V)(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:s},{executeRelationshipQuery:i}]=await(0,o.qr)(Promise.all([Promise.resolve().then(()=>r(26591)),r.e(1763).then(()=>r(71763))]),t),a=s.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:s},{executeRelationshipQueryForCount:i}]=await(0,o.qr)(Promise.all([Promise.resolve().then(()=>r(26591)),r.e(1763).then(()=>r(71763))]),t),a=s.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:s,fetchAttachments:i,processAttachmentQueryResult:a}=await(0,o.qr)(r.e(9239).then(()=>r(9239)),t),n=(0,d.Dl)(this.url);return a(n,await(this.queryAttachmentsSupported?s(n,e,t):i(n,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:s}=await(0,o.qr)(r.e(3103).then(()=>r(33103)),t);return s(this.parsedUrl,e,t)}async executePivotQuery(e,t){let{executePivotQuery:s}=await(0,o.qr)(r.e(566).then(()=>r(80566)),t);return s(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:s}=await(0,o.qr)(r.e(1273).then(()=>r(11273)),t);return s(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){let{executeForTopIds:s}=await(0,o.qr)(r.e(1277).then(()=>r(21277)),t);return s(this.parsedUrl,e,t)}async executeForTopExtents(e,t){let{executeForTopExtents:s}=await(0,o.qr)(r.e(8018).then(()=>r(8018)),t);return s(this.parsedUrl,e,t)}async executeForTopCount(e,t){let{executeForTopCount:s}=await(0,o.qr)(r.e(980).then(()=>r(10980)),t);return s(this.parsedUrl,e,t)}_normalizeQuery(e){let t=b.A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,s=this._queryGet3DObjectFormat(e);if(null!=r&&s){if(t=t===e?t.clone():t,t.formatOf3DObjects=s,t.outSpatialReference&&!(0,p.aI)(t.outSpatialReference,this.sourceSpatialReference))throw new a.A("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:s,originY:i,originZ:a,translationX:n,translationY:o,translationZ:u,scaleX:l,scaleY:p,scaleZ:c,rotationX:d,rotationY:h,rotationZ:y,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(s,i,a,n,o,u,l,p,c,d,h,y,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:r}){return!0!==e||"xyFootprint"===t||r?null:(0,c.Hz)(this.infoFor3D)}};(0,s.Cg)([(0,l.MZ)({types:h.e})],w.prototype,"dynamicDataSource",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"gdbVersion",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"infoFor3D",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,s.Cg)([(0,l.MZ)()],w.prototype,"pbfSupported",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"pbfSupportedWithCurves",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"queryAttachmentsSupported",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"relativeTimeBinWindow",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"sourceSpatialReference",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"timeInformation",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"uniqueIdFields",void 0),(0,s.Cg)([(0,l.MZ)({type:String})],w.prototype,"url",void 0),w=(0,s.Cg)([(0,l.$K)("esri.layers.graphics.sources.support.QueryTask")],w)},64714(e,t,r){r.d(t,{F0:()=>o,Vx:()=>p,e2:()=>d,f:()=>f});var s=r(44208),i=r(4718),a=r(99352),n=r(93470);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?n.Cb:"esriGeometryPolyline"===e?n.yM:n.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function p(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>t?{[t]:null,...e}:{...e};try{let r="";t&&(r+=`this${c(t)} = null;`);for(let t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;let s=Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch{return()=>t?{[t]:null,...e}:{...e}}}function c(e){return u.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.o8)(e)}}]}const h={...a.F,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!1,supportsDistance:!1,supportsExtent:!1,supportsQuantization:!1,supportsQueryGeometry:!1,supportsDisjointSpatialRelationship:!1},y={...a.P,supportedStatistics:{...a.P.supportedStatistics,envelope:!1,centroid:!1,convexHull:!1}};function f(e,t,r=!1){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r?h:a.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:r?y:a.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},20615(e,t,r){r.d(t,{I:()=>n});var s=r(2272),i=r(80893),a=r(97552);function n(e,t,r,n){return(0,i.gW)((0,s.Dl)(e),a.A.from(t),r,n)}},74910(e,t,r){r.d(t,{L:()=>o});var s=r(5443),i=r(2272),a=r(80893),n=r(97552);async function o(e,t,r){let o=(0,i.Dl)(e),u=await(0,a.Jf)(o,n.A.from(t),{...r}),l=u.extent;return!l||isNaN(l.xmin)||isNaN(l.ymin)||isNaN(l.xmax)||isNaN(l.ymax)?{count:u.count,extent:null}:{count:u.count,extent:s.A.fromJSON(l)}}},78286(e,t,r){r.d(t,{V:()=>n});var s=r(2272),i=r(80893),a=r(97552);async function n(e,t,r,n){let o=(0,s.Dl)(e),u=await(0,i.Pk)(o,a.A.from(t),r,n);return u.objectIds??function(e){if(e)return function(e){return!Array.isArray(e[0])}(e)?e:e.map(e=>JSON.stringify(e))}(u.uniqueIds)??[]}},99199(e,t,r){r.d(t,{e:()=>u,s:()=>o});var s=r(2272),i=r(80893),a=r(22671),n=r(97552);async function o(e,t,r,s){let i=await u(e,t,r,s);return a.A.fromJSON(i)}function u(e,t,r,a){let o=(0,s.Dl)(e),u={...r},l=n.A.from(t);return(0,i.eW)(o,l,l.sourceSpatialReference,u,a)}},63746(e,t,r){function s(e){return class{constructor(){for(let t of e)this[t]=null}}}function i(e,t=1){let{transform:r,hasZ:s,hasM:i}=e;if(null==r)return s&&1!==t?e=>{e[2]*=t}:null;let[a,n]=function(e,t,r,s){let{scale:i,translate:a,originPosition:n}=e;return"upperLeft"===n&&(i=i.map((e,t)=>1===t?-e:e)),t&&(i=i.map((e,t)=>2===t?e*s:e),a=a.map((e,t)=>2===t?e*s:e)),!t&&r&&(i=i.filter((e,t)=>2!==t),a=a.filter((e,t)=>2!==t)),[i,a]}(r,s,i,t),o=e.hasZ?3:2;return e=>{for(let t=0;t<e.length&&(t!==o||0!==e[t]);++t)e[t]=e[t]*a[t]+n[t]}}r.d(t,{M:()=>i,_:()=>s})},2272(e,t,r){r.d(t,{Dl:()=>l,gf:()=>c,jV:()=>u,lF:()=>p});var s=r(92602),i=r(70333),a=r(4718),n=r(84952),o=r(926);function u(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,n.An)(e):(0,a.o8)(e)}function p(e,t,r){let s={};for(let i in e){if("declaredClass"===i)continue;let a=e[i];if(null!=a&&"function"!=typeof a)if(Array.isArray(a))s[i]=a.map(e=>p(e));else if("object"==typeof a)if(a.toJSON){let e=a.toJSON(r?.[i]);s[i]=t?e:JSON.stringify(e)}else s[i]=t?a:JSON.stringify(a);else s[i]=a}return s}async function c(e,t,a){return function(e,t){return e?t&&(0,o.Qc)(e)?t:(0,o.getApiKey)(e)??i.id?.findCredential(e)?.token:null}(e,t)||(!i.id&&s.A.request.useIdentity&&await Promise.all([r.e(6361),r.e(6475),r.e(7715)]).then(()=>r(50148)),(await i.id.getCredential(e,a))?.token)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[514,3932,6553],{78955(e,t,r){r.d(t,{Bw:()=>g,C:()=>i,Cc:()=>v,LI:()=>p,Om:()=>x,S8:()=>M,T9:()=>h,WQ:()=>o,Z0:()=>R,aI:()=>C,hG:()=>c,hZ:()=>l,hs:()=>m,jk:()=>f,m3:()=>d,t2:()=>w});var n=r(34304);function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function l(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function o(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function a(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function s(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function u(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function f(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function h(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function p(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function m(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function y(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],l=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+l*l)}function c(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],l=t[3]-e[3];return r*r+n*n+i*i+l*l}function g(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function d(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function M(e,t){let r=t[0],n=t[1],i=t[2],l=t[3],o=r*r+n*n+i*i+l*l;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=l*o),e}function x(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,r,n){let i=t[0],l=t[1],o=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=l+n*(r[1]-l),e[2]=o+n*(r[2]-o),e[3]=a+n*(r[3]-a),e}function R(e,t,r){let n=t[0],i=t[1],l=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*l+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*l+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*l+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*l+r[15]*o,e}function w(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function C(e,t){let r=e[0],i=e[1],l=e[2],o=e[3],a=t[0],s=t[1],u=t[2],f=t[3],h=(0,n.FD)();return Math.abs(r-a)<=h*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=h*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(l-u)<=h*Math.max(1,Math.abs(l),Math.abs(u))&&Math.abs(o-f)<=h*Math.max(1,Math.abs(o),Math.abs(f))}const b=a,q=s,Z=u,z=y,G=c,S=g,T=d;Object.freeze(Object.defineProperty({__proto__:null,add:o,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:i,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:z,distance:y,div:Z,divide:u,dot:x,equals:C,exactEquals:w,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:S,length:g,lerp:v,max:h,min:f,mul:q,multiply:s,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:M,random:function(e,t=1){let r,i,l,o,a,s,u=n.Ov;do{r=2*u()-1,i=2*u()-1,a=r*r+i*i}while(a>=1);do{l=2*u()-1,o=2*u()-1,s=l*l+o*o}while(s>=1);let f=Math.sqrt((1-a)/s);return e[0]=t*r,e[1]=t*i,e[2]=t*l*f,e[3]=t*o*f,e},round:p,scale:m,scaleAndAdd:function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e},set:l,sqrDist:G,sqrLen:T,squaredDistance:c,squaredLength:d,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:b,subtract:a,transformMat4:R,transformQuat:function(e,t,r){let n=t[0],i=t[1],l=t[2],o=r[0],a=r[1],s=r[2],u=r[3],f=u*n+a*l-s*i,h=u*i+s*n-o*l,p=u*l+o*i-a*n,m=-o*n-a*i-s*l;return e[0]=f*u+m*-o+h*-s-p*-a,e[1]=h*u+m*-a+p*-o-f*-s,e[2]=p*u+m*-s+f*-a-h*-o,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},76553(e,t,r){function n(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>n})},96520(e,t,r){r.d(t,{u:()=>s});var n=r(86211),i=r(21325),l=r(52006);function o(e,t,r){if(null==e.hasM||e.hasZ)for(let e of t)for(let t of e)t.length>2&&(t[2]*=r)}function a(e,t,r){if(null==e.hasM||e.hasZ)for(let e of t)for(let t of e){let e=(0,l.yP)(t);e.length>2&&(e[2]*=r)}}function s(e,t,r){if(!e&&!t||!r)return;let i=(0,n.G9)(r);u(e,r,i),u(t,r,i)}function u(e,t,r){if(e)for(let n of e)f(n.geometry,t,r)}function f(e,t,r){if(!e?.spatialReference||(0,i.aI)(e.spatialReference,t))return;let l=(0,n.G9)(e.spatialReference)/r;if(1!==l)if("x"in e)null!=e.z&&(e.z*=l);else if("curveRings"in e)a(e,e.curveRings,l);else if("curvePaths"in e)a(e,e.curvePaths,l);else if("rings"in e)o(e,e.rings,l);else if("paths"in e)o(e,e.paths,l);else if("points"in e&&(null==e.hasM||e.hasZ))for(let t of e.points)t.length>2&&(t[2]*=l)}},22671(e,t,r){r.d(t,{A:()=>M});var n,i=r(32198),l=r(52106),o=r(66552),a=r(25482),s=r(4718),u=r(91429),f=r(16930),h=r(60408),p=r(65864),m=r(50498),y=r(20437),c=r(36005),g=r(43937);const d=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let M=n=class extends a.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,l.A)}writeGeometryType(e,t,r,n){if(e)return void d.write(e,t,r,n);let{features:i}=this;if(i)for(let e of i)if(null!=e?.geometry)return void d.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;let r=!!e.spatialReference,n=(0,p.rS)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=f.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());let{features:r}=this;if(r)for(let e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,s.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){let t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){let n=t.features[r];n.geometry&&=(e?.[r])?.toJSON()||n.geometry}return t}quantize(e){let{scale:[t,r],translate:[n,i]}=e,l=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-n)/t),e=>Math.round((i-e)/r));for(let e=0,t=l.length;e<t;e++)o?.(l[e].geometry)||(l.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){let{geometryType:e,features:t,transform:r}=this;if(!r)return this;let{translate:[n,i],scale:[l,o]}=r,a=null,s=null;if(this.hasZ&&null!=r?.scale?.[2]){let{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){let{translate:[,,,e],scale:[,,,t]}=r;s=r=>null==r?r:r*t+e}let u=this._getHydrationFunction(e,e=>e*l+n,e=>i-e*o,a,s);for(let{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){let n=f.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){let l=e[t],o=r.fromJSON(l),a=l.geometry?.spatialReference;null!=o.geometry&&!a&&(o.geometry.spatialReference=n);let s=l.aggregateGeometries,u=o.aggregateGeometries;if(s&&null!=u)for(let e in u){let t=u[e],r=s[e]?.spatialReference;null!=t&&!r&&(t.spatialReference=n)}i.push(o)}return i}_quantizePoints(e,t,r){let n,i,l=[];for(let o=0,a=e.length;o<a;o++){let a=e[o];if(o>0){let e=t(a[0]),o=r(a[1]);(e!==n||o!==i)&&(l.push([e-n,o-i]),n=e,i=o)}else n=t(a[0]),i=r(a[1]),l.push([n,i])}return l.length>0?l:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{let n=(0,h.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,l=n.length;e<l;e++){let l=n[e],o=this._quantizePoints(l,t,r);o&&i.push(o)}return i.length>0?((0,h.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{let n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,n,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{let l,o,a=(0,h.Bi)(e)?e.rings:e.paths;for(let e=0,n=a.length;e<n;e++){let n=a[e];for(let e=0,i=n.length;e<i;e++){let i=n[e];e>0?(l+=i[0],o+=i[1]):(l=i[0],o=i[1]),i[0]=t(l),i[1]=r(o)}}if(n&&i)for(let e=0,t=a.length;e<t;e++){let t=a[e];for(let e=0,r=t.length;e<r;e++){let r=t[e];r[2]=n(r[2]),r[3]=i(r[3])}}else if(n)for(let e=0,t=a.length;e<t;e++){let t=a[e];for(let e=0,r=t.length;e<r;e++){let r=t[e];r[2]=n(r[2])}}else if(i)for(let e=0,t=a.length;e<t;e++){let t=a[e];for(let e=0,r=t.length;e<r;e++){let r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{let l,o,a=e.points;for(let e=0,n=a.length;e<n;e++){let n=a[e];e>0?(l+=n[0],o+=n[1]):(l=n[0],o=n[1]),n[0]=t(l),n[1]=r(o)}if(n&&i)for(let e=0,t=a.length;e<t;e++){let t=a[e];t[2]=n(t[2]),t[3]=i(t[3])}else if(n)for(let e=0,t=a.length;e<t;e++){let t=a[e];t[2]=n(t[2])}else if(i)for(let e=0,t=a.length;e<t;e++){let t=a[e];t[2]=i(t[2])}}:null}};(0,i.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],M.prototype,"displayFieldName",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],M.prototype,"exceededTransferLimit",void 0),(0,i.Cg)([(0,u.MZ)({type:[l.A],json:{write:!0}})],M.prototype,"features",void 0),(0,i.Cg)([(0,c.w)("features")],M.prototype,"readFeatures",null),(0,i.Cg)([(0,u.MZ)({type:[y.A],json:{write:!0}})],M.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:d.read}}})],M.prototype,"geometryType",void 0),(0,i.Cg)([(0,g.K)("geometryType")],M.prototype,"writeGeometryType",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],M.prototype,"hasM",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],M.prototype,"hasZ",void 0),(0,i.Cg)([(0,u.MZ)({types:m.yR,json:{write:!0}})],M.prototype,"queryGeometry",void 0),(0,i.Cg)([(0,c.w)("queryGeometry")],M.prototype,"readQueryGeometry",null),(0,i.Cg)([(0,u.MZ)({type:f.A,json:{write:!0}})],M.prototype,"spatialReference",void 0),(0,i.Cg)([(0,g.K)("spatialReference")],M.prototype,"writeSpatialReference",null),(0,i.Cg)([(0,u.MZ)({json:{write:!0}})],M.prototype,"transform",void 0),M=n=(0,i.Cg)([(0,u.$K)("esri.rest.support.FeatureSet")],M),M.prototype.toJSON.isDefaultToJSON=!0}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4059,6440,7790],{60331(e,t,n){n.d(t,{a:()=>k});var a=n(74059),s=n(56198);const o=(0,a.aK)((e,t)=>{t.onConnected(()=>{m(e)}),t.onDisconnected(()=>{!function(e){if(!e)return;if(p.delete(e),document.removeEventListener(i,u.get(e)),document.removeEventListener(c,b.get(e)),u.delete(e),b.delete(e),!e.labelEl)return;const t=d.get(e.labelEl);1===t.length&&(e.labelEl.removeEventListener(l,h.get(e.labelEl)),h.delete(e.labelEl)),d.set(e.labelEl,t.filter(t=>t!==e).sort(g)),e.labelEl=void 0}(e)})}),l="calciteInternalLabelClick",i="calciteInternalLabelConnected",c="calciteInternalLabelDisconnected",r="calcite-label",d=new WeakMap,h=new WeakMap,u=new WeakMap,b=new WeakMap,p=new Set;function m(e){if(!e)return;const t=(e=>{const{id:t}=e,n=t&&(0,s.q)(e,{selector:`${r}[for="${t}"]`});if(n)return n;const a=(0,s.c)(e,r);return!a||function(e,t){let n;const a="custom-element-ancestor-check",s=a=>{a.stopImmediatePropagation();const s=a.composedPath();n=s.slice(s.indexOf(t),s.indexOf(e))};return e.addEventListener(a,s,{once:!0}),t.dispatchEvent(new CustomEvent(a,{composed:!0,bubbles:!0})),e.removeEventListener(a,s),n.filter(n=>n!==t&&n!==e).filter(e=>e.tagName?.includes("-")).length>0}(a,e)?null:a})(e.el);if(t&&h.has(t)&&t===e.labelEl||!t&&p.has(e))return;const n=y.bind(e);if(t){e.labelEl=t;const a=d.get(t)||[];a.push(e),d.set(t,a.sort(g)),h.has(e.labelEl)||(h.set(e.labelEl,v),e.labelEl.addEventListener(l,v)),p.delete(e),document.removeEventListener(i,u.get(e)),b.set(e,n),document.addEventListener(c,n)}else p.has(e)||(n(),document.removeEventListener(c,b.get(e)))}function g(e,t){return(0,s.i)(e.el,t.el)?-1:1}function v(e){const t=e.detail.sourceEvent.target,n=d.get(this),a=n.find(e=>e.el===t);if(a&&n.includes(a))return;const s=n[0];s.disabled||s.onLabelClick(e)}function f(){p.has(this)&&m(this)}function y(){p.add(this);const e=u.get(this)||f.bind(this);u.set(this,e),document.addEventListener(i,e)}async function k(e){if(await e.componentOnReady(),d.has(e))return;const t=e.for&&e.ownerDocument?.getElementById(e.for);t&&requestAnimationFrame(()=>{for(const e of p)if(e.el===t){m(e);break}})}n.d(t,["b",0,c,"l",0,i,"u",0,o])},57790(e,t,n){n.r(t),n.d(t,{Label:()=>r});var a=n(27994),s=n(58933),o=n(32012),l=n(64336),i=n(60331);const c=s.AH`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:.25rem;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);margin-block-end:var(--calcite-label-margin-bottom, .5rem)}:host([scale=m]) .container{gap:.5rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);margin-block-end:var(--calcite-label-margin-bottom, .75rem)}:host([scale=l]) .container{gap:.5rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1);color:var(--calcite-label-text-color, var(--calcite-color-text-1))}:host([layout=block]) .container,:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:.5rem}:host([layout=inline][scale=l]) .container{gap:.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity: 1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity: 0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`;class r extends o.WF{constructor(){super(),this.alignment="start",this.layout="block",this.scale="m",this.calciteInternalLabelClick=(0,l.b)({bubbles:!1,cancelable:!1}),this.listen("click",this.labelClickHandler)}static{this.properties={alignment:[3,{},{reflect:!0}],for:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.styles=c}connectedCallback(){super.connectedCallback(),document.dispatchEvent(new CustomEvent(i.l))}willUpdate(e){e.has("for")&&(0,i.a)(this.el)}disconnectedCallback(){super.disconnectedCallback(),document.dispatchEvent(new CustomEvent(i.b))}labelClickHandler(e){"Range"===window.getSelection()?.type||e.defaultPrevented||this.calciteInternalLabelClick.emit({sourceEvent:e})}render(){return s.qy`<div class=${(0,o.CP)("container")}><slot></slot></div>`}}(0,a.c)("calcite-label",r)},74059(e,t,n){n.d(t,{Dk:()=>f,aK:()=>y,yr:()=>$,jH:()=>C,oW:()=>w});var a=n(64336),s=n(59231);var o=n(58933),l=n(14246),i=n(44613);const c=e=>{const t=(0,l.a)(e,"lang",globalThis.navigator?.language||u);return{lang:t,t9nLocale:v(t)}},r=async(e,t,n=e.localName.split("-").slice(1).join("-"))=>{const{lang:a,t9nLocale:s}=c(e),o=`${t}/${n}/t9n`;return{lang:a,t9nLocale:s,t9nStrings:null===n?{}:await p(s,o,"messages.")}},d="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),h=new Set(d),u="en",b={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},p=async(e,t,n="")=>{const a=`${t}/${n}`,s=`${a}${e}.json`;return m[s]??=g(e,a),await m[s]},m={},g=async(e,t)=>{const n=`${t}${e}.json`;try{const e=await fetch(n);if(e.ok)return await e.json()}catch(e){return(0,i.Rm)("error","intl",`An unknown error occurred while fetching localization strings at ${n}`,{detail:{error:e}}),{}}return e===u?{}:await g(u,t)},v=e=>{const[t,n]=e.split("-"),a=t.toLowerCase();let s=a;return n&&(s=`${a}-${n.toUpperCase()}`),s=b[s]??s,h.has(s)?s:n?v(a):u},f=e=>x(void 0,e),y=e=>t=>x(t,e);class k extends a.C{constructor(e,t){super(e);const n=this.exports;try{(0,s.s)(this.component);const e=t(this.component,this),a=this.exports!==n;if((0,s.i)(e)){a||this.setProvisionalExports(e);const t=e.then(e=>{this.exports=e,super.catchUpLifecycle()}).catch(e=>{this.P.reject(e)});this.onLoad(async()=>await t)}else a&&void 0===e||(this.exports=e),queueMicrotask(()=>super.catchUpLifecycle())}catch(e){this.P.reject(e)}}catchUpLifecycle(){}}const x=(E=k,(...e)=>{const t=(0,s.b)(),n=new E(...e),o=n.exports;(0,s.a)(t.at(-1));const l=n.component.manager;l.W(n,o),n.watchExports(l.W.bind(l,n)),(0,s.f)(n);const i=[n.component,...t].reverse();return(0,a.a)(i,e=>void 0===e?void 0:((e,{host:t,key:n,isReactive:a},o)=>{const l=t,i=l[n]!==e.exports,c=l[n]!==o,r=o!==e.exports;if(i&&!c&&r&&(l[n]=e.exports),t===e.component){if(a){const t=e.component.manager;c&&t.W(e,l[n]),e.onUpdate(a=>{if(a.has(n)){const a=l[n];a!==e.exports&&t.W(e,a)}})}e.O=a?void 0:n}const d=e.component.constructor.elementProperties.get(n)?.readOnly;e.watchExports(()=>{l[n]!==e.exports&&(d?(0,s.c)(()=>{l[n]=e.exports}):l[n]=e.exports)})})(n,e,o),o)});var E;const w=(e,t)=>new L(e,t);class L extends a.C{#e;#t;#n;constructor(e,t){super(),o.S$||(this.#t=e,this.#n=t,this.#e=new MutationObserver(n=>{n.forEach(n=>{e.includes(n.attributeName)&&t.call(this.component,this.component.el.getAttribute(n.attributeName),n.oldValue,n.attributeName)})}))}hostConnected(){this.#t.forEach(e=>{this.component.el.hasAttribute(e)&&this.#n.call(this.component,this.component.el.getAttribute(e),null,e)}),this.#e.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this.#t})}hostDisconnected(){this.#e.disconnect()}}const C=()=>f((e,t)=>{t.exports="ltr",t.onLifecycle(()=>{const n=()=>{const n=(0,l.a)(e.el,"dir","ltr");t.exports="rtl"===n?"rtl":"ltr"};return n(),(0,l.o)(e.el,["dir"],n)})}),$=e=>(t={})=>f((n,a)=>{const s=c(n.el),o={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},d=n;a.onLifecycle(()=>((e,t,n,a)=>{let s;const o=()=>r(e,t(),a).then(e=>{s?.lang===e.lang&&s.t9nLocale===e.t9nLocale&&s.t9nStrings===e.t9nStrings||n(e),s=e}).catch(e=>{(0,i.Rm)("error","intl","Error updating component locale state",{detail:{error:e}})});return queueMicrotask(o),(0,l.o)(e,["lang"],o)})(n.el,()=>e("./assets"),({t9nLocale:e,t9nStrings:t,lang:s})=>{const o={...t,_lang:s,_t9nLocale:e,_loading:!1};a.exports=o;const l=t.componentLabel;"string"==typeof l&&"label"in n&&null==n.label&&(n.label??=l),h(d.messageOverrides)},t.name));const h=e=>{const t=a.exports,n=t._original??t,s=z(n,e);e&&(s._original=n),a.exports=s};return"messageOverrides"in d&&a.onUpdate(e=>{e.has("messageOverrides")&&h(d.messageOverrides)}),t.blocking?(a.setProvisionalExports(o,!1),a.ready):o}),z=(e,t)=>{if(!t)return e;const n={...e};return Object.entries(t).forEach(([t,a])=>{void 0!==e[t]&&(n[t]="object"==typeof a?z(e[t],a):a??e[t])}),n}}}]);