@arcgis/core 4.32.0-next.20250209 → 4.32.0-next.20250211

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 (148) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{3c23e567cfb7372c44ba.js → 0a5689348d544090006d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{7966c245a073c85f04b1.js → 0ac1399d252f2df670b6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/135fb580d8afd8d60811.js +1 -0
  5. package/assets/esri/core/workers/chunks/{cee3a38b92a48a58c4d0.js → 152becae48572299b07f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/24e6476f32ad2014d39d.js +1 -0
  7. package/assets/esri/core/workers/chunks/{5fbdb5fea7d6676fcf19.js → 2c1a85a801cb4d9d737e.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7f87cf3d6a365d987f69.js → 30bd5b3204e09f516ea2.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{c04091eea7089dc2e864.js → 35bcb0622234b38d85b4.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{1d51c064045e9c47bd2e.js → 3bad184751fcb26c003c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{5be7cf1564e756c24066.js → 3d5442055e01493efcb2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a559db8654b4f83fd79b.js → 3f6516af411256d90a03.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c83b26ff96e39266adc2.js → 4300c80fa10c5d9141e8.js} +1 -1
  14. package/assets/esri/core/workers/chunks/486df1e042204b90b0dd.js.LICENSE.txt +1 -1
  15. package/assets/esri/core/workers/chunks/{220b12654b94c94f8d8a.js → 50ae86c23efe709f41cc.js} +1 -1
  16. package/assets/esri/core/workers/chunks/5693d9ce4472a4c5959f.js.LICENSE.txt +1 -1
  17. package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{1accbc048b74857269e4.js → 57924f4909f2cbe5d64c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/5b56b271afb0fadf48b4.js.LICENSE.txt +1 -1
  20. package/assets/esri/core/workers/chunks/{b3aeda290470dcb2bdd2.js → 5cf08ee5114273163e09.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{bb1e9c062558671de957.js → 6518954889df2e781c47.js} +2 -2
  22. package/assets/esri/core/workers/chunks/{bb1e9c062558671de957.js.LICENSE.txt → 6518954889df2e781c47.js.LICENSE.txt} +1 -1
  23. package/assets/esri/core/workers/chunks/{92984981afcbb95828cd.js → 74844334b3a2100220fc.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{6d79ec15d1858839f576.js → 74f42e46bf551aab14dc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{e468bf4ec7402942ad8c.js → 8ddd4e2e50b8206564a7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/9bd83b8c1764813f18dd.js +1 -0
  27. package/assets/esri/core/workers/chunks/{8bd51b5b392dfacc922f.js → 9fb45c006d790273e8c1.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{e6087eda5e3b7e5ad3e1.js → a12afed58acff17708ca.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{f200dca22f9f9bbb8670.js → a4a9b4f792d47566fbf4.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{08c4b585290efc98ca5d.js → a6be1105a5e1f9597c5e.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{95ad76e58452b60fb79f.js → a864ef9b584c83ebf6ae.js} +1 -1
  32. package/assets/esri/core/workers/chunks/b0952b81d5be214262dd.js.LICENSE.txt +1 -1
  33. package/assets/esri/core/workers/chunks/{9f257e356bc6b8f742c6.js → b83151b03bbeba466f82.js} +2 -2
  34. package/assets/esri/core/workers/chunks/{9f257e356bc6b8f742c6.js.LICENSE.txt → b83151b03bbeba466f82.js.LICENSE.txt} +1 -1
  35. package/assets/esri/core/workers/chunks/{fef135e55706d84d1947.js → c4ce3c35b52b7999e877.js} +1 -1
  36. package/assets/esri/core/workers/chunks/cf498c621dc1f865530e.js +1 -0
  37. package/assets/esri/core/workers/chunks/{117e7a12af77c761efb5.js → d0e9874eb304010305c6.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → d279e4b09042988f93ae.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → d6b04f8a72e0c67ecef0.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{16a96f6b73e8fb1ede8c.js → de87009542886fad9a2f.js} +2 -2
  42. package/assets/esri/core/workers/chunks/{16a96f6b73e8fb1ede8c.js.LICENSE.txt → de87009542886fad9a2f.js.LICENSE.txt} +1 -1
  43. package/assets/esri/core/workers/chunks/{bb73cd34fbae935ccbcc.js → dff4a9d656b84fe3e052.js} +1 -1
  44. package/assets/esri/core/workers/chunks/f52ed527b46c316eb369.js +1 -0
  45. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  46. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  47. package/chunks/Bufferer-DjC-SKTJ.js +1 -1
  48. package/chunks/Distance2DCalculator-8-JrFGHH.js +1 -1
  49. package/chunks/Envelope.js +1 -1
  50. package/chunks/GeodeticDistanceCalculator-BsWHOuqE.js +1 -1
  51. package/chunks/OperatorClip.js +1 -1
  52. package/chunks/OperatorCut.js +1 -1
  53. package/chunks/OperatorGeodesicBuffer.js +1 -1
  54. package/chunks/OperatorGeodeticArea.js +1 -1
  55. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  56. package/chunks/OperatorProximity.js +1 -1
  57. package/chunks/OperatorShapePreservingProject.js +1 -1
  58. package/chunks/ProjectionTransformation.js +1 -1
  59. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  60. package/chunks/disjointOperator.js +1 -1
  61. package/chunks/lyr3DWorker.js +1 -1
  62. package/editing/sharedTemplates/SharedTemplate.d.ts +4 -0
  63. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  64. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  65. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  66. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  67. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  68. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  69. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  70. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  71. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  72. package/editing/sharedTemplates/executor/builders/pointAtAllVerticesOfLine.js +1 -1
  73. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfLine.js +1 -1
  74. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfRadial.js +1 -1
  75. package/editing/sharedTemplates/executor/builders/pointAtEndOfLine.js +1 -1
  76. package/editing/sharedTemplates/executor/builders/pointAtInteriorVertices.js +1 -1
  77. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  78. package/editing/sharedTemplates/executor/builders/pointAtNotBeginningOfLine.js +1 -1
  79. package/editing/sharedTemplates/executor/builders/pointAtNotEndOfLine.js +1 -1
  80. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  81. package/editing/sharedTemplates/executor/builders/pointAtPolygonNotStart.js +1 -1
  82. package/editing/sharedTemplates/executor/builders/pointAtPolygonStart.js +1 -1
  83. package/editing/sharedTemplates/executor/builders/pointIdentity.js +1 -1
  84. package/editing/sharedTemplates/executor/builders/pointPrimaryIdentity.js +1 -1
  85. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  86. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  87. package/editing/sharedTemplates/executor/builders/polygonIdentity.js +1 -1
  88. package/editing/sharedTemplates/executor/builders/polygonPrimaryIdentity.js +1 -1
  89. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  90. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  91. package/editing/sharedTemplates/executor/builders/twoPointLines.js +1 -1
  92. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  93. package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
  94. package/editing/sharedTemplates/executor/support/executorUtils.js +1 -1
  95. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  96. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  97. package/editing/sharedTemplates/templateDefinitions/parts/builders/builderUtils.js +1 -1
  98. package/editing/templateUtils.js +1 -1
  99. package/geometry/operators/extendOperator.js +1 -1
  100. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  101. package/geometry/operators/gx/operatorBuffer.js +1 -1
  102. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  103. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  104. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  105. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  106. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  107. package/geometry/operators/gx/operatorSimplify.js +1 -1
  108. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  109. package/geometry/operators/gx/operatorUnion.js +1 -1
  110. package/geometry/operators/json/disjointOperator.js +1 -1
  111. package/geometry/operators/reshapeOperator.js +1 -1
  112. package/geometry/operators/support/apiConverter.js +1 -1
  113. package/geometry/operators/support/initNoPeFactory.js +1 -1
  114. package/geometry/operators/support/jsonConverter.js +1 -1
  115. package/interfaces.d.ts +33 -1
  116. package/layers/VectorTileLayer.js +1 -1
  117. package/layers/mixins/operationalLayers.js +1 -1
  118. package/layers/save/featureLayerUtils.js +1 -1
  119. package/layers/save/utils.js +1 -1
  120. package/layers/support/commonProperties.js +1 -1
  121. package/layers/support/wmsUtils.js +1 -1
  122. package/package.json +2 -2
  123. package/portal/Portal.js +1 -1
  124. package/support/revision.js +1 -1
  125. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  126. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  127. package/views/layers/LayerView.js +1 -1
  128. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  129. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  130. package/widgets/Editor/EditorViewModel.js +1 -1
  131. package/widgets/Editor/UpdateWorkflow.js +1 -1
  132. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  133. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  134. package/widgets/Editor/modelUploadUtils.js +1 -1
  135. package/widgets/Editor/workflowUtils.js +1 -1
  136. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  137. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  138. package/widgets/OrientedImageryViewer/constants.js +1 -1
  139. package/widgets/OrientedImageryViewer/galleryUtils.js +5 -0
  140. package/widgets/OrientedImageryViewer/utils.js +1 -1
  141. package/widgets/OrientedImageryViewer.js +1 -1
  142. package/widgets/Sketch/support/sketchUtils.js +1 -1
  143. package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
  144. package/assets/esri/core/workers/chunks/324a5547c64a3bae670d.js +0 -1
  145. package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +0 -1
  146. package/assets/esri/core/workers/chunks/9c6380af3bc3130658e1.js +0 -1
  147. package/assets/esri/core/workers/chunks/b18620fc15707e4413a1.js +0 -1
  148. package/editing/sharedTemplates/support/sharedTemplateUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{c as e,t,g as n,n as r,m as i,G as s,b as a}from"../../../chunks/Geometry.js";import{am as o,i as u,P as m,a as l,an as c,m as d}from"../../../chunks/Point2D.js";import{aA as _,b as h,aB as f,aC as p,c as k,z as b,aD as y,aE as T,aF as N}from"../../../chunks/ProjectionTransformation.js";import{D as g,I as v,P as x,E as A,y as S,z as w,J as C,K as D,t as F}from"../../../chunks/Envelope.js";import{y as j,z,a as O,P as I,S as E,M as B,A as P,B as V,F as M,H as R}from"../../../chunks/QuadraticBezier.js";import"./initNoPeFactory.js";function U(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class Y{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter((t=>void 0!==e[t])),m_i:-1,m_bReturnKey:!0,next:U}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:X}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class L{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class W{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===W.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===W.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function G(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,T=!1,N=!1,S=!1,w=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,B=!1,P=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,X=Number.NaN,Y=Number.NaN,L=Number.NaN,W=Number.NaN,G=Number.NaN,K=Number.NaN,te=Number.NaN,ne=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=J(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=Z(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,P=H(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,V=H(i);continue}}else if("z"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=H(i);continue}}else if("m"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,R=H(i);continue}}else if("id"===u){if(!S&&(e===s.enumUnknown||e===s.enumPoint)){S=!0,U=$(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,X=H(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,Y=H(i);continue}}else if("mmin"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,te=H(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=H(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=$(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,L=H(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,W=H(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,ne=H(i);continue}}else if("zmax"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=H(i);continue}}else if("idmax"===u){if(!B&&(e===s.enumUnknown||e===s.enumEnvelope)){B=!0,ie=$(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=g(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ee(n,me)}else if(b||y||N||T||S){v(P,V)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(P))&&(P=Number.NaN,V=Number.NaN);const e=new x({x:P,y:V});T&&e.setZ(M),N&&e.setM(R),S&&e.setID(U),ce=e}else if(w||C||D||F||j||z||O||I||E||B){(Number.isNaN(Y)||Number.isNaN(L)||Number.isNaN(W))&&(X=Number.NaN);const e=new A({xmin:X,ymin:Y,xmax:L,ymax:W});j&&z&&e.setInterval(1,0,G,K),O&&I&&e.setInterval(2,0,te,ne),E&&B&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function K(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,N=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,z=0,O=0,I=0,E=0,B=0,P=0,V=0,M=0,R="",U="",X=null;for(;3!==e.nextToken();){const _=e.currentString();e.nextToken(),"wkid"===_?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===_?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===_?s||(s=!0,6===e.currentToken()&&(R=e.currentString())):"wkt2"===_?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===_?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===_?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===_?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===_?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===_?m||(m=!0,a=!0,z=e.currentDoubleValue()):"falseX"===_?l||(l=!0,a=!0,B=e.currentDoubleValue()):"falseY"===_?c||(c=!0,a=!0,P=e.currentDoubleValue()):"falseZ"===_?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===_?N||(N=!0,a=!0,M=e.currentDoubleValue()):"xyUnits"===_?g||(g=!0,a=!0,O=e.currentDoubleValue()):"zUnits"===_?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===_?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===_?A||(A=!0,X=K(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let Y=null,L=!0;if(0!==R.length&&(L=!1,_(R)&&(Y=h(R))),Y||0===U.length||(L=!1,_(U)&&(Y=h(U))),!Y&&w>0&&(L=!1,f(w)&&(D<=0||p())&&(Y=k(w,D))),!Y&&S>0&&(L=!1,f(S)&&(C<=0||p())&&(Y=k(S,C))),L&&(Y=b(X)),a&&Y){const e=new T;Y.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,z),g&&l&&c&&e.setGridParams(B,P,O),v&&d&&e.setZParams(V,I),x&&N&&e.setMParams(M,E),Y=y(Y,e)}return Y}function Q(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new I,a=s,o=S(0),u=g(2,0),d=w(0);let _=null,h=null,f=null,p=null,k=null,b=0,y=0,T=0;const N=new E,v=m.getNAN();let x=0,A=0;const D=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,F=!0;const j=4;let z=0,O=0;const I=m.getNAN(),E=new Array(j),B=new Array(j);let P=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())F&&t("failed to parse multipath: starting vertex array is expected"),f||(f=w(x-1,1),p=S(x-1,-1),k=g(0)),P=!0,r=1,({segFlag:T,toPointSz:z}=oe(N,E,v,i));else{for(P=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===j&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),E[z++]=H(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),C(E[0],E[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*x&&u.resize(te(x)),u.writePoint2D(2*x,I.setCoords(E[0],E[1])),_&&_.size()===x&&_.resize(ne(x)),z>2?(_||(_=g(x+1,Number.NaN)),_.write(x,E[2])):_&&_.write(x,Number.NaN),h&&h.size()===x&&h.resize(ne(x)),z>3?(h||(h=g(x+1,Number.NaN)),h.write(x,E[3])):h&&h.write(x,Number.NaN),F)A++,o.add(x),d.add(D),F=!1,O=z,l(B,E,0,0,O);else if(null!==f)if(P){const e=R(T),t=k.size();k.resize(t+e),f.add(T),p.add(b),N.get().writeInBufferStream(k,b),b+=e,a.incCurveType(T,1),y++}else f.add(1),p.add(-1);x++,s++,v.setCoords(E[0],E[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===O&&0===c(E,B,z)?(x--,s--):null!==f&&(f.add(1),p.add(-1)))}return x&&(o.resize(A),d.resize(A),x>0&&(o.add(x),d.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(d),a.setPathStreamRef(o),null!==f&&(a.updateCurveCounter(y),a.setSegmentData(p,k,f,b)),a.notifyModifiedFlags(65535)),{geometry:s,as:_,bs:h}}function J(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new B,s=g(2,0);let a=0;const o=4,u=new Array(o),l=new m;let c=null,d=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=H(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),C(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(te(r)),s.writePoint2D(2*r,l.setCoords(u[0],u[1])),c&&c.size()===r&&c.resize(ne(r)),a>2?(c||(c=g(r+1,Number.NaN)),c.write(r,u[2])):c&&c.write(r,Number.NaN),d&&d.size()===r&&d.resize(ne(r)),a>3?(d||(d=g(r+1,Number.NaN)),d.write(r,u[3])):d&&d.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:c,bs:d}}function Z(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=D(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ne(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function H(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function $(e){return e.currentInt32Value()}function ee(t,n){if(t.isEmpty())return;const r=D(2,0),i=t.getGeometryType();let s=0;i===B.type?s=1:i===I.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===B.type?m=t.getPointCount():i===I.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function te(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ne(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function re(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=m.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,P(e),!1;let u=!!(64&o);const l=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,P(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),P(e),!0}function ie(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,P(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),P(e),!0}function se(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=d(m,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ae(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function oe(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),l=u[0];for((1!==u.length||"a"!==l&&"b"!==l&&"c"!==l&&"n"!==l&&"q"!==l)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=H(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=m.construct(n[0],n[1]),d=m.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[m.getNAN(),m.getNAN(),m.getNAN()],T=m.getNAN();if("a"===l){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=H(i),o=i.nextToken(),k=H(i),o=i.nextToken(),b=H(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===l){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===l){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===l){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),T.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===l)if(e.createEllipticArc(),f){const t=!0;ue(e.get(),r,c,d,t,_,h)}else me(e.get(),r,c,d,_,h,p,k,b);else if("b"===l)e.createCubicBezier(),le(e.get(),r,c,y);else if("n"===l)e.createQuadraticRationalBezier(),ce(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===l)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;ue(e.get(),r,c,T,t,-1,-1)}return a}function ue(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new W({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,re(e,t,n,m,0)}function me(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new W({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ie(e,t,n,c,0)}function le(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new W({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,se(e,t,n,a,0)}function ce(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new W({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ae(e,t,n,m,0)}function de(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return _e(e,t,n,r,i);if(o===s.enumBezier)return he(e,t,n,r,i);if(o===s.enumRationalBezier2)return fe(e,t,n,r,i);if(o===s.enumBezier2){const s=new j;return s.constructFromQuadraticSegment(e),he(s,t,n,r,i)}a("")}function _e(e,t,r,i,s){n(!z(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return pe(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s),ke(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ke(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=e;ke(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function he(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp[0].x,e.m_cp[0].y,r,i),ke(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function fe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function pe(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ke(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class be{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){ye(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function ye(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:Te(!0,t,r,a);break;case s.enumPolyline:Te(!1,t,r,a);break;case s.enumMultiPoint:Ne(t,r,a);break;case s.enumPoint:ge(t,r,a);break;case s.enumEnvelope:ve(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),Ae(t,i,a)),a.endObject()}}function Te(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const T=new E;let N=null,g=null,v=null;_&&(N=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=F(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Se(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,z=S,O=w;let I=!1,E=0,B=Number.NaN,P=Number.NaN,V=0;for(let t=m+1,r=m,M=s?n+1:n;t<M;t++,r++){const s=null!==N?31&N.read(r):1;let m,M;if(t<n?(m=p.read(2*t),M=p.read(2*t+1),l&&(B=k.read(t)),c&&(P=b.read(t)),d&&(V=y.read(t))):(m=D,M=F,B=j,P=z,V=O),1!==s){I=!0,4===s?T.createEllipticArc():2===s?T.createCubicBezier():16===s?T.createQuadraticBezier():8===s?T.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=T.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,M),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,B)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,P)),t.readFromBufferStream(v,n);de(T.get(),o,u,e,i)&&E++}else Se(l,c,m,M,B,P,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=M,A=B,S=P,w=V}I&&0===E||(C<2&&E<1&&(Se(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Se(l,c,D,F,j,z,e,i),C++,_=D,x=F,A=j,S=z,w=O,d&&(h.add(O),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function Ne(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Se(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function ge(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function ve(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function xe(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Ae(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),xe(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new T;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Se(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const we={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backspace:"\b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_formfeed:"\f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_lt:"<".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_newline:"\n".charCodeAt(0),s_r:"r".charCodeAt(0),s_carriageReturn:"\r".charCodeAt(0),s_t:"t".charCodeAt(0),s_tab:"\t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ce{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return n(0),!1}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==we.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case we.s_doubleQuote:e+='"';break;case we.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case we.s_backslash:e+="\\";break;case we.s_forwardslash:e+="/";break;case we.s_b:e+="\b";break;case we.s_f:e+="\f";break;case we.s_n:e+="\n";break;case we.s_r:e+="\r";break;case we.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===we.s_asterisk?this.skipCStyleComments_():e===we.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===we.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===we.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===we.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==we.s_doubleQuote;){const n=e===we.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===we.s_doubleQuote||e===we.s_backslash||e===we.s_forwardslash||e===we.s_b||e===we.s_f||e===we.s_n||e===we.s_r||e===we.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===we.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||e>=we.s_a&&e<=we.s_f||e>=we.s_A&&e<=we.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===we.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===we.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==we.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==we.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=we.s_zero&&e<=we.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==we.s_plus&&e!==we.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===we.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=we.s_zero&&n<=we.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===we.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==we.s_e&&n!==we.s_E||this.exp_();else if(n===we.s_e||n===we.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===we.s_beginObject?this.valueStartObject_():e===we.s_beginArray?this.valueStartArray_():e===we.s_doubleQuote?this.valueString_():e===we.s_minus||e>=we.s_zero&&e<=we.s_zero+9?this.valueNumber_():e===we.s_n?this.valueNull_():e===we.s_t?this.valueTrue_():e===we.s_f?this.valueFalse_():e===we.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==we.s_beginObject&&e!==we.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class De{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Ce({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=G(n,e,u,i,s);return new N(m)}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return s.enumPoint}}const Fe=new L,je=new be,ze=new De;function Oe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ie(e,t){const n=new Y(e,{strict:!1});return n.nextToken(),ze.execute(0,s.enumUnknown,n,!0,t)}function Ee(e){let t=null;return[e.map((e=>{if(null==t){const n=Be(e);return t=n.getSpatialReference(),n.getGeometry()}return Pe(e)})),t]}function Be(e){return Ie(e,!0)}function Pe(e){return Ie(e,!1).getGeometry()}function Ve(e,t){return e instanceof N&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Fe.reset(),je.execute(0,e,t,Fe),Fe.getObject())}export{Ee as fromGeometries,Be as fromGeometry,Pe as fromGeometryToGXGeometry,Oe as getSpatialReference,Ve as toGeometry};
5
+ import{c as e,t,g as n,n as r,m as i,G as s,b as a}from"../../../chunks/Geometry.js";import{am as o,i as u,P as m,a as l,an as c,m as d}from"../../../chunks/Point2D.js";import{aA as _,a as h,aB as f,aC as p,c as k,z as b,aD as y,aE as T,aF as N}from"../../../chunks/ProjectionTransformation.js";import{D as g,I as v,P as x,E as A,y as S,z as w,J as C,K as D,t as F}from"../../../chunks/Envelope.js";import{y as j,z,a as O,P as I,S as E,M as B,A as P,B as V,F as M,H as R}from"../../../chunks/QuadraticBezier.js";import"./initNoPeFactory.js";function U(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class Y{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter((t=>void 0!==e[t])),m_i:-1,m_bReturnKey:!0,next:U}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:X}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class L{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class W{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===W.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===W.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function G(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,T=!1,N=!1,S=!1,w=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,B=!1,P=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,X=Number.NaN,Y=Number.NaN,L=Number.NaN,W=Number.NaN,G=Number.NaN,K=Number.NaN,te=Number.NaN,ne=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=J(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=Z(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,P=H(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,V=H(i);continue}}else if("z"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=H(i);continue}}else if("m"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,R=H(i);continue}}else if("id"===u){if(!S&&(e===s.enumUnknown||e===s.enumPoint)){S=!0,U=$(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,X=H(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,Y=H(i);continue}}else if("mmin"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,te=H(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=H(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=$(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,L=H(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,W=H(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,ne=H(i);continue}}else if("zmax"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=H(i);continue}}else if("idmax"===u){if(!B&&(e===s.enumUnknown||e===s.enumEnvelope)){B=!0,ie=$(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=g(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ee(n,me)}else if(b||y||N||T||S){v(P,V)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(P))&&(P=Number.NaN,V=Number.NaN);const e=new x({x:P,y:V});T&&e.setZ(M),N&&e.setM(R),S&&e.setID(U),ce=e}else if(w||C||D||F||j||z||O||I||E||B){(Number.isNaN(Y)||Number.isNaN(L)||Number.isNaN(W))&&(X=Number.NaN);const e=new A({xmin:X,ymin:Y,xmax:L,ymax:W});j&&z&&e.setInterval(1,0,G,K),O&&I&&e.setInterval(2,0,te,ne),E&&B&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function K(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,N=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,z=0,O=0,I=0,E=0,B=0,P=0,V=0,M=0,R="",U="",X=null;for(;3!==e.nextToken();){const _=e.currentString();e.nextToken(),"wkid"===_?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===_?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===_?s||(s=!0,6===e.currentToken()&&(R=e.currentString())):"wkt2"===_?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===_?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===_?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===_?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===_?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===_?m||(m=!0,a=!0,z=e.currentDoubleValue()):"falseX"===_?l||(l=!0,a=!0,B=e.currentDoubleValue()):"falseY"===_?c||(c=!0,a=!0,P=e.currentDoubleValue()):"falseZ"===_?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===_?N||(N=!0,a=!0,M=e.currentDoubleValue()):"xyUnits"===_?g||(g=!0,a=!0,O=e.currentDoubleValue()):"zUnits"===_?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===_?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===_?A||(A=!0,X=K(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let Y=null,L=!0;if(0!==R.length&&(L=!1,_(R)&&(Y=h(R))),Y||0===U.length||(L=!1,_(U)&&(Y=h(U))),!Y&&w>0&&(L=!1,f(w)&&(D<=0||p())&&(Y=k(w,D))),!Y&&S>0&&(L=!1,f(S)&&(C<=0||p())&&(Y=k(S,C))),L&&(Y=b(X)),a&&Y){const e=new T;Y.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,z),g&&l&&c&&e.setGridParams(B,P,O),v&&d&&e.setZParams(V,I),x&&N&&e.setMParams(M,E),Y=y(Y,e)}return Y}function Q(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new I,a=s,o=S(0),u=g(2,0),d=w(0);let _=null,h=null,f=null,p=null,k=null,b=0,y=0,T=0;const N=new E,v=m.getNAN();let x=0,A=0;const D=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,F=!0;const j=4;let z=0,O=0;const I=m.getNAN(),E=new Array(j),B=new Array(j);let P=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())F&&t("failed to parse multipath: starting vertex array is expected"),f||(f=w(x-1,1),p=S(x-1,-1),k=g(0)),P=!0,r=1,({segFlag:T,toPointSz:z}=oe(N,E,v,i));else{for(P=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===j&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),E[z++]=H(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),C(E[0],E[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*x&&u.resize(te(x)),u.writePoint2D(2*x,I.setCoords(E[0],E[1])),_&&_.size()===x&&_.resize(ne(x)),z>2?(_||(_=g(x+1,Number.NaN)),_.write(x,E[2])):_&&_.write(x,Number.NaN),h&&h.size()===x&&h.resize(ne(x)),z>3?(h||(h=g(x+1,Number.NaN)),h.write(x,E[3])):h&&h.write(x,Number.NaN),F)A++,o.add(x),d.add(D),F=!1,O=z,l(B,E,0,0,O);else if(null!==f)if(P){const e=R(T),t=k.size();k.resize(t+e),f.add(T),p.add(b),N.get().writeInBufferStream(k,b),b+=e,a.incCurveType(T,1),y++}else f.add(1),p.add(-1);x++,s++,v.setCoords(E[0],E[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===O&&0===c(E,B,z)?(x--,s--):null!==f&&(f.add(1),p.add(-1)))}return x&&(o.resize(A),d.resize(A),x>0&&(o.add(x),d.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(d),a.setPathStreamRef(o),null!==f&&(a.updateCurveCounter(y),a.setSegmentData(p,k,f,b)),a.notifyModifiedFlags(65535)),{geometry:s,as:_,bs:h}}function J(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new B,s=g(2,0);let a=0;const o=4,u=new Array(o),l=new m;let c=null,d=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=H(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),C(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(te(r)),s.writePoint2D(2*r,l.setCoords(u[0],u[1])),c&&c.size()===r&&c.resize(ne(r)),a>2?(c||(c=g(r+1,Number.NaN)),c.write(r,u[2])):c&&c.write(r,Number.NaN),d&&d.size()===r&&d.resize(ne(r)),a>3?(d||(d=g(r+1,Number.NaN)),d.write(r,u[3])):d&&d.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:c,bs:d}}function Z(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=D(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ne(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function H(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function $(e){return e.currentInt32Value()}function ee(t,n){if(t.isEmpty())return;const r=D(2,0),i=t.getGeometryType();let s=0;i===B.type?s=1:i===I.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===B.type?m=t.getPointCount():i===I.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function te(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ne(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function re(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=m.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,P(e),!1;let u=!!(64&o);const l=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,P(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),P(e),!0}function ie(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,P(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),P(e),!0}function se(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=d(m,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ae(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function oe(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),l=u[0];for((1!==u.length||"a"!==l&&"b"!==l&&"c"!==l&&"n"!==l&&"q"!==l)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=H(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=m.construct(n[0],n[1]),d=m.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[m.getNAN(),m.getNAN(),m.getNAN()],T=m.getNAN();if("a"===l){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=H(i),o=i.nextToken(),k=H(i),o=i.nextToken(),b=H(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===l){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===l){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===l){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),T.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===l)if(e.createEllipticArc(),f){const t=!0;ue(e.get(),r,c,d,t,_,h)}else me(e.get(),r,c,d,_,h,p,k,b);else if("b"===l)e.createCubicBezier(),le(e.get(),r,c,y);else if("n"===l)e.createQuadraticRationalBezier(),ce(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===l)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;ue(e.get(),r,c,T,t,-1,-1)}return a}function ue(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new W({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,re(e,t,n,m,0)}function me(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new W({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ie(e,t,n,c,0)}function le(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new W({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,se(e,t,n,a,0)}function ce(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new W({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ae(e,t,n,m,0)}function de(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return _e(e,t,n,r,i);if(o===s.enumBezier)return he(e,t,n,r,i);if(o===s.enumRationalBezier2)return fe(e,t,n,r,i);if(o===s.enumBezier2){const s=new j;return s.constructFromQuadraticSegment(e),he(s,t,n,r,i)}a("")}function _e(e,t,r,i,s){n(!z(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return pe(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s),ke(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ke(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=e;ke(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function he(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp[0].x,e.m_cp[0].y,r,i),ke(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function fe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function pe(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ke(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class be{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){ye(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function ye(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:Te(!0,t,r,a);break;case s.enumPolyline:Te(!1,t,r,a);break;case s.enumMultiPoint:Ne(t,r,a);break;case s.enumPoint:ge(t,r,a);break;case s.enumEnvelope:ve(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),Ae(t,i,a)),a.endObject()}}function Te(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const T=new E;let N=null,g=null,v=null;_&&(N=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=F(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Se(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,z=S,O=w;let I=!1,E=0,B=Number.NaN,P=Number.NaN,V=0;for(let t=m+1,r=m,M=s?n+1:n;t<M;t++,r++){const s=null!==N?31&N.read(r):1;let m,M;if(t<n?(m=p.read(2*t),M=p.read(2*t+1),l&&(B=k.read(t)),c&&(P=b.read(t)),d&&(V=y.read(t))):(m=D,M=F,B=j,P=z,V=O),1!==s){I=!0,4===s?T.createEllipticArc():2===s?T.createCubicBezier():16===s?T.createQuadraticBezier():8===s?T.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=T.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,M),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,B)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,P)),t.readFromBufferStream(v,n);de(T.get(),o,u,e,i)&&E++}else Se(l,c,m,M,B,P,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=M,A=B,S=P,w=V}I&&0===E||(C<2&&E<1&&(Se(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Se(l,c,D,F,j,z,e,i),C++,_=D,x=F,A=j,S=z,w=O,d&&(h.add(O),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function Ne(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Se(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function ge(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function ve(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function xe(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Ae(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),xe(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new T;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Se(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const we={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backspace:"\b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_formfeed:"\f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_lt:"<".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_newline:"\n".charCodeAt(0),s_r:"r".charCodeAt(0),s_carriageReturn:"\r".charCodeAt(0),s_t:"t".charCodeAt(0),s_tab:"\t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ce{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return n(0),!1}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==we.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case we.s_doubleQuote:e+='"';break;case we.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case we.s_backslash:e+="\\";break;case we.s_forwardslash:e+="/";break;case we.s_b:e+="\b";break;case we.s_f:e+="\f";break;case we.s_n:e+="\n";break;case we.s_r:e+="\r";break;case we.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===we.s_asterisk?this.skipCStyleComments_():e===we.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===we.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===we.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===we.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==we.s_doubleQuote;){const n=e===we.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===we.s_doubleQuote||e===we.s_backslash||e===we.s_forwardslash||e===we.s_b||e===we.s_f||e===we.s_n||e===we.s_r||e===we.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===we.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||e>=we.s_a&&e<=we.s_f||e>=we.s_A&&e<=we.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===we.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===we.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==we.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==we.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=we.s_zero&&e<=we.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==we.s_plus&&e!==we.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===we.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=we.s_zero&&n<=we.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===we.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==we.s_e&&n!==we.s_E||this.exp_();else if(n===we.s_e||n===we.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===we.s_beginObject?this.valueStartObject_():e===we.s_beginArray?this.valueStartArray_():e===we.s_doubleQuote?this.valueString_():e===we.s_minus||e>=we.s_zero&&e<=we.s_zero+9?this.valueNumber_():e===we.s_n?this.valueNull_():e===we.s_t?this.valueTrue_():e===we.s_f?this.valueFalse_():e===we.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==we.s_beginObject&&e!==we.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class De{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Ce({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=G(n,e,u,i,s);return new N(m)}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return s.enumPoint}}const Fe=new L,je=new be,ze=new De;function Oe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ie(e,t){const n=new Y(e,{strict:!1});return n.nextToken(),ze.execute(0,s.enumUnknown,n,!0,t)}function Ee(e){let t=null;return[e.map((e=>{if(null==t){const n=Be(e);return t=n.getSpatialReference(),n.getGeometry()}return Pe(e)})),t]}function Be(e){return Ie(e,!0)}function Pe(e){return Ie(e,!1).getGeometry()}function Ve(e,t){return e instanceof N&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Fe.reset(),je.execute(0,e,t,Fe),Fe.getObject())}export{Ee as fromGeometries,Be as fromGeometry,Pe as fromGeometryToGXGeometry,Oe as getSpatialReference,Ve as toGeometry};
package/interfaces.d.ts CHANGED
@@ -4300,6 +4300,18 @@ declare namespace __esri {
4300
4300
  signal?: AbortSignal | nullish;
4301
4301
  }
4302
4302
 
4303
+ /**
4304
+ * Represents the full definition for a shared template, typically obtained from the
4305
+ * `sharedTemplates/templates` endpoint of a feature service.
4306
+ *
4307
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-editing-sharedTemplates-SharedTemplate.html Read more...}
4308
+ */
4309
+ interface SharedTemplate {
4310
+ readonly type: "feature" | "group" | "preset";
4311
+ }
4312
+
4313
+ export const SharedTemplate: SharedTemplate;
4314
+
4303
4315
  /**
4304
4316
  * Represents the info for a shared template, typically obtained from the
4305
4317
  * `sharedTemplates/query` endpoint of a feature service.
@@ -93909,15 +93921,21 @@ declare namespace __esri {
93909
93921
  * Highlights the given feature(s).
93910
93922
  *
93911
93923
  * @param target The feature(s) to highlight. The graphics that are passed to this function must originate from one of the component sublayers of the BuildigSceneLayer.
93924
+ * @param parameters Optional parameters specifying how to highlight features.
93925
+ * @param parameters.name The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-support-HighlightOptions.html#name name} of the highlight options from the view's {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#highlights highlights} collection. The features will be highlighted according to the specified highlight options. If the `name` parameter is not provided, the feature(s) will be highlighted using the `default` highlight options.
93912
93926
  *
93913
93927
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-BuildingSceneLayerView.html#highlight Read more...}
93914
93928
  */
93915
- highlight(target: Graphic | Graphic[]): Handle;
93929
+ highlight(target: Graphic | Graphic[], parameters?: BuildingSceneLayerViewHighlightParameters): Handle;
93916
93930
  }
93917
93931
 
93918
93932
  interface BuildingSceneLayerViewProperties extends LayerViewProperties {
93919
93933
  }
93920
93934
 
93935
+ export interface BuildingSceneLayerViewHighlightParameters {
93936
+ name?: string;
93937
+ }
93938
+
93921
93939
  export class CatalogDynamicGroupLayerView extends LayerView {
93922
93940
  /**
93923
93941
  * A collection of layer views within the CatalogDynamicGroupLayerView.
@@ -108602,6 +108620,13 @@ declare namespace __esri {
108602
108620
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflowData.html#creationInfo Read more...}
108603
108621
  */
108604
108622
  creationInfo: CreationInfo | nullish;
108623
+ /**
108624
+ * The full version of the template referenced by the property
108625
+ * `creationInfo.template`.
108626
+ *
108627
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflowData.html#fullTemplate Read more...}
108628
+ */
108629
+ fullTemplate: FeatureTemplate | SharedTemplate | nullish;
108605
108630
  /**
108606
108631
  * Returns a collection of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html graphics} representing features that have been created during the workflow.
108607
108632
  *
@@ -108629,6 +108654,13 @@ declare namespace __esri {
108629
108654
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflowData.html#creationInfo Read more...}
108630
108655
  */
108631
108656
  creationInfo?: CreationInfo | nullish;
108657
+ /**
108658
+ * The full version of the template referenced by the property
108659
+ * `creationInfo.template`.
108660
+ *
108661
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflowData.html#fullTemplate Read more...}
108662
+ */
108663
+ fullTemplate?: FeatureTemplate | SharedTemplate | nullish;
108632
108664
  /**
108633
108665
  * The associated {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html EditorViewModel} for this workflow.
108634
108666
  *
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as U}from"./support/imageUtils.js";import I from"./support/SpriteSource.js";import R from"./support/TileInfo.js";import{TilemapCache as O}from"./support/TilemapCache.js";import{loadMetadata as P}from"./support/vectorTileLayerLoader.js";import{createForItemRead as M}from"../portal/support/jsonContext.js";import{parseKnownArcGISOnlineDomain as C}from"../portal/support/urlUtils.js";import{e as V}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as D,unionTileInfos as k}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import E from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as N}from"../views/webgl/capabilities.js";let B=class extends(_(L(x(v(j(b(T(w(g(s(f))))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(l).then((async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},M(this.portalItem,"portal-item"))})).catch(l).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=C(e);t.styleUrl=V(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r<e.length;r++)D(t,e[r].tileInfo)&&(t=k(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new O({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=N().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,o=new I({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await o.load(t),this._spriteSourceMap.set(e,o)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=N().maxTextureSize,i=e.spriteUrl,o=i?n(i,{...this.customParameters,token:this.apiKey}):null;if(!o&&"url"===e.type)return null;const s=new I(e,r);try{await s.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,s),o&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=o),this.emit("spriteSource-change",{spriteSource:s}),s}catch(a){l(a)}return null}async loadStyle(e,t){const i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=r((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await P(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await U("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new E(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||"";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.arcgis.com/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],B.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],B.prototype,"listMode",void 0),e([u({json:{read:!0,write:!0}})],B.prototype,"blendMode",void 0),e([u({readOnly:!0,json:{read:!1}})],B.prototype,"capabilities",null),e([u({readOnly:!0})],B.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],B.prototype,"fullExtent",null),e([u({json:{read:!1},readOnly:!0,type:d})],B.prototype,"initialExtent",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],B.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],B.prototype,"parsedUrl",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,"path",void 0),e([u({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],B.prototype,"refreshInterval",void 0),e([u()],B.prototype,"style",void 0),e([u({readOnly:!0})],B.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],B.prototype,"spatialReference",null),e([u({readOnly:!0})],B.prototype,"styleRepository",void 0),e([u({readOnly:!0})],B.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],B.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],B.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],B.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],B.prototype,"tileInfo",null),e([u()],B.prototype,"tilemapCache",void 0),e([c("service","tilemapCache",["capabilities","tileInfo"])],B.prototype,"readTilemapCache",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],B.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],B.prototype,"url",void 0),e([u({readOnly:!0})],B.prototype,"version",void 0),e([c("version",["version","currentVersion"])],B.prototype,"readVersion",null),B=e([m("esri.layers.VectorTileLayer")],B);const A=B;export{A as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as U}from"./support/imageUtils.js";import I from"./support/SpriteSource.js";import R from"./support/TileInfo.js";import{TilemapCache as O}from"./support/TilemapCache.js";import{loadMetadata as P}from"./support/vectorTileLayerLoader.js";import{createForItemRead as M}from"../portal/support/jsonContext.js";import{parseKnownArcGISOnlineDomain as C}from"../portal/support/urlUtils.js";import{e as V}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as D,unionTileInfos as k}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import E from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as N}from"../views/webgl/capabilities.js";let B=class extends(_(L(x(v(j(b(T(w(g(s(f))))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(l).then((async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:r},M(this.portalItem,"portal-item"))})).catch(l).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=C(e);t.styleUrl=V(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r<e.length;r++)D(t,e[r].tileInfo)&&(t=k(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new O({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=N().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,o=new I({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await o.load(t),this._spriteSourceMap.set(e,o)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=N().maxTextureSize,i=e.spriteUrl,o=i?n(i,{...this.customParameters,token:this.apiKey}):null;if(!o&&"url"===e.type)return null;const s=new I(e,r);try{await s.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,s),o&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=o),this.emit("spriteSource-change",{spriteSource:s}),s}catch(a){l(a)}return null}async loadStyle(e,t){const i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=r((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await P(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await U("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new E(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||"";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.arcgis.com/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],B.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],B.prototype,"listMode",void 0),e([u({json:{read:!0,write:!0}})],B.prototype,"blendMode",void 0),e([u({readOnly:!0,json:{read:!1}})],B.prototype,"capabilities",null),e([u({readOnly:!0})],B.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],B.prototype,"fullExtent",null),e([u({json:{read:!1},readOnly:!0,type:d})],B.prototype,"initialExtent",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],B.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],B.prototype,"parsedUrl",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,"path",void 0),e([u({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],B.prototype,"refreshInterval",void 0),e([u()],B.prototype,"style",void 0),e([u({readOnly:!0})],B.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],B.prototype,"spatialReference",null),e([u({readOnly:!0})],B.prototype,"styleRepository",void 0),e([u({readOnly:!0})],B.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],B.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],B.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],B.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],B.prototype,"tileInfo",null),e([u()],B.prototype,"tilemapCache",void 0),e([c("service","tilemapCache",["capabilities","tileInfo"])],B.prototype,"readTilemapCache",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],B.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],B.prototype,"url",void 0),e([u({readOnly:!0})],B.prototype,"version",void 0),e([c("version",["version","currentVersion"])],B.prototype,"readVersion",null),B=e([m("esri.layers.VectorTileLayer")],B);const A=B;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const e={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},r={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},a={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},S={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":e,"web-map/basemap":r,"web-map/tables":a,"link-chart/operational-layers":{...e,LinkChartLayer:!0},"link-chart/basemap":r,"link-chart/tables":a,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0,WCS:!0}};export{S as supportedTypes};
5
+ const e={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},r={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},a={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},S={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":e,"web-map/basemap":r,"web-map/tables":a,"link-chart/operational-layers":{...e,LinkChartLayer:!0},"link-chart/basemap":r,"link-chart/tables":a,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0,WCS:!0},"portal-item/tables":{ArcGISFeatureLayer:!0,SubtypeGroupTable:!0}};export{S as supportedTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{equals as e,difference as a,isSome as r}from"../../core/arrayUtils.js";import"../../core/has.js";import t from"../../core/Error.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import{save as s,createJSONContextForWrite as o,getLayerJSON as i,saveAs as l,getPortalItem as c,addItem as u,ensureLayerConfig as y,ensureItemConfig as p,setCommonItemProperties as f,createErrorMessage as m}from"./utils.js";import{parse as d}from"../support/arcgisLayerUrl.js";import{fetchFeatureService as h,getLayerModuleType as w}from"../support/fetchService.js";import{isLayerWithFeatureLayerSource as v}from"../support/layerUtils.js";import{getWGS84ExtentForItem as I,removeTypeKeyword as T,typeKeyword as E,toggleTypeKeyword as L,addTypeKeyword as b}from"../../portal/support/portalItemUtils.js";const S="Feature Service",A="feature-layer-utils",P=`${A}-save`,g=`${A}-save-as`,N=`${A}-saveall`,O=`${A}-saveall-as`;function $(e){return{isValid:v(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function x(e){const a=[],r=[];for(const{layer:t,layerJSON:n}of e)t.isTable?r.push(n):a.push(n);return{layers:a,tables:r}}function j(e){return x([e])}async function R(e,a){return/\/\d+\/?$/.test(e.url)?j(a[0]):U(a,e)}async function U(e,a){if(e.reverse(),!a)return x(e);const r=await M(a,e);for(const t of e)B(t.layer,t.layerJSON,r);return J(r,e),r}async function M(e,a){let r=await e.fetchData("json");if(D(r))return r;r||={},F(r);const{layer:{url:t,customParameters:n,apiKey:s}}=a[0];return await G(r,{url:t??"",customParameters:n,apiKey:s},a.map((e=>e.layer.layerId))),r}function D(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function F(e){e.layers||=[],e.tables||=[]}function J(e,a){const r=[],t=[];for(const{layer:n}of a){const{isTable:e,layerId:a}=n;e?t.push(a):r.push(a)}Y(e.layers,r),Y(e.tables,t)}function Y(a,r){if(a.length<2)return;const t=[];for(const{id:e}of a)t.push(e);e(t.sort(_),r.slice().sort(_))&&a.sort(((e,a)=>{const t=r.indexOf(e.id),n=r.indexOf(a.id);return t<n?-1:t>n?1:0}))}function _(e,a){return e<a?-1:e>a?1:0}async function G(e,a,r){const{url:t,customParameters:n,apiKey:s}=a,{serviceJSON:o,layersJSON:i}=await h(t,{customParameters:n,apiKey:s}),l=K(e.layers,o.layers,r),c=K(e.tables,o.tables,r);e.layers=l.itemResources,e.tables=c.itemResources;const u=[...l.added,...c.added],y=i?[...i.layers,...i.tables]:[];await k(e,u,t,y)}function K(e,r,t){const n=a(e,r,((e,a)=>e.id===a.id));e=e.filter((e=>!n.removed.some((a=>a.id===e.id))));const s=n.added;return s.forEach((({id:a})=>{e.push({id:a})})),{itemResources:e,added:s.filter((({id:e})=>!t.includes(e)))}}async function k(e,a,r,t){const n=await z(a),s=a.map((({id:e,type:a})=>new(n.get(a))({url:r,layerId:e,sourceJSON:t.find((({id:a})=>a===e))})));await Promise.allSettled(s.map((e=>e.load()))),s.forEach((a=>{const{layerId:r,loaded:t,defaultPopupTemplate:n}=a;if(!t||null==n)return;const s={id:r,popupInfo:n.toJSON()};"ArcGISFeatureLayer"!==a.operationalLayerType&&(s.layerType=a.operationalLayerType),B(a,s,e)}))}async function z(e){const a=[];e.forEach((({type:e})=>{switch(w(e)){case"CatalogLayer":a.push(import("../CatalogLayer.js").then((e=>e.default)));break;case"FeatureLayer":a.push(import("../FeatureLayer.js").then((e=>e.default)));break;case"OrientedImageryLayer":a.push(import("../OrientedImageryLayer.js").then((e=>e.default)))}}));const r=await Promise.all(a),t=new Map;return e.forEach((({type:e},a)=>{t.set(e,r[a])})),t}function B(e,a,r){e.isTable?C(r.tables,a):C(r.layers,a)}function C(e,a){const r=e.findIndex((({id:e})=>e===a.id));-1===r?e.push(a):e[r]=a}function V(e,a){if(!e.length)throw new t(`${a}:missing-parameters`,"'layers' array should contain at least one feature layer")}function q(e,a){const r=e.map((e=>e.portalItem.id));if(new Set(r).size>1)throw new t(`${a}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function H(e,a){const r=e.map((e=>e.layerId));if(new Set(r).size!==r.length)throw new t(`${a}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function Q(e){V(e,N),await Promise.all(e.map((e=>e.load())));for(const a of e)y(a,N,$),p({layer:a,itemType:S,errorNamePrefix:N});q(e,N),H(e,N)}function W(e,a){const r=e.layers.some((e=>"OrientedImageryLayer"===e.layerType));L(a,E.ORIENTED_IMAGERY_LAYER,r)}function X(e,a){const r=e.some((e=>"oriented-imagery"===e.type));L(a,E.ORIENTED_IMAGERY_LAYER,r)}async function Z(e,a,r){W(r,a)}async function ee(e,a){const{url:r,layerId:t,title:n,fullExtent:s,isTable:o}=e,i=d(r);a.url=("FeatureServer"===i?.serverType?r:`${r}/${t}`)??null,a.title||=n,a.extent=null,o||null==s||(a.extent=await I(s)),T(a,E.METADATA),T(a,E.MULTI_LAYER),b(a,E.SINGLE_LAYER),L(a,E.TABLE,o),X([e],a)}function ae(e,a){for(const o of e){const r=o.parsedUrl.path,n=d(r),s=n?.url.path;if(!s)throw new t(`${a}:invalid-parameters`,m(o,`has unsupported url pattern: ${r}`),{layer:o});const i=n?.serverType;if("FeatureServer"!==i&&"MapServer"!==i)throw new t(`${a}:invalid-parameters`,m(o,`has unsupported server type: ${i}`),{layer:o});if("MapServer"===i&&e.length>1)throw new t(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const r=d(e[0].parsedUrl.path),n=r?.url.path,s=e.every((e=>{const a=d(e.parsedUrl.path);return a?.url.path===n}));if(!s)throw new t(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function re(e){V(e,O),await Promise.all(e.map((e=>e.load())));for(const a of e)y(a,O,$);ae(e,O),H(e,O)}function te(e,a){W(a,e),f(e)}async function ne(e,a){let t=0,n=0;for(const{isTable:r}of a)r?n++:t++;const s=a[0].parsedUrl.path,o=d(s);if(e.url="FeatureServer"===o?.serverType?o.url.path:s,e.title||=o.title,e.extent=null,t>0){const t=a.map((e=>e.fullExtent)).filter(r).reduce(((e,a)=>e.clone().union(a)));t&&(e.extent=await I(t))}T(e,E.METADATA),L(e,E.MULTI_LAYER,a.length>1),L(e,E.SINGLE_LAYER,1===a.length),L(e,E.TABLE,n>0&&0===t),X(a,e),f(e)}async function se(e,a){return s({layer:e,itemType:S,validateLayer:$,createItemData:(e,a)=>R(a,[e]),errorNamePrefix:P,setItemProperties:Z},a)}async function oe(e,a){await Q(e);const r=e[0].portalItem,t=o(r),s=await Promise.all(e.map((e=>i(e,t,a)))),l=await R(r,e.map(((e,a)=>({layer:e,layerJSON:s[a]}))));return te(r,l),await r.update({data:l}),await Promise.all(e.slice(1).map((e=>e.portalItem.reload()))),n(t),r.clone()}async function ie(e,a,r){return l({layer:e,itemType:S,validateLayer:$,createItemData:(e,a)=>Promise.resolve(j(e)),errorNamePrefix:g,newItem:a,setItemProperties:ee},r)}async function le(e,a,r){await re(e);const t=c({itemType:S,errorNamePrefix:O,newItem:a}),s=o(t),l=await Promise.all(e.map((e=>i(e,s,r)))),y=await U(e.map(((e,a)=>({layer:e,layerJSON:l[a]}))));await ne(t,e),await u(t,y,r);for(const n of e)n.portalItem=t.clone();return n(s),t}export{se as save,oe as saveAll,le as saveAllAs,ie as saveAs};
5
+ import{equals as e,difference as r,isSome as a}from"../../core/arrayUtils.js";import"../../core/has.js";import t from"../../core/Error.js";import{updateOrigins as o}from"../../core/accessorSupport/originUtils.js";import{save as n,getLayerJSON as s,saveAs as i,getPortalItem as l,addItem as c,ensureLayerConfig as u,ensureItemConfig as y,setCommonItemProperties as p,createErrorMessage as f}from"./utils.js";import{parse as m}from"../support/arcgisLayerUrl.js";import{fetchFeatureService as d,getLayerModuleType as h}from"../support/fetchService.js";import{isLayerWithFeatureLayerSource as w}from"../support/layerUtils.js";import{createForItemWrite as T}from"../../portal/support/jsonContext.js";import{getWGS84ExtentForItem as v,removeTypeKeyword as b,typeKeyword as I,toggleTypeKeyword as L,addTypeKeyword as S}from"../../portal/support/portalItemUtils.js";const E="Feature Service",A="feature-layer-utils",P=`${A}-save`,g=`${A}-save-as`,N=`${A}-saveall`,O=`${A}-saveall-as`;function x(e){return{isValid:w(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function $(e,r){const a=T(e,"portal-item");return r?.isTable&&(a.layerContainerType="tables"),a}function j(e){const r=$(e),a=$(e);return a.layerContainerType="tables",{forLayers:r,forTables:a}}function R(e){const r=[],a=[];for(const{layer:t,layerJSON:o}of e)t.isTable?a.push(o):r.push(o);return{layers:r,tables:a}}function U(e){return R([e])}async function J(e,r){return/\/\d+\/?$/.test(e.url)?U(r[0]):M(r,e)}async function M(e,r){if(e.reverse(),!r)return R(e);const a=await D(r,e);for(const t of e)V(t.layer,t.layerJSON,a);return _(a,e),a}async function D(e,r){let a=await e.fetchData("json");if(F(a))return a;a||={},Y(a);const{layer:{url:t,customParameters:o,apiKey:n}}=r[0];return await K(a,{url:t??"",customParameters:o,apiKey:n},r.map((e=>e.layer.layerId))),a}function F(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function Y(e){e.layers||=[],e.tables||=[]}function _(e,r){const a=[],t=[];for(const{layer:o}of r){const{isTable:e,layerId:r}=o;e?t.push(r):a.push(r)}C(e.layers,a),C(e.tables,t)}function C(r,a){if(r.length<2)return;const t=[];for(const{id:e}of r)t.push(e);e(t.sort(G),a.slice().sort(G))&&r.sort(((e,r)=>{const t=a.indexOf(e.id),o=a.indexOf(r.id);return t<o?-1:t>o?1:0}))}function G(e,r){return e<r?-1:e>r?1:0}async function K(e,r,a){const{url:t,customParameters:o,apiKey:n}=r,{serviceJSON:s,layersJSON:i}=await d(t,{customParameters:o,apiKey:n}),l=k(e.layers,s.layers,a),c=k(e.tables,s.tables,a);e.layers=l.itemResources,e.tables=c.itemResources;const u=[...l.added,...c.added],y=i?[...i.layers,...i.tables]:[];await z(e,u,t,y)}function k(e,a,t){const o=r(e,a,((e,r)=>e.id===r.id));e=e.filter((e=>!o.removed.some((r=>r.id===e.id))));const n=o.added;return n.forEach((({id:r})=>{e.push({id:r})})),{itemResources:e,added:n.filter((({id:e})=>!t.includes(e)))}}async function z(e,r,a,t){const o=await B(r),n=r.map((({id:e,type:r})=>new(o.get(r))({url:a,layerId:e,sourceJSON:t.find((({id:r})=>r===e))})));await Promise.allSettled(n.map((e=>e.load()))),n.forEach((r=>{const{layerId:a,loaded:t,defaultPopupTemplate:o}=r;if(!t||null==o)return;const n={id:a,popupInfo:o.toJSON()};"ArcGISFeatureLayer"!==r.operationalLayerType&&(n.layerType=r.operationalLayerType),V(r,n,e)}))}async function B(e){const r=[];e.forEach((({type:e})=>{switch(h(e)){case"CatalogLayer":r.push(import("../CatalogLayer.js").then((e=>e.default)));break;case"FeatureLayer":r.push(import("../FeatureLayer.js").then((e=>e.default)));break;case"OrientedImageryLayer":r.push(import("../OrientedImageryLayer.js").then((e=>e.default)))}}));const a=await Promise.all(r),t=new Map;return e.forEach((({type:e},r)=>{t.set(e,a[r])})),t}function V(e,r,a){e.isTable?q(a.tables,r):q(a.layers,r)}function q(e,r){const a=e.findIndex((({id:e})=>e===r.id));-1===a?e.push(r):e[a]=r}function H(e,r){if(!e.length)throw new t(`${r}:missing-parameters`,"'layers' array should contain at least one feature layer")}function Q(e,r){const a=e.map((e=>e.portalItem.id));if(new Set(a).size>1)throw new t(`${r}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function W(e,r){const a=e.map((e=>e.layerId));if(new Set(a).size!==a.length)throw new t(`${r}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function X(e){H(e,N),await Promise.all(e.map((e=>e.load())));for(const r of e)u(r,N,x),y({layer:r,itemType:E,errorNamePrefix:N});Q(e,N),W(e,N)}function Z(e,r){const a=e.layers.some((e=>"OrientedImageryLayer"===e.layerType));L(r,I.ORIENTED_IMAGERY_LAYER,a)}function ee(e,r){const a=e.some((e=>"oriented-imagery"===e.type));L(r,I.ORIENTED_IMAGERY_LAYER,a)}async function re(e,r,a){Z(a,r)}async function ae(e,r){const{url:a,layerId:t,title:o,fullExtent:n,isTable:s}=e,i=m(a);r.url=("FeatureServer"===i?.serverType?a:`${a}/${t}`)??null,r.title||=o,r.extent=null,s||null==n||(r.extent=await v(n)),b(r,I.METADATA),b(r,I.MULTI_LAYER),S(r,I.SINGLE_LAYER),L(r,I.TABLE,s),ee([e],r)}function te(e,r){for(const s of e){const a=s.parsedUrl.path,o=m(a),n=o?.url.path;if(!n)throw new t(`${r}:invalid-parameters`,f(s,`has unsupported url pattern: ${a}`),{layer:s});const i=o?.serverType;if("FeatureServer"!==i&&"MapServer"!==i)throw new t(`${r}:invalid-parameters`,f(s,`has unsupported server type: ${i}`),{layer:s});if("MapServer"===i&&e.length>1)throw new t(`${r}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const a=m(e[0].parsedUrl.path),o=a?.url.path,n=e.every((e=>{const r=m(e.parsedUrl.path);return r?.url.path===o}));if(!n)throw new t(`${r}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function oe(e){H(e,O),await Promise.all(e.map((e=>e.load())));for(const r of e)u(r,O,x);te(e,O),W(e,O)}function ne(e,r){Z(r,e),p(e)}async function se(e,r){let t=0,o=0;for(const{isTable:a}of r)a?o++:t++;const n=r[0].parsedUrl.path,s=m(n);if(e.url="FeatureServer"===s?.serverType?s.url.path:n,e.title||=s.title,e.extent=null,t>0){const t=r.map((e=>e.fullExtent)).filter(a).reduce(((e,r)=>e.clone().union(r)));t&&(e.extent=await v(t))}b(e,I.METADATA),L(e,I.MULTI_LAYER,r.length>1),L(e,I.SINGLE_LAYER,1===r.length),L(e,I.TABLE,o>0&&0===t),ee(r,e),p(e)}async function ie(e,r){return n({layer:e,itemType:E,validateLayer:x,createJSONContext:r=>$(r,e),createItemData:(e,r)=>J(r,[e]),errorNamePrefix:P,setItemProperties:re},r)}async function le(e,r){await X(e);const a=e[0].portalItem,t=j(a),n=await Promise.all(e.map((e=>s(e,e.isTable?t.forTables:t.forLayers,r)))),i=await J(a,e.map(((e,r)=>({layer:e,layerJSON:n[r]}))));return ne(a,i),await a.update({data:i}),await Promise.all(e.slice(1).map((e=>e.portalItem.reload()))),o(t.forLayers),o(t.forTables),a.clone()}async function ce(e,r,a){return i({layer:e,itemType:E,validateLayer:x,createJSONContext:r=>$(r,e),createItemData:(e,r)=>Promise.resolve(U(e)),errorNamePrefix:g,newItem:r,setItemProperties:ae},a)}async function ue(e,r,a){await oe(e);const t=l({itemType:E,errorNamePrefix:O,newItem:r}),n=j(t),i=await Promise.all(e.map((e=>s(e,e.isTable?n.forTables:n.forLayers,a)))),u=await M(e.map(((e,r)=>({layer:e,layerJSON:i[r]}))));await se(t,e),await c(t,u,a);for(const o of e)o.portalItem=t.clone();return o(n.forLayers),o(n.forTables),t}export{ie as save,le as saveAll,ue as saveAllAs,ce as saveAs};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{updateOrigins as t}from"../../core/accessorSupport/originUtils.js";import r from"../../portal/Portal.js";import a from"../../portal/PortalItem.js";import{createForItemWrite as o}from"../../portal/support/jsonContext.js";import{addTypeKeyword as i,typeKeyword as n}from"../../portal/support/portalItemUtils.js";import{evaluateWriteErrors as s}from"../../webdoc/support/saveUtils.js";function p(t,r,a){const o=a(t);if(!o.isValid)throw new e(`${r}:invalid-parameters`,o.errorMessage,{layer:t})}async function l(e){const{layer:t,errorNamePrefix:r,validateLayer:a}=e;await t.load(),p(t,r,a)}function m(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function c(t){const{item:r,errorNamePrefix:a,layer:o,validateItem:i}=t;if(u(t),i){const t=i(r);if(!t.isValid)throw new e(`${a}:invalid-parameters`,t.errorMessage,{layer:o})}}function u(t){const{item:r,itemType:a,additionalItemType:o,errorNamePrefix:i,layer:n}=t,s=[a];if(o&&s.push(o),!s.includes(r.type)){const t=s.map((e=>`'${e}'`)).join(", ");throw new e(`${i}:portal-item-wrong-type`,`Portal item type should be one of: "${t}"`,{item:r,layer:n})}}function f(t){const{layer:r,errorNamePrefix:a}=t,{portalItem:o}=r;if(!o)throw new e(`${a}:portal-item-not-set`,m(r,"requires the portalItem property to be set"));if(!o.loaded)throw new e(`${a}:portal-item-not-loaded`,m(r,"cannot be saved to a portal item that does not exist or is inaccessible"));c({...t,item:o})}function d(e){const{newItem:t,itemType:o}=e;let i=a.from(t);return i.id&&(i=i.clone(),i.id=null),i.type??=o,i.portal??=r.getDefault(),c({...e,item:i}),i}function y(e){return o(e,"portal-item")}async function w(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),s(t,{errorName:"layer-write:unsupported"},r),a}function I(e){i(e,n.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function v(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}async function P(e,r){const{layer:a,createItemData:o,createJSONContext:i,setItemProperties:n,saveResources:s,supplementalUnsupportedErrors:p}=e;await l(e),f(e);const m=a.portalItem,c=i?i(m):y(m),u=await w(a,c,{...r,supplementalUnsupportedErrors:p}),d=await o({layer:a,layerJSON:u},m);return await(n?.(a,m,d)),I(m),await m.update({data:d}),t(c),await(s?.(m,c)),m}async function $(e,r){const{layer:a,createItemData:o,createJSONContext:i,setItemProperties:n,saveResources:s,supplementalUnsupportedErrors:p}=e;await l(e);const m=d(e),c=i?i(m):y(m),u=await w(a,c,{...r,supplementalUnsupportedErrors:p}),f=await o({layer:a,layerJSON:u},m);return await n(a,m,f),I(m),await v(m,f,r),a.portalItem=m,t(c),await(s?.(m,c)),m}export{v as addItem,m as createErrorMessage,y as createJSONContextForWrite,f as ensureItemConfig,p as ensureLayerConfig,w as getLayerJSON,d as getPortalItem,P as save,$ as saveAs,I as setCommonItemProperties};
5
+ import e from"../../core/Error.js";import{updateOrigins as t}from"../../core/accessorSupport/originUtils.js";import r from"../../portal/Portal.js";import a from"../../portal/PortalItem.js";import{createForItemWrite as o}from"../../portal/support/jsonContext.js";import{addTypeKeyword as i,typeKeyword as n}from"../../portal/support/portalItemUtils.js";import{evaluateWriteErrors as s}from"../../webdoc/support/saveUtils.js";function p(t,r,a){const o=a(t);if(!o.isValid)throw new e(`${r}:invalid-parameters`,o.errorMessage,{layer:t})}async function l(e){const{layer:t,errorNamePrefix:r,validateLayer:a}=e;await t.load(),p(t,r,a)}function m(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function c(t){const{item:r,errorNamePrefix:a,layer:o,validateItem:i}=t;if(u(t),i){const t=i(r);if(!t.isValid)throw new e(`${a}:invalid-parameters`,t.errorMessage,{layer:o})}}function u(t){const{item:r,itemType:a,additionalItemType:o,errorNamePrefix:i,layer:n}=t,s=[a];if(o&&s.push(o),!s.includes(r.type)){const t=s.map((e=>`'${e}'`)).join(", ");throw new e(`${i}:portal-item-wrong-type`,`Portal item type should be one of: "${t}"`,{item:r,layer:n})}}function f(t){const{layer:r,errorNamePrefix:a}=t,{portalItem:o}=r;if(!o)throw new e(`${a}:portal-item-not-set`,m(r,"requires the portalItem property to be set"));if(!o.loaded)throw new e(`${a}:portal-item-not-loaded`,m(r,"cannot be saved to a portal item that does not exist or is inaccessible"));c({...t,item:o})}function d(e){const{newItem:t,itemType:o}=e;let i=a.from(t);return i.id&&(i=i.clone(),i.id=null),i.type??=o,i.portal??=r.getDefault(),c({...e,item:i}),i}function y(e){return o(e,"portal-item")}async function w(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),s(t,{errorName:"layer-write:unsupported"},r),a}function I(e){i(e,n.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function v(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}async function P(e,r){const{layer:a,createItemData:o,createJSONContext:i,setItemProperties:n,saveResources:s,supplementalUnsupportedErrors:p}=e;await l(e),f(e);const m=a.portalItem,c=i?i(m):y(m),u=await w(a,c,{...r,supplementalUnsupportedErrors:p}),d=await o({layer:a,layerJSON:u},m);return await(n?.(a,m,d)),I(m),await m.update({data:d}),t(c),await(s?.(m,c)),m}async function $(e,r){const{layer:a,createItemData:o,createJSONContext:i,setItemProperties:n,saveResources:s,supplementalUnsupportedErrors:p}=e;await l(e);const m=d(e),c=i?i(m):y(m),u=await w(a,c,{...r,supplementalUnsupportedErrors:p}),f=await o({layer:a,layerJSON:u},m);return await n(a,m,f),I(m),await v(m,f,r),a.portalItem=m,t(c),await(s?.(m,c)),m}export{v as addItem,m as createErrorMessage,f as ensureItemConfig,p as ensureLayerConfig,w as getLayerJSON,d as getPortalItem,P as save,$ as saveAs,I as setCommonItemProperties};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as t}from"../../webdoc/support/opacityUtils.js";const s={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:e}}},l={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,n){r[n]=!e}}}},p={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:e}}},y={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},d={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:e}}},c={value:null,type:a,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:e}}};function m(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const w={write:{enabled:!0,layerContainerTypes:e},read:!0},f={type:Number,json:{origins:{"web-document":w,"portal-item":{write:!0}}}},b={...f,json:{...f.json,origins:{"web-document":{...w,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,n)=>n&&"service"!==n.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?t(r.layerDefinition.drawingInfo.transparency):void 0:t(r.drawingInfo.transparency)}}},g={type:r,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,i)=>{const a=r.fromJSON(e);return null!=i.spatialReference&&"object"==typeof i.spatialReference&&(a.spatialReference=n.fromJSON(i.spatialReference)),a}}}},read:!1}},u={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},j={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:e}}},v={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:e}}},I={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},T={type:o,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{T as attributeTableTemplate,c as elevationInfo,u as id,p as labelsVisible,d as legendEnabled,I as listMode,v as maxScale,j as minScale,f as opacity,b as opacityDrawingInfo,l as popupEnabled,m as readOnlyService,g as sceneLayerFullExtent,s as screenSizePerspectiveEnabled,y as url};
5
+ import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as t}from"../../webdoc/support/opacityUtils.js";const s={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:e}}},l={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,n){r[n]=!e}}}},p={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:e}}},y={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},d={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:e}}},c={value:null,type:a,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:e}}};function m(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const w={write:{enabled:!0,layerContainerTypes:e},read:!0},f={type:Number,json:{origins:{"web-document":w,"portal-item":{write:{layerContainerTypes:e}}}}},b={...f,json:{...f.json,origins:{"web-document":{...w,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,n)=>n&&"service"!==n.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?t(r.layerDefinition.drawingInfo.transparency):void 0:t(r.drawingInfo.transparency)}}},g={type:r,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,i)=>{const a=r.fromJSON(e);return null!=i.spatialReference&&"object"==typeof i.spatialReference&&(a.spatialReference=n.fromJSON(i.spatialReference)),a}}}},read:!1}},u={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},j={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:e}}},v={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:e}}},T={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},I={type:o,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{I as attributeTableTemplate,c as elevationInfo,u as id,p as labelsVisible,d as legendEnabled,T as listMode,v as maxScale,j as minScale,f as opacity,b as opacityDrawingInfo,l as popupEnabled,m as readOnlyService,g as sceneLayerFullExtent,s as screenSizePerspectiveEnabled,y as url};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{urlToObject as n}from"../../core/urlUtils.js";import r from"../../geometry/Extent.js";import i from"../../geometry/SpatialReference.js";import{isAxesOrderReversedForWkid as s}from"../ogc/crsUtils.js";import{DateTime as o,FixedOffsetZone as l}from"luxon";const a={84:4326,83:4269,27:4267};function u(n){if(!n)return null;const i={idCounter:-1};if("string"==typeof n){n=(new DOMParser).parseFromString(n,"text/xml")}const s=n.documentElement;if("ServiceExceptionReport"===s.nodeName){const e=Array.prototype.slice.call(s.childNodes).map((e=>e.textContent)).join("\r\n");throw new t("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",e)}const o=x("Capability",s),l=x("Service",s),a=o&&x("Request",o);if(!o||!l||!a)return null;const u=x("Layer",o);if(!u)return null;const c="WMS_Capabilities"===s.nodeName||"WMT_MS_Capabilities"===s.nodeName?s.getAttribute("version"):"1.3.0",d=N("Title",l,"")||N("Name",l,""),p=N("AccessConstraints",l,""),h=/^none$/i.test(p)?"":p,g=N("Abstract",l,""),A=parseInt(N("MaxWidth",l,"5000"),10),w=parseInt(N("MaxHeight",l,"5000"),10),L=b(a,"GetMap"),C=y(a,"GetMap"),F=S(u,c,i);if(!F)return null;let T,I=0;const R=Array.prototype.slice.call(o.childNodes),v=F.sublayers??[],U=e=>{null!=e&&v.push(e)};R.forEach((e=>{"Layer"===e.nodeName&&(0===I?T=e:1===I?(F.name&&(F.name="",U(S(T,c,i))),U(S(e,c,i))):U(S(e,c,i)),I++)}));let V=F.sublayers,O=F.extent;const _=F.fullExtents??[];if(V||(V=[]),0===V.length&&V.push(F),!O){const e=new r(V[0].extent);F.extent=e.toJSON(),O=F.extent}const B=F.spatialReferences.length>0?F.spatialReferences:m(F),j=y(a,"GetFeatureInfo"),k=j?b(a,"GetFeatureInfo"):null,q=f(V),X=F.minScale||0,D=F.maxScale||0,G=F.dimensions??[],$=q.reduce(((e,t)=>e.concat(t.dimensions??[])),[]),W=G.concat($).filter(M);let P=null;if(W.length){const t=W.map((e=>{const{extent:t}=e;return E(t)?t.map((e=>e.getTime())):t?.map((e=>[e.min.getTime(),e.max.getTime()]))})).flat(2).filter(e);P={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...t),Math.max(...t)]}}return{copyright:h,description:g,dimensions:G,extent:O,fullExtents:_,featureInfoFormats:k,featureInfoUrl:j,mapUrl:C,maxWidth:A,maxHeight:w,maxScale:D,minScale:X,layers:q,spatialReferences:B,supportedImageFormatTypes:L,timeInfo:P,title:d,version:c}}function c(e){const t=e.filter((e=>e.popupEnabled&&e.name&&e.queryable));return t.length?t.map((({name:e})=>e)).join():null}function m(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const e=m(t);if(e.length>0)return e}return[]}function f(e){let t=[];for(const n of e)t.push(n),n.sublayers?.length&&(t=t.concat(f(n.sublayers)),delete n.sublayers);return t}function d(e,t,n){return t.getAttribute(e)??n}function p(e,t,n,r){const i=x(e,n);return i?d(t,i,r):r}function x(e,t){for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(w(r)&&r.nodeName===e)return r}return null}function h(e,t){if(null==t)return[];const n=[];for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];w(i)&&i.nodeName===e&&n.push(i)}return n}function N(e,t,n){return x(e,t)?.textContent??n}function g(e,t,n){if(!e)return null;const s=parseFloat(e.getAttribute("minx")),o=parseFloat(e.getAttribute("miny")),l=parseFloat(e.getAttribute("maxx")),a=parseFloat(e.getAttribute("maxy"));let u,c,m,f;n?(u=isNaN(o)?-Number.MAX_VALUE:o,c=isNaN(s)?-Number.MAX_VALUE:s,m=isNaN(a)?Number.MAX_VALUE:a,f=isNaN(l)?Number.MAX_VALUE:l):(u=isNaN(s)?-Number.MAX_VALUE:s,c=isNaN(o)?-Number.MAX_VALUE:o,m=isNaN(l)?Number.MAX_VALUE:l,f=isNaN(a)?Number.MAX_VALUE:a);const d=new i({wkid:t});return new r({xmin:u,ymin:c,xmax:m,ymax:f,spatialReference:d})}function y(e,t){const n=x(t,e);if(n){const e=x("DCPType",n);if(e){const t=x("HTTP",e);if(t){const e=x("Get",t);if(e){let t=p("OnlineResource","xlink:href",e,null);if(t){const e=t.indexOf("&");return-1!==e&&e===t.length-1&&(t=t.slice(0,-1)),T(t,["service","request"])}}}}}return null}function b(t,n){const r=h("Operation",t);if(!r.length){return h("Format",x(n,t)).map((({textContent:e})=>e)).filter(e)}const i=[];for(const e of r)if(e.getAttribute("name")===n){const t=h("Format",e);for(const{textContent:e}of t)null!=e&&i.push(e)}return i}function A(e,t,n){const r=x(t,e);if(!r)return n;const{textContent:i}=r;if(null==i||""===i)return n;const s=Number(i);return isNaN(s)?n:s}function S(e,t,n){if(!e)return null;const o=e.getAttribute("queryable")?.toLowerCase(),l="1"===o||"true"===o,u={id:n.idCounter++,fullExtents:[],parentLayerId:null,queryable:l,spatialReferences:[],sublayers:null},c=x("LatLonBoundingBox",e),m=x("EX_GeographicBoundingBox",e);let f=null;c&&(f=g(c,4326)),m&&(f=new r(0,0,0,0,new i({wkid:4326})),f.xmin=parseFloat(N("westBoundLongitude",m,"0")),f.ymin=parseFloat(N("southBoundLatitude",m,"0")),f.xmax=parseFloat(N("eastBoundLongitude",m,"0")),f.ymax=parseFloat(N("northBoundLatitude",m,"0"))),c||m||(f=new r(-180,-90,180,90,new i({wkid:4326}))),u.minScale=A(e,"MaxScaleDenominator",0),u.maxScale=A(e,"MinScaleDenominator",0);const p=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach((e=>{if("Name"===e.nodeName)u.name=e.textContent||"";else if("Title"===e.nodeName)u.title=e.textContent||"";else if("Abstract"===e.nodeName)u.description=e.textContent||"";else if("BoundingBox"===e.nodeName){const n=e.getAttribute(p);if(n&&0===n.indexOf("EPSG:")){const r=parseInt(n.slice(5),10);0===r||isNaN(r)||f||(f="1.3.0"===t?g(e,r,s(r)):g(e,r))}const r=n?.indexOf(":");if(r&&r>-1){let i=parseInt(n.slice(r+1),10);0===i||isNaN(i)||(i=a[i]??i);const o="1.3.0"===t?g(e,i,s(i)):g(e,i);o&&u.fullExtents&&u.fullExtents.push(o)}}else if(e.nodeName===p){(e.textContent?.split(" ")??[]).forEach((e=>{let t=NaN;if(e.includes(":")){const[n,r]=e.toUpperCase().split(":");"CRS"!==n&&"EPSG"!==n||(t=parseInt(r,10))}else t=parseInt(e,10);if(0!==t&&!isNaN(t)){const e=a[t]??t;u.spatialReferences.includes(e)||u.spatialReferences.push(e)}}))}else if("Style"!==e.nodeName||u.legendUrl){if("Layer"===e.nodeName){const r=S(e,t,n);r&&(r.parentLayerId=u.id,u.sublayers||(u.sublayers=[]),u.sublayers.push(r))}}else{const t=x("LegendURL",e);if(t){const e=x("OnlineResource",t);e&&(u.legendUrl=e.getAttribute("xlink:href"))}}})),u.extent=f?.toJSON(),u.dimensions=h("Dimension",e).filter((e=>e.getAttribute("name")&&e.getAttribute("units")&&e.textContent)).map((e=>{const t=e.getAttribute("name"),n=e.getAttribute("units"),r=e.textContent,i=e.getAttribute("unitSymbol")??void 0,s=e.getAttribute("default")??void 0,o="0"!==d("default",e,"0"),l="0"!==d("nearestValue",e,"0"),a="0"!==d("current",e,"0");if(M({name:t,units:n})){return{name:"time",units:"ISO8601",extent:v(r),default:v(s),multipleValues:o,nearestValue:l,current:a}}if(C({name:t,units:n})){return{name:"elevation",units:n,extent:I(r),unitSymbol:i,default:I(s),multipleValues:o,nearestValue:l}}return{name:t,units:n,extent:R(r),unitSymbol:i,default:R(s),multipleValues:o,nearestValue:l}})),u}function E(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function w(e){return e.nodeType===Node.ELEMENT_NODE}function L(e){return void 0!==e.min&&void 0!==e.max}function C(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function F(e){return!M(e)&&!C(e)}function M(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function T(e,t){const r=[],i=n(e);for(const n in i.query)i.query.hasOwnProperty(n)&&(t.includes(n.toLowerCase())||r.push(n+"="+i.query[n]));return i.path+(r.length?"?"+r.join("&"):"")}function I(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map((e=>{const t=e.split("/");if(t.length<2)return null;return{min:parseFloat(t[0]),max:parseFloat(t[1]),resolution:t.length>=3&&"0"!==t[2]?parseFloat(t[2]):void 0}})).filter(e):r.map((e=>parseFloat(e)))}function R(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map((e=>{const t=e.split("/");if(t.length<2)return null;return{min:t[0],max:t[1],resolution:t.length>=3&&"0"!==t[2]?t[2]:void 0}})).filter(e):r}function v(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map((e=>{const t=e.split("/");if(t.length<2)return null;return{min:U(t[0]),max:U(t[1]),resolution:t.length>=3&&"0"!==t[2]?V(t[2]):void 0}})).filter(e):r.map((e=>U(e)))}function U(e){return o.fromISO(e,{zone:l.utcInstance}).toJSDate()}function V(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,n=e.match(t);if(!n)return null;return{years:O(n[1]),months:O(n[2]),days:O(n[3]),hours:O(n[4]),minutes:O(n[5]),seconds:O(n[6])}}function O(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,n=e.match(t);if(!n)return 0;const r=n[0].replace(",",".");return Number(r)}function _(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const B="0000-01-01T00:00:00Z",j="9999-12-31T23:59:59Z";function k(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:n}=e;if(t&&n&&t.getTime()===n.getTime())return`${_(t)}`;return`${t?_(t):B}/${n?_(n):j}`}const q=new Set([102100,3857,102113,900913]),X=new Set([3395,54004]);function D(e,t){let n=e.wkid;return null==t?n:(null!=n&&t.includes(n)||!e.latestWkid||(n=e.latestWkid),null!=n&&q.has(n)?t.find((e=>q.has(e)))||t.find((e=>X.has(e)))||102100:n)}export{V as fromISODuration,c as getPopupLayers,L as isDimensionInterval,C as isElevationDimension,F as isGenericDimension,M as isTimeDimension,D as normalizeWKID,u as parseCapabilities,k as toTimeQueryParameter};
5
+ import{isSome as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{urlToObject as n}from"../../core/urlUtils.js";import r from"../../geometry/Extent.js";import i from"../../geometry/SpatialReference.js";import{isAxesOrderReversedForWkid as s}from"../ogc/crsUtils.js";import{DateTime as o,FixedOffsetZone as l}from"luxon";const a={84:4326,83:4269,27:4267};function u(n){if(!n)return null;const r={idCounter:-1};if("string"==typeof n){n=(new DOMParser).parseFromString(n,"text/xml")}const i=n.documentElement;if("ServiceExceptionReport"===i.nodeName){const e=Array.prototype.slice.call(i.childNodes).map((e=>e.textContent)).join("\r\n");throw new t("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",e)}const s=x("Capability",i),o=x("Service",i),l=s&&x("Request",s);if(!s||!o||!l)return null;const a=x("Layer",s);if(!a)return null;const u="WMS_Capabilities"===i.nodeName||"WMT_MS_Capabilities"===i.nodeName?i.getAttribute("version"):"1.3.0",c=N("Title",o,"")||N("Name",o,""),d=N("AccessConstraints",o,""),p=/^none$/i.test(d)?"":d,h=N("Abstract",o,""),g=parseInt(N("MaxWidth",o,"5000"),10),A=parseInt(N("MaxHeight",o,"5000"),10),L=b(l,"GetMap"),C=y(l,"GetMap"),F=S(a,u,r);if(!F)return null;let M,T=0;const I=Array.prototype.slice.call(s.childNodes),R=F.sublayers??[],v=e=>{null!=e&&R.push(e)};I.forEach((e=>{"Layer"===e.nodeName&&(0===T?M=e:1===T?(F.name&&(F.name="",v(S(M,u,r))),v(S(e,u,r))):v(S(e,u,r)),T++)}));const U=F.sublayers??[],V=F.fullExtents??[];0===U.length&&U.push(F),F.extent??=U[0].extent;const _=F.spatialReferences.length>0?F.spatialReferences:m(F),O=y(l,"GetFeatureInfo"),B=O?b(l,"GetFeatureInfo"):null,j=f(U),k=F.minScale||0,q=F.maxScale||0,X=F.dimensions??[],D=j.reduce(((e,t)=>e.concat(t.dimensions??[])),[]),G=X.concat(D).filter(w);let $=null;if(G.length){const t=G.map((e=>{const{extent:t}=e;return E(t)?t.map((e=>e.getTime())):t?.map((e=>[e.min.getTime(),e.max.getTime()]))})).flat(2).filter(e);$={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...t),Math.max(...t)]}}return{copyright:p,description:h,dimensions:X,extent:F.extent,fullExtents:V,featureInfoFormats:B,featureInfoUrl:O,mapUrl:C,maxWidth:g,maxHeight:A,maxScale:q,minScale:k,layers:j,spatialReferences:_,supportedImageFormatTypes:L,timeInfo:$,title:c,version:u}}function c(e){const t=e.filter((e=>e.popupEnabled&&e.name&&e.queryable));return t.length?t.map((({name:e})=>e)).join():null}function m(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const e=m(t);if(e.length>0)return e}return[]}function f(e){let t=[];for(const n of e)t.push(n),n.sublayers?.length&&(t=t.concat(f(n.sublayers)),delete n.sublayers);return t}function d(e,t,n){return t.getAttribute(e)??n}function p(e,t,n,r){const i=x(e,n);return i?d(t,i,r):r}function x(e,t){for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(L(r)&&r.nodeName===e)return r}return null}function h(e,t){if(null==t)return[];const n=[];for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];L(i)&&i.nodeName===e&&n.push(i)}return n}function N(e,t,n){return x(e,t)?.textContent??n}function g(e,t,n){if(!e)return null;const r=parseFloat(e.getAttribute("minx")),i=parseFloat(e.getAttribute("miny")),s=parseFloat(e.getAttribute("maxx")),o=parseFloat(e.getAttribute("maxy"));let l,a,u,c;return n?(l=isNaN(i)?-Number.MAX_VALUE:i,a=isNaN(r)?-Number.MAX_VALUE:r,u=isNaN(o)?Number.MAX_VALUE:o,c=isNaN(s)?Number.MAX_VALUE:s):(l=isNaN(r)?-Number.MAX_VALUE:r,a=isNaN(i)?-Number.MAX_VALUE:i,u=isNaN(s)?Number.MAX_VALUE:s,c=isNaN(o)?Number.MAX_VALUE:o),{xmin:l,ymin:a,xmax:u,ymax:c,spatialReference:{wkid:t}}}function y(e,t){const n=x(t,e);if(n){const e=x("DCPType",n);if(e){const t=x("HTTP",e);if(t){const e=x("Get",t);if(e){let t=p("OnlineResource","xlink:href",e,null);if(t){const e=t.indexOf("&");return-1!==e&&e===t.length-1&&(t=t.slice(0,-1)),T(t,["service","request"])}}}}}return null}function b(t,n){const r=h("Operation",t);if(!r.length){return h("Format",x(n,t)).map((({textContent:e})=>e)).filter(e)}const i=[];for(const e of r)if(e.getAttribute("name")===n){const t=h("Format",e);for(const{textContent:e}of t)null!=e&&i.push(e)}return i}function A(e,t,n){const r=x(t,e);if(!r)return n;const{textContent:i}=r;if(null==i||""===i)return n;const s=Number(i);return isNaN(s)?n:s}function S(e,t,n){if(!e)return null;const o=e.getAttribute("queryable")?.toLowerCase(),l="1"===o||"true"===o,u={id:n.idCounter++,fullExtents:[],parentLayerId:null,queryable:l,spatialReferences:[],sublayers:null},c=x("LatLonBoundingBox",e),m=x("EX_GeographicBoundingBox",e);let f=null;c&&(f=g(c,4326)),m&&(f=new r(0,0,0,0,new i({wkid:4326})),f.xmin=parseFloat(N("westBoundLongitude",m,"0")),f.ymin=parseFloat(N("southBoundLatitude",m,"0")),f.xmax=parseFloat(N("eastBoundLongitude",m,"0")),f.ymax=parseFloat(N("northBoundLatitude",m,"0"))),c||m||(f=new r(-180,-90,180,90,new i({wkid:4326}))),u.minScale=A(e,"MaxScaleDenominator",0),u.maxScale=A(e,"MinScaleDenominator",0);const p=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach((e=>{if("Name"===e.nodeName)u.name=e.textContent||"";else if("Title"===e.nodeName)u.title=e.textContent||"";else if("Abstract"===e.nodeName)u.description=e.textContent||"";else if("BoundingBox"===e.nodeName){const n=e.getAttribute(p);if(n&&0===n.indexOf("EPSG:")){const r=parseInt(n.slice(5),10);0===r||isNaN(r)||f||(f="1.3.0"===t?g(e,r,s(r)):g(e,r))}const r=n?.indexOf(":");if(r&&r>-1){let i=parseInt(n.slice(r+1),10);0===i||isNaN(i)||(i=a[i]??i);const o="1.3.0"===t?g(e,i,s(i)):g(e,i);o&&u.fullExtents&&u.fullExtents.push(o)}}else if(e.nodeName===p){(e.textContent?.split(" ")??[]).forEach((e=>{let t=NaN;if(e.includes(":")){const[n,r]=e.toUpperCase().split(":");"CRS"!==n&&"EPSG"!==n||(t=parseInt(r,10))}else t=parseInt(e,10);if(0!==t&&!isNaN(t)){const e=a[t]??t;u.spatialReferences.includes(e)||u.spatialReferences.push(e)}}))}else if("Style"!==e.nodeName||u.legendUrl){if("Layer"===e.nodeName){const r=S(e,t,n);r&&(r.parentLayerId=u.id,u.sublayers||(u.sublayers=[]),u.sublayers.push(r))}}else{const t=x("LegendURL",e);if(t){const e=x("OnlineResource",t);e&&(u.legendUrl=e.getAttribute("xlink:href"))}}})),u.extent=f,u.dimensions=h("Dimension",e).filter((e=>e.getAttribute("name")&&e.getAttribute("units")&&e.textContent)).map((e=>{const t=e.getAttribute("name"),n=e.getAttribute("units"),r=e.textContent,i=e.getAttribute("unitSymbol")??void 0,s=e.getAttribute("default")??void 0,o="0"!==d("default",e,"0"),l="0"!==d("nearestValue",e,"0"),a="0"!==d("current",e,"0");if(w({name:t,units:n})){return{name:"time",units:"ISO8601",extent:v(r),default:v(s),multipleValues:o,nearestValue:l,current:a}}if(F({name:t,units:n})){return{name:"elevation",units:n,extent:I(r),unitSymbol:i,default:I(s),multipleValues:o,nearestValue:l}}return{name:t,units:n,extent:R(r),unitSymbol:i,default:R(s),multipleValues:o,nearestValue:l}})),u}function E(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function L(e){return e.nodeType===Node.ELEMENT_NODE}function C(e){return void 0!==e.min&&void 0!==e.max}function F(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function M(e){return!w(e)&&!F(e)}function w(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function T(e,t){const r=[],i=n(e);for(const n in i.query)i.query.hasOwnProperty(n)&&(t.includes(n.toLowerCase())||r.push(n+"="+i.query[n]));return i.path+(r.length?"?"+r.join("&"):"")}function I(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map((e=>{const t=e.split("/");if(t.length<2)return null;return{min:parseFloat(t[0]),max:parseFloat(t[1]),resolution:t.length>=3&&"0"!==t[2]?parseFloat(t[2]):void 0}})).filter(e):r.map((e=>parseFloat(e)))}function R(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map((e=>{const t=e.split("/");if(t.length<2)return null;return{min:t[0],max:t[1],resolution:t.length>=3&&"0"!==t[2]?t[2]:void 0}})).filter(e):r}function v(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map((e=>{const t=e.split("/");if(t.length<2)return null;return{min:U(t[0]),max:U(t[1]),resolution:t.length>=3&&"0"!==t[2]?V(t[2]):void 0}})).filter(e):r.map((e=>U(e)))}function U(e){return o.fromISO(e,{zone:l.utcInstance}).toJSDate()}function V(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,n=e.match(t);if(!n)return null;return{years:_(n[1]),months:_(n[2]),days:_(n[3]),hours:_(n[4]),minutes:_(n[5]),seconds:_(n[6])}}function _(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,n=e.match(t);if(!n)return 0;const r=n[0].replace(",",".");return Number(r)}function O(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const B="0000-01-01T00:00:00Z",j="9999-12-31T23:59:59Z";function k(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:n}=e;if(t&&n&&t.getTime()===n.getTime())return`${O(t)}`;return`${t?O(t):B}/${n?O(n):j}`}const q=new Set([102100,3857,102113,900913]),X=new Set([3395,54004]);function D(e,t){let n=e.wkid;return null==t?n:(null!=n&&t.includes(n)||!e.latestWkid||(n=e.latestWkid),null!=n&&q.has(n)?t.find((e=>q.has(e)))||t.find((e=>X.has(e)))||102100:n)}export{V as fromISODuration,c as getPopupLayers,C as isDimensionInterval,F as isElevationDimension,M as isGenericDimension,w as isTimeDimension,D as normalizeWKID,u as parseCapabilities,k as toTimeQueryParameter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.0-next.20250209",
3
+ "version": "4.32.0-next.20250211",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@esri/arcgis-html-sanitizer": "~4.1.0",
29
- "@esri/calcite-components": "~3.0.0-next.132",
29
+ "@esri/calcite-components": "^3.0.0",
30
30
  "@vaadin/grid": "~24.6.4",
31
31
  "@zip.js/zip.js": "~2.7.57",
32
32
  "luxon": "~3.5.0",