@arcgis/core 5.2.0-next.21 → 5.2.0-next.23

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 (214) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js → 1040bce57ea63a6dbca4.js} +2 -2
  4. package/assets/esri/core/workers/chunks/1a7c0a1dc6ecc93ea03a.js +1 -0
  5. package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
  6. package/assets/esri/core/workers/chunks/2d6d01913096f7cb5ff8.js +1 -0
  7. package/assets/esri/core/workers/chunks/30298f84bd414f9dea64.js +1 -0
  8. package/assets/esri/core/workers/chunks/353c67da4b25c29360db.js +2 -0
  9. package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
  10. package/assets/esri/core/workers/chunks/47948c72bc01bd173c20.js +2 -0
  11. package/assets/esri/core/workers/chunks/{f0519b06987471456b69.js → 502464c4eab7667f6566.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
  13. package/assets/esri/core/workers/chunks/6c0c77de1934f35dc45f.js +1 -0
  14. package/assets/esri/core/workers/chunks/{f7f820483e45c05ab9e4.js → 75df436e6e9773bdcfc2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/780519b60aa674a61a74.js +1 -0
  16. package/assets/esri/core/workers/chunks/7dbaa089c7472825b80c.js +1 -0
  17. package/assets/esri/core/workers/chunks/7dec8c453fdee1968d12.js +1 -0
  18. package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
  19. package/assets/esri/core/workers/chunks/7e4093f42795ba2f8cfd.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6649acaceab00ad30e7f.js → 8ba3e0462a9bdaae5f40.js} +1 -1
  21. package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
  22. package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +1 -0
  23. package/assets/esri/core/workers/chunks/{909e67dee8c30e391d69.js → a8310f55de4749f973d0.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7175f0c6a6e56b685d20.js → b419fd36337e76e2d4a3.js} +6 -6
  26. package/assets/esri/core/workers/chunks/{05d597dd117766beadd8.js → b91a15522692781560b4.js} +1 -1
  27. package/assets/esri/core/workers/chunks/c86d388d216adbb15a05.js +1 -0
  28. package/assets/esri/core/workers/chunks/{f1ff33584680d8718400.js → c9ce408675dae6a0edd1.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
  30. package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{da47fdffb5969694a2ae.js → d41eed41916ed0422059.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{19493c9c7e1d2ac0f80f.js → d4e0346209fabc58f929.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{b375abfb2a2d9c63e20a.js → db90fb8ac96579259566.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js → dd0acd0f8b96839b4f24.js} +2 -2
  35. package/assets/esri/core/workers/chunks/{5809e70a8e57e9b05959.js → dd795c95cdc3812b5b49.js} +1 -1
  36. package/assets/esri/core/workers/chunks/f7344d855f1092383abe.js +1 -0
  37. package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js → f859c53432f258af77e3.js} +2 -2
  38. package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
  39. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  40. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
  41. package/assets/esri/themes/dark/main.css +1 -1
  42. package/assets/esri/themes/light/main.css +1 -1
  43. package/assets/esri/themes/light/view.css +1 -1
  44. package/chunks/GaussianSplat.glsl.js +4 -4
  45. package/chunks/GaussianSplatShadow.glsl.js +1 -1
  46. package/config.d.ts +9 -2
  47. package/config.js +1 -1
  48. package/core/date.js +1 -1
  49. package/form/FormTemplate.d.ts +15 -20
  50. package/form/elements/AttachmentElement.d.ts +38 -11
  51. package/form/elements/Element.d.ts +9 -6
  52. package/form/elements/FieldElement.d.ts +0 -1
  53. package/form/elements/GroupElement.d.ts +4 -6
  54. package/form/elements/RelationshipElement.d.ts +8 -8
  55. package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
  56. package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
  57. package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
  58. package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
  59. package/form/elements/inputs/attachments/Input.d.ts +6 -3
  60. package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
  61. package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
  62. package/form/elements.d.ts +6 -12
  63. package/form/types.d.ts +0 -4
  64. package/kernel.js +1 -1
  65. package/layers/AnnotationFeatureLayer.d.ts +2 -1
  66. package/layers/DimensionFeatureLayer.d.ts +2 -1
  67. package/layers/OrientedImageryLayer.d.ts +20 -2
  68. package/layers/OrientedImageryLayer.js +1 -1
  69. package/layers/ParquetLayer.js +1 -1
  70. package/layers/graphics/sources/ParquetSource.js +1 -1
  71. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  72. package/layers/graphics/sources/geojson/geojson.js +1 -1
  73. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  74. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  75. package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
  76. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  77. package/layers/mixins/EditBusLayer.js +1 -1
  78. package/layers/orientedImagery/core/utils.js +1 -1
  79. package/layers/orientedImagery/types.d.ts +4 -1
  80. package/layers/support/RasterBandInfo.js +1 -1
  81. package/layers/types.d.ts +1 -0
  82. package/package.json +3 -3
  83. package/rest/support/AttachmentQuery.d.ts +13 -1
  84. package/rest/support/AttachmentQuery.js +1 -1
  85. package/rest/support/OutDistance.d.ts +5 -1
  86. package/rest/support/PrintParameters.d.ts +2 -1
  87. package/rest/support/Query.d.ts +2 -0
  88. package/support/basemapUtils.js +1 -1
  89. package/support/revision.js +1 -1
  90. package/symbols/SimpleMarkerSymbol.d.ts +2 -2
  91. package/views/2d/engine/AFeatureContainer.js +1 -1
  92. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  93. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  101. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  102. package/views/2d/layers/features/FeatureContainer.js +1 -1
  103. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  104. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  105. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  106. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  107. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  108. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  109. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  110. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  111. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  112. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  113. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  114. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  115. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  116. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
  117. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  118. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  119. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  120. package/views/3d/state/utils/navigationUtils.js +1 -1
  121. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  122. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  123. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +2 -0
  124. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  125. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
  126. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +13 -12
  127. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  128. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  129. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +1 -1
  130. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  131. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  132. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  133. package/views/PopupView.d.ts +3 -0
  134. package/views/View2D.d.ts +2 -2
  135. package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
  136. package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
  137. package/views/layers/FeatureLikeLayerView.js +1 -1
  138. package/widgets/BasemapGallery.js +1 -1
  139. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  140. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  141. package/widgets/BatchAttributeForm/css.js +1 -1
  142. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  143. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  144. package/widgets/BatchAttributeForm/types.d.ts +0 -7
  145. package/widgets/BatchAttributeForm.d.ts +7 -9
  146. package/widgets/BatchAttributeForm.js +1 -1
  147. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  148. package/widgets/Editor/EditorViewModel.d.ts +12 -2
  149. package/widgets/Editor/EditorViewModel.js +1 -1
  150. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  151. package/widgets/Editor/UpdateWorkflow.js +1 -1
  152. package/widgets/Editor/compatibilityAdapters.js +2 -0
  153. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  154. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  155. package/widgets/Editor/legacy/AddAssociationWorkflow.js +2 -0
  156. package/widgets/Editor/legacy/AddAssociationWorkflowData.js +2 -0
  157. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +2 -0
  158. package/widgets/Editor/legacy/CreateFeaturesWorkflowData.js +2 -0
  159. package/widgets/Editor/legacy/MergeFeaturesWorkflow.js +2 -0
  160. package/widgets/Editor/legacy/MergeFeaturesWorkflowData.js +2 -0
  161. package/widgets/Editor/legacy/SplitFeatureWorkflow.js +2 -0
  162. package/widgets/Editor/legacy/SplitFeatureWorkflowData.js +2 -0
  163. package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +2 -0
  164. package/widgets/Editor/legacy/UpdateFeatureWorkflowData.js +2 -0
  165. package/widgets/Editor/legacy/UpdateFeaturesWorkflow.js +2 -0
  166. package/widgets/Editor/legacy/UpdateFeaturesWorkflowData.js +2 -0
  167. package/widgets/Editor/legacy/UpdateRecordWorkflow.js +2 -0
  168. package/widgets/Editor/legacy/UpdateRecordWorkflowData.js +2 -0
  169. package/widgets/Editor/legacy/UpdateWorkflow.js +2 -0
  170. package/widgets/Editor/legacy/UpdateWorkflowData.js +2 -0
  171. package/widgets/Editor/legacy/Workflow.js +2 -0
  172. package/widgets/Editor/legacy/workflowUtils.js +2 -0
  173. package/widgets/Editor/types.d.ts +12 -0
  174. package/widgets/Editor/workflowUtils.js +1 -1
  175. package/widgets/Editor.js +1 -1
  176. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
  177. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  178. package/widgets/FeatureForm.d.ts +14 -16
  179. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +2 -1
  180. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  181. package/widgets/FeatureTable/Grid/GridViewModel.d.ts +3 -0
  182. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  183. package/widgets/FeatureTable/Grid/types.d.ts +20 -0
  184. package/widgets/FeatureTable.d.ts +14 -2
  185. package/widgets/FeatureTable.js +1 -1
  186. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  187. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  188. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  189. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  190. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  191. package/widgets/OrientedImageryViewer.js +1 -1
  192. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  193. package/assets/esri/core/workers/chunks/057d288d795b853295f1.js +0 -2
  194. package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
  195. package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
  196. package/assets/esri/core/workers/chunks/33866e6e6de1bab64599.js +0 -1
  197. package/assets/esri/core/workers/chunks/360fd810d70d21c092d9.js +0 -1
  198. package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
  199. package/assets/esri/core/workers/chunks/5aa375b0c6a205134703.js +0 -1
  200. package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
  201. package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +0 -1
  202. package/assets/esri/core/workers/chunks/754f7ed62afc4e0a1972.js +0 -2
  203. package/assets/esri/core/workers/chunks/7ee76504e7fea389a1c9.js +0 -1
  204. package/assets/esri/core/workers/chunks/8331e04ebe0a54b04ab6.js +0 -1
  205. package/assets/esri/core/workers/chunks/8c64c6b8d7376a9d1c91.js +0 -1
  206. package/assets/esri/core/workers/chunks/c30ca771dd3f7198142b.js +0 -1
  207. package/assets/esri/core/workers/chunks/e5fcd8e7a4a660ef6ad6.js +0 -1
  208. package/assets/esri/core/workers/chunks/f47319d36f1527277923.js +0 -1
  209. package/assets/esri/core/workers/chunks/ff00ac01f0baaecaa890.js +0 -1
  210. /package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js.LICENSE.txt → 1040bce57ea63a6dbca4.js.LICENSE.txt} +0 -0
  211. /package/assets/esri/core/workers/chunks/{057d288d795b853295f1.js.LICENSE.txt → 353c67da4b25c29360db.js.LICENSE.txt} +0 -0
  212. /package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js.LICENSE.txt → 47948c72bc01bd173c20.js.LICENSE.txt} +0 -0
  213. /package/assets/esri/core/workers/chunks/{754f7ed62afc4e0a1972.js.LICENSE.txt → dd0acd0f8b96839b4f24.js.LICENSE.txt} +0 -0
  214. /package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js.LICENSE.txt → f859c53432f258af77e3.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,n,s,d,i,u,p){const c=[];for(const a in e){const o=e[a],r=s.get(a);r?c.push(new t(r,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=r(e),n=[];o&&n.push(o),h.push(new a("v_"+t,"out",e,n))}}return new o(c,h,u,p)}static createFragment(e,r,n,s,d,i,u){const p=[],c=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],r=n.get(a);if(r){p.push(new t(r,"builtin",o));continue}const s=c.find(e=>e.node===o);s&&p.push(new t(s.outVariableName,"in",o))}for(const a of s){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t],o=n.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of e)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){const e=[],t=[],a=new Set;this._arrayReadVersions.clear();for(const o of this.rootOutputNodes())this.shouldPruneOutputNode(o)||(t.push(o.node),a.add(o.node.uid));for(let o=0;o<t.length;o++){const r=t[o];"array-read-node"===r.shaderType&&e.push(r);for(const e of r.children)e&&"number"!=typeof e&&"boolean"!=typeof e&&!a.has(e.uid)&&(a.add(e.uid),t.push(e))}for(const o of e){let e=this._arrayReadVersions.get(o.version.uid);e||(e=[],this._arrayReadVersions.set(o.version.uid,e)),e.push(o)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._arrayReadVersions=this._arrayReadVersions,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const n of this.rootOutputNodes())"builtin"===n.outVariableType?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):"discard"===n.outVariableType||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),r=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const n of r)e.fragment.code.add(` ${n.outVariableName} = ${n.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function r(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
2
+ import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,n,s,d,i,u,p){const c=[];for(const a in e){const o=e[a],r=s.get(a);r?c.push(new t(r,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=r(e),n=[];o&&n.push(o),h.push(new a("v_"+t,"out",e,n))}}return new o(c,h,u,p)}static createFragment(e,r,n,s,d,i,u){const p=[],c=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],r=n.get(a);if(r){p.push(new t(r,"builtin",o));continue}const s=c.find(e=>e.node===o);s&&p.push(new t(s.outVariableName,"in",o,s.qualifiers))}for(const a of s){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t],o=n.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of e)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){const e=[],t=[],a=new Set;this._arrayReadVersions.clear();for(const o of this.rootOutputNodes())this.shouldPruneOutputNode(o)||(t.push(o.node),a.add(o.node.uid));for(let o=0;o<t.length;o++){const r=t[o];"array-read-node"===r.shaderType&&e.push(r);for(const e of r.children)e&&"number"!=typeof e&&"boolean"!=typeof e&&!a.has(e.uid)&&(a.add(e.uid),t.push(e))}for(const o of e){let e=this._arrayReadVersions.get(o.version.uid);e||(e=[],this._arrayReadVersions.set(o.version.uid,e)),e.push(o)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._arrayReadVersions=this._arrayReadVersions,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const n of this.rootOutputNodes())"builtin"===n.outVariableType?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):"discard"===n.outVariableType||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),r=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const n of r)e.fragment.code.add(` ${n.outVariableName} = ${n.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function r(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderPropertyAccessNode as r,ShaderPropertyAccess2DNode as i,ShaderFunctionNode as c,ShaderConditionNode as s,ShaderArrayWriteNode as u,ShaderArrayReadNode as o,ShaderBlockNode as h,ShaderScopeNode as l}from"./ShaderGraphNode.js";var a,f,p,d,y,w,m,v,b,g,x,I,E;function $(t){switch(t.type){case"uint":return C;case"uvec2":return X;case"uvec3":return Y;case"uvec4":return _;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"float":return A;case"vec2":return G;case"vec3":return H;case"vec4":return V;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"int":return C;case"ivec2":return X;case"ivec3":return Y;case"ivec4":return _;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function D(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return C;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return A;default:throw new Error("Unable to handle type")}}function k(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*k(t.elementType)}}function M(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>ct[t]);throw new Error("Unable to find type family")}function S(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>S(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=M(t.type);return dt(t,n,e[n.length-1])}}})}function R(t){return new Proxy(t,{construct:(t,e,n)=>S(new t(...e))})}function j(t,e){if(!Number.isSafeInteger(t)||t<0||t>=e)throw new B}class B extends Error{}class q extends e{static{this.type="array"}constructor(t,e,n=null){super(),this.elementType=t,this.size=e,this.writeNode=n,this.type="array"}get children(){return this.writeNode?[this.writeNode]:[this.elementType]}clone(){const t=this.writeNode?n(this.writeNode):null,e=new q(n(this.elementType),this.size,t);return super.cloneInto(e),e}set(t,e){return"number"==typeof t&&j(t,this.size),new q(n(this.elementType),this.size,new u(this,t,e))}get(t,e){"number"==typeof t&&j(t,this.size);const n=null!=e?new W(e):null;if(null!=n){const e=F(this.elementType.constructor);return yt(this,new W(t),n,e)}return wt(this,t,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return $t(this,t,e,n)}glslFindIndex(t,e,n){return zt(this,t,e,n)}static ofType(t,e){const n=t;return class extends q{static{this.elementType=t}static{this.size=e}constructor(){super(new n,e)}}}}class U extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.type="array-2d",this.children=Array(e*n).fill(t)}clone(){const t=new U(n(this.elementType),this.xSize,this.ySize,this.isRowMajor);return t.children=this.children.map(n),super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(q,{construct:(i,c)=>new U(new t,e,n,r)})}}class P extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new P;return t.children=this.children.map(n),super.cloneInto(t),t}}class C extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new C(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}}let X=class extends e{static{a=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new a(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};X=a=t([R],X);let Y=class extends e{static{f=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){throw new B}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};Y=f=t([R],Y);let _=class extends e{static{p=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new p(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){return dt(this,"[3]",C)}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};_=p=t([R],_);let A=class extends e{static{d=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new d(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ft(this,O(t,d))}add(t){return Mt(this,O(t,d))}subtract(t){return St(this,O(t,d))}divide(t){return kt(this,O(t,d))}};A=d=t([R],A);let G=class extends e{static{y=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};G=y=t([R],G);let H=class extends e{static{w=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",A)}get 1(){return dt(this,"[1]",A)}get 2(){return dt(this,"[2]",A)}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};H=w=t([R],H);let V=class extends e{static{m=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new m(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",A)}get 1(){return dt(this,"[1]",A)}get 2(){return dt(this,"[2]",A)}get 3(){return dt(this,"[3]",A)}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};V=m=t([R],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Ot(this,t)}or(t){return Vt(this,t)}xor(t){return Kt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{v=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=v=t([R],K);let L=class extends e{static{b=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=b=t([R],L);let Q=class extends e{static{g=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new g(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=g=t([R],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ft(this,O(t,W))}add(t){return Mt(this,O(t,W))}subtract(t){return St(this,O(t,W))}divide(t){return kt(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{x=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};Z=x=t([R],Z);let tt=class extends e{static{I=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};tt=I=t([R],tt);let et=class extends e{static{E=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new E(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){return dt(this,"[3]",W)}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};et=E=t([R],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return yt(this,new W(t),new W(e),C)}multiply(t){return Ft(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=un(t),n=he(t);return new rt(n,e,0,xt(e),n,0,0,0,1)}constructor(t,e,n,r,i,c,s,u,o){super(),this.type="mat3",this.children=[t,e,n,r,i,c,s,u,o]}add(t){return Mt(this,t)}multiply(t){return Ft(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class it extends e{static{this.type="mat4"}static identity(){return new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,i,c,s,u,o,h,l,a,f,p,d,y){super(),this.type="mat4",this.children=[t,e,n,r,i,c,s,u,o,h,l,a,f,p,d,y]}static fromColumns(t,e,n,r){return new it(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Ft(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new it(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const ct={float:C,vec2:X,vec3:Y,vec4:_,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:A,uvec2:G,uvec3:H,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},st=(...t)=>new W(...t),ut=(...t)=>new C(...t),ot=(...t)=>new X(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new it(...t);function dt(t,e,n){const i=new n(new r(e,t,n));return i.isImplicit=!0,i}function yt(t,e,n,r){const c=new r(new i(e,n,t,r));return c.isImplicit=!0,c}function wt(t,e,n){const r=new n(new o(t,e,n));return r.isImplicit=!0,r}function mt(t,e,n,r=null){if(r){const i=new r,s=new r(new c(t,[e,n],!0,!1,i));return s.isImplicit=!0,s}if("float"===e.type||"int"===e.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const i=new e.constructor(new c(t,[e,n],!0,!1,e.constructor));return i.isImplicit=!0,i}function vt(t,e,n=e.constructor){const r=new n(new c(t,[e],!1,!1,n));return r.isImplicit=!0,r}function bt(t,e,n,r=e.constructor){const i=new r(new c(t,[e,n],!1,!1,r));return i.isImplicit=!0,i}function gt(t,e,n,r,i=e.constructor){const s=new i(new c(t,[e,n,r],!1,!1,i));return s.isImplicit=!0,s}function xt(t){return Ft(t,ut(-1))}function It(t,e,n,r){return new e(new h(t,e,n,r))}function Et(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new l(n).setDebugName(e));return r.isImplicit=!0,r}function $t(t,e,n=0,r=t.size){const i=new W(n).setMutable().setDebugName("FindIndexIterator"),c=e(t.get(i)).setDebugName("FindIndexPredicate"),s=It({iter:i},W,c,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return s}function zt(t,e,n=0,r=t.size){const i=It({array:t},W,null,({out:t,array:i})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:i,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return i}function Tt(t,e,n){const r="function"==typeof e?e():e,i="function"==typeof n?n():n,c=new r.constructor(new s(t,r,i));return c.isImplicit=!0,c}function Nt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const i=e.slice(0,r),c=e[r][1],s=new n(i.reduceRight((t,e)=>Tt(e[0],e[1],t),c));return s.isImplicit=!0,s}function Dt(t,e){const n=new e.constructor(new s(t,e,null));return n.isImplicit=!0,n}function Ft(t,e){return mt("*",t,e)}function kt(t,e){return mt("/",t,e)}function Mt(t,e){return mt("+",t,e)}function St(t,e){return mt("-",t,e)}function Rt(t,e){return mt("%",t,e)}function jt(t,e){return mt("<<",t,e)}function Bt(t,e){return mt(">>",t,e)}function qt(t,e){return mt("&",t,e)}function Ut(t,e){return mt("|",t,e)}function Pt(t,e){return mt("^",t,e)}function Ct(t){return vt("~",t)}function Xt(t,e){return mt("==",t,e,J)}function Yt(t,e){return mt("!=",t,e,J)}function _t(t,e){return mt("<",t,e,J)}function At(t,e){return mt("<=",t,e,J)}function Gt(t,e){return mt(">",t,e,J)}function Ht(t,e){return mt(">=",t,e,J)}function Vt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Jt(t,e),t[0])}function Jt(t,e){return mt("||",t,e,J)}function Kt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Lt(t,e),t[0])}function Lt(t,e){return mt("^^",t,e,J)}function Ot(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Qt(t,e),t[0])}function Qt(t,e){return mt("&&",t,e,J)}function Wt(t){return vt("abs",t)}function Zt(t){return vt("acos",t)}function te(t){return vt("acosh",t)}function ee(t){return vt("all",t,J)}function ne(t){return vt("any",t,J)}function re(t){return vt("asin",t)}function ie(t){return vt("asinh",t)}function ce(t,e){return null==e?vt("atan",t):bt("atan",t,e,t.constructor)}function se(t){return vt("atanh",t)}function ue(t){return vt("ceil",t)}function oe(t,e,n){return gt("clamp",t,e,n,t.constructor)}function he(t){return vt("cos",t)}function le(t){return vt("cosh",t)}function ae(t,e){return bt("cross",t,e,t.constructor)}function fe(t){return vt("dFdX",t)}function pe(t){return vt("dFdY",t)}function de(t){return vt("degrees",t)}function ye(t){return vt("determinant",t,C)}function we(t,e){return bt("distance",t,e,C)}function me(t,e){return bt("dot",t,e,C)}function ve(t,e){return bt("equal",t,e,D(t))}function be(t,e){return bt("greaterThan",t,e,D(t))}function ge(t,e){return bt("greaterThanEqual",t,e,D(t))}function xe(t){return vt("exp",t)}function Ie(t){return vt("exp2",t)}function Ee(t,e,n){return gt("faceforward",t,e,n)}function $e(t){return vt("floatBitsToInt",t,N(t))}function ze(t){return vt("floatBitsToUint",t,z(t))}function Te(t){return vt("floor",t)}function Ne(t){return vt("fract",t)}function De(t){return vt("fwidth",t)}function Fe(t){return vt("intBitsToFloat",t,T(t))}function ke(t){return vt("uintBitsToFloat",t,$(t))}function Me(t){return vt("inverse",t,C)}function Se(t){return vt("inversesqrt",t)}function Re(t){return vt("isinf",t,D(t))}function je(t){return vt("isnan",t,D(t))}function Be(t){return vt("length",t,C)}function qe(t,e){return bt("lessThan",t,e,D(t))}function Ue(t,e){return bt("lessThanEqual",t,e,D(t))}function Pe(t){return vt("log",t)}function Ce(t){return vt("log2",t)}function Xe(t,e){return bt("matrixCompMult",t,e)}function Ye(t,e){return bt("max",t,e)}function _e(t,e){return bt("min",t,e)}function Ae(t,e,n){return gt("mix",t,e,n)}function Ge(t,e){return bt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ve(t){return vt("normalize",t)}function Je(t){return"bool"===t.type?vt("!",t):vt("not",t)}function Ke(t,e){return bt("notEqual",t,e,D(t))}function Le(t,e){throw new Error("Impl type?")}function Oe(t){return vt("packHalf2x16",t,A)}function Qe(t){return vt("packUnorm2x16",t,A)}function We(t){return vt("packSnorm2x16",t,A)}function Ze(t,e){return bt("pow",t,e)}function tn(t){return vt("radians",t)}function en(t,e){return bt("reflect",t,e)}function nn(t,e,n){return gt("refract",t,e,n)}function rn(t){return vt("round",t)}function cn(t){return vt("roundEven",t)}function sn(t){return vt("sign",t)}function un(t){return vt("sin",t)}function on(t){return vt("sinh",t)}function hn(t,e,n){return gt("smoothstep",t,e,n)}function ln(t){return vt("sqrt",t)}function an(t,e){return bt("step",t,e,e.constructor)}function fn(t){return vt("tan",t)}function pn(t){return vt("tanh",t)}function dn(t,e,n){return gt("texelFetch",t,e,n,_)}function yn(t,e,n,r){throw new Error("Impl type")}function wn(t,e,n){throw new Error("Impl type")}function mn(t,e){return bt("texture",t,e,_)}function vn(t,e,n,r){throw new Error("Impl type")}function bn(t,e,n,r,i){throw new Error("Impl type")}function gn(t,e,n){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function En(t,e,n){throw new Error("Impl type")}function $n(t,e,n,r){throw new Error("Impl type")}function zn(t,e,n,r,i){throw new Error("Impl type")}function Tn(t,e,n){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e,n,r){throw new Error("Impl type")}function Fn(t,e){throw new Error("Impl type")}function kn(t){return vt("transpose",t)}function Mn(t){return vt("trunc",t)}function Sn(t){return vt("unpackHalf2x16",t,X)}function Rn(t){return vt("unpackUnorm2x16",t,X)}function jn(t){return vt("unpackSnorm2x16",t,X)}function Bn(t,e){const n=Ze(new C(2),new C(e));return[new _(Ge(t.x,n),Te(t.x.divide(n)),Ge(t.y,n),Te(t.y.divide(n))),new _(Ge(t.z,n),Te(t.z.divide(n)),Ge(t.w,n),Te(t.w.divide(n)))]}function qn(t,e){const{initialValue:n,xRange:r,yRange:i,callback:c}=e,[s,u]=r,[o,h]=i,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=c(f,t.get(l,a),l,a).setDebugName("callback"),d=It({iterX:l,iterY:a,accumulator:f},n.constructor,p,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:i})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${s}; ${e} < ${u}; ${e}++) {\n\n ${i.body}\n\n ${r} = ${i.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,q as FixedArray,U as FixedArray2D,C as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,it as Mat4,P as Sampler2D,A as UInt,G as UVec2,H as UVec3,V as UVec4,X as Vec2,Y as Vec3,_ as Vec4,Jt as _or,Lt as _xor,Wt as abs,Zt as acos,te as acosh,Mt as add,ee as all,Ot as and,ne as any,re as asin,ie as asinh,ce as atan,se as atanh,qt as bitAnd,Ct as bitNot,Ut as bitOr,Bt as bitRShift,jt as bitShift,Pt as bitXor,It as block,ue as ceil,oe as clamp,Nt as cond,he as cos,le as cosh,ae as cross,fe as dFdx,pe as dFdy,wt as defineArrayRead,dt as definePropertyAccess,yt as definePropertyAccess2D,de as degrees,ye as determinant,we as distance,kt as divide,me as dot,Xt as equal,ve as equalComponent,xe as exp,Ie as exp2,Ee as faceforward,$t as findIndex,ut as float,$e as floatBitsToInt,ze as floatBitsToUint,Te as floor,Ne as fract,De as fwidth,k as getTypeElementLengthForType,zt as glslFindIndex,Gt as greaterThan,be as greaterThanComponent,Ht as greaterThanEqual,ge as greaterThanEqualComponent,Tt as ifElse,st as int,Fe as intBitsToFloat,Rt as intMod,Me as inverse,Se as inversesqrt,Re as isinf,je as isnan,Be as length,_t as lessThan,qe as lessThanComponent,At as lessThanEqual,Ue as lessThanEqualComponent,Pe as log,Ce as log2,at as mat2,ft as mat3,pt as mat4,Xe as matrixCompMult,Ye as max,_e as min,Ae as mix,Ge as mod,He as modf,Ft as multiply,Et as namedScope,xt as negate,Ve as normalize,Je as not,Yt as notEqual,Ke as notEqualComponent,Vt as or,Le as outerProduct,Oe as packHalf2x16,We as packSnorm2x16,Qe as packUnorm2x16,Ze as pow,tn as radians,qn as reduce2D,en as reflect,nn as refract,rn as round,cn as roundEven,sn as sign,un as sin,on as sinh,hn as smoothstep,ln as sqrt,an as step,St as subtract,fn as tan,pn as tanh,dn as texelFetch,yn as texelFetchOffset,wn as texture,mn as texture2D,vn as textureGrad,bn as textureGradOffset,gn as textureLod,xn as textureLodOffset,In as textureOffset,En as textureProj,$n as textureProjGrad,zn as textureProjGradOffset,Tn as textureProjLod,Nn as textureProjLodOffset,Dn as textureProjOffset,Fn as textureSize,N as transformFloatToInt,z as transformFloatToUInt,T as transformIntToFloat,D as transformTypeToBooleanType,$ as transformUIntToFloat,kn as transpose,Mn as trunc,ke as uintBitsToFloat,Sn as unpackHalf2x16,jn as unpackSnorm2x16,Rn as unpackUnorm2x16,Bn as unpackVec4,ot as vec2,ht as vec3,lt as vec4,Dt as when,Kt as xor};
2
+ import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderPropertyAccessNode as r,ShaderPropertyAccess2DNode as i,ShaderFunctionNode as c,ShaderConditionNode as s,ShaderArrayWriteNode as u,ShaderArrayReadNode as o,ShaderBlockNode as h,ShaderScopeNode as l}from"./ShaderGraphNode.js";var a,p,f,d,y,w,m,v,b,g,x,I,E;function $(t){switch(t.type){case"uint":return C;case"uvec2":return X;case"uvec3":return Y;case"uvec4":return _;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"float":return A;case"vec2":return G;case"vec3":return H;case"vec4":return V;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"int":return C;case"ivec2":return X;case"ivec3":return Y;case"ivec4":return _;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function D(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return C;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return A;default:throw new Error("Unable to handle type")}}function k(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*k(t.elementType)}}function M(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>ct[t]);throw new Error("Unable to find type family")}function S(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>S(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=M(t.type);return dt(t,n,e[n.length-1])}}})}function R(t){return new Proxy(t,{construct:(t,e,n)=>S(new t(...e))})}function j(t,e){if(!Number.isSafeInteger(t)||t<0||t>=e)throw new B}class B extends Error{}class q extends e{static{this.type="array"}constructor(t,e,n=null){super(),this.elementType=t,this.size=e,this.writeNode=n,this.type="array"}get children(){return this.writeNode?[this.writeNode]:[this.elementType]}clone(){const t=this.writeNode?n(this.writeNode):null,e=new q(n(this.elementType),this.size,t);return super.cloneInto(e),e}set(t,e){return"number"==typeof t&&j(t,this.size),new q(n(this.elementType),this.size,new u(this,t,e))}get(t,e){"number"==typeof t&&j(t,this.size);const n=null!=e?new W(e):null;if(null!=n){const e=F(this.elementType.constructor);return yt(this,new W(t),n,e)}return wt(this,t,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return $t(this,t,e,n)}glslFindIndex(t,e,n){return zt(this,t,e,n)}static ofType(t,e){const n=t;return class extends q{static{this.elementType=t}static{this.size=e}constructor(){super(new n,e)}}}}class U extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.type="array-2d",this.children=Array(e*n).fill(t)}clone(){const t=new U(n(this.elementType),this.xSize,this.ySize,this.isRowMajor);return t.children=this.children.map(n),super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(q,{construct:(i,c)=>new U(new t,e,n,r)})}}class P extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new P;return t.children=this.children.map(n),super.cloneInto(t),t}}class C extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new C(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}}let X=class extends e{static{a=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new a(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};X=a=t([R],X);let Y=class extends e{static{p=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){throw new B}clone(){const t=new p(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};Y=p=t([R],Y);let _=class extends e{static{f=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){return dt(this,"[3]",C)}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};_=f=t([R],_);let A=class extends e{static{d=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new d(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ft(this,O(t,d))}add(t){return Mt(this,O(t,d))}subtract(t){return St(this,O(t,d))}divide(t){return kt(this,O(t,d))}};A=d=t([R],A);let G=class extends e{static{y=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};G=y=t([R],G);let H=class extends e{static{w=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",A)}get 1(){return dt(this,"[1]",A)}get 2(){return dt(this,"[2]",A)}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};H=w=t([R],H);let V=class extends e{static{m=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new m(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",A)}get 1(){return dt(this,"[1]",A)}get 2(){return dt(this,"[2]",A)}get 3(){return dt(this,"[3]",A)}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};V=m=t([R],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Ot(this,t)}or(t){return Vt(this,t)}xor(t){return Kt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{v=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=v=t([R],K);let L=class extends e{static{b=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=b=t([R],L);let Q=class extends e{static{g=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new g(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=g=t([R],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ft(this,O(t,W))}add(t){return Mt(this,O(t,W))}subtract(t){return St(this,O(t,W))}divide(t){return kt(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{x=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};Z=x=t([R],Z);let tt=class extends e{static{I=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};tt=I=t([R],tt);let et=class extends e{static{E=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new E(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){return dt(this,"[3]",W)}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};et=E=t([R],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return yt(this,new W(t),new W(e),C)}multiply(t){return Ft(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=on(t),n=le(t);return new rt(n,e,0,xt(e),n,0,0,0,1)}constructor(t,e,n,r,i,c,s,u,o){super(),this.type="mat3",this.children=[t,e,n,r,i,c,s,u,o]}add(t){return Mt(this,t)}multiply(t){return Ft(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class it extends e{static{this.type="mat4"}static identity(){return new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,i,c,s,u,o,h,l,a,p,f,d,y){super(),this.type="mat4",this.children=[t,e,n,r,i,c,s,u,o,h,l,a,p,f,d,y]}static fromColumns(t,e,n,r){return new it(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Ft(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new it(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const ct={float:C,vec2:X,vec3:Y,vec4:_,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:A,uvec2:G,uvec3:H,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},st=(...t)=>new W(...t),ut=(...t)=>new C(...t),ot=(...t)=>new X(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new nt(...t),pt=(...t)=>new rt(...t),ft=(...t)=>new it(...t);function dt(t,e,n){const i=new n(new r(e,t,n));return i.isImplicit=!0,i}function yt(t,e,n,r){const c=new r(new i(e,n,t,r));return c.isImplicit=!0,c}function wt(t,e,n){const r=new n(new o(t,e,n));return r.isImplicit=!0,r}function mt(t,e,n,r=null){if(r){const i=new r,s=new r(new c(t,[e,n],!0,!1,i));return s.isImplicit=!0,s}if("float"===e.type||"int"===e.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const i=new e.constructor(new c(t,[e,n],!0,!1,e.constructor));return i.isImplicit=!0,i}function vt(t,e,n=e.constructor){const r=new n(new c(t,[e],!1,!1,n));return r.isImplicit=!0,r}function bt(t,e,n,r=e.constructor){const i=new r(new c(t,[e,n],!1,!1,r));return i.isImplicit=!0,i}function gt(t,e,n,r,i=e.constructor){const s=new i(new c(t,[e,n,r],!1,!1,i));return s.isImplicit=!0,s}function xt(t){return Ft(t,ut(-1))}function It(t,e,n,r){return new e(new h(t,e,n,r))}function Et(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new l(n).setDebugName(e));return r.isImplicit=!0,r}function $t(t,e,n=0,r=t.size){const i=new W(n).setMutable().setDebugName("FindIndexIterator"),c=e(t.get(i)).setDebugName("FindIndexPredicate"),s=It({iter:i},W,c,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return s}function zt(t,e,n=0,r=t.size){const i=It({array:t},W,null,({out:t,array:i})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:i,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return i}function Tt(t,e,n){const r="function"==typeof e?e():e,i="function"==typeof n?n():n,c=new r.constructor(new s(t,r,i));return c.isImplicit=!0,c}function Nt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const i=e.slice(0,r),c=e[r][1],s=new n(i.reduceRight((t,e)=>Tt(e[0],e[1],t),c));return s.isImplicit=!0,s}function Dt(t,e){const n=new e.constructor(new s(t,e,null));return n.isImplicit=!0,n}function Ft(t,e){return mt("*",t,e)}function kt(t,e){return mt("/",t,e)}function Mt(t,e){return mt("+",t,e)}function St(t,e){return mt("-",t,e)}function Rt(t,e){return mt("%",t,e)}function jt(t,e){return mt("<<",t,e)}function Bt(t,e){return mt(">>",t,e)}function qt(t,e){return mt("&",t,e)}function Ut(t,e){return mt("|",t,e)}function Pt(t,e){return mt("^",t,e)}function Ct(t){return vt("~",t)}function Xt(t,e){return mt("==",t,e,J)}function Yt(t,e){return mt("!=",t,e,J)}function _t(t,e){return mt("<",t,e,J)}function At(t,e){return mt("<=",t,e,J)}function Gt(t,e){return mt(">",t,e,J)}function Ht(t,e){return mt(">=",t,e,J)}function Vt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Jt(t,e),t[0])}function Jt(t,e){return mt("||",t,e,J)}function Kt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Lt(t,e),t[0])}function Lt(t,e){return mt("^^",t,e,J)}function Ot(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Qt(t,e),t[0])}function Qt(t,e){return mt("&&",t,e,J)}function Wt(t){return vt("abs",t)}function Zt(t){return vt("acos",t)}function te(t){return vt("acosh",t)}function ee(t){return vt("all",t,J)}function ne(t){return vt("any",t,J)}function re(t){return vt("asin",t)}function ie(t){return vt("asinh",t)}function ce(t,e){return null==e?vt("atan",t):bt("atan",t,e,t.constructor)}function se(t,e){const n=Wt(e),r=Wt(t),i=_e(n,r),c=Ae(n,r);let s=new C(1).divide(i);s=c.multiply(s);const u=s.multiply(s);let o=new C(-.01348047);return o=o.multiply(u).add(.057477314),o=o.multiply(u).subtract(.121239071),o=o.multiply(u).add(.195635925),o=o.multiply(u).subtract(.332994597),o=o.multiply(u).add(.99999563),s=o.multiply(s),s=Tt(Gt(r,n),new C(1.570796327).subtract(s),s),s=Tt(_t(e,new C(0)),new C(3.141592654).subtract(s),s),Tt(_t(t,new C(0)),s.multiply(-1),s)}function ue(t){return vt("atanh",t)}function oe(t){return vt("ceil",t)}function he(t,e,n){return gt("clamp",t,e,n,t.constructor)}function le(t){return vt("cos",t)}function ae(t){return vt("cosh",t)}function pe(t,e){return bt("cross",t,e,t.constructor)}function fe(t){return vt("dFdX",t)}function de(t){return vt("dFdY",t)}function ye(t){return vt("degrees",t)}function we(t){return vt("determinant",t,C)}function me(t,e){return bt("distance",t,e,C)}function ve(t,e){return bt("dot",t,e,C)}function be(t,e){return bt("equal",t,e,D(t))}function ge(t,e){return bt("greaterThan",t,e,D(t))}function xe(t,e){return bt("greaterThanEqual",t,e,D(t))}function Ie(t){return vt("exp",t)}function Ee(t){return vt("exp2",t)}function $e(t,e,n){return gt("faceforward",t,e,n)}function ze(t){return vt("floatBitsToInt",t,N(t))}function Te(t){return vt("floatBitsToUint",t,z(t))}function Ne(t){return vt("floor",t)}function De(t){return vt("fract",t)}function Fe(t){return vt("fwidth",t)}function ke(t){return vt("intBitsToFloat",t,T(t))}function Me(t){return vt("uintBitsToFloat",t,$(t))}function Se(t){return vt("inverse",t,C)}function Re(t){return vt("inversesqrt",t)}function je(t){return vt("isinf",t,D(t))}function Be(t){return vt("isnan",t,D(t))}function qe(t){return vt("length",t,C)}function Ue(t,e){return bt("lessThan",t,e,D(t))}function Pe(t,e){return bt("lessThanEqual",t,e,D(t))}function Ce(t){return vt("log",t)}function Xe(t){return vt("log2",t)}function Ye(t,e){return bt("matrixCompMult",t,e)}function _e(t,e){return bt("max",t,e)}function Ae(t,e){return bt("min",t,e)}function Ge(t,e,n){return gt("mix",t,e,n)}function He(t,e){return bt("mod",t,e)}function Ve(t,e){throw new Error("modf not implemented")}function Je(t){return vt("normalize",t)}function Ke(t){return"bool"===t.type?vt("!",t):vt("not",t)}function Le(t,e){return bt("notEqual",t,e,D(t))}function Oe(t,e){throw new Error("Impl type?")}function Qe(t){return vt("packHalf2x16",t,A)}function We(t){return vt("packUnorm2x16",t,A)}function Ze(t){return vt("packSnorm2x16",t,A)}function tn(t,e){return bt("pow",t,e)}function en(t){return vt("radians",t)}function nn(t,e){return bt("reflect",t,e)}function rn(t,e,n){return gt("refract",t,e,n)}function cn(t){return vt("round",t)}function sn(t){return vt("roundEven",t)}function un(t){return vt("sign",t)}function on(t){return vt("sin",t)}function hn(t){return vt("sinh",t)}function ln(t,e,n){return gt("smoothstep",t,e,n)}function an(t){return vt("sqrt",t)}function pn(t,e){return bt("step",t,e,e.constructor)}function fn(t){return vt("tan",t)}function dn(t){return vt("tanh",t)}function yn(t,e,n){return gt("texelFetch",t,e,n,_)}function wn(t,e,n,r){throw new Error("Impl type")}function mn(t,e,n){throw new Error("Impl type")}function vn(t,e){return bt("texture",t,e,_)}function bn(t,e,n,r){throw new Error("Impl type")}function gn(t,e,n,r,i){throw new Error("Impl type")}function xn(t,e,n){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n){throw new Error("Impl type")}function zn(t,e,n,r){throw new Error("Impl type")}function Tn(t,e,n,r,i){throw new Error("Impl type")}function Nn(t,e,n){throw new Error("Impl type")}function Dn(t,e,n,r){throw new Error("Impl type")}function Fn(t,e,n,r){throw new Error("Impl type")}function kn(t,e){throw new Error("Impl type")}function Mn(t){return vt("transpose",t)}function Sn(t){return vt("trunc",t)}function Rn(t){return vt("unpackHalf2x16",t,X)}function jn(t){return vt("unpackUnorm2x16",t,X)}function Bn(t){return vt("unpackSnorm2x16",t,X)}function qn(t,e){const n=tn(new C(2),new C(e));return[new _(He(t.x,n),Ne(t.x.divide(n)),He(t.y,n),Ne(t.y.divide(n))),new _(He(t.z,n),Ne(t.z.divide(n)),He(t.w,n),Ne(t.w.divide(n)))]}function Un(t,e){const{initialValue:n,xRange:r,yRange:i,callback:c}=e,[s,u]=r,[o,h]=i,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),p=n.setMutable().setDebugName("accumulator"),f=c(p,t.get(l,a),l,a).setDebugName("callback"),d=It({iterX:l,iterY:a,accumulator:p},n.constructor,f,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:i})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${s}; ${e} < ${u}; ${e}++) {\n\n ${i.body}\n\n ${r} = ${i.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,q as FixedArray,U as FixedArray2D,C as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,it as Mat4,P as Sampler2D,A as UInt,G as UVec2,H as UVec3,V as UVec4,X as Vec2,Y as Vec3,_ as Vec4,Jt as _or,Lt as _xor,Wt as abs,Zt as acos,te as acosh,Mt as add,ee as all,Ot as and,ne as any,re as asin,ie as asinh,ce as atan,se as atan2,ue as atanh,qt as bitAnd,Ct as bitNot,Ut as bitOr,Bt as bitRShift,jt as bitShift,Pt as bitXor,It as block,oe as ceil,he as clamp,Nt as cond,le as cos,ae as cosh,pe as cross,fe as dFdx,de as dFdy,wt as defineArrayRead,dt as definePropertyAccess,yt as definePropertyAccess2D,ye as degrees,we as determinant,me as distance,kt as divide,ve as dot,Xt as equal,be as equalComponent,Ie as exp,Ee as exp2,$e as faceforward,$t as findIndex,ut as float,ze as floatBitsToInt,Te as floatBitsToUint,Ne as floor,De as fract,Fe as fwidth,k as getTypeElementLengthForType,zt as glslFindIndex,Gt as greaterThan,ge as greaterThanComponent,Ht as greaterThanEqual,xe as greaterThanEqualComponent,Tt as ifElse,st as int,ke as intBitsToFloat,Rt as intMod,Se as inverse,Re as inversesqrt,je as isinf,Be as isnan,qe as length,_t as lessThan,Ue as lessThanComponent,At as lessThanEqual,Pe as lessThanEqualComponent,Ce as log,Xe as log2,at as mat2,pt as mat3,ft as mat4,Ye as matrixCompMult,_e as max,Ae as min,Ge as mix,He as mod,Ve as modf,Ft as multiply,Et as namedScope,xt as negate,Je as normalize,Ke as not,Yt as notEqual,Le as notEqualComponent,Vt as or,Oe as outerProduct,Qe as packHalf2x16,Ze as packSnorm2x16,We as packUnorm2x16,tn as pow,en as radians,Un as reduce2D,nn as reflect,rn as refract,cn as round,sn as roundEven,un as sign,on as sin,hn as sinh,ln as smoothstep,an as sqrt,pn as step,St as subtract,fn as tan,dn as tanh,yn as texelFetch,wn as texelFetchOffset,mn as texture,vn as texture2D,bn as textureGrad,gn as textureGradOffset,xn as textureLod,In as textureLodOffset,En as textureOffset,$n as textureProj,zn as textureProjGrad,Tn as textureProjGradOffset,Nn as textureProjLod,Dn as textureProjLodOffset,Fn as textureProjOffset,kn as textureSize,N as transformFloatToInt,z as transformFloatToUInt,T as transformIntToFloat,D as transformTypeToBooleanType,$ as transformUIntToFloat,Mn as transpose,Sn as trunc,Me as uintBitsToFloat,Rn as unpackHalf2x16,Bn as unpackSnorm2x16,jn as unpackUnorm2x16,qn as unpackVec4,ot as vec2,ht as vec3,lt as vec4,Dt as when,Kt as xor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as i}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as s}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as o}from"../../../definitions.js";import{AAnimatedMeshWriter as n}from"./AnimatedMeshWriter.js";import{angle as a,sizing as c,animationPointerAndBaseSizeAndReferenceSize as l,uv as m,offset as d,pos as h,bitset as p,id as u,lineLength as f,value1Position2Value2 as y,zoomRange as x}from"./attributes.js";import{createComputedAnimatedMeshParams as M}from"./ComputedAnimatedParams.js";const P=64,g=64,v=2;class b extends n{get vertexSpec(){return{createComputedParams:M,optionalAttributes:{zoomRange:x,value1Position2Value2:y,lineLength:f},attributes:{id:u,bitset:p,pos:h,offset:d.marker,uv:m.marker,animationPointerAndBaseSizeAndReferenceSize:l,sizing:c,angle:a}}}_write(e,{target:i,effectGeometry:s}){const r=this.evaluatedMeshParams.sprite,{textureBinding:o}=r;e.recordStart(this.instanceId,this.attributeLayout,o);const n=i.getDisplayId();if(this.shift&&"esriGeometryPolyline"===i.geometryType){if(!s){const s=t.fromFeatureSetReaderCIM(i);s&&this._writeParticles(e,i,s)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,i);else if("esriGeometryPolygon"===i.geometryType){const t=i.readCentroidForDisplay();if(!t)return;const[s,r]=t.coords;this._writeQuad(e,n,s,r)}else if("esriGeometryPoint"===i.geometryType){const t=i.readXForDisplay(),s=i.readYForDisplay();this._writeQuad(e,n,t,s)}else{const t=i.readGeometryForDisplay();t&&t.forEachVertex((t,i)=>{this._writeQuad(e,n,t,i)})}e.recordEnd()}_writePlacedMarkers(i,o){const n=t.fromFeatureSetReaderCIM(o)?.clone();if(!n)return;const a=-1,c=r.getPlacement(n,a,this.evaluatedMeshParams.placement,e(1),i.id);if(!c)return;const l=o.getDisplayId();let m=c.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>s||Math.abs(t)>s){m=c.next();continue}const r=-m.getAngle();i.recordBounds(e,t,P,g),this.shift?d&&this._writeQuad(i,l,d[0],d[1],void 0,r):this._writeQuad(i,l,e,t,void 0,r),d=[e,t],m=c.next()}}_writeParticles(e,t,s){const r=t.getDisplayId(),o=Math.max(this.evaluatedMeshParams.baseSize,this.evaluatedMeshParams.baseSize),n=i(s,2*o,!1);if(n)for(;n.nextPath();){const t=[];for(;n.nextPoint();)t.push([n.x,n.y]);const i=w(t);let s=0;for(let e=1;e<t.length;e++){const i=t[e][0]-t[e-1][0],r=t[e][1]-t[e-1][1],o=Math.sqrt(i*i+r*r);s+=o}const o=t=>{for(const o of i){const{a:i,b:n}=o;this._writeQuad(e,r,i.position[0],i.position[1],[i.distance-t,n.position[0],n.position[1],n.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(i.direction[1],i.direction[0]):0,s,!0)}},{placement:a}=this.evaluatedMeshParams;if(!a||"placementTemplate"in a||"CIMMarkerPlacementOnVertices"===a.type){let e;if(a&&"CIMMarkerPlacementOnVertices"!==a.type)e=a.placementTemplate;else{e=[0];for(const t of i){const{a:i,b:s}=t,r=i.position[0]-s.position[0],o=i.position[1]-s.position[1],n=Math.sqrt(r*r+o*o);e.push(n)}}let t=-1*s;for(;t<(1+v/2)*s;)for(const i of e)t+=i,o(t)}else"CIMMarkerPlacementAtExtremities"===a.type?"JustBegin"===a.extremityPlacement?o(1):"JustEnd"===a.extremityPlacement?(o(s-1),o(-1)):"Both"===a.extremityPlacement&&(o(1),o(s-1)):"CIMMarkerPlacementOnLine"===a.type&&("LineBeginning"===a.relativeTo?o(1):"LineEnd"===a.relativeTo?(o(s-1),o(-1)):"LineMiddle"===a.relativeTo&&o(s/2))}}_writeQuad(e,t,i,s,r,n=0,a=0,c=!1){const l=this.evaluatedMeshParams.sprite,{rect:m}=l,d=m.x+o,h=m.y+o,p=m.x+m.width-o,u=m.y+m.height-o,f=e.vertexCount();c||e.recordBounds(i,s,P,P);const y={texXmin:d,texYmin:h,texXmax:p,texYmax:u,value1Position2Value2:r,angle:n,lineLength:a};for(let o=0;o<4;o++)this._writeVertex(e,t,i,s,y);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function w(e){const t=[];let i=0;for(let s=1;s<e.length;s++){const r=e[s-1],o=e[s],n=o[0]-r[0],a=o[1]-r[1],c=Math.sqrt(n*n+a*a),l=n/c,m=a/c;t.push({a:{position:r,distance:i,direction:[l,m]},b:{position:o,distance:i+c,direction:[l,m]}}),i+=c}return t}class C extends b{constructor(){super(...arguments),this.shift=!1}}class _ extends b{constructor(){super(...arguments),this.shift=!0}}export{C as AnimatedMarkerMeshWriter,_ as AnimatedMarkerShiftMeshWriter};
2
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as i}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as s}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as n}from"../../../definitions.js";import{AAnimatedMeshWriter as o}from"./AnimatedMeshWriter.js";import{angle as a,sizing as c,animationPointerAndBaseSizeAndReferenceSize as l,uv as m,offset as d,pos as p,bitset as h,id as u,lineLength as f,value1Position2Value2 as x,zoomRange as y}from"./attributes.js";import{createComputedAnimatedMeshParams as P}from"./ComputedAnimatedParams.js";const M=64,g=64,v=2;class b extends o{get vertexSpec(){return{createComputedParams:P,optionalAttributes:{zoomRange:y,value1Position2Value2:x,lineLength:f},attributes:{id:u,bitset:h,pos:p,offset:d.marker,uv:m.marker,animationPointerAndBaseSizeAndReferenceSize:l,sizing:c,angle:a}}}_write(e,{target:i,effectGeometry:s}){const r=this.evaluatedMeshParams.sprite,{textureBinding:n}=r;e.recordStart(this.instanceId,this.attributeLayout,n);const o=i.getDisplayId();if(this.shift&&"esriGeometryPolyline"===i.geometryType){if(!s){const s=t.fromFeatureSetReaderCIM(i);s&&this._writeParticles(e,i,s)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,i);else if("esriGeometryPolygon"===i.geometryType){const t=i.readCentroidForDisplay();if(!t)return;const[s,r]=t.coords;this._writeQuad(e,o,s,r)}else if("esriGeometryPoint"===i.geometryType){const t=i.readXForDisplay(),s=i.readYForDisplay();this._writeQuad(e,o,t,s)}else{const t=i.readGeometryForDisplay();t&&t.forEachVertex((t,i)=>{this._writeQuad(e,o,t,i)})}e.recordEnd()}_writePlacedMarkers(i,n){const o=t.fromFeatureSetReaderCIM(n)?.clone();if(!o)return;const a=-1,c=r.getPlacement(o,a,this.evaluatedMeshParams.placement,e(1),i.id);if(!c)return;const l=n.getDisplayId();let m=c.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>s||Math.abs(t)>s){m=c.next();continue}const r=-m.getAngle();i.recordBounds(e,t,M,g),this.shift?d&&this._writeQuad(i,l,d[0],d[1],void 0,r):this._writeQuad(i,l,e,t,void 0,r),d=[e,t],m=c.next()}}_writeParticles(e,t,s){const r=t.getDisplayId(),n=Math.max(this.evaluatedMeshParams.baseSize,this.evaluatedMeshParams.baseSize),o=i(s,2*n,!1);if(!o)return;const{placement:a}=this.evaluatedMeshParams,c=w(o,a?.placePerPart??!1);for(const{particles:i,distance:l}of c){const t=t=>{for(const s of i){const{a:i,b:n}=s;this._writeQuad(e,r,i.position[0],i.position[1],[i.distance-t,n.position[0],n.position[1],n.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(i.direction[1],i.direction[0]):0,l,!0)}};if(!a||"placementTemplate"in a||"CIMMarkerPlacementOnVertices"===a.type){let e;if(a&&"CIMMarkerPlacementOnVertices"!==a.type)e=a.placementTemplate;else{e=[0];for(const t of i){const{a:i,b:s}=t,r=i.position[0]-s.position[0],n=i.position[1]-s.position[1],o=Math.sqrt(r*r+n*n);e.push(o)}}let s=-1*l;for(;s<(1+v/2)*l;)for(const i of e)s+=i,t(s)}else"CIMMarkerPlacementAtExtremities"===a.type?"JustBegin"===a.extremityPlacement?t(1):"JustEnd"===a.extremityPlacement?(t(l-1),t(-1)):"Both"===a.extremityPlacement&&(t(1),t(l-1)):"CIMMarkerPlacementOnLine"===a.type&&("LineBeginning"===a.relativeTo?t(1):"LineEnd"===a.relativeTo?(t(l-1),t(-1)):"LineMiddle"===a.relativeTo&&t(l/2))}}_writeQuad(e,t,i,s,r,o=0,a=0,c=!1){const l=this.evaluatedMeshParams.sprite,{rect:m}=l,d=m.x+n,p=m.y+n,h=m.x+m.width-n,u=m.y+m.height-n,f=e.vertexCount();c||e.recordBounds(i,s,M,M);const x={texXmin:d,texYmin:p,texXmax:h,texYmax:u,value1Position2Value2:r,angle:o,lineLength:a};for(let n=0;n<4;n++)this._writeVertex(e,t,i,s,x);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function w(e,t){const i=[];if(t)for(;e.nextPath();){const t=[];for(;e.nextPoint();)t.push([e.x,e.y]);const s=[];let r=0;for(let e=1;e<t.length;e++){const i=t[e-1],n=t[e],o=n[0]-i[0],a=n[1]-i[1],c=Math.sqrt(o*o+a*a),l=o/c,m=a/c;s.push({a:{position:i,distance:r,direction:[l,m]},b:{position:n,distance:r+c,direction:[l,m]}}),r+=c}s.length>0&&i.push({particles:s,distance:r})}else{const t=[];let s=0;for(;e.nextPath();){const i=[];for(;e.nextPoint();)i.push([e.x,e.y]);for(let e=1;e<i.length;e++){const r=i[e-1],n=i[e],o=n[0]-r[0],a=n[1]-r[1],c=Math.sqrt(o*o+a*a),l=o/c,m=a/c;t.push({a:{position:r,distance:s,direction:[l,m]},b:{position:n,distance:s+c,direction:[l,m]}}),s+=c}}t.length>0&&i.push({particles:t,distance:s})}return i}class C extends b{constructor(){super(...arguments),this.shift=!1}}class _ extends b{constructor(){super(...arguments),this.shift=!0}}export{C as AnimatedMarkerMeshWriter,_ as AnimatedMarkerShiftMeshWriter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{getMinMaxZoom as t}from"../fill/meshWriterUtils.js";import{MeshWriter as r}from"../mesh/MeshWriter.js";import{DataType as i}from"../../../../../../webgl/enums.js";const o={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:i.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:i.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:i.UNSIGNED_BYTE,count:1,pack:e=>0},offset:{type:i.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const r=e(t),i=-r/2,o=-r/2;return[[i,o],[i+r,o],[i,o+r],[i+r,o+r]]}}},texCoords:{type:i.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},referenceSize:{type:i.UNSIGNED_BYTE,count:1,pack:({size:t})=>e(t)},zoomRange:{type:i.UNSIGNED_BYTE,count:2,pack:({scaleInfo:e},{tileInfo:r})=>t(e,r)}}};class s extends r{constructor(){super(...arguments),this.vertexSpec=o}_write(t,{target:r}){const i=r.getDisplayId(),o=this.evaluatedMeshParams.minPixelBuffer,s=Math.max(e(this.evaluatedMeshParams.size),o);let a,c;if("esriGeometryPoint"===r.geometryType)a=r.readXForDisplay(),c=r.readYForDisplay();else{const e=r.readCentroidForDisplay();if(!e)return;a=e?.coords[0],c=e?.coords[1]}t.recordStart(this.instanceId,this.attributeLayout),t.recordBounds(a,c,s,s);const n=t.vertexCount();this._writeVertex(t,i,a,c),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2),t.recordEnd()}}export{s as PieChartMeshWriter};
2
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{getMinMaxZoom as t}from"../fill/meshWriterUtils.js";import{MeshWriter as r}from"../mesh/MeshWriter.js";import{DataType as i}from"../../../../../../webgl/enums.js";const o={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:i.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:r})=>t(e,r)}},attributes:{id:{type:i.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:i.UNSIGNED_BYTE,count:1,pack:e=>0},pos:{type:i.SHORT,count:2,packPrecisionFactor:10,pack:"position"},offset:{type:i.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const r=e(t),i=-r/2,o=-r/2;return[[i,o],[i+r,o],[i,o+r],[i+r,o+r]]}}},texCoords:{type:i.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},referenceSize:{type:i.UNSIGNED_BYTE,count:1,pack:({size:t})=>e(t)}}};class s extends r{constructor(){super(...arguments),this.vertexSpec=o}_write(t,{target:r}){const i=r.getDisplayId(),o=this.evaluatedMeshParams.minPixelBuffer,s=Math.max(e(this.evaluatedMeshParams.size),o);let a,c;if("esriGeometryPoint"===r.geometryType)a=r.readXForDisplay(),c=r.readYForDisplay();else{const e=r.readCentroidForDisplay();if(!e)return;a=e?.coords[0],c=e?.coords[1]}t.recordStart(this.instanceId,this.attributeLayout),t.recordBounds(a,c,s,s);const n=t.vertexCount();this._writeVertex(t,i,a,c),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2),t.recordEnd()}}export{s as PieChartMeshWriter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GLSLShaderModule as e}from"../../GLSLShaderModule.js";import{Float as i,Vec4 as t,FixedArray as a,Vec2 as s,Mat3 as r,Sampler2D as o,Vec3 as l}from"../../graph/glsl.js";import{resolveIncludes as n}from"../../../shaders/sources/resolver.js";const p={hittestDist:i,hittestPos:s},d={size:i},y={filterFlags:o,animation:o,visualVariableData:o,dataDriven0:o,dataDriven1:o,dataDriven2:o,gpgpu:o},u={displayViewScreenMat3:r,displayViewMat3:r,displayMat3:r,viewMat3:r,tileMat3:r,displayZoomFactor:i,requiredZoomFactor:i,tileOffset:s,currentScale:i,currentZoom:i,metersPerSRUnit:i};class h extends e{constructor(){super(...arguments),this.vertexShader=n("materials/pie/pie.vert"),this.fragmentShader=n("materials/pie/pie.frag"),this.required={...u,...d,outlineWidth:i,colors:a,defaultColor:t,othersColor:t,outlineColor:t,donutRatio:i,sectorThreshold:i},this.textures=y,this.options={hittestUniforms:p,visualVariableSizeMinMaxValue:{minMaxValueAndSize:t},visualVariableSizeScaleStops:{sizes:{type:"array",elementType:i,size:8},values:{type:"array",elementType:i,size:8}},visualVariableSizeStops:{sizes:{type:"array",elementType:i,size:8},values:{type:"array",elementType:i,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:i},visualVariableOpacity:{opacities:{type:"array",elementType:i,size:8},opacityValues:{type:"array",elementType:i,size:8}},highlightUniforms:{highlightAll:i,activeReasons:i}},this.locations={pos:{index:0,type:s},id:{index:1,type:l},bitset:{index:2,type:i},offset:{index:3,type:s},texCoords:{index:4,type:s},referenceSize:{index:5,type:i},zoomRange:{index:6,type:s}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={type:"array",elementType:t,size:e}}}export{h as PieChartShader};
2
+ import{__decorate as t,__param as e}from"tslib";import{uniform as r,location as o,option as i,input as s,UniformGroup as l}from"../../GraphShaderModule.js";import{Float as a,FixedArray as n,Vec4 as u,Vec2 as d,Vec3 as c,Int as h,ifElse as p,greaterThan as m,or as w,max as y,lessThan as S,and as g,greaterThanEqual as b,equal as f,abs as x,length as v,smoothstep as V,mix as C,step as _,not as A,mod as z,atan2 as T,min as R,clamp as j,lessThanEqual as D,distance as M}from"../../graph/glsl.js";import{FeatureVertexInput as O,AFeatureShader as F,FeatureFragmentInput as I}from"../shaders/AFeatureShader.js";import{bitsetMarkerScaleSymbolsProportionally as q,bitsetMarkerAlignmentMap as W,noHit as U,trueHit as P,epsilon as G,cRadToDeg as H}from"../shaders/constants.js";import{hittestMarker as k,isRectHittest as B}from"../shaders/hittestUtils.js";import{getBit as E,isNan as J}from"../shaders/utils.js";import{VisualVariableOpacity as K}from"../shaders/VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as L}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as N}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Q}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as X}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as Y,getVisualVariableSize as Z}from"../shaders/vvUtils.js";const $=10;class tt extends l{}t([r(a)],tt.prototype,"outlineWidth",void 0),t([r(n.ofType(u,$))],tt.prototype,"colors",void 0),t([r(u)],tt.prototype,"defaultColor",void 0),t([r(u)],tt.prototype,"othersColor",void 0),t([r(u)],tt.prototype,"outlineColor",void 0),t([r(a)],tt.prototype,"donutRatio",void 0),t([r(a)],tt.prototype,"sectorThreshold",void 0),t([r(a)],tt.prototype,"fieldCount",void 0);class et extends O{}t([o(3,d)],et.prototype,"offset",void 0),t([o(4,d)],et.prototype,"texCoords",void 0),t([o(5,a)],et.prototype,"referenceSize",void 0),t([o(6,d)],et.prototype,"zoomRange",void 0);class rt extends I{}class ot extends F{constructor(){super(...arguments),this.type="PieChartShader"}vertex(t){const e=Y(this,t.id),r=Z(this,t.id,t.referenceSize).divide(t.referenceSize),o=t.referenceSize.multiply(.5).multiply(r),i=t.offset.multiply(r),s=E(t.bitset,q),l=this.chart.outlineWidth.multiply(s.multiply(r.subtract(1)).add(1)),p=this.view.displayViewScreenMat3.multiply(new c(t.pos,1)),m=this._getViewRotationMatrix(E(t.bitset,W)).multiply(new c(i,0)),w=new u(p.xy.add(m.xy),this.clip(t.id,t.zoomRange),1),y=null==this.hittestRequest?this._getSectorData(t.id):{filteredSectorToColorId:new n(new d(0),$),numberOfFilteredSectors:new h(0),maxSectorAngle:new a(0)};return{glPosition:w,color:new u(0),offset:t.texCoords.multiply(2).subtract(1),size:o,outlineWidth:l,opacity:e,filteredSectorToColorId:y.filteredSectorToColorId,numberOfFilteredSectors:y.numberOfFilteredSectors,maxSectorAngle:y.maxSectorAngle,...this.maybeRunHittest(t,{},o)}}fragment(t){return this.getFragmentOutput(null!=this.hittestRequest?new u(0):this._getColor(t),t)}hittest(t,e,r){const{viewMat3:o,tileMat3:i}=this.view,s=o.multiply(i).multiply(new c(t.pos,1)).xy;return p(B(this.hittestRequest),this._hittestScreenRect(s,r),p(m(k(s,r,this.hittestRequest.position),this.hittestRequest.distance),new a(U),new a(P)))}_getColor(t){const e=this._getAngle(t.offset),r=m(this.chart.sectorThreshold,new a(0));let o=p(w(m(t.maxSectorAngle,new a(0)),r),this.chart.othersColor,this.chart.defaultColor);const i=y(t.numberOfFilteredSectors.subtract(1),new h(0)),s=this._getSectorColor(t.filteredSectorToColorId,i),l=this._getSectorColor(t.filteredSectorToColorId,0),n=m(t.numberOfFilteredSectors,new h(0));let u=p(n,s,o),d=p(n,l,o),c=p(n,t.maxSectorAngle,new a(0)),_=p(n,new a(360),new a(0));const A=S(e,t.maxSectorAngle),z=g(r,S(t.maxSectorAngle.add(new a(G)),new a(360)));let T=new a(0);for(let w=0;w<$;w++){const r=t.filteredSectorToColorId.get(w).x,i=S(new h(w),t.numberOfFilteredSectors),l=g(A,g(i,g(m(r,e),b(e,T)))),n=w>0?this._getSectorColor(t.filteredSectorToColorId,w-1):s,y=p(S(new h(w+1),t.numberOfFilteredSectors),new h(w+1),new h(0)),v=this._getSectorColor(t.filteredSectorToColorId,y),V=p(g(z,f(new a(w),new a(0))),this.chart.othersColor,n),C=p(g(z,S(x(r.subtract(t.maxSectorAngle)),new a(G))),this.chart.othersColor,v);o=p(l,this._getSectorColor(t.filteredSectorToColorId,w),o),u=p(l,V,u),d=p(l,C,d),c=p(l,T,c),_=p(l,r,_),T=p(i,r,T)}const R=v(t.offset),j=R.multiply(t.size),D=new a(.75),M=e.subtract(c),O=_.subtract(e),F=V(D.multiply(-1),D,M.multiply(R)),I=V(D.multiply(-1),D,O.multiply(R));o=C(u,o,F).add(C(d,o,I)).subtract(o);const q=t.size.subtract(t.outlineWidth).subtract(D),W=this.chart.donutRatio.multiply(q),U=W.subtract(t.outlineWidth),P=p(m(U,D),V(U.subtract(D),U.add(D),j),new a(1)),H=new a(1).subtract(V(t.size.subtract(D.multiply(2)),t.size,j)),k=P.multiply(H),B=g(m(q,new a(0)),m(t.outlineWidth,new a(.25))),E=V(q.subtract(D),q.add(D),j),J=p(m(W,D),new a(1).subtract(V(W.subtract(D),W.add(D),j)),new a(0));return o=p(B,C(o,this.chart.outlineColor,J.add(E)),o),t.opacity.multiply(k).multiply(o)}_getSectorData(t){const e=this._getAttributeValues(t);let r=new a(0);for(let a=0;a<$;a++)r=r.add(e[a]);const o=this.chart.sectorThreshold.multiply(360);let i=new n(new d(0),$),s=new a(0),l=new h(0);for(let n=0;n<$;n++){const t=p(m(r,new a(0)),e[n].multiply(360).divide(r),new a(0)),u=p(m(t,o),new a(1),new a(0)),c=s.add(u.multiply(t)),w=new d(c,new a(n));i=i.set(l,w),s=c,l=l.add(new h(u))}return{filteredSectorToColorId:i,numberOfFilteredSectors:l,maxSectorAngle:s}}_getAttributeValues(t){const e=this.getAttributeDataCoords(t),r=this.storageTextures.getDataDrivenData0(e),o=this.storageTextures.getDataDrivenData1(e),i=this.storageTextures.getDataDrivenData2(e);return[this._getAttributeValue(r.x,0),this._getAttributeValue(r.y,1),this._getAttributeValue(r.z,2),this._getAttributeValue(r.w,3),this._getAttributeValue(o.x,4),this._getAttributeValue(o.y,5),this._getAttributeValue(o.z,6),this._getAttributeValue(o.w,7),this._getAttributeValue(i.x,8),this._getAttributeValue(i.y,9)]}_getAttributeValue(t,e){const r=_(new a(e+1),this.chart.fieldCount);return p(g(A(J(t)),m(t,new a(0))),t,new a(0)).multiply(r)}_getAngle(t){return z(new a(90).subtract(new a(H).multiply(T(t.y,t.x))),new a(360))}_getSectorColor(t,e){return this.chart.colors.get(new h(t.get(e).y))}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,r=this.view.displayMat3,o=new a(1).subtract(t);return e.multiply(t).add(r.multiply(o))}_hittestScreenRect(t,e){const r=this.hittestRequest.tlbr.xy,o=this.hittestRequest.tlbr.zw,i=R(r.x,o.x),s=R(r.y,o.y),l=y(r.x,o.x),n=y(r.y,o.y),u=new d(j(t.x,i,l),j(t.y,s,n));return p(D(M(t,u),e),new a(1),new a(0))}}t([r(tt)],ot.prototype,"chart",void 0),t([i(K)],ot.prototype,"visualVariableOpacity",void 0),t([i(L)],ot.prototype,"visualVariableSizeMinMaxValue",void 0),t([i(N)],ot.prototype,"visualVariableSizeScaleStops",void 0),t([i(Q)],ot.prototype,"visualVariableSizeStops",void 0),t([i(X)],ot.prototype,"visualVariableSizeUnitValue",void 0),t([e(0,s(et))],ot.prototype,"vertex",null),t([e(0,s(rt))],ot.prototype,"fragment",null);export{ot as PieChartShader,et as PieChartVertexInput,$ as maxPieChartFields};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getFeatureUniforms as i,getSelectionDefines as s,getFeatureStorageTextures as r,resolveDynamicUniforms as a,getFeaturePipelineState as h}from"../featureTechniqueUtils.js";import{PieChartShader as u}from"./PieChartShader.js";class o extends e{constructor(){super(...arguments),this.type=30,this.shaders={geometry:new u},this.symbologyPlane=2}render(e,u){const{painter:o}=e,{instance:n,target:l}=u,m=this.shaders.geometry,f=n.getInput(),S=f.uniforms.numberOfFields,V=t(e),d=i(e,l),g=s(e);m.setNumberOfFields(S),o.setShader({shader:m,uniforms:{...a(e,u.target,f.uniforms.shader),...d.storage,...d.view,...d.highlight,highlightUniforms:d.highlight,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},textures:r(e),defines:{VV_SIZE_MIN_MAX_VALUE:!!f.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!f.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!f.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!f.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!f.uniforms.shader.visualVariableOpacity,HITTEST:V,highlight:d.highlight?1:0,...g,numberOfFields:S},optionalAttributes:{},useComputeBuffer:V}),o.setPipelineState(h(e)),o.submitDraw(e,u)}}export{o as PieChartTechnique};
2
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getFeatureUniforms as t,getSelectionDefines as r,isHittest as s,getFeatureTextures as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{PieChartShader as n}from"./PieChartShader.js";class u extends e{constructor(){super(...arguments),this.type=30,this.shaders={geometry:new n},this.symbologyPlane=2}render(e,n){const{painter:u}=e,{instance:h,target:m}=n,p=h.getInput(),d=t(e,m),f=r(e);u.setShader({shader:this.shaders.geometry,uniforms:{...o(e,n.target,p.uniforms.shader),...d},textures:i(e),defines:{...f},optionalAttributes:p.optionalAttributes,useComputeBuffer:s(e)}),u.setPipelineState(a(e)),u.submitDraw(e,n)}}export{u as PieChartTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{labelPlacementOffsetPadding as i}from"../../../definitions.js";import{location as o,option as s,uniform as l,texture as a,define as r,input as n,ComputeVertexInput as p}from"../../GraphShaderModule.js";import{Vec4 as d,Vec2 as u,Float as y,Sampler2D as c,mod as m,step as f,and as h,lessThan as v,greaterThanEqual as w,Vec3 as b,Mat3 as x,ifElse as V,equal as S,greaterThan as g,Bool as z,texture2D as R,smoothstep as j,Int as A,bitRShift as C,bitAnd as O}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as T,FeatureFragmentInput as L}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as P,bitsetTextIsMapAligned as F,noHit as H,trueHit as N}from"../shaders/constants.js";import{isRectHittest as U,distPointTriangle as _,hittestScreenRect as k}from"../shaders/hittestUtils.js";import{MosaicInfo as q}from"../shaders/MosaicInfo.js";import{getBit as D}from"../shaders/utils.js";import{VisualVariableColor as I}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as B}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as E}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as W}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as G}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Z}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as J}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as K,getVisualVariableRotation as Q}from"../shaders/vvUtils.js";const X=360/254;class Y extends M{}t([o(3,d)],Y.prototype,"color",void 0),t([o(4,u)],Y.prototype,"offset",void 0),t([o(5,u)],Y.prototype,"textureUV",void 0),t([o(6,d)],Y.prototype,"fontAndReferenceSize",void 0),t([o(7,d)],Y.prototype,"outlineColor",void 0),t([o(8,d)],Y.prototype,"haloColor",void 0),t([o(9,u)],Y.prototype,"outlineAndHaloSize",void 0),t([o(10,u)],Y.prototype,"zoomRange",void 0),t([o(11,y)],Y.prototype,"clipAngle",void 0),t([o(12,d)],Y.prototype,"referenceSymbol",void 0),t([o(15,y)],Y.prototype,"visibility",void 0);class $ extends p{}t([o(13,u)],$.prototype,"offsetNextVertex1",void 0),t([o(14,u)],$.prototype,"offsetNextVertex2",void 0);class tt extends L{}class et extends T{constructor(){super(...arguments),this.type="TextShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e){const{clipAngle:i,zoomRange:o,visibility:s}=t,l=i.multiply(X),a=m(l.subtract(this.view.rotation),new y(360));let r=new y(0);const n=this.view.currentZoom,p=o.x,d=o.y,u=new y(1).subtract(f(p,n)).multiply(2),c=new y(h(w(a,new y(90)),v(a,new y(270)))).multiply(2),b=new y(2).multiply(new y(1).subtract(f(n,d)));return r=r.add(e.multiply(u)),r=r.add(e.multiply(c)),r=r.add(b),s&&(r=r.add(s)),r}vertex(t,e){const o=D(t.bitset,P),s=new y(1).subtract(o);let l=t.fontAndReferenceSize[0];const a=t.fontAndReferenceSize[1],r=t.fontAndReferenceSize[2],n=t.fontAndReferenceSize[3];let p=l.divide(r);const c=1===this.textRenderPassType?t.outlineColor:2===this.textRenderPassType?t.haloColor:this._getVertexColor(t),m=this.view.displayViewScreenMat3.multiply(new b(t.pos,1));let f=t.offset,h=new y(1),v=x.identity(),w=new u(0);if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,o=e.xy,s=e.z,l=this._unpackDirection(e.w),a=K(this,t.id,s).divide(2),r=l.multiply(a.add(i));w=o.add(r),f=f.add(w)}else{h=K(this,t.id,a).divide(a),l=l.multiply(h),p=p.multiply(h),f=f.multiply(h),v=Q(this,t.id),f=v.multiply(new b(f,0)).xy}const R=D(t.bitset,F),j=this._getViewRotationMatrix(R).multiply(new b(f,0)).multiply(this.view.scaleFactor);let A=this.isLabel?this.clipLabel(t,R):this.clip(t.id,t.zoomRange);A=this.isBackgroundPass?A.add(s.multiply(2)):A.add(o.multiply(2));let C=new y(0);if(1===this.textRenderPassType){A=A.add(V(S(t.outlineAndHaloSize.x,new y(0)),new y(2),new y(0)));C=new y(t.outlineAndHaloSize.x).divide(p).divide(n)}if(2===this.textRenderPassType){const e=t.outlineAndHaloSize.x,i=new y(t.outlineAndHaloSize.y);A=A.add(V(S(i,new y(0)),new y(2),new y(0)));C=i.add(e).divide(p).divide(n)}const O=this.isLabel?g(A,new y(1)):new z(!1);return{glPosition:new d(m.xy.add(j.xy),A,1),color:c,size:p,textureUV:t.textureUV.divide(this.mosaicInfo.size),antialiasingWidth:new y(.105).multiply(r).divide(l).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(t,e,{vvSizeAdjustment:h,vvRotation:v,labelOffset:w,labelClipped:O,scaleFactor:this.view.scaleFactor})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new y(2/8),i=new y(1).subtract(e),o=R(this.mosaicTexture,t.textureUV).a;let s=i.subtract(t.outlineDistanceOffset);this.highlight&&(s=s.divide(2));const l=t.antialiasingWidth,a=j(s.subtract(l),s.add(l),o);return this.getFragmentOutput(t.color.multiply(a),t)}computeHittestTriangle(t,e,{vvSizeAdjustment:i,vvRotation:o,labelOffset:s,scaleFactor:l}){let a,r,n;this.isLabel?(a=new b(t.offset.multiply(l).add(s),0),r=new b(e.offsetNextVertex1.multiply(l).add(s),0),n=new b(e.offsetNextVertex2.multiply(l).add(s),0)):(a=o.multiply(new b(t.offset.multiply(l).multiply(i),0)),r=o.multiply(new b(e.offsetNextVertex1.multiply(l).multiply(i),0)),n=o.multiply(new b(e.offsetNextVertex2.multiply(l).multiply(i),0)));const{viewMat3:p,tileMat3:d}=this.view,u=p.multiply(d).multiply(new b(t.pos,1));return{pos0:u.add(d.multiply(a)).xy,pos1:u.add(d.multiply(r)).xy,pos2:u.add(d.multiply(n)).xy}}hittest(t,e,i){const{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,labelClipped:a,scaleFactor:r}=i,n=U(this.hittestRequest),{pos0:p,pos1:d,pos2:u}=this.computeHittestTriangle(t,e,{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,scaleFactor:r});return V(n,()=>{const{tlbr:t}=this.hittestRequest;return this.isLabel?V(a,new y(H),k(p,d,u,t)):k(p,d,u,t)},()=>{const t=_(this.hittestRequest.position,p,d,u),e=this.isLabel?a:new z(!1);return V(e,new y(H),V(g(t,this.hittestRequest.distance),new y(H),new y(N)))})}_unpackDirection(t){const e=new A(t),i=C(e,new A(2)),o=O(e,new A(3));return new u(new y(i).subtract(1),new y(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new z(!1))}if(this.visualVariableOpacity){const i=this.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([s(I)],et.prototype,"visualVariableColor",void 0),t([s(B)],et.prototype,"visualVariableOpacity",void 0),t([s(E)],et.prototype,"visualVariableRotation",void 0),t([s(W)],et.prototype,"visualVariableSizeMinMaxValue",void 0),t([s(G)],et.prototype,"visualVariableSizeScaleStops",void 0),t([s(Z)],et.prototype,"visualVariableSizeStops",void 0),t([s(J)],et.prototype,"visualVariableSizeUnitValue",void 0),t([l(q)],et.prototype,"mosaicInfo",void 0),t([a(c)],et.prototype,"mosaicTexture",void 0),t([r],et.prototype,"textRenderPassType",void 0),t([r],et.prototype,"isBackgroundPass",void 0),t([r],et.prototype,"isLabel",void 0),t([e(0,n(Y)),e(1,n($))],et.prototype,"vertex",null),t([e(0,n(tt))],et.prototype,"fragment",null);export{tt as TextFragmentInput,et as TextShader,Y as TextVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{labelPlacementOffsetPadding as i}from"../../../definitions.js";import{location as o,option as s,uniform as l,texture as a,define as r,input as n,ComputeVertexInput as p}from"../../GraphShaderModule.js";import{Vec4 as d,Vec2 as u,Float as y,Sampler2D as m,mod as c,step as h,and as v,lessThan as f,greaterThanEqual as w,Vec3 as b,Mat3 as x,ifElse as V,equal as S,greaterThan as g,Bool as z,texture2D as R,smoothstep as j,Int as A,bitRShift as M,bitAnd as C}from"../../graph/glsl.js";import{FeatureVertexInput as O,AFeatureShader as T,FeatureFragmentInput as H}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as L,bitsetTextIsMapAligned as P,noHit as F,trueHit as N}from"../shaders/constants.js";import{isRectHittest as U,distPointTriangle as _,hittestScreenRect as k}from"../shaders/hittestUtils.js";import{MosaicInfo as q}from"../shaders/MosaicInfo.js";import{getBit as D}from"../shaders/utils.js";import{VisualVariableColor as I}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as B}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as E}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as W}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as G}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Z}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as J}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as K,getVisualVariableRotation as Q}from"../shaders/vvUtils.js";const X=360/254;class Y extends O{}t([o(3,d)],Y.prototype,"color",void 0),t([o(4,u)],Y.prototype,"offset",void 0),t([o(5,u)],Y.prototype,"textureUV",void 0),t([o(6,d)],Y.prototype,"fontAndReferenceSize",void 0),t([o(7,d)],Y.prototype,"outlineColor",void 0),t([o(8,d)],Y.prototype,"haloColor",void 0),t([o(9,u)],Y.prototype,"outlineAndHaloSize",void 0),t([o(10,u)],Y.prototype,"zoomRange",void 0),t([o(11,y)],Y.prototype,"clipAngle",void 0),t([o(12,d)],Y.prototype,"referenceSymbol",void 0),t([o(15,y)],Y.prototype,"visibility",void 0);class $ extends p{}t([o(13,u)],$.prototype,"offsetNextVertex1",void 0),t([o(14,u)],$.prototype,"offsetNextVertex2",void 0);class tt extends H{}class et extends T{constructor(){super(...arguments),this.type="TextShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e){const{clipAngle:i,zoomRange:o,visibility:s}=t,l=i.multiply(X),a=c(l.subtract(this.view.rotation),new y(360));let r=new y(0);const n=this.view.currentZoom,p=o.x,d=o.y,u=new y(1).subtract(h(p,n)).multiply(2),m=new y(v(w(a,new y(90)),f(a,new y(270)))).multiply(2),b=new y(2).multiply(new y(1).subtract(h(n,d)));return r=r.add(e.multiply(u)),r=r.add(e.multiply(m)),r=r.add(b),s&&(r=r.add(s)),r}vertex(t,e){const o=D(t.bitset,L),s=new y(1).subtract(o);let l=t.fontAndReferenceSize[0];const a=t.fontAndReferenceSize[1],r=t.fontAndReferenceSize[2],n=t.fontAndReferenceSize[3];let p=l.divide(r);const m=1===this.textRenderPassType?t.outlineColor:2===this.textRenderPassType?t.haloColor:this._getVertexColor(t),c=this.view.displayViewScreenMat3.multiply(new b(t.pos,1));let h=t.offset,v=new y(1),f=x.identity(),w=new u(0);if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,o=e.xy,s=e.z,l=this._unpackDirection(e.w),a=K(this,t.id,s).divide(2),r=l.multiply(a.add(i));w=o.add(r),h=h.add(w)}else{v=K(this,t.id,a).divide(a),l=l.multiply(v),p=p.multiply(v),h=h.multiply(v),f=Q(this,t.id),h=f.multiply(new b(h,0)).xy}const R=D(t.bitset,P),j=this._getViewRotationMatrix(R).multiply(new b(h,0)).multiply(this.view.scaleFactor);let A=this.isLabel?this.clipLabel(t,R):this.clip(t.id,t.zoomRange);A=this.isBackgroundPass?A.add(s.multiply(2)):A.add(o.multiply(2));let M=new y(0);if(1===this.textRenderPassType){A=A.add(V(S(t.outlineAndHaloSize.x,new y(0)),new y(2),new y(0)));M=new y(t.outlineAndHaloSize.x).divide(p).divide(n)}if(2===this.textRenderPassType){const e=t.outlineAndHaloSize.x,i=new y(t.outlineAndHaloSize.y);A=A.add(V(S(i,new y(0)),new y(2),new y(0)));M=i.add(e).divide(p).divide(n)}const C=this.isLabel?g(A,new y(1)):new z(!1);return{glPosition:new d(c.xy.add(j.xy),A,1),color:m,size:p,textureUV:t.textureUV.divide(this.mosaicInfo.size),antialiasingWidth:new y(.105).multiply(r).divide(l).divide(this.view.pixelRatio),outlineDistanceOffset:M,...this.maybeRunHittest(t,e,{vvSizeAdjustment:v,vvRotation:f,labelOffset:w,labelClipped:C,scaleFactor:this.view.scaleFactor})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getHittestAlignmentMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new y(2/8),i=new y(1).subtract(e),o=R(this.mosaicTexture,t.textureUV).a;let s=i.subtract(t.outlineDistanceOffset);this.highlight&&(s=s.divide(2));const l=t.antialiasingWidth,a=j(s.subtract(l),s.add(l),o);return this.getFragmentOutput(t.color.multiply(a),t)}computeHittestTriangle(t,e,{vvSizeAdjustment:i,vvRotation:o,labelOffset:s,scaleFactor:l}){let a,r,n;this.isLabel?(a=new b(t.offset.multiply(l).add(s),0),r=new b(e.offsetNextVertex1.multiply(l).add(s),0),n=new b(e.offsetNextVertex2.multiply(l).add(s),0)):(a=o.multiply(new b(t.offset.multiply(l).multiply(i),0)),r=o.multiply(new b(e.offsetNextVertex1.multiply(l).multiply(i),0)),n=o.multiply(new b(e.offsetNextVertex2.multiply(l).multiply(i),0)));const{viewMat3:p,tileMat3:d}=this.view,u=p.multiply(d).multiply(new b(t.pos,1)),y=D(t.bitset,P),m=this._getHittestAlignmentMatrix(y);return{pos0:u.add(m.multiply(a)).xy,pos1:u.add(m.multiply(r)).xy,pos2:u.add(m.multiply(n)).xy}}hittest(t,e,i){const{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,labelClipped:a,scaleFactor:r}=i,n=U(this.hittestRequest),{pos0:p,pos1:d,pos2:u}=this.computeHittestTriangle(t,e,{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,scaleFactor:r});return V(n,()=>{const{tlbr:t}=this.hittestRequest;return this.isLabel?V(a,new y(F),k(p,d,u,t)):k(p,d,u,t)},()=>{const t=_(this.hittestRequest.position,p,d,u),e=this.isLabel?a:new z(!1);return V(e,new y(F),V(g(t,this.hittestRequest.distance),new y(F),new y(N)))})}_unpackDirection(t){const e=new A(t),i=M(e,new A(2)),o=C(e,new A(3));return new u(new y(i).subtract(1),new y(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new z(!1))}if(this.visualVariableOpacity){const i=this.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([s(I)],et.prototype,"visualVariableColor",void 0),t([s(B)],et.prototype,"visualVariableOpacity",void 0),t([s(E)],et.prototype,"visualVariableRotation",void 0),t([s(W)],et.prototype,"visualVariableSizeMinMaxValue",void 0),t([s(G)],et.prototype,"visualVariableSizeScaleStops",void 0),t([s(Z)],et.prototype,"visualVariableSizeStops",void 0),t([s(J)],et.prototype,"visualVariableSizeUnitValue",void 0),t([l(q)],et.prototype,"mosaicInfo",void 0),t([a(m)],et.prototype,"mosaicTexture",void 0),t([r],et.prototype,"textRenderPassType",void 0),t([r],et.prototype,"isBackgroundPass",void 0),t([r],et.prototype,"isLabel",void 0),t([e(0,n(Y)),e(1,n($))],et.prototype,"vertex",null),t([e(0,n(tt))],et.prototype,"fragment",null);export{tt as TextFragmentInput,et as TextShader,Y as TextVertexInput};