@arcgis/core 5.2.0-next.131 → 5.2.0-next.134

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 (173) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/107f4bcf8e6c91a67010.js +1 -0
  3. package/assets/esri/core/workers/chunks/{081c9ccaa5884c730a91.js → 1688c4dcd36db992a9dc.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3a6b8f9aabde7e138834.js +1 -0
  5. package/assets/esri/core/workers/chunks/{18d5bad86ea3ef3ec747.js → eba9e03c1c9aa55044a3.js} +120 -120
  6. package/assets/esri/core/workers/chunks/f6c8e5abe1d55ab5c7dd.js +1 -0
  7. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  8. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  9. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  10. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  11. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  12. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  13. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  14. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  15. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  16. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  17. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  18. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  19. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  20. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  21. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  22. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  23. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  24. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  25. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  26. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  27. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  28. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  29. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  30. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  31. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  32. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  33. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  34. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  35. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  36. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  37. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  38. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  39. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  40. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  41. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  42. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  43. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  44. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  45. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  46. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  47. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  48. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  49. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  50. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  51. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  52. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  53. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  54. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  55. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  56. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  57. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  58. package/chunks/GaussianSplat.glsl.js +24 -9
  59. package/chunks/LineMarker.glsl.js +23 -23
  60. package/chunks/RibbonLine.glsl.js +136 -99
  61. package/config.js +1 -1
  62. package/core/PooledArray.js +1 -1
  63. package/geometry/operators/affineTransformOperator.d.ts +4 -0
  64. package/geometry/operators/alphaShapeOperator.d.ts +10 -1
  65. package/geometry/operators/areaOperator.d.ts +3 -0
  66. package/geometry/operators/autoCompleteOperator.d.ts +3 -0
  67. package/geometry/operators/boundaryOperator.d.ts +4 -0
  68. package/geometry/operators/bufferOperator.d.ts +6 -0
  69. package/geometry/operators/centroidOperator.d.ts +3 -0
  70. package/geometry/operators/clipOperator.d.ts +4 -0
  71. package/geometry/operators/containsOperator.d.ts +4 -0
  72. package/geometry/operators/convexHullOperator.d.ts +6 -0
  73. package/geometry/operators/crossesOperator.d.ts +4 -0
  74. package/geometry/operators/cutOperator.d.ts +3 -0
  75. package/geometry/operators/densifyOperator.d.ts +5 -0
  76. package/geometry/operators/differenceOperator.d.ts +4 -0
  77. package/geometry/operators/disjointOperator.d.ts +4 -0
  78. package/geometry/operators/distanceOperator.d.ts +4 -0
  79. package/geometry/operators/equalsOperator.d.ts +4 -0
  80. package/geometry/operators/extendOperator.d.ts +4 -0
  81. package/geometry/operators/generalizeOperator.d.ts +5 -0
  82. package/geometry/operators/geodesicBufferOperator.d.ts +8 -0
  83. package/geometry/operators/geodesicProximityOperator.d.ts +9 -0
  84. package/geometry/operators/geodeticAreaOperator.d.ts +6 -0
  85. package/geometry/operators/geodeticDensifyOperator.d.ts +7 -0
  86. package/geometry/operators/geodeticDistanceOperator.d.ts +6 -0
  87. package/geometry/operators/geodeticLengthOperator.d.ts +6 -0
  88. package/geometry/operators/geodeticUtilsOperator.d.ts +7 -0
  89. package/geometry/operators/graphicBufferOperator.d.ts +4 -0
  90. package/geometry/operators/integrateOperator.d.ts +3 -0
  91. package/geometry/operators/intersectionOperator.d.ts +5 -0
  92. package/geometry/operators/intersectsOperator.d.ts +4 -0
  93. package/geometry/operators/isNearOperator.d.ts +4 -0
  94. package/geometry/operators/labelPointOperator.d.ts +4 -0
  95. package/geometry/operators/lengthOperator.d.ts +3 -0
  96. package/geometry/operators/linesToPolygonsOperator.d.ts +3 -0
  97. package/geometry/operators/locateBetweenOperator.d.ts +3 -0
  98. package/geometry/operators/minimumBoundingCircleOperator.d.ts +5 -0
  99. package/geometry/operators/multiPartToSinglePartOperator.d.ts +4 -0
  100. package/geometry/operators/offsetOperator.d.ts +5 -0
  101. package/geometry/operators/overlapsOperator.d.ts +4 -0
  102. package/geometry/operators/polygonOverlayOperator.d.ts +9 -1
  103. package/geometry/operators/polygonSlicerOperator.d.ts +7 -0
  104. package/geometry/operators/projectOperator.d.ts +6 -0
  105. package/geometry/operators/proximityOperator.d.ts +7 -0
  106. package/geometry/operators/relateOperator.d.ts +5 -0
  107. package/geometry/operators/reshapeOperator.d.ts +3 -0
  108. package/geometry/operators/shapePreservingProjectOperator.d.ts +7 -0
  109. package/geometry/operators/simplifyOGCOperator.d.ts +5 -0
  110. package/geometry/operators/simplifyOperator.d.ts +5 -0
  111. package/geometry/operators/support/GeographicTransformation.d.ts +2 -0
  112. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -0
  113. package/geometry/operators/support/Transformation.d.ts +6 -1
  114. package/geometry/operators/support/geographicTransformationUtils.d.ts +4 -0
  115. package/geometry/operators/symmetricDifferenceOperator.d.ts +4 -0
  116. package/geometry/operators/touchesOperator.d.ts +4 -0
  117. package/geometry/operators/types.d.ts +1 -0
  118. package/geometry/operators/unionOperator.d.ts +4 -0
  119. package/geometry/operators/withinOperator.d.ts +4 -0
  120. package/kernel.js +1 -1
  121. package/layers/GaussianSplatLayer.d.ts +0 -1
  122. package/layers/GeospatialPDFLayer.js +1 -1
  123. package/package.json +2 -2
  124. package/support/revision.js +1 -1
  125. package/symbols/LineSymbol3D.d.ts +0 -7
  126. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  127. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  128. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  129. package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
  130. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  132. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  133. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  134. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  135. package/views/3d/state/Constraints.js +1 -1
  136. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  137. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  138. package/views/3d/state/utils/navigationUtils.js +1 -1
  139. package/views/3d/terrain/SphericalPatch.js +1 -1
  140. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  141. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +23 -12
  142. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +35 -25
  143. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +2 -2
  144. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  145. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  146. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  147. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  148. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  149. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  150. package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +1 -1
  151. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  152. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  153. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  154. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  155. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  156. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  157. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  158. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  159. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +4 -4
  160. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  161. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  162. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
  163. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  164. package/views/support/PromiseQueue.js +1 -1
  165. package/views/support/Scheduler.js +1 -1
  166. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +1 -1
  167. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  168. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  169. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  170. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +148 -1
  171. package/assets/esri/core/workers/chunks/540f60e31b19d85e9371.js +0 -1
  172. package/assets/esri/core/workers/chunks/55a560fd872f7463b33d.js +0 -1
  173. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4907],{26887(e,t,i){function n(){return[1,0,0,1,0,0]}function r(e,t,i,n,r,o){return[e,t,i,n,r,o]}i.d(t,{fA:()=>r,vt:()=>n});Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:[1,0,0,1,0,0],clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},create:n,fromValues:r},Symbol.toStringTag,{value:"Module"}))},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>l,execute:()=>c,executeMany:()=>u,foldInto360Range:()=>h,foldInto360RangeGeodetic:()=>p,isLoaded:()=>s,load:()=>a,normalizeGeometry:()=>d,supportsCurves:()=>f,transform:()=>g});var n=i(76061),r=i(83290);let o;function s(){return!!o&&(0,r.i)()}async function a(){if(!s()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,r.l)()]);o=new e.OperatorProject,t(r.p)}}function l(e,t,i){return o.clipToSpatialReference(e,t,null,i)}function c(e,t){return o.execute(e,t,null)}function u(e,t){const i=o.executeMany(new n.S(e),t,null);return Array.from(i)}function h(e,t){return o.foldInto360Range(e,t)}function p(e,t,i){return o.foldInto360RangeGeodetic(e,t,i)}function d(e,t,i){return o.normalizeGeometry(e,t,i)}function f(){return o.supportsCurves()}function g(e,t,i,n,r){return o.transform(e,t,i,n,r)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>y,executeMany:()=>x,isLoaded:()=>f,load:()=>m,projectExecute:()=>_,projectExecuteMany:()=>w,projectIsLoaded:()=>d,projectLoad:()=>g,projectSupportsCurves:()=>h,supportsCurves:()=>p});var n=i(4144),r=i(85036),o=i(17499);let s,a,l,c,u,h,p;function d(){return!!s&&(0,n.isLoaded)()}function f(){return(0,r.Q)("projectOperator","isLoaded","projectIsLoaded"),d()}async function g(){if(!d()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,n.load)()]);s=e.fromGeometry,a=e.fromSpatialReference,l=e.getSpatialReference,c=e.toGeometry,u=t.createProjectionTransformation,h=(0,n.supportsCurves)(),p=h}}function m(){return(0,r.Q)("projectOperator","load","projectLoad"),g()}function _(e,t,i){const r=l(e),h=u(a(r),a(t),i),p=c((0,n.execute)(s(e),h),t);return!i?.zConversionDisabled&&p?.hasZ&&(0,o.g)([p],r,t),p}function y(e,t,i){return(0,r.Q)("projectOperator","execute","projectExecute"),_(e,t,i)}function w(e,t,i){const r=e.map(s),h=l(e),p=u(a(h),a(t),i),d=(0,n.executeMany)(r,p).map(e=>c(e,t));return!i?.zConversionDisabled&&d&&(0,o.g)(d,h,t),d}function x(e,t,i){return(0,r.Q)("projectOperator","executeMany","projectExecuteMany"),w(e,t,i)}},17499(e,t,i){i.d(t,{g:()=>o});var n=i(60408),r=i(62815);function o(e,t,i){let o;for(const s of e)if(s&&(0,n.Pv)(s)&&!("vertexAttributes"in s)){if(!o){const e="type"in s?s.type:(0,n.$B)(s);if(o=(0,r.N)(e,t,i),!o)return}o(s)}}},62815(e,t,i){i.d(t,{N:()=>a,d:()=>l});var n=i(86211),r=i(73941),o=i(21325),s=i(52006);function a(e,t,i){const n=l(t,i);if(1!==n)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,n);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(const i of e.curvePaths)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(const i of e.curveRings)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,n);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,n);default:return}}function l(e,t){return null==e||null==t||(0,o.aI)(e,t)||(0,r.xP)(e)||(0,r.xP)(t)?1:(0,n.G9)(e)/(0,n.G9)(t)}},44907(e,t,i){i.r(t),i.d(t,{default:()=>ye});var n=i(32198),r=i(49186),o=i(53966),s=i(25728),a=i(17676),l=i(91429),c=i(16930),u=i(21325),h=i(4146),p=i(63074),d=i(8303),f=i(72545),g=i(25036),m=i(86738),_=i(92474),y=i(83027),w=i(48163),x=i(37585),P=i(5443),A=i(39829),M=i(88411),v=i(83276);class R{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){const e=[];for(const[t,i]of this.outerMediaBox){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){const e=[];for(const[t,i]of this.pairedNeatline){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(e,t,i){(0,a.Te)(i);const n=e;if(n.spatialReference.equals(t))return n;if(!n||!n.extent)throw new r.A("geospatial-pdf-layer:load","Could not project neatline");const o=Math.max(n.extent.width,n.extent.height)/256,s=(0,M.densifyExecute)(n,o);return(0,v.projectExecute)(s,t)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(let o=0;o<e.length;o++){const s=T(this.ctm,e[o][0],e[o][1]);t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),r=Math.max(r,s[1])}return new P.A({xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:this.spatialReference})}}function T(e,t,i){const[n,r,o,s,a,l]=e,c=(0,w.vt)();return(0,x.hZ)(c,n*t+o*i+a,r*t+s*i+l),c}i(44208);var C=i(26887),F=i(48237);function E(e,t,i,n){const r=Math.min(e.length,t.length,3),o=e.slice(0,r).map((e,n)=>({sourcePoint:{x:e[0],y:e[1]},mapPoint:new m.A({x:t[n][0],y:t[n][1],spatialReference:i})}));return new F.A({controlPoints:o,width:n.xmax-n.xmin,height:n.ymax-n.ymin})}function S(e){if(!e?.transform||e.transform.length<6)throw new r.A("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function b(e){return(0,C.fA)(e[0],-e[1],-e[3],e[4],e[2],e[5])}function D(e){return[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]}class j{constructor(e){const t=this.inputValidation(e);this._registration=t.registration,this._projection=t.projection,this._neatline=t.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=D(t.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=t.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){const{ctm:t,registration:i,projection:n,display:o,neatline:s,mediaBox:a}=e;if(t&&6!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!t&&(!i||i.length<3))throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!s||s.length<4||s.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:t?(0,C.fA)(t[0],t[1],t[2],t[3],t[4],t[5]):void 0,registration:i??[],projection:n,display:o,neatline:s,mediaBox:a}}outputValidation(){if(6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){const e=[],t=[];for(const i of this._registration)i.length<4||(e.push((0,w.fA)(i[0],i[1])),t.push((0,w.fA)(i[2],i[3])));const i=this._getSourceRect();return b(S(E(e,t,this.toSpatialReference(),i)))}_extentFromArray(e){let t=1/0,i=1/0,n=-1/0,o=-1/0;for(let r=0;r<e.length;r++){const s=e[r];t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),o=Math.max(o,s[1])}if(!(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(o)))throw new r.A("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:t,ymin:i,xmax:n,ymax:o}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);const e=this._getRegistrationPoints("page");if(e.length>=2)return this._extentFromArray(e);throw new r.A("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(e){const[t,i]="page"===e?[0,1]:[2,3];return this._registration.filter(e=>e.length>i).map(e=>[e[t],e[i]])}_pairNeatline(){const e=[];for(let t=0;t<this._neatline.length;t+=2){const i=this._neatline[t],n=this._neatline[t+1];Number.isFinite(i)&&Number.isFinite(n)&&e.push([i,n])}return 2===e.length&&(e.splice(1,0,[e[1][0],e[0][1]]),e.push([e[0][0],e[2][1]])),e}}const G={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},N=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,L=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,O=/^(?:WGS84|WGS 84|WGE)$/i;function I(e){const t=function(e){return function(e){const t=function(e){switch(e){case"Projection":case"Display":return e;default:return}}(e.Type),i=function(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}(e.Projection_Type);let n;if(i||(n="Projection is missing or has unsupported ProjectionType"),t||(n="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),e.Datum||(n="Projection is missing a Datum"),n)throw new r.A("geospatial-pdf-layer:invalid-projection",n);return $(e,i),{kind:"projected",dictionaryType:t,projectionType:i,datum:e.Datum}}(e)}(e);if("projected"===t.kind){const{projectionType:i,datum:n}=t;return"SPCS"===i?function(e,t){const i=B(t);if(2800===e.Zone&&i&&Z(i))return new c.A({wkid:32110});throw new r.A("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${t.name}, zone ${e.Zone}`)}(e,n):new c.A({wkt:z(e,i,n)})}}function $(e,t){const i=function(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}(t);for(const n of i){const i=e[G[n]];if(void 0===i||""===i)throw new r.A("geospatial-pdf-layer:invalid-projection",`Projection ${t} missing required parameter ${n}.`)}}function z(e,t,i){const n=function(e,t,i){const n=function(e){const t=B(e);return t?Z(t)?"NAD_1983":H(t)?"NAD_1927":k(t)?"WGS_1984":"geospatialPDF":"geospatialPDF"}(i);switch(t){case"TC":return`${n}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${n}_GeospatialPDF_Polyconic`;case"UT":return`${n}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${n}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${n}_GeospatialPDF_Lambert_Conformal_Conic`}}(e,t,i),o=function(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}(t),s=function(e){if("definition"===e.kind){const t=e.ellipsoid;if(!t?.semi_Major_Axis)throw new r.A("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");const i=function(e){if(null!=e.inverse_Flattening)return e.inverse_Flattening;const t=e.semi_Major_Axis,i=e.semi_Minor_Axis;if(null==t||null==i)throw new r.A("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===i?0:t/(t-i)}(t),n=e.name??"GeospatialPDF_Datum",o=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${i}]`,s=e.to_WGS84;return`DATUM["${n}",${o}${s?`,TOWGS84[${s.dx??0},${s.dy??0},${s.dz??0},${s.rx??0},${s.ry??0},${s.rz??0},${s.sf??0}]`:""}]`}if(e.name){const t=e.name.toUpperCase();if(Z(t))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(H(t))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(k(t))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new r.A("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+e.name)}(i),a=function(e){const t=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(t)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(t)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}(e.Units??"M"),l=function(e,t){switch(t){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return function(e){if(!e.Zone)throw new r.A("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");const t=6*e.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(e.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}(e)}}(e,t);return`PROJCS["${n}",GEOGCS["${function(e){const t=B(e);return t?Z(t)?"GCS_North_American_1983":H(t)?"GCS_North_American_1927":k(t)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}(i)}",${s},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${o}"],${l.join(",\n ")},${a}]`}function B(e){return e.name?function(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}(e.name):null}function Z(e){return N.test(e)}function H(e){return L.test(e)}function k(e){return O.test(e)}class V{constructor(e){const{bbox:t,bounds:i,gpts:n,lpts:r,gcs:o,mediaBox:s}=this.inputValidation(e);this._bbox=t,this._bounds=i,this._gpts=n,this._lpts=r,this._gcs=o,this.outerExtentMediaBox=D(s),this.geoControlPoints=this._getProjectedGeoControlPoints().map(e=>[e[0],e[1]]);const a=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=a.map(e=>[e[0],e[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();const l=S(this._georeference);this.ctm=b(l),this.outputValidation()}toSpatialReference(){return new c.A({wkt:this._gcs.WKT})}inputValidation(e){const{bbox:t,bounds:i,gpts:n,lpts:o,gcs:s,mediaBox:a}=e;if(!t||4!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!n||n.length<6||n.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!o||o.length<6||o.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(o.length!==n.length)throw new r.A("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!s?.WKT)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:t,bounds:i,gpts:n,lpts:o,gcs:{WKT:s.WKT},mediaBox:a}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){const e=this._getPageControlPoints(),t=this._getProjectedGeoControlPoints(),i=this._getViewportRect();return E(e,t,this.toSpatialReference(),i)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;const e=[];for(let t=0;t<this._bounds.length;t+=2)e.push({u:this._bounds[t],v:this._bounds[t+1]});return e}_getBoundsPolygonPage(){const e=this._getBoundsPolygonLocal();return e?.map(e=>this._localToPage(e.u,e.v))??null}_getPageControlPoints(){const e=[];for(let t=0;t<this._lpts.length;t+=2){const i=this._lpts[t],n=this._lpts[t+1];e.push(this._localToPage(i,n))}return e}_getProjectedGeoControlPoints(){const e=this.toSpatialReference(),t=[];for(let i=0;i<this._gpts.length;i+=2){const n=this._gpts[i],r=this._gpts[i+1],o=new m.A({x:r,y:n}),s=(0,v.projectExecute)(o,e);t.push((0,w.fA)(s.x,s.y))}return t}_getViewportRect(){const[e,t,i,n]=this._bbox;return{xmin:Math.min(e,i),ymin:Math.min(t,n),xmax:Math.max(e,i),ymax:Math.max(t,n)}}_localToPage(e,t){const[i,n,r,o]=this._bbox;return(0,w.fA)(i+e*(r-i),n+t*(o-n))}}function U(e){const t=oe(e,"LGIDict map frame must be an object.");return{CTM:Y(t.CTM),Registration:ee(t.Registration),Neatline:Y(t.Neatline),Projection:K(t.Projection),Display:K(t.Display)}}function W(e){const t=oe(e,"Viewport frame must be an object."),i=function(e){if(re(e))return{Bounds:Y(e.Bounds),GPTS:Y(e.GPTS),LPTS:Y(e.LPTS),GCS:J(e.GCS)}}(t.Measure);return{BBox:Y(t.BBox),Measure_Raw:t.Measure,Measure:i,Raw:t}}function J(e){if(re(e))return{WKT:te(e.WKT)}}function K(e){if(re(e))return{Type:ie(e.Type),Units:ie(e.Units),Datum:q(e.Datum),Projection_Type:ie(e.ProjectionType),Central_Meridian:ne(e.CentralMeridian),False_Easting:ne(e.FalseEasting),False_Northing:ne(e.FalseNorthing),Height:ne(e.Height),Hemisphere:ie(e.Hemisphere),Latitude_One:ne(e.LatitudeOne),Latitude_Two:ne(e.LatitudeTwo),Latitude_Of_True_Scale:ne(e.LatitudeOfTrueScale),Longitude_One:ne(e.LongitudeOne),Longitude_Two:ne(e.LongitudeTwo),Longitude_Down_From_Pole:ne(e.LongitudeDownFromPole),Orientation:ie(e.Orientation),Origin_Height:ne(e.OriginHeight),Origin_Latitude:ne(e.OriginLatitude),Origin_Longitude:ne(e.OriginLongitude),Scale_Factor:ne(e.ScaleFactor),Standard_Parallel:ne(e.StandardParallel),Standard_Parallel_One:ne(e.StandardParallelOne),Standard_Parallel_Two:ne(e.StandardParallelTwo),Zone:ne(e.Zone),Description:ie(e.Description),raw:e}}function q(e){return null==e?null:"string"==typeof e?{kind:"name",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}:re(e)?{kind:"definition",name:ie(e.Description),ellipsoid:Q(e.Ellipsoid),to_WGS84:X(e.ToWGS84),raw:e}:{kind:"unknown",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}}function Q(e){if(re(e))return{semi_Major_Axis:ne(e.SemiMajorAxis),inverse_Flattening:ne(e.InvFlattening),semi_Minor_Axis:ne(e.SemiMinorAxis),description:ie(e.Description)}}function X(e){if(re(e))return{dx:ne(e.dx)??0,dy:ne(e.dy)??0,dz:ne(e.dz)??0,rx:ne(e.rx)??0,ry:ne(e.ry)??0,rz:ne(e.rz)??0,sf:ne(e.sf)??0}}function Y(e){if(!Array.isArray(e))return;const t=[];for(const i of e){const e=ne(i);if(void 0===e)return;t.push(e)}return t}function ee(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>ne(e)).filter(e=>void 0!==e))}function te(e){if(null!=e)return"string"==typeof e?e:String(e)}function ie(e){const t=te(e);if(void 0!==t)return t.trim()}function ne(e){if(null==e)return;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;const t=e.trim();if(""===t)return;const i=Number(t);return Number.isFinite(i)?i:void 0}function re(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function oe(e,t){if(!re(e))throw new r.A("geospatial-pdf-layer:parse",t);return e}let se=class extends _.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){const t=(0,y.h)("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);const{geospatialMetadata:i}=await this._workerHandler.loadPDF(e,t),n=function(e,t=0){const i={mediaBox:Y(e.MediaBox),rotate:ne(e.Rotate),hasLGIDict:null!=e.LGIDict,hasVP:null!=e.VP},n=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>U(e)):[U(e)]}(e)[t]}(e.LGIDict,t);if(n){if(!n.Projection)throw new r.A("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");const t=I(n.Projection);let o;try{o=n.Display?I(n.Display):void 0}catch{o=t}return{result:i,lgiDictFrame:new j({ctm:n.CTM,registration:n.Registration,projection:t,display:o,neatline:n.Neatline,mediaBox:Y(e.MediaBox)})}}const o=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>W(e)):[W(e)]}(e)[t]}(e.VP,t);return o?{result:i,vpFrame:new V({bbox:o.BBox,bounds:o.Measure?.Bounds,gpts:o.Measure?.GPTS,lpts:o.Measure?.LPTS,gcs:o.Measure?.GCS,mediaBox:Y(e.MediaBox)})}:{result:i}}(i,0),o=n.lgiDictFrame??n.vpFrame;if(!o)throw new r.A("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");const s=new R(o),a=s.spatialReference.toJSON();return{frame:s,sourceSpatialReference:a,fullExtent:s.toExtent()}}async render(e,t,i,n,r,o){const s={sourceExtentAsJSON:e.toJSON(),width:t,height:i,ctm:n,currentRing:r};return this._workerHandler.renderPDF(s,o)}};se=(0,n.Cg)([(0,l.$K)("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],se);var ae=i(49859),le=i(14140),ce=i(87186);let ue=class extends ae.A{constructor(){super(...arguments),this._workerClient=new se,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,i,n={}){const r=this._extent,o=this._ctm,s=this.getTileExtentPDF(e,t,i);return s.intersects(r)?function(e){return new le.A({width:e.width,height:e.height,pixelType:"u8",pixels:[e.red,e.green,e.blue],mask:e.mask})}(await this._workerClient.render(s,this._tileSize,this._tileSize,o,this._neatlineRing,n)):null}async _open(e){if(!this.url)throw new r.A("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");const t=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=t.frame;const i=this.frame.outerExtentMediabox;if(!i)throw new r.A("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=t.fullExtent,this._extent=i,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];const n=function(e,t){const[i,n,o,s]=e,a=i*s-n*o;if(!Number.isFinite(a)||0===a)throw new r.A("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");const l=10*Math.hypot(s,n)/Math.abs(a),c=10*Math.hypot(o,i)/Math.abs(a),u=Math.max(1,Math.ceil(t.width*l)),h=Math.max(1,Math.ceil(t.height*c));if(!Number.isFinite(u)||!Number.isFinite(h))throw new r.A("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[u,h]}(this.frame.ctm,this._extent);this._width=n[0],this._height=n[1];const o={x:i.width/this._width,y:i.height/this._height},s=new ce.A({width:this._width,height:this._height,pixelType:"u8",extent:i,pixelSize:o,spatialReference:i.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(s,this._tileSize,this._tileSize),this._set("rasterInfo",s),this.updateTileInfo()}getTileExtentPDF(e,t,i){const n=this._extent,r=2**e,o=n.width/this._width*r,s=n.height/this._height*r,a=new m.A({x:n.xmin,y:n.ymax});return this.getTileExtent({x:o,y:s},t,i,a,n.spatialReference,[512,512])}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,l.MZ)({constructOnly:!0})],ue.prototype,"page",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ue.prototype,"tileType",void 0),ue=(0,n.Cg)([(0,l.$K)("esri.layers.raster.datasets.GeospatialPDFRaster")],ue);var he=i(34930),pe=i(60694),de=i(13868),fe=i(87045),ge=i(93223);let me=class extends((0,p.dM)((0,g.j)((0,d.A)((0,f.G)((0,s.M)(h.A)))))){constructor(e){super(e),this.interpolation="bilinear",this.serviceRasterInfo=null,this._frame=null,this.clippedToNeatline=!0,this.neatlineVisible=!0,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["PDF"],supportsData:!1},e).catch(a.QP).then(()=>this._openRaster(e?.signal))),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy()}get fullExtent(){return this.serviceRasterInfo?.extent}set url(e){this._set("url",(0,pe.Jf)(e,o.A.getLogger(this)))}async fetchImageBitmapTile(){throw new r.A("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,i,n={}){return _e(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(i),n)}async fetchTile(e,t,i,n={}){if(_e(this),n.requestAsImageElement)throw new r.A("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();const o=await this.raster.fetchTile(e,t,i,n);return this.clippedToNeatline&&o.pixelBlock&&this._frame&&o.srcExtent&&(o.pixelBlock=await(0,he.$Q)(o.pixelBlock,o.srcExtent,this._frame.sourceNeatlinePolygon)),o}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,u.Vp)(e);return fe.A.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return _e(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(_e(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}async _openRaster(e){const t=new ue({url:this.url});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new r.A("geospatialpdf-layer:load","cannot load resources on "+this.url);const{rasterInfo:i}=t;this._set("serviceRasterInfo",i),this.setAtOrigin("spatialReference",i.spatialReference,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service"),this._frame=t.frame,this.raster=t}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}};function _e(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}(0,n.Cg)([(0,ge.e)(de.SZ)],me.prototype,"interpolation",void 0),(0,n.Cg)([(0,l.MZ)()],me.prototype,"serviceRasterInfo",void 0),(0,n.Cg)([(0,l.MZ)({clonable:!1})],me.prototype,"_compatibleFullExtent",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],me.prototype,"clippedToNeatline",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1}})],me.prototype,"fullExtent",null),(0,n.Cg)([(0,l.MZ)({type:Boolean})],me.prototype,"neatlineVisible",void 0),(0,n.Cg)([(0,l.MZ)()],me.prototype,"raster",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,type:c.A,json:{read:!1}})],me.prototype,"spatialReference",void 0),(0,n.Cg)([(0,l.MZ)({type:fe.A})],me.prototype,"tileInfo",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,value:"geospatial-pdf"})],me.prototype,"type",void 0),(0,n.Cg)([(0,l.MZ)()],me.prototype,"url",null),me=(0,n.Cg)([(0,l.$K)("esri.layers.GeospatialPDFLayer")],me);const ye=me},91806(e,t,i){i.d(t,{A:()=>l});var n,r=i(32198),o=i(25482),s=i(91429),a=i(78888);let l=class extends o.o{static{n=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new n({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,r.Cg)([(0,s.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=n=(0,r.Cg)([(0,s.$K)("esri.layers.support.LOD")],l)},87045(e,t,i){i.d(t,{A:()=>w});var n,r=i(32198),o=i(66552),s=i(25482),a=i(86211),l=i(91429),c=i(78888),u=i(86738),h=i(16930),p=i(21325),d=i(28735),f=i(91806),g=i(72802),m=i(36005),_=i(43937);const y=new o.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends s.o{static{n=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:o=h.A.WebMercator,numLODs:s=24}=e;if(!(0,p.fn)(o)){const e=[];if(i)for(let t=0;t<i.length;t++){const n=i[t];e.push(new f.A({level:t,scale:n,resolution:n}))}else{let t=5e-4;for(let i=s-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new n({dpi:96,lods:e,origin:new u.A(0,0,o),size:[r,r],spatialReference:o})}const l=(0,p.Vp)(o),c=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:o}):new u.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),d=1/(39.37*(0,a.GA)(o)*96),g=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],n=t*d;g.push(new f.A({level:e,scale:t,resolution:n}))}else{let e=(0,p.EA)(o)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(s/t);g.push(new f.A({level:0,scale:e,resolution:e*d}));for(let n=1;n<i;n++){const i=e/2**t,r=i*d;g.push(new f.A({level:n,scale:i,resolution:r})),e=i}}return new n({dpi:96,lods:g,origin:c,size:[r,r],spatialReference:o})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,p.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const n=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{n.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",n),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),n=i+1;return t[i]/(t[i]/t[n])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let n=0;for(;n<i;n++){const i=t[n],r=t[n+1];if(i<=e)return n;if(r===e)return n+1;if(i>e&&r<e)return n+Math.log(i/e)/Math.log(i/r)}return n}tileAt(e,t,i,n){const r=this.lodAt(e);if(!r)return null;let o,s;if("number"==typeof t)o=t,s=i;else if((0,p.aI)(t.spatialReference,this.spatialReference))o=t.x,s=t.y,n=i;else{const e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;o=e.x,s=e.y,n=i}const a=r.resolution*this.size[0],l=r.resolution*this.size[1];return n??=new g.U(0,0,0),n.level=e,n.row=Math.floor((this.origin.y-s)/l+.001),n.col=Math.floor((o-this.origin.x)/a+.001),this.updateTileInfo(n),n}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:n}=i,r=n*this.size[0],o=n*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*o,e[2]=e[0]+r,e[3]=e[1]+o,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return n.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const n=e+t,{scale:r,resolution:o}=n>=0?this.lods[n]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:r,resolution:o}))}return new n({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const n=e[i];this._upsampleLevels[n.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/n.resolution:0},t=n}}};(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,r.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,r.Cg)([(0,l.MZ)({type:u.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,r.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,r.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,r.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,r.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,r.Cg)([(0,_.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,r.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=n=(0,r.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>r});var n=i(19419);class r{constructor(e,t,i,r=(0,n.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4907],{26887(e,t,i){function n(){return[1,0,0,1,0,0]}function r(e,t,i,n,r,o){return[e,t,i,n,r,o]}i.d(t,{fA:()=>r,vt:()=>n});Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:[1,0,0,1,0,0],clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},create:n,fromValues:r},Symbol.toStringTag,{value:"Module"}))},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>l,execute:()=>c,executeMany:()=>u,foldInto360Range:()=>h,foldInto360RangeGeodetic:()=>p,isLoaded:()=>s,load:()=>a,normalizeGeometry:()=>d,supportsCurves:()=>f,transform:()=>g});var n=i(76061),r=i(83290);let o;function s(){return!!o&&(0,r.i)()}async function a(){if(!s()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,r.l)()]);o=new e.OperatorProject,t(r.p)}}function l(e,t,i){return o.clipToSpatialReference(e,t,null,i)}function c(e,t){return o.execute(e,t,null)}function u(e,t){const i=o.executeMany(new n.S(e),t,null);return Array.from(i)}function h(e,t){return o.foldInto360Range(e,t)}function p(e,t,i){return o.foldInto360RangeGeodetic(e,t,i)}function d(e,t,i){return o.normalizeGeometry(e,t,i)}function f(){return o.supportsCurves()}function g(e,t,i,n,r){return o.transform(e,t,i,n,r)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>y,executeMany:()=>x,isLoaded:()=>f,load:()=>m,projectExecute:()=>_,projectExecuteMany:()=>w,projectIsLoaded:()=>d,projectLoad:()=>g,projectSupportsCurves:()=>h,supportsCurves:()=>p});var n=i(4144),r=i(85036),o=i(17499);let s,a,l,c,u,h,p;function d(){return!!s&&(0,n.isLoaded)()}function f(){return(0,r.Q)("projectOperator","isLoaded","projectIsLoaded"),d()}async function g(){if(!d()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,n.load)()]);s=e.fromGeometry,a=e.fromSpatialReference,l=e.getSpatialReference,c=e.toGeometry,u=t.createProjectionTransformation,h=(0,n.supportsCurves)(),p=h}}function m(){return(0,r.Q)("projectOperator","load","projectLoad"),g()}function _(e,t,i){const r=l(e),h=u(a(r),a(t),i),p=c((0,n.execute)(s(e),h),t);return!i?.zConversionDisabled&&p?.hasZ&&(0,o.g)([p],r,t),p}function y(e,t,i){return(0,r.Q)("projectOperator","execute","projectExecute"),_(e,t,i)}function w(e,t,i){const r=e.map(s),h=l(e),p=u(a(h),a(t),i),d=(0,n.executeMany)(r,p).map(e=>c(e,t));return!i?.zConversionDisabled&&d&&(0,o.g)(d,h,t),d}function x(e,t,i){return(0,r.Q)("projectOperator","executeMany","projectExecuteMany"),w(e,t,i)}},17499(e,t,i){i.d(t,{g:()=>o});var n=i(60408),r=i(62815);function o(e,t,i){let o;for(const s of e)if(s&&(0,n.Pv)(s)&&!("vertexAttributes"in s)){if(!o){const e="type"in s?s.type:(0,n.$B)(s);if(o=(0,r.N)(e,t,i),!o)return}o(s)}}},62815(e,t,i){i.d(t,{N:()=>a,d:()=>l});var n=i(86211),r=i(73941),o=i(21325),s=i(52006);function a(e,t,i){const n=l(t,i);if(1!==n)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,n);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(const i of e.curvePaths)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(const i of e.curveRings)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,n);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,n);default:return}}function l(e,t){return null==e||null==t||(0,o.aI)(e,t)||(0,r.xP)(e)||(0,r.xP)(t)?1:(0,n.G9)(e)/(0,n.G9)(t)}},44907(e,t,i){i.r(t),i.d(t,{default:()=>me});var n=i(32198),r=i(49186),o=i(53966),s=i(25728),a=i(17676),l=i(91429),c=i(16930),u=i(21325),h=i(4146),p=i(63074),d=i(8303),f=i(72545),g=i(25036),m=i(86738),_=i(92474),y=i(83027),w=i(48163),x=i(37585),P=i(5443),A=i(39829),M=i(88411),v=i(83276);class R{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){const e=[];for(const[t,i]of this.outerMediaBox){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){const e=[];for(const[t,i]of this.pairedNeatline){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(e,t,i){(0,a.Te)(i);const n=e;if(n.spatialReference.equals(t))return n;if(!n||!n.extent)throw new r.A("geospatial-pdf-layer:load","Could not project neatline");const o=Math.max(n.extent.width,n.extent.height)/256,s=(0,M.densifyExecute)(n,o);return(0,v.projectExecute)(s,t)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(let o=0;o<e.length;o++){const s=T(this.ctm,e[o][0],e[o][1]);t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),r=Math.max(r,s[1])}return new P.A({xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:this.spatialReference})}}function T(e,t,i){const[n,r,o,s,a,l]=e,c=(0,w.vt)();return(0,x.hZ)(c,n*t+o*i+a,r*t+s*i+l),c}i(44208);var C=i(26887),F=i(48237);function E(e,t,i,n){const r=Math.min(e.length,t.length,3),o=e.slice(0,r).map((e,n)=>({sourcePoint:{x:e[0],y:e[1]},mapPoint:new m.A({x:t[n][0],y:t[n][1],spatialReference:i})}));return new F.A({controlPoints:o,width:n.xmax-n.xmin,height:n.ymax-n.ymin})}function S(e){if(!e?.transform||e.transform.length<6)throw new r.A("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function b(e){return(0,C.fA)(e[0],-e[1],-e[3],e[4],e[2],e[5])}function D(e){return[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]}class j{constructor(e){const t=this.inputValidation(e);this._registration=t.registration,this._projection=t.projection,this._neatline=t.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=D(t.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=t.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){const{ctm:t,registration:i,projection:n,display:o,neatline:s,mediaBox:a}=e;if(t&&6!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!t&&(!i||i.length<3))throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!s||s.length<4||s.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:t?(0,C.fA)(t[0],t[1],t[2],t[3],t[4],t[5]):void 0,registration:i??[],projection:n,display:o,neatline:s,mediaBox:a}}outputValidation(){if(6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){const e=[],t=[];for(const i of this._registration)i.length<4||(e.push((0,w.fA)(i[0],i[1])),t.push((0,w.fA)(i[2],i[3])));const i=this._getSourceRect();return b(S(E(e,t,this.toSpatialReference(),i)))}_extentFromArray(e){let t=1/0,i=1/0,n=-1/0,o=-1/0;for(let r=0;r<e.length;r++){const s=e[r];t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),o=Math.max(o,s[1])}if(!(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(o)))throw new r.A("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:t,ymin:i,xmax:n,ymax:o}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);const e=this._getRegistrationPoints("page");if(e.length>=2)return this._extentFromArray(e);throw new r.A("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(e){const[t,i]="page"===e?[0,1]:[2,3];return this._registration.filter(e=>e.length>i).map(e=>[e[t],e[i]])}_pairNeatline(){const e=[];for(let t=0;t<this._neatline.length;t+=2){const i=this._neatline[t],n=this._neatline[t+1];Number.isFinite(i)&&Number.isFinite(n)&&e.push([i,n])}return 2===e.length&&(e.splice(1,0,[e[1][0],e[0][1]]),e.push([e[0][0],e[2][1]])),e}}const G={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},N=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,L=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,O=/^(?:WGS84|WGS 84|WGE)$/i;function I(e){const t=function(e){return function(e){const t=function(e){switch(e){case"Projection":case"Display":return e;default:return}}(e.Type),i=function(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}(e.Projection_Type);let n;if(i||(n="Projection is missing or has unsupported ProjectionType"),t||(n="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),e.Datum||(n="Projection is missing a Datum"),n)throw new r.A("geospatial-pdf-layer:invalid-projection",n);return $(e,i),{kind:"projected",dictionaryType:t,projectionType:i,datum:e.Datum}}(e)}(e);if("projected"===t.kind){const{projectionType:i,datum:n}=t;return"SPCS"===i?function(e,t){const i=B(t);if(2800===e.Zone&&i&&Z(i))return new c.A({wkid:32110});throw new r.A("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${t.name}, zone ${e.Zone}`)}(e,n):new c.A({wkt:z(e,i,n)})}}function $(e,t){const i=function(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}(t);for(const n of i){const i=e[G[n]];if(void 0===i||""===i)throw new r.A("geospatial-pdf-layer:invalid-projection",`Projection ${t} missing required parameter ${n}.`)}}function z(e,t,i){const n=function(e,t,i){const n=function(e){const t=B(e);return t?Z(t)?"NAD_1983":H(t)?"NAD_1927":k(t)?"WGS_1984":"geospatialPDF":"geospatialPDF"}(i);switch(t){case"TC":return`${n}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${n}_GeospatialPDF_Polyconic`;case"UT":return`${n}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${n}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${n}_GeospatialPDF_Lambert_Conformal_Conic`}}(e,t,i),o=function(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}(t),s=function(e){if("definition"===e.kind){const t=e.ellipsoid;if(!t?.semi_Major_Axis)throw new r.A("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");const i=function(e){if(null!=e.inverse_Flattening)return e.inverse_Flattening;const t=e.semi_Major_Axis,i=e.semi_Minor_Axis;if(null==t||null==i)throw new r.A("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===i?0:t/(t-i)}(t),n=e.name??"GeospatialPDF_Datum",o=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${i}]`,s=e.to_WGS84;return`DATUM["${n}",${o}${s?`,TOWGS84[${s.dx??0},${s.dy??0},${s.dz??0},${s.rx??0},${s.ry??0},${s.rz??0},${s.sf??0}]`:""}]`}if(e.name){const t=e.name.toUpperCase();if(Z(t))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(H(t))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(k(t))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new r.A("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+e.name)}(i),a=function(e){const t=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(t)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(t)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}(e.Units??"M"),l=function(e,t){switch(t){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return function(e){if(!e.Zone)throw new r.A("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");const t=6*e.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(e.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}(e)}}(e,t);return`PROJCS["${n}",GEOGCS["${function(e){const t=B(e);return t?Z(t)?"GCS_North_American_1983":H(t)?"GCS_North_American_1927":k(t)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}(i)}",${s},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${o}"],${l.join(",\n ")},${a}]`}function B(e){return e.name?function(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}(e.name):null}function Z(e){return N.test(e)}function H(e){return L.test(e)}function k(e){return O.test(e)}class V{constructor(e){const{bbox:t,bounds:i,gpts:n,lpts:r,gcs:o,mediaBox:s}=this.inputValidation(e);this._bbox=t,this._bounds=i,this._gpts=n,this._lpts=r,this._gcs=o,this.outerExtentMediaBox=D(s),this.geoControlPoints=this._getProjectedGeoControlPoints().map(e=>[e[0],e[1]]);const a=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=a.map(e=>[e[0],e[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();const l=S(this._georeference);this.ctm=b(l),this.outputValidation()}toSpatialReference(){return new c.A({wkt:this._gcs.WKT})}inputValidation(e){const{bbox:t,bounds:i,gpts:n,lpts:o,gcs:s,mediaBox:a}=e;if(!t||4!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!n||n.length<6||n.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!o||o.length<6||o.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(o.length!==n.length)throw new r.A("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!s?.WKT)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:t,bounds:i,gpts:n,lpts:o,gcs:{WKT:s.WKT},mediaBox:a}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){const e=this._getPageControlPoints(),t=this._getProjectedGeoControlPoints(),i=this._getViewportRect();return E(e,t,this.toSpatialReference(),i)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;const e=[];for(let t=0;t<this._bounds.length;t+=2)e.push({u:this._bounds[t],v:this._bounds[t+1]});return e}_getBoundsPolygonPage(){const e=this._getBoundsPolygonLocal();return e?.map(e=>this._localToPage(e.u,e.v))??null}_getPageControlPoints(){const e=[];for(let t=0;t<this._lpts.length;t+=2){const i=this._lpts[t],n=this._lpts[t+1];e.push(this._localToPage(i,n))}return e}_getProjectedGeoControlPoints(){const e=this.toSpatialReference(),t=[];for(let i=0;i<this._gpts.length;i+=2){const n=this._gpts[i],r=this._gpts[i+1],o=new m.A({x:r,y:n}),s=(0,v.projectExecute)(o,e);t.push((0,w.fA)(s.x,s.y))}return t}_getViewportRect(){const[e,t,i,n]=this._bbox;return{xmin:Math.min(e,i),ymin:Math.min(t,n),xmax:Math.max(e,i),ymax:Math.max(t,n)}}_localToPage(e,t){const[i,n,r,o]=this._bbox;return(0,w.fA)(i+e*(r-i),n+t*(o-n))}}function U(e){const t=oe(e,"LGIDict map frame must be an object.");return{CTM:Y(t.CTM),Registration:ee(t.Registration),Neatline:Y(t.Neatline),Projection:K(t.Projection),Display:K(t.Display)}}function W(e){const t=oe(e,"Viewport frame must be an object."),i=function(e){if(re(e))return{Bounds:Y(e.Bounds),GPTS:Y(e.GPTS),LPTS:Y(e.LPTS),GCS:J(e.GCS)}}(t.Measure);return{BBox:Y(t.BBox),Measure_Raw:t.Measure,Measure:i,Raw:t}}function J(e){if(re(e))return{WKT:te(e.WKT)}}function K(e){if(re(e))return{Type:ie(e.Type),Units:ie(e.Units),Datum:q(e.Datum),Projection_Type:ie(e.ProjectionType),Central_Meridian:ne(e.CentralMeridian),False_Easting:ne(e.FalseEasting),False_Northing:ne(e.FalseNorthing),Height:ne(e.Height),Hemisphere:ie(e.Hemisphere),Latitude_One:ne(e.LatitudeOne),Latitude_Two:ne(e.LatitudeTwo),Latitude_Of_True_Scale:ne(e.LatitudeOfTrueScale),Longitude_One:ne(e.LongitudeOne),Longitude_Two:ne(e.LongitudeTwo),Longitude_Down_From_Pole:ne(e.LongitudeDownFromPole),Orientation:ie(e.Orientation),Origin_Height:ne(e.OriginHeight),Origin_Latitude:ne(e.OriginLatitude),Origin_Longitude:ne(e.OriginLongitude),Scale_Factor:ne(e.ScaleFactor),Standard_Parallel:ne(e.StandardParallel),Standard_Parallel_One:ne(e.StandardParallelOne),Standard_Parallel_Two:ne(e.StandardParallelTwo),Zone:ne(e.Zone),Description:ie(e.Description),raw:e}}function q(e){return null==e?null:"string"==typeof e?{kind:"name",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}:re(e)?{kind:"definition",name:ie(e.Description),ellipsoid:Q(e.Ellipsoid),to_WGS84:X(e.ToWGS84),raw:e}:{kind:"unknown",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}}function Q(e){if(re(e))return{semi_Major_Axis:ne(e.SemiMajorAxis),inverse_Flattening:ne(e.InvFlattening),semi_Minor_Axis:ne(e.SemiMinorAxis),description:ie(e.Description)}}function X(e){if(re(e))return{dx:ne(e.dx)??0,dy:ne(e.dy)??0,dz:ne(e.dz)??0,rx:ne(e.rx)??0,ry:ne(e.ry)??0,rz:ne(e.rz)??0,sf:ne(e.sf)??0}}function Y(e){if(!Array.isArray(e))return;const t=[];for(const i of e){const e=ne(i);if(void 0===e)return;t.push(e)}return t}function ee(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>ne(e)).filter(e=>void 0!==e))}function te(e){if(null!=e)return"string"==typeof e?e:String(e)}function ie(e){const t=te(e);if(void 0!==t)return t.trim()}function ne(e){if(null==e)return;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;const t=e.trim();if(""===t)return;const i=Number(t);return Number.isFinite(i)?i:void 0}function re(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function oe(e,t){if(!re(e))throw new r.A("geospatial-pdf-layer:parse",t);return e}let se=class extends _.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){const t=(0,y.h)("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);const{geospatialMetadata:i}=await this._workerHandler.loadPDF(e,t),n=function(e,t=0){const i={mediaBox:Y(e.MediaBox),rotate:ne(e.Rotate),hasLGIDict:null!=e.LGIDict,hasVP:null!=e.VP},n=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>U(e)):[U(e)]}(e)[t]}(e.LGIDict,t);if(n){if(!n.Projection)throw new r.A("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");const t=I(n.Projection);let o;try{o=n.Display?I(n.Display):void 0}catch{o=t}return{result:i,lgiDictFrame:new j({ctm:n.CTM,registration:n.Registration,projection:t,display:o,neatline:n.Neatline,mediaBox:Y(e.MediaBox)})}}const o=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>W(e)):[W(e)]}(e)[t]}(e.VP,t);return o?{result:i,vpFrame:new V({bbox:o.BBox,bounds:o.Measure?.Bounds,gpts:o.Measure?.GPTS,lpts:o.Measure?.LPTS,gcs:o.Measure?.GCS,mediaBox:Y(e.MediaBox)})}:{result:i}}(i,0),o=n.lgiDictFrame??n.vpFrame;if(!o)throw new r.A("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");const s=new R(o),a=s.spatialReference.toJSON();return{frame:s,sourceSpatialReference:a,fullExtent:s.toExtent()}}async render(e,t,i,n,r,o){const s={sourceExtentAsJSON:e.toJSON(),width:t,height:i,ctm:n,currentRing:r};return this._workerHandler.renderPDF(s,o)}};se=(0,n.Cg)([(0,l.$K)("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],se);var ae=i(49859),le=i(14140),ce=i(87186);let ue=class extends ae.A{constructor(){super(...arguments),this._workerClient=new se,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,i,n={}){const r=this._extent,o=this._ctm,s=this.getTileExtentPDF(e,t,i);return s.intersects(r)?function(e){return new le.A({width:e.width,height:e.height,pixelType:"u8",pixels:[e.red,e.green,e.blue],mask:e.mask})}(await this._workerClient.render(s,this._tileSize,this._tileSize,o,this._neatlineRing,n)):null}async _open(e){if(!this.url)throw new r.A("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");const t=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=t.frame;const i=this.frame.outerExtentMediabox;if(!i)throw new r.A("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=t.fullExtent,this._extent=i,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];const n=function(e,t){const[i,n,o,s]=e,a=i*s-n*o;if(!Number.isFinite(a)||0===a)throw new r.A("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");const l=10*Math.hypot(s,n)/Math.abs(a),c=10*Math.hypot(o,i)/Math.abs(a),u=Math.max(1,Math.ceil(t.width*l)),h=Math.max(1,Math.ceil(t.height*c));if(!Number.isFinite(u)||!Number.isFinite(h))throw new r.A("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[u,h]}(this.frame.ctm,this._extent);this._width=n[0],this._height=n[1];const o={x:i.width/this._width,y:i.height/this._height},s=new ce.A({width:this._width,height:this._height,pixelType:"u8",extent:i,pixelSize:o,spatialReference:i.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(s,this._tileSize,this._tileSize),this._set("rasterInfo",s),this.updateTileInfo()}getTileExtentPDF(e,t,i){const n=this._extent,r=2**e,o=n.width/this._width*r,s=n.height/this._height*r,a=new m.A({x:n.xmin,y:n.ymax});return this.getTileExtent({x:o,y:s},t,i,a,n.spatialReference,[512,512])}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,l.MZ)({constructOnly:!0})],ue.prototype,"page",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ue.prototype,"tileType",void 0),ue=(0,n.Cg)([(0,l.$K)("esri.layers.raster.datasets.GeospatialPDFRaster")],ue);var he=i(34930),pe=i(60694),de=i(87045);let fe=class extends((0,p.dM)((0,g.j)((0,d.A)((0,f.G)((0,s.M)(h.A)))))){constructor(e){super(e),this.serviceRasterInfo=null,this._frame=null,this.clippedToNeatline=!0,this.neatlineVisible=!0,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["PDF"],supportsData:!1},e).catch(a.QP).then(()=>this._openRaster(e?.signal))),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy()}get fullExtent(){return this.serviceRasterInfo?.extent}set url(e){this._set("url",(0,pe.Jf)(e,o.A.getLogger(this)))}async fetchImageBitmapTile(){throw new r.A("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,i,n={}){return ge(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(i),n)}async fetchTile(e,t,i,n={}){if(ge(this),n.requestAsImageElement)throw new r.A("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();const o=await this.raster.fetchTile(e,t,i,n);return this.clippedToNeatline&&o.pixelBlock&&this._frame&&o.srcExtent&&(o.pixelBlock=await(0,he.$Q)(o.pixelBlock,o.srcExtent,this._frame.sourceNeatlinePolygon)),o}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,u.Vp)(e);return de.A.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return ge(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(ge(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}async _openRaster(e){const t=new ue({url:this.url});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new r.A("geospatialpdf-layer:load","cannot load resources on "+this.url);const{rasterInfo:i}=t;this._set("serviceRasterInfo",i),this.setAtOrigin("spatialReference",i.spatialReference,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service"),this._frame=t.frame,this.raster=t}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}};function ge(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}(0,n.Cg)([(0,l.MZ)()],fe.prototype,"serviceRasterInfo",void 0),(0,n.Cg)([(0,l.MZ)({clonable:!1})],fe.prototype,"_compatibleFullExtent",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],fe.prototype,"clippedToNeatline",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1}})],fe.prototype,"fullExtent",null),(0,n.Cg)([(0,l.MZ)({type:Boolean})],fe.prototype,"neatlineVisible",void 0),(0,n.Cg)([(0,l.MZ)()],fe.prototype,"raster",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,type:c.A,json:{read:!1}})],fe.prototype,"spatialReference",void 0),(0,n.Cg)([(0,l.MZ)({type:de.A})],fe.prototype,"tileInfo",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,value:"geospatial-pdf"})],fe.prototype,"type",void 0),(0,n.Cg)([(0,l.MZ)()],fe.prototype,"url",null),fe=(0,n.Cg)([(0,l.$K)("esri.layers.GeospatialPDFLayer")],fe);const me=fe},91806(e,t,i){i.d(t,{A:()=>l});var n,r=i(32198),o=i(25482),s=i(91429),a=i(78888);let l=class extends o.o{static{n=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new n({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,r.Cg)([(0,s.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=n=(0,r.Cg)([(0,s.$K)("esri.layers.support.LOD")],l)},87045(e,t,i){i.d(t,{A:()=>w});var n,r=i(32198),o=i(66552),s=i(25482),a=i(86211),l=i(91429),c=i(78888),u=i(86738),h=i(16930),p=i(21325),d=i(28735),f=i(91806),g=i(72802),m=i(36005),_=i(43937);const y=new o.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends s.o{static{n=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:o=h.A.WebMercator,numLODs:s=24}=e;if(!(0,p.fn)(o)){const e=[];if(i)for(let t=0;t<i.length;t++){const n=i[t];e.push(new f.A({level:t,scale:n,resolution:n}))}else{let t=5e-4;for(let i=s-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new n({dpi:96,lods:e,origin:new u.A(0,0,o),size:[r,r],spatialReference:o})}const l=(0,p.Vp)(o),c=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:o}):new u.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),d=1/(39.37*(0,a.GA)(o)*96),g=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],n=t*d;g.push(new f.A({level:e,scale:t,resolution:n}))}else{let e=(0,p.EA)(o)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(s/t);g.push(new f.A({level:0,scale:e,resolution:e*d}));for(let n=1;n<i;n++){const i=e/2**t,r=i*d;g.push(new f.A({level:n,scale:i,resolution:r})),e=i}}return new n({dpi:96,lods:g,origin:c,size:[r,r],spatialReference:o})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,p.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const n=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{n.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",n),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),n=i+1;return t[i]/(t[i]/t[n])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let n=0;for(;n<i;n++){const i=t[n],r=t[n+1];if(i<=e)return n;if(r===e)return n+1;if(i>e&&r<e)return n+Math.log(i/e)/Math.log(i/r)}return n}tileAt(e,t,i,n){const r=this.lodAt(e);if(!r)return null;let o,s;if("number"==typeof t)o=t,s=i;else if((0,p.aI)(t.spatialReference,this.spatialReference))o=t.x,s=t.y,n=i;else{const e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;o=e.x,s=e.y,n=i}const a=r.resolution*this.size[0],l=r.resolution*this.size[1];return n??=new g.U(0,0,0),n.level=e,n.row=Math.floor((this.origin.y-s)/l+.001),n.col=Math.floor((o-this.origin.x)/a+.001),this.updateTileInfo(n),n}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:n}=i,r=n*this.size[0],o=n*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*o,e[2]=e[0]+r,e[3]=e[1]+o,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return n.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const n=e+t,{scale:r,resolution:o}=n>=0?this.lods[n]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:r,resolution:o}))}return new n({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const n=e[i];this._upsampleLevels[n.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/n.resolution:0},t=n}}};(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,r.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,r.Cg)([(0,l.MZ)({type:u.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,r.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,r.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,r.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,r.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,r.Cg)([(0,_.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,r.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=n=(0,r.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>r});var n=i(19419);class r{constructor(e,t,i,r=(0,n.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[433],{15142(t,e,n){n.d(e,{A:()=>l});var r=n(4576),i=n(21818);const s=(t,e,n,r)=>{let i=e,s=e;const a=n>>>1,h=t[i-1];for(;s<=a;){s=i<<1,s<n&&r(t[s-1],t[s])<0&&++s;const e=t[s-1];if(r(e,h)<=0)break;t[i-1]=e,i=s}t[i-1]=h},a=(t,e)=>t<e?-1:t>e?1:0;function h(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===r&&(r=a);for(let i=n>>>1;i>e;i--)s(t,i,n,r);const i=e+1;for(let a=n-1;a>e;a--){const n=t[e];t[e]=t[a],t[a]=n,s(t,i,a,r)}}function*o(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===r&&(r=a);for(let i=n>>>1;i>e;i--)s(t,i,n,r),yield;const i=e+1;for(let a=n-1;a>e;a--){const n=t[e];t[e]=t[a],t[a]=n,s(t,i,a,r),yield}}class l{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new r.vW,t&&(t.initialSize&&(this.data=new Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),void 0!==t.deallocator&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>u(this)))}toArray(){return this.data.slice(0,this.length)}filter(t){const e=new Array;for(let n=0;n<this._length;n++){const r=this.data[n];t(r)&&e.push(r)}return e}at(t){if((t=Math.trunc(t)||0)<0&&(t+=this._length),!(t<0||t>=this._length))return this.data[t]}includes(t,e){const n=this.data.indexOf(t,e);return-1!==n&&n<this.length}get length(){return this._length}set length(t){if(t>this._length){if(this._allocator){for(;this._length<t;)this.data[this._length++]=this._allocator(this.data[this._length]);return}this._length=t}else{if(this._deallocator)for(let e=t;e<this._length;++e)this.data[e]=this._deallocator(this.data[e]);this._length=t,this._shrink()}}clear(){this.length=0}prune(){this.clear(),this.data=[]}push(t){this.data[this._length++]=t}pushArray(t,e=t.length){for(let n=0;n<e;n++)this.data[this._length++]=t[n]}pushAll(t){for(const e of t)this.data[this._length++]=e}fill(t,e){for(let n=0;n<e;n++)this.data[this._length++]=t}pushNew(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));const t=this.data[this._length];return++this._length,t}unshift(t){this.data.unshift(t),this._length++,u(this)}pop(){if(0===this.length)return;const t=this.data[this.length-1];return this.length=this.length-1,this._shrink(),t}remove(t){const e=(0,r.qh)(this.data,(0,i.z)(t),this.length,this._hint);if(-1!==e)return this.data.splice(e,1),this.length=this.length-1,t}removeUnordered(t){return this.removeUnorderedIndex((0,r.qh)(this.data,(0,i.z)(t),this.length,this._hint))}removeUnorderedIndex(t){if(!(t>=this.length||t<0))return this.swapElements(t,this.length-1),this.pop()}removeUnorderedMany(t,e=t.length,n){this.length=(0,r.mW)(this.data,t,this.length,e,this._hint,n),this._shrink()}front(){if(0!==this.length)return this.data[0]}back(){if(0!==this.length)return this.data[this.length-1]}swapElements(t,e){if(t>=this.length||e>=this.length||t===e)return;const n=this.data[t];this.data[t]=this.data[e],this.data[e]=n}sort(t){h(this.data,0,this.length,t)}iterableSort(t){return o(this.data,0,this.length,t)}some(t,e){for(let n=0;n<this.length;++n)if(t.call(e,this.data[n],n,this.data))return!0;return!1}find(t,e){const{data:n,length:r}=this;for(let i=0;i<r;++i)if(t.call(e,n[i]))return n[i]}filterInPlace(t,e){let n=0;for(let r=0;r<this._length;++r){const i=this.data[r];t.call(e,i,r,this.data)&&(this.data[r]=this.data[n],this.data[n]=i,n++)}if(this._deallocator)for(let t=n;t<this._length;t++)this.data[t]=this._deallocator(this.data[t]);return this._length=n,this._shrink(),this}forAll(t,e){const{data:n,length:r}=this;for(let i=0;i<r;++i)t.call(e,n[i],i,n)}forEach(t,e){this.data.slice(0,this.length).forEach(t,e)}map(t,e){const n=new Array(this.length);for(let r=0;r<this.length;++r)n[r]=t.call(e,this.data[r],r,this.data);return n}reduce(t,e){let n=e;for(let e=0;e<this.length;++e)n=t(n,this.data[e],e,this.data);return n}has(t){const e=this.length,n=this.data;for(let r=0;r<e;++r)if(n[r]===t)return!0;return!1}*[Symbol.iterator](){for(let t=0;t<this.length;++t)yield this.data[t]}}function u(t){t.data.length>1.5*t.length&&(t.data.length=Math.floor(1.1*t.length))}},91829(t,e,n){function r(){return[0,0,0,0]}function i(t,e,n,r){return[t,e,n,r]}function s(){return i(1,1,1,1)}function a(){return i(1,0,0,0)}function h(){return i(0,1,0,0)}function o(){return i(0,0,1,0)}function l(){return i(0,0,0,1)}n.d(e,{_Y:()=>l,fA:()=>i,vt:()=>r});const u=[0,0,0,0],c=s(),d=a(),f=h(),_=o(),p=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_W:p,UNIT_X:d,UNIT_Y:f,UNIT_Z:_,ZEROS:u,clone:function(t){return[t[0],t[1],t[2],t[3]]},create:r,freeze:function(t,e,n,r){return[t,e,n,r]},fromArray:function(t,e=[0,0,0,0]){const n=Math.min(4,t.length);for(let r=0;r<n;++r)e[r]=t[r];return e},fromValues:i,ones:s,unitW:l,unitX:a,unitY:h,unitZ:o,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"})),n.d(e,["Un",0,c,"uY",0,u,"v7",0,p])},78955(t,e,n){n.d(e,{Bw:()=>E,C:()=>i,Cc:()=>T,LI:()=>d,Om:()=>S,S8:()=>R,T9:()=>c,WQ:()=>a,Z0:()=>I,aI:()=>m,hG:()=>p,hZ:()=>s,hs:()=>f,jk:()=>u,m3:()=>g,t2:()=>N});var r=n(34304);function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function s(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function a(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function o(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function l(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function c(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function d(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function f(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function _(t,e){const n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+s*s)}function p(t,e){const n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return n*n+r*r+i*i+s*s}function E(t){const e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function g(t){const e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function R(t,e){const n=e[0],r=e[1],i=e[2],s=e[3];let a=n*n+r*r+i*i+s*s;return a>0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=s*a),t}function S(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function T(t,e,n,r){const i=e[0],s=e[1],a=e[2],h=e[3];return t[0]=i+r*(n[0]-i),t[1]=s+r*(n[1]-s),t[2]=a+r*(n[2]-a),t[3]=h+r*(n[3]-h),t}function I(t,e,n){const r=e[0],i=e[1],s=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*s+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*s+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*s+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*s+n[15]*a,t}function N(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function m(t,e){const n=t[0],i=t[1],s=t[2],a=t[3],h=e[0],o=e[1],l=e[2],u=e[3],c=(0,r.FD)();return Math.abs(n-h)<=c*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-o)<=c*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(s-l)<=c*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(a-u)<=c*Math.max(1,Math.abs(a),Math.abs(u))}const G=h,A=o,M=l,y=_,O=p,U=E,b=g;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},copy:i,copyVec3:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},dist:y,distance:_,div:M,divide:l,dot:S,equals:m,exactEquals:N,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},len:U,length:E,lerp:T,max:c,min:u,mul:A,multiply:o,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},normalize:R,random:function(t,e=1){const n=r.Ov;let i,s,a,h,o,l;do{i=2*n()-1,s=2*n()-1,o=i*i+s*s}while(o>=1);do{a=2*n()-1,h=2*n()-1,l=a*a+h*h}while(l>=1);const u=Math.sqrt((1-o)/l);return t[0]=e*i,t[1]=e*s,t[2]=e*a*u,t[3]=e*h*u,t},round:d,scale:f,scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},set:s,sqrDist:O,sqrLen:b,squaredDistance:p,squaredLength:g,str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},sub:G,subtract:h,transformMat4:I,transformQuat:function(t,e,n){const r=e[0],i=e[1],s=e[2],a=n[0],h=n[1],o=n[2],l=n[3],u=l*r+h*s-o*i,c=l*i+o*r-a*s,d=l*s+a*i-h*r,f=-a*r-h*i-o*s;return t[0]=u*l+f*-a+c*-o-d*-h,t[1]=c*l+f*-h+d*-a-u*-o,t[2]=d*l+f*-o+u*-h-c*-a,t[3]=e[3],t}},Symbol.toStringTag,{value:"Module"}))},90239(t,e,n){function r(t){switch(t){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}n.d(e,{GJ:()=>r})},1843(t,e,n){n.d(e,{BP:()=>u,l5:()=>c});var r=n(13030),i=n(90239),s=n(4431),a=n(620),h=n(85079);class o{constructor(t,e,n=0){this.layout=t,this.byteOffset=n,this.buffer="number"==typeof e?new ArrayBuffer(e*t.stride):e;for(const e of t.fields.keys()){const r=t.fields.get(e);this[e]=new r.constructor(this.buffer,n+r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(t,e){const n=this[t];return n&&n.elementCount===e.ElementCount&&n.elementType===e.ElementType?n:null}slice(t,e){return new o(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,n=0,r=t.count){const i=this.stride,s=t.byteOffset+e*i,a=this.byteOffset+n*i,h=r*i;if(i%4==0&&s%4==0&&a%4==0){const e=new Uint32Array(t.buffer,s,h/4);new Uint32Array(this.buffer,a,h/4).set(e)}else{const e=new Uint8Array(t.buffer,s,h);new Uint8Array(this.buffer,a,h).set(e)}return this}get usedMemory(){return this.byteLength}dispose(){}}class l{constructor(t){this._stride=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(t=>this._fields.set(t[0],{...t[1],constructor:_(t[1].constructor)})))}freeze(){return this}get locations(){return(0,h.Xk)((0,s.U)(this))}vec2f16(t,e){return this._appendField(t,r.ZD,e),this}vec2f(t,e){return this._appendField(t,r.gH,e),this}vec2f64(t,e){return this._appendField(t,r.si,e),this}vec3f16(t,e){return this._appendField(t,r.EC,e),this}vec3f(t,e){return this._appendField(t,r.xs,e),this}vec3f64(t,e){return this._appendField(t,r.Xm,e),this}vec4f16(t,e){return this._appendField(t,r.jz,e),this}vec4f(t,e){return this._appendField(t,r.Eq,e),this}vec4f64(t,e){return this._appendField(t,r.Aj,e),this}mat3f(t,e){return this._appendField(t,r.jZ,e),this}mat3f64(t,e){return this._appendField(t,r.j0,e),this}mat4f(t,e){return this._appendField(t,r.Sx,e),this}mat4f64(t,e){return this._appendField(t,r.E$,e),this}vec4u8(t,e){return this._appendField(t,r.XP,e),this}f16(t,e){return this._appendField(t,r.XW,e),this}f32(t,e){return this._appendField(t,r.Y$,e),this}f64(t,e){return this._appendField(t,r.qB,e),this}u8(t,e){return this._appendField(t,r.SL,e),this}u16(t,e){return this._appendField(t,r.h,e),this}i8(t,e){return this._appendField(t,r.bf,e),this}vec2i8(t,e){return this._appendField(t,r.D6,e),this}vec2i16(t,e){return this._appendField(t,r.mJ,e),this}vec2u8(t,e){return this._appendField(t,r.LC,e),this}vec2u16(t,e){return this._appendField(t,r.Yi,e),this}vec4u16(t,e){return this._appendField(t,r.Uz,e),this}vec4i16(t,e){return this._appendField(t,r.E7,e),this}u32(t,e){return this._appendField(t,r.P,e),this}_appendField(t,e,n){this._fields.has(t)&&(0,a.vA)(!1,`${t} already added to vertex buffer layout`);const r=e.ElementCount*(0,i.GJ)(e.ElementType),s=this._stride;this._fields.set(t,{constructor:e,size:r,offset:s,optional:n}),this._alignFields()}_alignFields(){let t=0,e=1;this._fields.forEach(n=>{const r=(0,i.GJ)(n.constructor.ElementType);t=Math.floor((t+r-1)/r)*r,n.offset=t,t+=n.size,e=Math.max(e,r)}),t=Math.floor((t+e-1)/e)*e,this._stride=t}createBuffer(t){return new o(this,t)}createView(t,e){return new o(this,t,e)}clone(){const t=new l;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,n)=>t._fields.set(n,e)),t}get stride(){return this._stride}get fields(){return this._fields}}function u(){return new l}class c{constructor(t){this.fields=new Array,t.fields.forEach((t,e)=>{const n={...t,constructor:f(t.constructor)};this.fields.push([e,n])}),this.stride=t.stride}}const d=[r.Y$,r.gH,r.xs,r.Eq,r.jZ,r.Sx,r.qB,r.si,r.Xm,r.Aj,r.j0,r.E$,r.SL,r.LC,r.eI,r.XP,r.h,r.Yi,r.nS,r.Uz,r.P,r.An,r.H$,r.ml,r.bf,r.D6,r.m8,r.TX,r.Qt,r.mJ,r.Vp,r.E7,r.My,r.UL,r.zD,r.Y4];function f(t){return`${t.ElementType}_${t.ElementCount}`}function _(t){return p.get(t)}const p=new Map;d.forEach(t=>p.set(f(t),t))},4431(t,e,n){n.d(e,{U:()=>s});var r=n(63907),i=n(74038);function s(t,e=0){const n=t.stride;return t.fields.entries().map(([t,s])=>{const a=s.constructor.ElementCount,h=function(t){switch(t){case"u8":return r.pe.UNSIGNED_BYTE;case"u16":return r.pe.UNSIGNED_SHORT;case"u32":return r.pe.UNSIGNED_INT;case"i8":return r.pe.BYTE;case"i16":return r.pe.SHORT;case"i32":return r.pe.INT;case"f16":return r.pe.HALF_FLOAT;case"f32":return r.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(s.constructor.ElementType),o=s.offset,l=s.optional?.glNormalized??!1,u=s.optional?.integer??!1;return new i._(t,a,h,o,n,l,e,u)}).toArray()}},620(t,e,n){n.d(e,{O_:()=>s,vA:()=>i}),n(48163),n(78955),(0,n(91829).vt)();class r{constructor(t){this.message=t}toString(){return`AssertException: ${this.message}`}}function i(t,e="Assertion"){if(!t){const t=new Error(e).stack;throw new r(`${e} at ${t}`)}}function s(t,e,n,r){let i,s=(n[0]-t[0])/e[0],a=(r[0]-t[0])/e[0];s>a&&(i=s,s=a,a=i);let h=(n[1]-t[1])/e[1],o=(r[1]-t[1])/e[1];if(h>o&&(i=h,h=o,o=i),s>o||h>a)return!1;h>s&&(s=h),o<a&&(a=o);let l=(n[2]-t[2])/e[2],u=(r[2]-t[2])/e[2];return l>u&&(i=l,l=u,u=i),!(s>u||l>a||(u<a&&(a=u),a<0))}},71936(t,e,n){n.r(e),n.d(e,{default:()=>o});var r=n(1843);function i(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new r.l5(t.layout)}}var s=n(99058),a=n(93406),h=n(44801);class o{async extract(t){const e=l(t),n=(0,h.o6)(e),r=[e.data.buffer];return{result:u(n,r),transferList:r}}async extractComponentsEdgeLocations(t){const e=l(t),n=(0,h.hx)(e.data,e.skipDeduplicate,e.indices,e.indicesLength),r=[];return{result:i((0,a.K)(n,d).regular.instancesData,r),transferList:r}}async extractEdgeLocations(t){const e=l(t),n=(0,h.hx)(e.data,e.skipDeduplicate,e.indices,e.indicesLength),r=[];return{result:i((0,a.K)(n,c).regular.instancesData,r),transferList:r}}}function l(t){return{data:s.I$.createView(t.dataBuffer),indices:"Uint32Array"===t.indicesType?new Uint32Array(t.indices):"Uint16Array"===t.indicesType?new Uint16Array(t.indices):"Uint8Array"===t.indicesType?new Uint8Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function u(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:i(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:i(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}const c=new class{allocate(t){return h.Jb.createBuffer(t)}trim(t,e){return t.slice(0,e)}write(t,e,n){t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1)}},d=new class{allocate(t){return h.HY.createBuffer(t)}trim(t,e){return t.slice(0,e)}write(t,e,n){t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1),t.componentIndex.set(e,n.componentIndex)}}},85079(t,e,n){n.d(e,{Sk:()=>a,Xk:()=>i,_u:()=>s});var r=n(21818);function i(t){let e=0;return(0,r.z)(new Map(t.map(({name:t,count:n})=>{const r=[t,e];return 16===n?e+=4:9===n?e+=3:++e,r})))}function s(t){const e=new Map;let n=0;return t.forEach(t=>t.forEach(({name:t,count:r})=>{e.set(t,n),16===r?n+=4:9===r?n+=3:++n})),e}function a(t){return s(Array.from(t.values()).map(({layout:t})=>t))}},74038(t,e,n){n.d(e,{_:()=>r});class r{constructor(t,e,n,r,i,s=!1,a=0,h=!1){this.name=t,this.count=e,this.type=n,this.offset=r,this.stride=i,this.normalized=s,this.divisor=a,this.integer=h}}},63907(t,e,n){const r={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},i={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},s=Object.values(i),a={FLOAT:r.FLOAT,UNSIGNED_BYTE:r.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:r.BYTE,UNSIGNED_SHORT:r.UNSIGNED_SHORT,SHORT:r.SHORT,UNSIGNED_INT:r.UNSIGNED_INT,INT:r.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269};n.d(e,["CQ",0,{COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497},"H0",0,i,"SB",0,{DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},"WR",0,{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},"XN",0,s,"iE",0,{DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},"ld",0,a,"pe",0,r,"vt",0,{Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12}])}}]);