@arcgis/core 6.0.0-next.19 → 6.0.0-next.20

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 (68) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{e4af2a1ea01df7226ace.js → 3c277a0f099d67090d07.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{94baa354e50c03b82b25.js → 597db9c90f19092d8d66.js} +1 -1
  5. package/assets/esri/core/workers/chunks/768389f7f8dba6080df7.js +2 -0
  6. package/assets/esri/core/workers/chunks/{ae0563d573baf91e01f7.js → 8e4206068c6953bb7df2.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{bc0f54a2c15502b630ec.js → 949bee7b304e625a7891.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d62afb71f4ece4283994.js → 9bc3afe7013ef4ae737b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
  10. package/assets/esri/core/workers/chunks/d678828726371243d5eb.js +1 -0
  11. package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
  12. package/assets/esri/core/workers/chunks/e35641a3a4da8cfbcf54.js +1 -0
  13. package/assets/esri/core/workers/chunks/{f3cd610084e3f4d8656b.js → fc76aff0f7d95e517d8f.js} +1 -1
  14. package/config.js +1 -1
  15. package/core/mapCollectionUtils.js +1 -1
  16. package/form/elements.d.ts +46 -8
  17. package/form/elements.js +1 -1
  18. package/geometry/support/Indices.js +1 -1
  19. package/geometry/support/aaBoundingRect.js +1 -1
  20. package/geometry/support/ray.js +1 -1
  21. package/kernel.js +1 -1
  22. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  23. package/package.json +3 -3
  24. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  25. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  26. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  27. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  28. package/views/3d/input/SceneInputManager.js +1 -1
  29. package/views/3d/input/handlers/DragZoom.js +1 -1
  30. package/views/3d/input/handlers/MouseWheelFov.js +1 -1
  31. package/views/3d/layers/graphics/extrudePolygon.js +1 -1
  32. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  33. package/views/3d/layers/support/FeatureTile.js +1 -1
  34. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  35. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  36. package/views/3d/state/controllers/FovController.js +1 -1
  37. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  38. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  39. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  40. package/views/3d/terrain/PatchRenderData.js +1 -1
  41. package/views/3d/terrain/TextureReference.js +1 -1
  42. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  43. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  44. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  45. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  46. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  47. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  48. package/views/DOMContainer.d.ts +8 -6
  49. package/views/VideoView.d.ts +8 -6
  50. package/views/View.d.ts +4 -3
  51. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  52. package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
  53. package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
  54. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  55. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  56. package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +3 -0
  57. package/widgets/ScaleRangeSlider/types.d.ts +3 -3
  58. package/widgets/Search/LocatorSearchSource.d.ts +22 -1
  59. package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
  60. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  61. package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
  62. package/widgets/support/SelectionList/ItemBase.js +1 -1
  63. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  64. package/widgets/support/SelectionList.js +1 -1
  65. package/assets/esri/core/workers/chunks/792c90a67e63b98394c8.js +0 -1
  66. package/assets/esri/core/workers/chunks/b686cd74975da09b9c91.js +0 -2
  67. package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +0 -1
  68. /package/assets/esri/core/workers/chunks/{b686cd74975da09b9c91.js.LICENSE.txt → 768389f7f8dba6080df7.js.LICENSE.txt} +0 -0
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@6.0.0-next.19/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@6.0.0-next.20/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{createTask as e}from"./asyncUtils.js";import t from"./Collection.js";import{destroyHandle as n,removeIfHandle as r}from"./handleUtils.js";import{ignoreAbortErrors as i,isAborted as a,createAbortError as o}from"./promiseUtils.js";import{on as s}from"./reactiveUtils.js";function c(e,n,r){let i=r?.createCollection?.()??new t,a=r?.recycleItems?new l:null,o=(e,t=0)=>{if(!e?.length)return;let n=i.splice(t,e.length);a?a.processRemoved(e):n.forEach(d)},c=(e,t=0)=>{if(!e?.length)return;let r=[];for(let t of e){let e=a?.use(t);if(e)r.push(e);else{let e=n(t);a?.register(t,e),r.push(e)}}i.addMany(r,t)},u=s(e,`after-splice`,({added:e,start:t,removed:n})=>{o(n,t),c(e,t)},{sync:!0,onListenerRemove:e=>o(e.items),onListenerAdd:e=>c(e.items)});return i.addHandles(u),i}class l{constructor(){this._originalToMapped=new Map,this._removedItemCandidates=new Set,this._garbageCollectionQueued=!1}processRemoved(e){if(!e?.length)return;let{_removedItemCandidates:t}=this;for(let n of e)this._getItem(n)?.markRemoved()&&(t.add(n),this._queueGarbageCollection())}use(e){let t=this._getItem(e);return t&&(t.removed=!1),t?.item}register(e,t){this._originalToMapped.set(e,new u(t))}_getItem(e){return this._originalToMapped.get(e)}_queueGarbageCollection(){this._garbageCollectionQueued||(this._garbageCollectionQueued=!0,queueMicrotask(()=>this._garbageCollectCandidates()))}_garbageCollectCandidates(){this._garbageCollectionQueued=!1;let{_removedItemCandidates:e}=this,t=Array.from(e);e.clear(),t.forEach(e=>this._garbageCollectIfRemoved(e))}_garbageCollectIfRemoved(e){let{_originalToMapped:t}=this,n=this._getItem(e);n?.removed&&(d(n.item),t.delete(e))}}class u{constructor(e){this.item=e,this.removed=!1}markRemoved(){return this.removed=!0,!0}}function d(e){typeof e==`object`&&e&&(`destroy`in e&&typeof e.destroy==`function`?e.destroy():r(e))}function f(r,s,l){let u=new t,f=c(r,t=>e(async e=>{let n=await s(t,e);if(a(e))throw d(n),o();return n}),l),p=()=>null,m=async e=>{let t=await e.promise,n=f.indexOf(e);n<0||u.splice(n,1,t)};u.addMany(f.items.map(p));for(let e of f)i(m(e));let h=f.on(`after-splice`,({added:e,start:t,deleteCount:n})=>{let r=u.splice(t,n);for(let e of r)d(e);if(e?.length){u.addMany(e.map(p),t);for(let t of e)i(m(t))}});return u.addHandles([n(f),h]),u}export{c as mapCollection,f as mapCollectionAsync};
2
+ import{createTask as e}from"./asyncUtils.js";import t from"./Collection.js";import{destroyHandle as n,removeIfHandle as r}from"./handleUtils.js";import{ignoreAbortErrors as i,isAborted as a,createAbortError as o}from"./promiseUtils.js";import{on as s}from"./reactiveUtils.js";function c(e,n,r){let i=r?.createCollection?.()??new t,a=r?.recycleItems?new l:null,o=(e,t=0)=>{if(!e?.length)return;let n=i.splice(t,e.length);a?a.processRemoved(e):n.forEach(d)},c=(e,t=0)=>{if(!e?.length)return;let r=[];for(let t of e){let e=a?.use(t);if(e)r.push(e);else{let e=n(t);a?.register(t,e),r.push(e)}}i.addMany(r,t)},u=s(e,`after-splice`,({added:e,start:t,removed:n})=>{o(n,t),c(e,t)},{sync:!0,onListenerRemove:e=>o(e.items),onListenerAdd:e=>c(e.items)});return i.addHandles(u),i}class l{constructor(){this._originalToMapped=new Map,this._removedItemCandidates=new Set,this._garbageCollectionQueued=!1}processRemoved(e){if(!e?.length)return;let{_removedItemCandidates:t}=this;for(let n of e)this._getItem(n)?.markRemoved()&&(t.add(n),this._queueGarbageCollection())}use(e){let t=this._getItem(e);return t&&(t.removed=!1),t?.item}register(e,t){this._originalToMapped.set(e,new u(t))}_getItem(e){return this._originalToMapped.get(e)}_queueGarbageCollection(){this._garbageCollectionQueued||(this._garbageCollectionQueued=!0,queueMicrotask(()=>this._garbageCollectCandidates()))}_garbageCollectCandidates(){this._garbageCollectionQueued=!1;let{_removedItemCandidates:e}=this,t=Array.from(e);e.clear(),t.forEach(e=>this._garbageCollectIfRemoved(e))}_garbageCollectIfRemoved(e){let{_originalToMapped:t}=this,n=this._getItem(e);n?.removed&&(d(n.item),t.delete(e))}}class u{constructor(e){this.item=e,this.removed=!1}markRemoved(){return this.removed=!0,!0}}function d(e){typeof e==`object`&&e&&(`destroy`in e&&typeof e.destroy==`function`?e.destroy():r(e))}function f(r,s,l){let u=new t,f=c(r,t=>e(async e=>{let n=await s(t,e);if(a(e))throw d(n),o();return n}),l),p=()=>null,m=async e=>{let t=await e.promise,n=f.indexOf(e);n<0?d(t):u.splice(n,1,t)};u.addMany(f.items.map(p));for(let e of f)i(m(e));let h=f.on(`after-splice`,({added:e,start:t,deleteCount:n})=>{let r=u.splice(t,n);for(let e of r)d(e);if(e?.length){u.addMany(e.map(p),t);for(let t of e)i(m(t))}});return u.addHandles([n(f),h]),u}export{c as mapCollection,f as mapCollectionAsync};
@@ -50,39 +50,68 @@ import type RelationshipElementClass from "./elements/RelationshipElement.js";
50
50
  import type TextElementClass from "./elements/TextElement.js";
51
51
  import type UtilityNetworkAssociationsElementClass from "./elements/UtilityNetworkAssociationsElement.js";
52
52
 
53
- /** `FieldElement` defines how a feature layer's field participates in the form. */
53
+ /**
54
+ * `FieldElement` defines how a feature layer's field participates in the form.
55
+ *
56
+ * @deprecated since 5.2. Import [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) directly instead.
57
+ */
54
58
  export const FieldElement: typeof FieldElementClass;
55
59
 
56
- /** `FieldElement` defines how a feature layer's field participates in the form. */
60
+ /**
61
+ * `FieldElement` defines how a feature layer's field participates in the form.
62
+ *
63
+ * @deprecated since 5.2. Import [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) directly instead.
64
+ */
57
65
  export type FieldElement = FieldElementClass;
58
66
 
59
67
  /**
60
68
  * `GroupElement` defines a container that holds a set of form elements
61
69
  * that can be expanded, collapsed, or displayed together.
70
+ *
71
+ * @deprecated since 5.2. Import [GroupElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/GroupElement/) directly instead.
62
72
  */
63
73
  export const GroupElement: typeof GroupElementClass;
64
74
 
65
75
  /**
66
76
  * `GroupElement` defines a container that holds a set of form elements
67
77
  * that can be expanded, collapsed, or displayed together.
78
+ *
79
+ * @deprecated since 5.2. Import [GroupElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/GroupElement/) directly instead.
68
80
  */
69
81
  export type GroupElement = GroupElementClass;
70
82
 
71
- /** `RelationshipElement` defines how a relationship between [feature layers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and [Map.tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables) participates in the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/). */
83
+ /**
84
+ * `RelationshipElement` defines how a relationship between [feature layers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and [Map.tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables) participates in the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/).
85
+ *
86
+ * @deprecated since 5.2. Import [RelationshipElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/RelationshipElement/) directly instead.
87
+ */
72
88
  export const RelationshipElement: typeof RelationshipElementClass;
73
89
 
74
- /** `RelationshipElement` defines how a relationship between [feature layers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and [Map.tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables) participates in the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/). */
90
+ /**
91
+ * `RelationshipElement` defines how a relationship between [feature layers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and [Map.tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables) participates in the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/).
92
+ *
93
+ * @deprecated since 5.2. Import [RelationshipElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/RelationshipElement/) directly instead.
94
+ */
75
95
  export type RelationshipElement = RelationshipElementClass;
76
96
 
77
- /** `TextElement` form element is used to define descriptive text as an element within a layer or [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) and can be used to aid those entering or updating information. */
97
+ /**
98
+ * `TextElement` form element is used to define descriptive text as an element within a layer or [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) and can be used to aid those entering or updating information.
99
+ *
100
+ * @deprecated since 5.2. Import [TextElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/TextElement/) directly instead.
101
+ */
78
102
  export const TextElement: typeof TextElementClass;
79
103
 
80
- /** `TextElement` form element is used to define descriptive text as an element within a layer or [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) and can be used to aid those entering or updating information. */
104
+ /**
105
+ * `TextElement` form element is used to define descriptive text as an element within a layer or [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) and can be used to aid those entering or updating information.
106
+ *
107
+ * @deprecated since 5.2. Import [TextElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/TextElement/) directly instead.
108
+ */
81
109
  export type TextElement = TextElementClass;
82
110
 
83
111
  /**
84
112
  * `AttachmentElement` defines how one or more attachments can participate in the form. When present in the form, the user has the ability to upload an attachment specific to the form element.
85
113
  *
114
+ * @deprecated since 5.2. Import [AttachmentElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) directly instead.
86
115
  * @since 5.1
87
116
  */
88
117
  export const AttachmentElement: typeof AttachmentElementClass;
@@ -90,12 +119,21 @@ export const AttachmentElement: typeof AttachmentElementClass;
90
119
  /**
91
120
  * `AttachmentElement` defines how one or more attachments can participate in the form. When present in the form, the user has the ability to upload an attachment specific to the form element.
92
121
  *
122
+ * @deprecated since 5.2. Import [AttachmentElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) directly instead.
93
123
  * @since 5.1
94
124
  */
95
125
  export type AttachmentElement = AttachmentElementClass;
96
126
 
97
- /** `UtilityNetworkAssociationsElement` defines how utility network associations can participate in the form. */
127
+ /**
128
+ * `UtilityNetworkAssociationsElement` defines how utility network associations can participate in the form.
129
+ *
130
+ * @deprecated since 5.2. Import [UtilityNetworkAssociationsElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/UtilityNetworkAssociationsElement/) directly instead.
131
+ */
98
132
  export const UtilityNetworkAssociationsElement: typeof UtilityNetworkAssociationsElementClass;
99
133
 
100
- /** `UtilityNetworkAssociationsElement` defines how utility network associations can participate in the form. */
134
+ /**
135
+ * `UtilityNetworkAssociationsElement` defines how utility network associations can participate in the form.
136
+ *
137
+ * @deprecated since 5.2. Import [UtilityNetworkAssociationsElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/UtilityNetworkAssociationsElement/) directly instead.
138
+ */
101
139
  export type UtilityNetworkAssociationsElement = UtilityNetworkAssociationsElementClass;
package/form/elements.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"./elements/AttachmentElement.js";import t from"./elements/FieldElement.js";import n from"./elements/GroupElement.js";import r from"./elements/RelationshipElement.js";import i from"./elements/TextElement.js";import a from"./elements/UtilityNetworkAssociationsElement.js";const o=t,s=n,c=r,l=i,u=e,d=a;export{u as AttachmentElement,o as FieldElement,s as GroupElement,c as RelationshipElement,l as TextElement,d as UtilityNetworkAssociationsElement};
2
+ import{deprecatedModule as e}from"../core/deprecate.js";import t from"../core/Logger.js";import n from"./elements/AttachmentElement.js";import r from"./elements/FieldElement.js";import i from"./elements/GroupElement.js";import a from"./elements/RelationshipElement.js";import o from"./elements/TextElement.js";import s from"./elements/UtilityNetworkAssociationsElement.js";e(t.getLogger(`esri.form.elements`),`esri.form.elements`,{replacement:`Individual element module imports`,version:`5.2`,warnOnce:!0});const c=r,l=i,u=a,d=o,f=n,p=s;export{f as AttachmentElement,c as FieldElement,l as GroupElement,u as RelationshipElement,d as TextElement,p as UtilityNetworkAssociationsElement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{nativeArrayMaxSize as e,isTypedArray as t}from"../../core/typedArrayUtil.js";function n(e){return r(e,!0)}function r(n,r){if(Array.isArray(n)){if(n.length<e)return n}else if(n.length<e)return Array.from(n);let i=!0,o=!0;return n.some((e,t)=>(i&&=e===0,o&&=e===t,!i&&!o)),i?h(n.length):o?d(n.length):t(n)&&n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?n:a(n,!r)}function i(t,n){return t.length<e?Array.from(t):n<256?Uint8Array.from(t):n<2**16?Uint16Array.from(t):Uint32Array.from(t)}function a(e,n){for(let r of e){if(r>=65536)return t(e)?e:new Uint32Array(e);r>=256&&(n=!1)}return n?new Uint8Array(e):new Uint16Array(e)}function o(t,n=t){return t<=e?Array(t):n<=65536?new Uint16Array(t):new Uint32Array(t)}function s(e,t,n){if(t.length===0)return e.slice();if(e.length===0)return t.slice();let r=o(e.length+t.length,n);for(let t=0;t<e.length;++t)r[t]=e[t];for(let n=0;n<t.length;++n)r[e.length+n]=t[n];return r}let c=p(131072);const l=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(t){return t===1?l:t<e?Array.from(new Uint16Array(u.buffer,0,t)):t<u.length?new Uint16Array(u.buffer,0,t):(t>c.length&&(c=p(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t))}function f(t){return t===1?[0]:t<e?Array.from(new Uint16Array(u.buffer,0,t)):t<u.length?new Uint16Array(u.buffer,0,t).slice():(t>c.length&&(c=p(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t).slice())}function p(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536);function h(t){if(t===1)return l;if(t<e)return Array(t).fill(0);if(t>m.length){let e=Math.max(2*m.length,t);m=new Uint8Array(e)}return new Uint8Array(m.buffer,0,t)}function g(){c=p(131072),m=new Uint8Array(65536)}function _(e){return`byteLength`in e?e.byteLength:e.length*8}export{r as compactIndices,n as compactMeshIndices,s as concatIndexArrays,d as getContinuousIndexArray,h as getZeroIndexArray,_ as indexArrayByteSize,i as indexArrayFrom,f as newContinuousIndexArray,o as newIndexArray,g as pruneIndexArrays};
2
+ import{nativeArrayMaxSize as e,isTypedArray as t}from"../../core/typedArrayUtil.js";function n(e){return r(e,!0)}function r(n,r){if(Array.isArray(n)){if(n.length<e)return n}else if(n.length<e)return Array.from(n);let i=!0,o=!0;return n.some((e,t)=>(i&&=e===0,o&&=e===t,!i&&!o)),i?g(n.length):o?d(n.length):t(n)&&n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?n:a(n,!r)}function i(t,n){return t.length<e?Array.from(t):n<256?Uint8Array.from(t):n<2**16?Uint16Array.from(t):Uint32Array.from(t)}function a(e,n){for(let r of e){if(r>=65536)return t(e)?e:new Uint32Array(e);r>=256&&(n=!1)}return n?new Uint8Array(e):new Uint16Array(e)}function o(t,n=t){return t<=e?Array(t):n<=65536?new Uint16Array(t):new Uint32Array(t)}function s(e,t,n){if(t.length===0)return e.slice();if(e.length===0)return t.slice();let r=o(e.length+t.length,n);for(let t=0;t<e.length;++t)r[t]=e[t];for(let n=0;n<t.length;++n)r[e.length+n]=t[n];return r}let c=m(131072);const l=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(t){return t===1?l:t<e?p(t):t<u.length?new Uint16Array(u.buffer,0,t):(t>c.length&&(c=m(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t))}function f(t){return t===1?[0]:t<e?p(t):t<u.length?new Uint16Array(u.buffer,0,t).slice():(t>c.length&&(c=m(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t).slice())}function p(e){let t=Array(e).fill(0);for(let n=0;n<e;n++)t[n]=n;return t}function m(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536);function g(t){if(t===1)return l;if(t<e)return Array(t).fill(0);if(t>h.length){let e=Math.max(2*h.length,t);h=new Uint8Array(e)}return new Uint8Array(h.buffer,0,t)}function _(){c=m(131072),h=new Uint8Array(65536)}function v(e){return`byteLength`in e?e.byteLength:e.length*8}export{r as compactIndices,n as compactMeshIndices,s as concatIndexArrays,d as getContinuousIndexArray,g as getZeroIndexArray,v as indexArrayByteSize,i as indexArrayFrom,f as newContinuousIndexArray,o as newIndexArray,_ as pruneIndexArrays};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{clamp as e,floatEqualUlp as t}from"../../core/mathUtils.js";import n from"../Extent.js";function r(e){return e}function i(e=Q){return r([e[0],e[1],e[2],e[3]])}function a(e){return r([e[0],e[1],e[2],e[3]])}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function s(e,t,n,r,a=i()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t=i()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function l(e,t,r=new n){return r.xmin=e[0],r.ymin=e[1],r.xmax=e[2],r.ymax=e[3],r.spatialReference=t,r}function u(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function d(e,t){t<e[0]&&(e[0]=t),t>e[2]&&(e[2]=t)}function f(e,t){t<e[1]&&(e[1]=t),t>e[3]&&(e[3]=t)}function p(e,{xmin:t,ymin:n,xmax:r,ymax:i}){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}function m(e,t,n){if(t==null)o(n,e);else if(`length`in t)U(t)?(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3])):(t.length===2||t.length===3)&&(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[0]),n[3]=Math.max(e[3],t[1]));else switch(t.type){case`extent`:n[0]=Math.min(e[0],t.xmin),n[1]=Math.min(e[1],t.ymin),n[2]=Math.max(e[2],t.xmax),n[3]=Math.max(e[3],t.ymax);break;case`point`:n[0]=Math.min(e[0],t.x),n[1]=Math.min(e[1],t.y),n[2]=Math.max(e[2],t.x),n[3]=Math.max(e[3],t.y)}}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3])}function g(e,t,n=e){let r=t.length,i=e[0],a=e[1],o=e[2],s=e[3];for(let e=0;e<r;e++){let n=t[e];i=Math.min(i,n[0]),a=Math.min(a,n[1]),o=Math.max(o,n[0]),s=Math.max(s,n[1])}return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n}function _(e){for(let t=0;t<4;t++)if(!isFinite(e[t]))return!1;return!0}function v(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function y(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function b(e){return v(e)*y(e)}function x(e){return v(e)>0&&y(e)>0}function S(e,t=[0,0]){return t[0]=(e[0]+e[2])/2,t[1]=(e[1]+e[3])/2,t}function C(e){let t=v(e),n=y(e);return Math.sqrt(t*t+n*n)}function w(e,t){return O(e,t[0],t[1])}function T(e,t){let n=t.radius,r=(e[0]+e[2])*.5,i=Math.abs(t.center[0]-r),a=(e[2]-e[0])*.5;if(i>n+a)return!1;let o=(e[1]+e[3])*.5,s=(e[3]-e[1])*.5,c=Math.abs(t.center[1]-o);if(c>n+s)return!1;if(i<a||c<s)return!0;let l=i-a,u=c-s;return l*l+u*u<=n*n}function E(e,t,n){let r=e[0],i=e[1],a=e[2],o=e[3],{x:s,y:c}=t,{x:l,y:u}=n,d=(e,t)=>(u-c)*e+(s-l)*t+(l*c-s*u)<0,f=d(r,o),p=d(a,o),m=d(a,i),h=d(r,i);return!(f===p&&p===m&&m===h&&h===f||s<r&&l<r||s>a&&l>a||c>o&&u>o||c<i&&u<i)}function D(e,t){return e?O(e,t.x,t.y):!1}function O(e,t,n){return t>=e[0]&&n>=e[1]&&t<=e[2]&&n<=e[3]}function k(e,t,n,r){return t>=e[0]-r&&n>=e[1]-r&&t<=e[2]+r&&n<=e[3]+r}function A(e,t,n){return t[0]>=e[0]-n&&t[1]>=e[1]-n&&t[0]<=e[2]+n&&t[1]<=e[3]+n}function j(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function M(e,t,n){return Math.max(t[0],e[0])-n<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])-n<=Math.min(t[3],e[3])}function N(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function P(e,t,n){return t==null?o(n,e):(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n)}function F(t,n,r){if(n==null)return o(r,t);let i=n[0],a=n[1],s=n[2],c=n[3];return r[0]=e(t[0],i,s),r[1]=e(t[1],a,c),r[2]=e(t[2],i,s),r[3]=e(t[3],a,c),r}function I(e,t){let n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i=Math.max(Math.abs(t[0]-n)-v(e)/2,0),a=Math.max(Math.abs(t[1]-r)-y(e)/2,0);return Math.sqrt(i*i+a*a)}function L(e,t){t[0]=e[2]-e[0],t[1]=e[3]-e[1]}function R(e,t,n,r){return r??=e,r[0]=e[0]+t,r[1]=e[1]+n,r[2]=e[2]+t,r[3]=e[3]+n,r}function z(e,t,n=e){return n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n}function B(e,t,n=e){return n[0]=t[0],n[1]=t[1],n!==e&&(n[2]=e[2],n[3]=e[3]),n}function V(e,t,n=e){return n[2]=t[0],n[3]=t[1],n!==e&&(n[0]=e[0],n[1]=e[1]),e}function H(e){return e?o(e,Z):i(Z)}function U(e){return e!=null&&e.length===4}function W(e){return(v(e)===0||!isFinite(e[0]))&&(y(e)===0||!isFinite(e[1]))}function G(e,t){return!U(e)||!U(t)?e===t:e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function K(e,n,r){return e!=null&&n!=null&&e.every((e,i)=>t(e,n[i],r))}function q(e,t,n){return t==null?!1:n?n.contains(e[0],e[2],t[0])&&n.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:N(e,t)}function J(e,t,n){return e==null?!1:n?(n.contains(t[0],t[2],e[0])||n.contains(t[0],t[2],e[2])||n.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t)}function Y(e,t){if(t.length!==4||e[0]===e[2]||e[1]===e[3])return!1;for(let n=0;n<t.length;n++){let r=t[n],i=t[(n+1)%t.length];if(r[0]!==e[0]&&r[0]!==e[2]||r[1]!==e[1]&&r[1]!==e[3])return!1;let a=r[1]===i[1]&&r[0]!==i[0],o=r[0]===i[0]&&r[1]!==i[1];if(!a&&!o)return!1}return!0}const X=r([-1/0,-1/0,1/0,1/0]),Z=r([1/0,1/0,-1/0,-1/0]),Q=r([0,0,0,0]),$=r([0,0,1,1]);export{_ as allFinite,K as almostEquals,b as area,S as center,a as clone,N as contains,w as containsPoint,D as containsPointObject,A as containsPointWithMargin,O as containsXY,k as containsXYWithMargin,o as copy,i as create,C as diagonal,I as distance,H as empty,G as equals,Y as equalsPoints,m as expand,p as expandExtentInPlace,u as expandPointInPlace,g as expandWithNestedArray,h as expandWithRect,d as expandXInPlace,f as expandYInPlace,c as fromExtent,s as fromValues,x as hasArea,y as height,F as intersection,j as intersects,E as intersectsSegment,T as intersectsSphere,M as intersectsWithMargin,U as is,W as isPoint,Z as negativeInfinity,R as offset,z as pad,X as positiveInfinity,q as rectangleContainsRectangleCyclicalAware,J as rectanglesIntersectCyclicalAware,V as setMax,B as setMin,L as size,l as toExtent,P as union,$ as unit,v as width,Q as zero};
2
+ import{clamp as e,floatEqualUlp as t}from"../../core/mathUtils.js";import n from"../Extent.js";function r(e){return e}function i(e=Q){return r([e[0],e[1],e[2],e[3]])}function a(e){return r([e[0],e[1],e[2],e[3]])}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function s(e,t,n,r,a=i()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t=i()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function l(e,t,r=new n){return r.xmin=e[0],r.ymin=e[1],r.xmax=e[2],r.ymax=e[3],r.spatialReference=t,r}function u(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function d(e,t){t<e[0]&&(e[0]=t),t>e[2]&&(e[2]=t)}function f(e,t){t<e[1]&&(e[1]=t),t>e[3]&&(e[3]=t)}function p(e,{xmin:t,ymin:n,xmax:r,ymax:i}){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}function m(e,t,n){if(t==null)o(n,e);else if(`length`in t)U(t)?(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3])):(t.length===2||t.length===3)&&(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[0]),n[3]=Math.max(e[3],t[1]));else switch(t.type){case`extent`:n[0]=Math.min(e[0],t.xmin),n[1]=Math.min(e[1],t.ymin),n[2]=Math.max(e[2],t.xmax),n[3]=Math.max(e[3],t.ymax);break;case`point`:n[0]=Math.min(e[0],t.x),n[1]=Math.min(e[1],t.y),n[2]=Math.max(e[2],t.x),n[3]=Math.max(e[3],t.y)}}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3])}function g(e,t,n=e){let r=t.length,i=e[0],a=e[1],o=e[2],s=e[3];for(let e=0;e<r;e++){let n=t[e];i=Math.min(i,n[0]),a=Math.min(a,n[1]),o=Math.max(o,n[0]),s=Math.max(s,n[1])}return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n}function _(e){for(let t=0;t<4;t++)if(!isFinite(e[t]))return!1;return!0}function v(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function y(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function b(e){return v(e)*y(e)}function x(e){return v(e)>0&&y(e)>0}function S(e,t=[0,0]){return t[0]=(e[0]+e[2])/2,t[1]=(e[1]+e[3])/2,t}function C(e){let t=v(e),n=y(e);return Math.sqrt(t*t+n*n)}function w(e,t){return O(e,t[0],t[1])}function T(e,t){let n=t.radius,r=(e[0]+e[2])*.5,i=Math.abs(t.center[0]-r),a=(e[2]-e[0])*.5;if(i>n+a)return!1;let o=(e[1]+e[3])*.5,s=(e[3]-e[1])*.5,c=Math.abs(t.center[1]-o);if(c>n+s)return!1;if(i<a||c<s)return!0;let l=i-a,u=c-s;return l*l+u*u<=n*n}function E(e,t,n){let r=e[0],i=e[1],a=e[2],o=e[3],{x:s,y:c}=t,{x:l,y:u}=n,d=(e,t)=>(u-c)*e+(s-l)*t+(l*c-s*u)<0,f=d(r,o),p=d(a,o),m=d(a,i),h=d(r,i);return!(f===p&&p===m&&m===h&&h===f||s<r&&l<r||s>a&&l>a||c>o&&u>o||c<i&&u<i)}function D(e,t){return e?O(e,t.x,t.y):!1}function O(e,t,n){return t>=e[0]&&n>=e[1]&&t<=e[2]&&n<=e[3]}function k(e,t,n,r){return t>=e[0]-r&&n>=e[1]-r&&t<=e[2]+r&&n<=e[3]+r}function A(e,t,n){return t[0]>=e[0]-n&&t[1]>=e[1]-n&&t[0]<=e[2]+n&&t[1]<=e[3]+n}function j(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function M(e,t,n){return Math.max(t[0],e[0])-n<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])-n<=Math.min(t[3],e[3])}function N(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function P(e,t,n){return t==null?o(n,e):(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n)}function F(t,n,r){if(n==null)return o(r,t);let i=n[0],a=n[1],s=n[2],c=n[3];return r[0]=e(t[0],i,s),r[1]=e(t[1],a,c),r[2]=e(t[2],i,s),r[3]=e(t[3],a,c),r}function I(e,t){let n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i=Math.max(Math.abs(t[0]-n)-v(e)/2,0),a=Math.max(Math.abs(t[1]-r)-y(e)/2,0);return Math.sqrt(i*i+a*a)}function L(e,t){t[0]=e[2]-e[0],t[1]=e[3]-e[1]}function R(e,t,n,r){return r??=e,r[0]=e[0]+t,r[1]=e[1]+n,r[2]=e[2]+t,r[3]=e[3]+n,r}function z(e,t,n=e){return n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n}function B(e,t,n=e){return n[0]=t[0],n[1]=t[1],n!==e&&(n[2]=e[2],n[3]=e[3]),n}function V(e,t,n=e){return n[2]=t[0],n[3]=t[1],n!==e&&(n[0]=e[0],n[1]=e[1]),e}function H(e){return e?o(e,Z):i(Z)}function U(e){return e!=null&&e.length===4}function W(e){return(v(e)===0||!isFinite(e[0]))&&(y(e)===0||!isFinite(e[1]))}function G(e,t){return!U(e)||!U(t)?e==null&&t==null||e===t:e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function K(e,n,r){return e!=null&&n!=null&&e.every((e,i)=>t(e,n[i],r))}function q(e,t,n){return t==null?!1:n?n.contains(e[0],e[2],t[0])&&n.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:N(e,t)}function J(e,t,n){return e==null?!1:n?(n.contains(t[0],t[2],e[0])||n.contains(t[0],t[2],e[2])||n.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t)}function Y(e,t){if(t.length!==4||e[0]===e[2]||e[1]===e[3])return!1;for(let n=0;n<t.length;n++){let r=t[n],i=t[(n+1)%t.length];if(r[0]!==e[0]&&r[0]!==e[2]||r[1]!==e[1]&&r[1]!==e[3])return!1;let a=r[1]===i[1]&&r[0]!==i[0],o=r[0]===i[0]&&r[1]!==i[1];if(!a&&!o)return!1}return!0}const X=r([-1/0,-1/0,1/0,1/0]),Z=r([1/0,1/0,-1/0,-1/0]),Q=r([0,0,0,0]),$=r([0,0,1,1]);export{_ as allFinite,K as almostEquals,b as area,S as center,a as clone,N as contains,w as containsPoint,D as containsPointObject,A as containsPointWithMargin,O as containsXY,k as containsXYWithMargin,o as copy,i as create,C as diagonal,I as distance,H as empty,G as equals,Y as equalsPoints,m as expand,p as expandExtentInPlace,u as expandPointInPlace,g as expandWithNestedArray,h as expandWithRect,d as expandXInPlace,f as expandYInPlace,c as fromExtent,s as fromValues,x as hasArea,y as height,F as intersection,j as intersects,E as intersectsSegment,T as intersectsSphere,M as intersectsWithMargin,U as is,W as isPoint,Z as negativeInfinity,R as offset,z as pad,X as positiveInfinity,q as rectangleContainsRectangleCyclicalAware,J as rectanglesIntersectCyclicalAware,V as setMax,B as setMin,L as size,l as toExtent,P as union,$ as unit,v as width,Q as zero};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{equals as e}from"../../core/arrayUtils.js";import{ObjectStack as t}from"../../core/ObjectStack.js";import{set as n,invert as r}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as a,subtract as o,dot as s,normalize as c,cross as l,sub as u,set as d,add as f,scale as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{clone as m,create as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as g}from"./vectorStacks.js";function _(e){return e?v(m(e.origin),m(e.direction)):v(h(),h())}function v(e,t){return{origin:e,direction:t}}function y(t,n){return e(t.origin,n.origin)&&e(t.direction,n.direction)}function b(e,t){let n=D.get();return n.origin=e,n.direction=t,n}function x(e,t=_()){return C(e.origin,e.direction,t)}function S(e,t,n=_()){return a(n.origin,e),o(n.direction,t,e),n}function C(e,t,n=_()){return a(n.origin,e),a(n.direction,t),n}function w(e,t){let n=l(g.get(),c(g.get(),e.direction),o(g.get(),t,e.origin));return s(n,n)}function T(e,t,n){let r=s(e.direction,o(n,t,e.origin));return f(n,e.origin,p(n,e.direction,r)),n}function E(e,t,i,a){let o=e.origin,m=t.origin,h=e.direction,g=t.direction,_=s(c(k,h),c(A,g));if(Math.abs(_)>=1)return null;let v=l(k,h,g),y=u(O,m,o),b=n(j,h[0],h[1],h[2],-g[0],-g[1],-g[2],v[0],v[1],v[2]),x=r(j,b);if(x==null)return[i,a];let S=s(d(k,x[0],x[3],x[6]),y),C=s(d(A,x[1],x[4],x[7]),y);return f(i,o,p(O,h,S)),f(a,m,p(O,g,C)),[i,a]}const D=new t(()=>_()),O=h(),k=h(),A=h(),j=i();export{T as closestPoint,E as closestPoints,x as copy,_ as create,w as distance2,y as equals,S as fromPoints,C as fromValues,b as wrap};
2
+ import{ObjectStack as e}from"../../core/ObjectStack.js";import{set as t,invert as n}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as i,subtract as a,exactEquals as o,dot as s,normalize as c,cross as l,sub as u,set as d,add as f,scale as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{clone as m,create as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as g}from"./vectorStacks.js";function _(e){return e?v(m(e.origin),m(e.direction)):v(h(),h())}function v(e,t){return{origin:e,direction:t}}function y(e,t){return o(e.origin,t.origin)&&o(e.direction,t.direction)}function b(e,t){let n=D.get();return n.origin=e,n.direction=t,n}function x(e,t=_()){return C(e.origin,e.direction,t)}function S(e,t,n=_()){return i(n.origin,e),a(n.direction,t,e),n}function C(e,t,n=_()){return i(n.origin,e),i(n.direction,t),n}function w(e,t){let n=l(g.get(),c(g.get(),e.direction),a(g.get(),t,e.origin));return s(n,n)}function T(e,t,n){let r=s(e.direction,a(n,t,e.origin));return f(n,e.origin,p(n,e.direction,r)),n}function E(e,r,i,a){let o=e.origin,m=r.origin,h=e.direction,g=r.direction,_=s(c(k,h),c(A,g));if(Math.abs(_)>=1)return null;let v=l(k,h,g),y=u(O,m,o),b=t(j,h[0],h[1],h[2],-g[0],-g[1],-g[2],v[0],v[1],v[2]),x=n(j,b);if(x==null)return[i,a];let S=s(d(k,x[0],x[3],x[6]),y),C=s(d(A,x[1],x[4],x[7]),y);return f(i,o,p(O,h,S)),f(a,m,p(O,g,C)),[i,a]}const D=new e(()=>_()),O=h(),k=h(),A=h(),j=r();export{T as closestPoint,E as closestPoints,x as copy,_ as create,w as distance2,y as equals,S as fromPoints,C as fromValues,b as wrap};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.19`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.20`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{result as n}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{destroyMaybe as s,removeMaybe as c,abortMaybe as l}from"../../../core/maybe.js";import{EsriPromiseMixin as u}from"../../../core/Promise.js";import{createAbortError as d,isAbortError as f}from"../../../core/promiseUtils.js";import{initial as p,watch as m,syncAndInitial as h,sync as g}from"../../../core/reactiveUtils.js";import{sqlAnd as _}from"../../../core/sql.js";import{property as v,subclass as y}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as b}from"../../../core/support/UpdatingHandles.js";import{projectAsync as x}from"../../../geometry/projectionUtils.js";import{isHostedAgolService as S}from"../../support/arcgisLayerUrl.js";import{checkServiceCurrentUserSupport as C}from"../../support/featureLayerUtils.js";import{getEffectiveLayerCapabilities as w}from"../../support/layerUtils.js";import T from"../../../rest/support/StatisticDefinition.js";import{FeatureTileDescriptor as E,virtualSnapshotTileId as D,virtualDisplayFilterHighlightTileId as O}from"../../../views/3d/layers/support/FeatureTileDescriptor.js";import{FeatureTileFetcher3D as k}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as A}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import{debugFlags as j}from"../../../views/3d/support/debugFlags.js";let M=class extends u(t){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(e){if(e!=null&&!e.spatialReference.equals(this.layerView.view.spatialReference)){o.getLogger(this).error(`#extent=`,`extent needs to be in the same spatial reference as the view`);return}let t=this._get(`extent`);if(t===e||t!=null&&e&&t.equals(e))return;let n=e==null?null:e.clone();this._set(`extent`,n)}get updating(){return!!(this._tileFetcher?.updating||this._fetchDataInfoPromise!=null||this.mode===`tiles`&&this.layerView.view.featureTiles?.updating||this._updatingHandles?.updating)}get updatingTotal(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.expectedFeatureDiff:0}get usedMemory(){return this._tileFetcher?.usedMemory??0}get usedMemoryPerFeature(){return this._tileFetcher?.usedMemoryPerFeature??0}get maximumNumberOfFeaturesExceeded(){return!!(this._tileFetcher!=null&&this._tileFetcher.maximumNumberOfFeaturesExceeded)}get snappingComplexityExceeded(){return this._tileFetcher?.snappingComplexityExceeded??!0}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome(`maximumNumberOfFeatures`,e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden(`maximumNumberOfFeatures`)}get hasAllFeatures(){return this.serviceDataCount===I.noServiceDataCount&&this.mode===`snapshot`&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){let e=this.context.effectiveDisplayFilter?.where||null,t=e!=null&&e!==`1=1`;return this.mode===`tiles`&&t?!1:this._tileFetcher?.showsAllFeatures??!1}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){let e=this.layerView.layer;if(e.type===`feature`&&e.infoFor3D!=null)return`snapshot`;if(e.type===`catalog-footprint`||this._forceTilesMode)return`tiles`;let t=this.layerView.view;if(t.qualitySettings?.graphics3D?.snapshotAvailable===!1||this.serviceDataCount===I.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return`tiles`;let n=(t&&t.featureTiles)?.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&n){let t=this._approximateExtentSizeAtScale(e.minScale,n);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>I.maxSnapshotMinScaleFactor)return`tiles`}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?`snapshot`:`tiles`}get maxTotalSnapshotVertices(){let e=this._get(`maxTotalSnapshotVertices`)||0,t=this.mode===`snapshot`&&this._tileFetcher?.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){let n=this.layerView.view,r=Math.ceil((n.width/t.pixelSize+n.height/t.pixelSize)/2),i=t.levels[0];return r*((i.tileSize[0]/(i.scale/e)+i.tileSize[1]/(i.scale/e))/2)}get tileDescriptors(){if(this.mode===`snapshot`){let e=new E(0,0,0,null,D);return new r([e])}let e=this.layerView.view.featureTiles;if(!e)return new r;let t=e.tiles;if(this.layerView.displayFilterEnabled&&this.layerView.effectiveDisplayFilterClause!=null&&this.layerView.effectiveDisplayFilterClause!==`1=1`&&this.layerView.highlightIds?.length>0){let e=new E(0,0,0,this.layerView.view.featureTiles?.tilingScheme,O);return new r([...t,e])}return t}get test(){}constructor(e){super(e),this.type=`feature-tile-3d`,this._updatingHandles=new b,this.serviceDataExtent=null,this.serviceDataCount=I.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=>this.displayFeatureLimit,e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal))),this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),p),this._updatingHandles.add(()=>this.mode,(e,t)=>{e===`tiles`&&t===`snapshot`&&(this._forceTilesMode=!0)},p),this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){let e=this.layerView.layer;if(e.type!==`ogc-feature`&&!w(e)?.operations.supportsQuery)throw new i(`graphicscontroller:query-capability-required`,`Service requires query capabilities to be used as a feature layer`,{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=s(this._tileFetcher),this._tilesHandle=c(this._tilesHandle),this._lifeCycleAbortController=l(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set(`_updatingHandles`,null)}suspend(){this._suspended||(this._suspended=!0,this._tileFetcher!=null&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,this._tileFetcher!=null&&this._tileFetcher.resume())}restart(){let e=()=>{this._tileFetcher!=null&&this._tileFetcher.restart()};this._updatingHandles.consumePromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(e){return this._tileFetcher?.getMissingAttributesForFeature(e)}_refetch(e){let t=()=>{this._tileFetcher!=null&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.consumePromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){let e=this.layerView.view;if(!e)return;let{layerView:t,tileDescriptors:n}=this,r=t.layer,i=new k({context:this.context,filterExtent:this.extent,tileDescriptors:n,features:this.graphics});this._tileFetcher=i,this._suspended?i.suspend():i.resume(),e&&this.addHandles(m(()=>e.quality,e=>i.memoryFactor=e,h));let a=this.context.geometryType===`polygon`?`polygonLodFactor`:this.context.geometryType===`polyline`?`polylineLodFactor`:null;a&&this.addHandles(m(()=>this.layerView.view?.qualitySettings?.graphics3D?.[a],e=>i.lodFactor=e||1,p)),r.type!==`ogc-feature`&&this._updatingHandles.add(()=>r.createQueryVersion,()=>this._dataFilterChanged()),this._updatingHandles.add(()=>this.layerView.effectiveDisplayFilter,()=>this._effectiveDisplayFilterChanged()),this._updatingHandles.add(()=>this.layerView.highlightIds,()=>this._displayFilterHighlightIdsChanged()),this._updatingHandles.add(()=>t.availableFields,(e,t)=>this._availableFieldsChanged(t,e)),this._updatingHandles.add(()=>t.requiredFields,(e,t)=>this._requiredFieldsChanged(t,e)),`customParameters`in r&&this._updatingHandles.add(()=>r.customParameters,()=>this.restart()),this.addHandles([r.on(`apply-edits`,e=>this._applyEdits(e)),m(()=>this.extent,e=>i.filterExtent=e,g),m(()=>this.tileDescriptors,e=>i.tileDescriptors=e,g),m(()=>this.maximumNumberOfFeatures,e=>{i.maximumNumberOfFeatures=e,i.useTileCount=this.serviceDataCount>e},h),m(()=>this.serviceDataCount,e=>{i.useTileCount=e>this.maximumNumberOfFeatures},h),m(()=>({featureTiles:e.featureTiles,show:j.FEATURE_TILE_FETCH_SHOW_TILES}),({show:t,featureTiles:n})=>{t&&i&&n?i.debugger??=new A(i,n.tilingScheme.toTileInfo(),e):i.debugger=s(i.debugger)},p)]),this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}_modeChanged(){switch(this.mode){case`tiles`:this._tilesHandle||=this.layerView.view.enableFeatureTiles();break;default:o.getLogger(this).warn(`Unhandled feature layer mode `+this.mode);case`snapshot`:this._tilesHandle!=null&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set(`maxTotalSnapshotVertices`,0),this.notifyChange(`maxTotalSnapshotVertices`),this._refetch({resetForceTilesMode:!0})}_effectiveDisplayFilterChanged(){this.mode!==`snapshot`&&this._refetch({resetForceTilesMode:!1})}_displayFilterHighlightIdsChanged(){this.mode!==`snapshot`&&this._tileFetcher!=null&&this._tileFetcher.refetchDisplayFilterHighlightTile()}_applyEdits(e){let t=this.layerView.layer;this._tileFetcher!=null&&this._tileFetcher.applyEdits(e).then(e=>{if(e){if(!this._lifeCycleAbortController)throw d();e.exceededTransferLimit&&`refresh`in t?t.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.consumePromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(e=>{if(!f(e))throw e})}_availableFieldsChanged(e,t){this._tileFetcher!=null&&F(this._tileFetcher.availableFields,t)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(e,t){this._tileFetcher!=null&&F(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){let t=this.layerView.layer,n=t.createQuery();return n.returnGeometry=!1,n.outStatistics=[new T({statisticType:`exceedslimit`,maxVertexCount:e,outStatisticFieldName:`exceedslimit`,maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(n.cacheHint=!0),n}_createDataInfoQuery(){let e=this.layerView.layer,t=this.layerView,n=e.createQuery();return n.returnGeometry=!1,n.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(n.cacheHint=!0),t.effectiveDisplayFilter&&(n.where=_(n.where,t.effectiveDisplayFilter.where)),n}_fullExtentIsAccurate(){let e=this.layerView.layer;if(`definitionExpression`in e&&e.definitionExpression)return!1;switch(e.type){case`feature`:case`catalog-footprint`:case`oriented-imagery`:return S(e.url);case`csv`:case`geojson`:case`ogc-feature`:case`wfs`:return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(e){f(e)||this._set(`serviceDataExtent`,a(this.layerView.fullExtentInLocalViewSpatialReference)??null)}}async _tryUpdateServiceDataExtent(e){let t=this.layerView,n=t.layer,r=n.capabilities?.query.supportsExtent??!1,i=a(t.fullExtentInLocalViewSpatialReference),o=n.fullExtent,s=this._fullExtentIsAccurate(),c=this.serviceDataCount;if(r&&c<=I.maxFeatureCountForExtent&&(!i||!s)&&`queryExtent`in n){let t=this._createDataInfoQuery(),r=await n.queryExtent(t,{timeout:I.queryExtentTimeout,signal:e});this._set(`serviceDataExtent`,r.extent)}else if(i)this._set(`serviceDataExtent`,i);else if(o!=null){let e=o.spatialReference?await x(o,t.view.spatialReference):null;this._set(`serviceDataExtent`,e??null)}else this._set(`serviceDataExtent`,null)}async _updateServiceDataCount(e){let t=this.layerView.layer;if(!(`queryFeatureCount`in t)||!has(`featurelayer-snapshot-enabled`)){this._set(`serviceDataCount`,I.noServiceDataCount);return}let r=await n(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:I.queryStatisticsTimeout,signal:e}));if(r.ok===!0)this._set(`serviceDataCount`,r.value);else{if(f(r.error))throw r.error;this._set(`serviceDataCount`,I.noServiceDataCount)}}get _supportsExceedsLimitQuery(){let e=this.layerView.layer;return e.capabilities!=null&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case`point`:return 1;case`multipoint`:return 1;case`polygon`:return 4;case`polyline`:return 2;case`multipatch`:case`mesh`:return 3;case null:case void 0:return 0;default:return 0}}async _updateSnapshotLimit(e,t,r){if(e?.averageSymbolComplexity==null){this._snapshotLimitExceeded=!1;return}let{maximumTotalNumberOfVertices:i,averageSymbolComplexity:a}=e,{verticesPerFeature:o,verticesPerCoordinate:s}=a,c=o<=0,l=this._minimumNumberOfVerticesForGeometry>1;if(!c&&!l){this._snapshotLimitExceeded=!1;return}o!==0&&t!=null&&await t;let u=Math.min(i,N),d=this.serviceDataCount,p=d!==I.noServiceDataCount,m=Math.ceil(p?(u-d*o)/(s||1):u/(s||1));if(l&&(m=Math.min(m,P)),p&&this._minimumNumberOfVerticesForGeometry*d>m){this._snapshotLimitExceeded=!0;return}if(!this._supportsExceedsLimitQuery||!has(`featurelayer-snapshot-enabled`)){this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>m;return}let h=await n(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(m),{timeout:I.queryStatisticsTimeout,signal:r}));if(h.ok===!1){if(f(h.error))throw h.error;this._snapshotLimitExceeded=!1;return}let g=h.value.features[0];this._snapshotLimitExceeded=g?.attributes?!!g.attributes.exceedslimit:!1}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(),await C(this.layerView.layer);let e=new AbortController,t=e.signal,n=this._updateServiceDataCount(t),r=Promise.allSettled([n,this._updateSnapshotLimit(this.displayFeatureLimit,n,t)]),i=r.then(()=>this._updateServiceDataExtent(t)).catch(e=>{f(e)||o.getLogger(this).error(`#fetchServiceDataInfo()`,e)}).then(()=>{i===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null});return e&&(this._fetchDataInfoPromise=i),this._fetchDataInfoAbortController=e,r.then(()=>{},()=>{})}_cancelFetchServiceDataInfo(){let e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};e([v({readOnly:!0})],M.prototype,`type`,void 0),e([v({constructOnly:!0})],M.prototype,`graphics`,void 0),e([v({constructOnly:!0})],M.prototype,`layerView`,void 0),e([v({constructOnly:!0})],M.prototype,`context`,void 0),e([v({readOnly:!0})],M.prototype,`dataUpdating`,null),e([v()],M.prototype,`extent`,null),e([v()],M.prototype,`updating`,null),e([v({readOnly:!0})],M.prototype,`_updatingHandles`,void 0),e([v()],M.prototype,`updatingTotal`,null),e([v()],M.prototype,`updatingRemaining`,null),e([v()],M.prototype,`expectedFeatureDiff`,null),e([v()],M.prototype,`usedMemory`,null),e([v()],M.prototype,`usedMemoryPerFeature`,null),e([v()],M.prototype,`maximumNumberOfFeaturesExceeded`,null),e([v()],M.prototype,`snappingComplexityExceeded`,null),e([v({readOnly:!0})],M.prototype,`serviceDataExtent`,void 0),e([v({readOnly:!0})],M.prototype,`serviceDataCount`,void 0),e([v()],M.prototype,`_snapshotLimitExceeded`,void 0),e([v()],M.prototype,`displayFeatureLimit`,void 0),e([v({type:Number})],M.prototype,`maximumNumberOfFeatures`,null),e([v({readOnly:!0})],M.prototype,`hasAllFeatures`,null),e([v({readOnly:!0})],M.prototype,`hasAllFeaturesInView`,null),e([v({readOnly:!0})],M.prototype,`hasFullGeometries`,null),e([v()],M.prototype,`_forceTilesMode`,void 0),e([v({readOnly:!0})],M.prototype,`mode`,null),e([v({readOnly:!0})],M.prototype,`maxTotalSnapshotVertices`,null),e([v({readOnly:!0})],M.prototype,`tileDescriptors`,null),e([v()],M.prototype,`_tileFetcher`,void 0),e([v()],M.prototype,`_fetchDataInfoPromise`,void 0),M=e([y(`esri.layers.graphics.controllers.FeatureTileController3D`)],M);const N=has(`esri-tests-maximum-vertices-for-snapshot`)??1e6,P=5e6;function F(e,t){if(!t)return!1;for(let n of t)if(!e.has(n))return!0;return!1}class I{static{this.noServiceDataCount=1/0}static{this.maxSnapshotMinScaleFactor=5}static reset(){I.maxFeatureCountForExtent=1e4,I.queryStatisticsTimeout=12e3,I.queryExtentTimeout=1e4}}I.reset();export{M as FeatureTileController3D,I as FeatureTileController3DConstants};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{result as n}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{destroyMaybe as s,removeMaybe as c,abortMaybe as l}from"../../../core/maybe.js";import{EsriPromiseMixin as u}from"../../../core/Promise.js";import{createAbortError as d,isAbortError as f}from"../../../core/promiseUtils.js";import{initial as p,watch as m,syncAndInitial as h,sync as g}from"../../../core/reactiveUtils.js";import{sqlAnd as _}from"../../../core/sql.js";import{property as v,subclass as y}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as b}from"../../../core/support/UpdatingHandles.js";import{projectAsync as x}from"../../../geometry/projectionUtils.js";import{isHostedAgolService as S}from"../../support/arcgisLayerUrl.js";import{checkServiceCurrentUserSupport as C}from"../../support/featureLayerUtils.js";import{getEffectiveLayerCapabilities as w}from"../../support/layerUtils.js";import T from"../../../rest/support/StatisticDefinition.js";import{FeatureTileDescriptor as E,virtualSnapshotTileId as D,virtualDisplayFilterHighlightTileId as O}from"../../../views/3d/layers/support/FeatureTileDescriptor.js";import{FeatureTileFetcher3D as k}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as A}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import{debugFlags as j}from"../../../views/3d/support/debugFlags.js";let M=class extends u(t){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(e){if(e!=null&&!e.spatialReference.equals(this.layerView.view.spatialReference)){o.getLogger(this).error(`#extent=`,`extent needs to be in the same spatial reference as the view`);return}let t=this._get(`extent`);if(t===e||t!=null&&e&&t.equals(e))return;let n=e==null?null:e.clone();this._set(`extent`,n)}get updating(){return!!(this._tileFetcher?.updating||this._fetchDataInfoPromise!=null||this.mode===`tiles`&&this.layerView.view.featureTiles?.updating||this._updatingHandles?.updating)}get updatingTotal(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.expectedFeatureDiff:0}get usedMemory(){return this._tileFetcher?.usedMemory??0}get usedMemoryPerFeature(){return this._tileFetcher?.usedMemoryPerFeature??0}get maximumNumberOfFeaturesExceeded(){return!!(this._tileFetcher!=null&&this._tileFetcher.maximumNumberOfFeaturesExceeded)}get snappingComplexityExceeded(){return this._tileFetcher?.snappingComplexityExceeded??!0}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome(`maximumNumberOfFeatures`,e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden(`maximumNumberOfFeatures`)}get hasAllFeatures(){return this.serviceDataCount===I.noServiceDataCount&&this.mode===`snapshot`&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){let e=this.context.effectiveDisplayFilter?.where||null,t=e!=null&&e!==`1=1`;return this.mode===`tiles`&&t?!1:this._tileFetcher?.showsAllFeatures??!1}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){let e=this.layerView.layer;if(e.type===`feature`&&e.infoFor3D!=null)return`snapshot`;if(e.type===`catalog-footprint`||this._forceTilesMode)return`tiles`;let t=this.layerView.view;if(t.qualitySettings?.graphics3D?.snapshotAvailable===!1||this.serviceDataCount===I.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return`tiles`;let n=(t&&t.featureTiles)?.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&n){let t=this._approximateExtentSizeAtScale(e.minScale,n);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>I.maxSnapshotMinScaleFactor)return`tiles`}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?`snapshot`:`tiles`}get maxTotalSnapshotVertices(){let e=this._get(`maxTotalSnapshotVertices`)||0,t=this.mode===`snapshot`&&this._tileFetcher?.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){let n=this.layerView.view,r=Math.ceil((n.width/t.pixelSize+n.height/t.pixelSize)/2),i=t.levels[0];return r*((i.tileSize[0]/(i.scale/e)+i.tileSize[1]/(i.scale/e))/2)}get tileDescriptors(){if(this.mode===`snapshot`){let e=new E(0,0,0,null,D);return new r([e])}let e=this.layerView.view.featureTiles;if(!e)return new r;let t=e.tiles;if(this.layerView.displayFilterEnabled&&this.layerView.effectiveDisplayFilterClause!=null&&this.layerView.effectiveDisplayFilterClause!==`1=1`&&this.layerView.highlightIds?.length>0){let e=new E(0,0,0,this.layerView.view.featureTiles?.tilingScheme,O);return new r([...t,e])}return t}get test(){}constructor(e){super(e),this.type=`feature-tile-3d`,this._updatingHandles=new b,this.serviceDataExtent=null,this.serviceDataCount=I.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=>this.displayFeatureLimit,e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal))),this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),p),this._updatingHandles.add(()=>this.mode,(e,t)=>{e===`tiles`&&t===`snapshot`&&(this._forceTilesMode=!0)},p),this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){let e=this.layerView.layer;if(e.type!==`ogc-feature`&&!w(e)?.operations.supportsQuery)throw new i(`graphicscontroller:query-capability-required`,`Service requires query capabilities to be used as a feature layer`,{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=s(this._tileFetcher),this._tilesHandle=c(this._tilesHandle),this._lifeCycleAbortController=l(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set(`_updatingHandles`,null)}suspend(){this._suspended||(this._suspended=!0,this._tileFetcher!=null&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,this._tileFetcher!=null&&this._tileFetcher.resume())}restart(){let e=()=>{this._tileFetcher!=null&&this._tileFetcher.restart()};this._updatingHandles.consumePromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(e){return this._tileFetcher?.getMissingAttributesForFeature(e)}_refetch(e){let t=()=>{this._tileFetcher!=null&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.consumePromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){let e=this.layerView.view;if(!e)return;let{layerView:t,tileDescriptors:n}=this,r=t.layer,i=new k({context:this.context,filterExtent:this.extent,tileDescriptors:n,features:this.graphics});this._tileFetcher=i,this._suspended?i.suspend():i.resume(),e&&this.addHandles(m(()=>e.quality,e=>i.memoryFactor=e,h));let a=this.context.geometryType===`polygon`?`polygonLodFactor`:this.context.geometryType===`polyline`?`polylineLodFactor`:null;a&&this.addHandles(m(()=>this.layerView.view?.qualitySettings?.graphics3D?.[a],e=>i.lodFactor=e||1,p)),r.type!==`ogc-feature`&&this._updatingHandles.add(()=>r.createQueryVersion,()=>this._dataFilterChanged()),this._updatingHandles.add(()=>this.layerView.effectiveDisplayFilter,()=>this._effectiveDisplayFilterChanged()),this._updatingHandles.add(()=>this.layerView.highlightIds,()=>this._displayFilterHighlightIdsChanged()),this._updatingHandles.add(()=>({availableFields:t.availableFields,requiredFields:t.requiredFields}),({availableFields:e,requiredFields:t})=>this._fieldsChanged(e,t)),`customParameters`in r&&this._updatingHandles.add(()=>r.customParameters,()=>this.restart()),this.addHandles([r.on(`apply-edits`,e=>this._applyEdits(e)),m(()=>this.extent,e=>i.filterExtent=e,g),m(()=>this.tileDescriptors,e=>i.tileDescriptors=e,g),m(()=>this.maximumNumberOfFeatures,e=>{i.maximumNumberOfFeatures=e,i.useTileCount=this.serviceDataCount>e},h),m(()=>this.serviceDataCount,e=>{i.useTileCount=e>this.maximumNumberOfFeatures},h),m(()=>({featureTiles:e.featureTiles,show:j.FEATURE_TILE_FETCH_SHOW_TILES}),({show:t,featureTiles:n})=>{t&&i&&n?i.debugger??=new A(i,n.tilingScheme.toTileInfo(),e):i.debugger=s(i.debugger)},p)]),this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}_modeChanged(){switch(this.mode){case`tiles`:this._tilesHandle||=this.layerView.view.enableFeatureTiles();break;default:o.getLogger(this).warn(`Unhandled feature layer mode `+this.mode);case`snapshot`:this._tilesHandle!=null&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set(`maxTotalSnapshotVertices`,0),this.notifyChange(`maxTotalSnapshotVertices`),this._refetch({resetForceTilesMode:!0})}_effectiveDisplayFilterChanged(){this.mode!==`snapshot`&&this._refetch({resetForceTilesMode:!1})}_displayFilterHighlightIdsChanged(){this.mode!==`snapshot`&&this._tileFetcher!=null&&this._tileFetcher.refetchDisplayFilterHighlightTile()}_applyEdits(e){let t=this.layerView.layer;this._tileFetcher!=null&&this._tileFetcher.applyEdits(e).then(e=>{if(e){if(!this._lifeCycleAbortController)throw d();e.exceededTransferLimit&&`refresh`in t?t.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.consumePromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(e=>{if(!f(e))throw e})}_fieldsChanged(e,t){this._tileFetcher!=null&&(F(this._tileFetcher.availableFields,e)||this._tileFetcher.hasMissingAttributes(t))&&this._tileFetcher.refetchAttributes()}_createVertexLimitExceededQuery(e){let t=this.layerView.layer,n=t.createQuery();return n.returnGeometry=!1,n.outStatistics=[new T({statisticType:`exceedslimit`,maxVertexCount:e,outStatisticFieldName:`exceedslimit`,maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(n.cacheHint=!0),n}_createDataInfoQuery(){let e=this.layerView.layer,t=this.layerView,n=e.createQuery();return n.returnGeometry=!1,n.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(n.cacheHint=!0),t.effectiveDisplayFilter&&(n.where=_(n.where,t.effectiveDisplayFilter.where)),n}_fullExtentIsAccurate(){let e=this.layerView.layer;if(`definitionExpression`in e&&e.definitionExpression)return!1;switch(e.type){case`feature`:case`catalog-footprint`:case`oriented-imagery`:return S(e.url);case`csv`:case`geojson`:case`ogc-feature`:case`wfs`:return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(e){f(e)||this._set(`serviceDataExtent`,a(this.layerView.fullExtentInLocalViewSpatialReference)??null)}}async _tryUpdateServiceDataExtent(e){let t=this.layerView,n=t.layer,r=n.capabilities?.query.supportsExtent??!1,i=a(t.fullExtentInLocalViewSpatialReference),o=n.fullExtent,s=this._fullExtentIsAccurate(),c=this.serviceDataCount;if(r&&c<=I.maxFeatureCountForExtent&&(!i||!s)&&`queryExtent`in n){let t=this._createDataInfoQuery(),r=await n.queryExtent(t,{timeout:I.queryExtentTimeout,signal:e});this._set(`serviceDataExtent`,r.extent)}else if(i)this._set(`serviceDataExtent`,i);else if(o!=null){let e=o.spatialReference?await x(o,t.view.spatialReference):null;this._set(`serviceDataExtent`,e??null)}else this._set(`serviceDataExtent`,null)}async _updateServiceDataCount(e){let t=this.layerView.layer;if(!(`queryFeatureCount`in t)||!has(`featurelayer-snapshot-enabled`)){this._set(`serviceDataCount`,I.noServiceDataCount);return}let r=await n(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:I.queryStatisticsTimeout,signal:e}));if(r.ok===!0)this._set(`serviceDataCount`,r.value);else{if(f(r.error))throw r.error;this._set(`serviceDataCount`,I.noServiceDataCount)}}get _supportsExceedsLimitQuery(){let e=this.layerView.layer;return e.capabilities!=null&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case`point`:return 1;case`multipoint`:return 1;case`polygon`:return 4;case`polyline`:return 2;case`multipatch`:case`mesh`:return 3;case null:case void 0:return 0;default:return 0}}async _updateSnapshotLimit(e,t,r){if(e?.averageSymbolComplexity==null){this._snapshotLimitExceeded=!1;return}let{maximumTotalNumberOfVertices:i,averageSymbolComplexity:a}=e,{verticesPerFeature:o,verticesPerCoordinate:s}=a,c=o<=0,l=this._minimumNumberOfVerticesForGeometry>1;if(!c&&!l){this._snapshotLimitExceeded=!1;return}o!==0&&t!=null&&await t;let u=Math.min(i,N),d=this.serviceDataCount,p=d!==I.noServiceDataCount,m=Math.ceil(p?(u-d*o)/(s||1):u/(s||1));if(l&&(m=Math.min(m,P)),p&&this._minimumNumberOfVerticesForGeometry*d>m){this._snapshotLimitExceeded=!0;return}if(!this._supportsExceedsLimitQuery||!has(`featurelayer-snapshot-enabled`)){this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>m;return}let h=await n(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(m),{timeout:I.queryStatisticsTimeout,signal:r}));if(h.ok===!1){if(f(h.error))throw h.error;this._snapshotLimitExceeded=!1;return}let g=h.value.features[0];this._snapshotLimitExceeded=g?.attributes?!!g.attributes.exceedslimit:!1}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(),await C(this.layerView.layer);let e=new AbortController,t=e.signal,n=this._updateServiceDataCount(t),r=Promise.allSettled([n,this._updateSnapshotLimit(this.displayFeatureLimit,n,t)]),i=r.then(()=>this._updateServiceDataExtent(t)).catch(e=>{f(e)||o.getLogger(this).error(`#fetchServiceDataInfo()`,e)}).then(()=>{i===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null});return e&&(this._fetchDataInfoPromise=i),this._fetchDataInfoAbortController=e,r.then(()=>{},()=>{})}_cancelFetchServiceDataInfo(){let e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};e([v({readOnly:!0})],M.prototype,`type`,void 0),e([v({constructOnly:!0})],M.prototype,`graphics`,void 0),e([v({constructOnly:!0})],M.prototype,`layerView`,void 0),e([v({constructOnly:!0})],M.prototype,`context`,void 0),e([v({readOnly:!0})],M.prototype,`dataUpdating`,null),e([v()],M.prototype,`extent`,null),e([v()],M.prototype,`updating`,null),e([v({readOnly:!0})],M.prototype,`_updatingHandles`,void 0),e([v()],M.prototype,`updatingTotal`,null),e([v()],M.prototype,`updatingRemaining`,null),e([v()],M.prototype,`expectedFeatureDiff`,null),e([v()],M.prototype,`usedMemory`,null),e([v()],M.prototype,`usedMemoryPerFeature`,null),e([v()],M.prototype,`maximumNumberOfFeaturesExceeded`,null),e([v()],M.prototype,`snappingComplexityExceeded`,null),e([v({readOnly:!0})],M.prototype,`serviceDataExtent`,void 0),e([v({readOnly:!0})],M.prototype,`serviceDataCount`,void 0),e([v()],M.prototype,`_snapshotLimitExceeded`,void 0),e([v()],M.prototype,`displayFeatureLimit`,void 0),e([v({type:Number})],M.prototype,`maximumNumberOfFeatures`,null),e([v({readOnly:!0})],M.prototype,`hasAllFeatures`,null),e([v({readOnly:!0})],M.prototype,`hasAllFeaturesInView`,null),e([v({readOnly:!0})],M.prototype,`hasFullGeometries`,null),e([v()],M.prototype,`_forceTilesMode`,void 0),e([v({readOnly:!0})],M.prototype,`mode`,null),e([v({readOnly:!0})],M.prototype,`maxTotalSnapshotVertices`,null),e([v({readOnly:!0})],M.prototype,`tileDescriptors`,null),e([v()],M.prototype,`_tileFetcher`,void 0),e([v()],M.prototype,`_fetchDataInfoPromise`,void 0),M=e([y(`esri.layers.graphics.controllers.FeatureTileController3D`)],M);const N=has(`esri-tests-maximum-vertices-for-snapshot`)??1e6,P=5e6;function F(e,t){if(!t)return!1;for(let n of t)if(!e.has(n))return!0;return!1}class I{static{this.noServiceDataCount=1/0}static{this.maxSnapshotMinScaleFactor=5}static reset(){I.maxFeatureCountForExtent=1e4,I.queryStatisticsTimeout=12e3,I.queryExtentTimeout=1e4}}I.reset();export{M as FeatureTileController3D,I as FeatureTileController3DConstants};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.19",
3
+ "version": "6.0.0-next.20",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -19,8 +19,8 @@
19
19
  "type": "module",
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
- "@amcharts/amcharts5": "~5.21.3",
23
- "@arcgis/toolkit": "6.0.0-next.19",
22
+ "@amcharts/amcharts5": "~5.21.4",
23
+ "@arcgis/toolkit": "6.0.0-next.20",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0",
26
26
  "@vaadin/grid": "~25.3.4",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../../core/screenUtils.js";import{fromRotation as t,multiply as n,translate as r,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as s}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import p from"../../collisions/BoundingBox.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureBinding:a.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=a(),this._transform=a(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureBinding=e.textureBinding,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){let{x:e,y:r,width:i,height:s}=this,c=t(a(),-this.angle),l=n(a(),c,this._transform);this._offsets={topLeft:o([0,0],[e,r],l),topRight:o([0,0],[e+i,r],l),bottomLeft:o([0,0],[e,r+s],l),bottomRight:o([0,0],[e+i,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new p(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(t){return t===`underline`?e(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>o(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;let r=this._transform,i=t(a(),e);n(r,i,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureBinding;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,d=[r-8,i-8],f=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[d[0]-t,d[1]-t],[f[0]+t,f[1]-t],[d[0]+n,d[1]+n],[f[0]-n,f[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[d[0]-t,d[1]-t],[d[0]+n,d[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[f[0]-n,f[1]+n],[f[0]+t,f[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([d,f,m,h],e),top:g,bot:_,left:v,right:b};return[new p(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=s(c(),e.x,e.y);if(o(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new p(t[0],t[1],n,n)}return new p(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new p(s,c,a,o)}_createGlyphTransform(e,t){let n=m*t.angle,o=a(),l=c();return r(o,o,s(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?i(o,o,n):(r(o,o,s(l,e.x,e.y)),i(o,o,n),r(o,o,s(l,-e.x,-e.y))),o}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=t?e.length-1:0,s=t?-1:e.length,c=t?-1:1,l=o,u=0,d=0,f=l,p=f,m=0,h=1/0,g=0;for(;l!==s;){let{code:t,rect:n,shaping:i}=e[l],s=Math.abs(n.top);if(!S(t)&&!C(t)&&(h=Math.min(h,s),g=Math.max(g,s+n.height)),S(t))l!==o&&(r.push(new x(e,f,l-c,u,h===1/0?0:h,g)),h=1/0,g=0),u=0,f=l+c,p=l+c,d=0;else if(C(t))p=l+c,d=0,m=i.xAdvance,u+=i.xAdvance;else if(u>a){if(p!==f){let t=p-2*c;u-=m,r.push(new x(e,f,t,u-d,h,g)),h=1/0,g=0,f=p,u=d}else r.push(new x(e,f,l-c,u,h,g)),h=1/0,g=0,f=l,p=l,u=0;u+=i.xAdvance,d+=i.xAdvance}else u+=i.xAdvance,d+=i.xAdvance;l+=c}let _=new x(e,f,l-c,u,h,g);return _.start>=0&&_.end<e.length&&r.push(_),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,s,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2);for(let a=0;a<d.length;a++){let{start:s,end:l,width:u}=d[a],m=c&&a<d.length-1?E(o,s,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(e.isRightToLeft?d.length-1-a:a)*t.lineHeight+x-i;d[a].startX=v,d[a].startY=y;for(let e=s;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureBinding:i.mosaicItem.textureBinding,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureBinding=p.textureBinding??i.mosaicItem.textureBinding),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(t,n){let r=n.lineHeightRatio??1,i=[];for(let n of t.runs){let t=e(n.fontSize),a=t/n.glyphs.sdfSize,o=d/24*t*r,s=(n.glyphs.faceInfo?.baseline??22)*a,c=(n.glyphs.faceInfo?.midline??16)*a,l=4*a+_(n.decoration),u=1+(n.characterSpacing??0);for(let e of n.glyphs.glyphs){let r=e.shaping.xAdvance*a,d=Math.abs(e.rect.top)*a,f=d+e.rect.height*a;i.push({glyph:e,scale:a,fontSize:t,decoration:n.decoration,underlineOffset:l,color:n.color,xAdvance:!S(e.code)&&!C(e.code)?r*u:r,top:d,bottom:f,lineHeight:o,baseline:s,midline:c})}}return i}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),!(S(n.glyph.code)||C(n.glyph.code))&&(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin,r=e[e.length-1];return{x:0,y:n,height:L(r)-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureBinding),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
2
+ import{pt2px as e}from"../../../../../../core/screenUtils.js";import{fromRotation as t,multiply as n,translate as r,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as s}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import p from"../../collisions/BoundingBox.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureBinding:a.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=a(),this._transform=a(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureBinding=e.textureBinding,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){let{x:e,y:r,width:i,height:s}=this,c=t(a(),-this.angle),l=n(a(),c,this._transform);this._offsets={topLeft:o([0,0],[e,r],l),topRight:o([0,0],[e+i,r],l),bottomLeft:o([0,0],[e,r+s],l),bottomRight:o([0,0],[e+i,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new p(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(t){return t===`underline`?e(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>o(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;let r=this._transform,i=t(a(),e);n(r,i,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureBinding;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,d=[r-8,i-8],f=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[d[0]-t,d[1]-t],[f[0]+t,f[1]-t],[d[0]+n,d[1]+n],[f[0]-n,f[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[d[0]-t,d[1]-t],[d[0]+n,d[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[f[0]-n,f[1]+n],[f[0]+t,f[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([d,f,m,h],e),top:g,bot:_,left:v,right:b};return[new p(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=s(c(),e.x,e.y);if(o(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new p(t[0],t[1],n,n)}return new p(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new p(s,c,a,o)}_createGlyphTransform(e,t){let n=m*t.angle,o=a(),l=c();return r(o,o,s(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?i(o,o,n):(r(o,o,s(l,e.x,e.y)),i(o,o,n),r(o,o,s(l,-e.x,-e.y))),o}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=e.length,s=0,c=0,l=0,u=s,d=u,f=0,p=1/0,m=0;for(;s!==o;){let{code:t,rect:n,shaping:i}=e[s],o=Math.abs(n.top);if(!S(t)&&!C(t)&&(p=Math.min(p,o),m=Math.max(m,o+n.height)),S(t))s!==0&&(r.push(new x(e,u,s-1,c,p===1/0?0:p,m)),p=1/0,m=0),c=0,u=s+1,d=s+1,l=0;else if(C(t))d=s+1,l=0,f=i.xAdvance,c+=i.xAdvance;else if(c>a){if(d!==u){let t=d-2;c-=f,r.push(new x(e,u,t,c-l,p,m)),p=1/0,m=0,u=d,c=l}else r.push(new x(e,u,s-1,c,p,m)),p=1/0,m=0,u=s,d=s,c=0;c+=i.xAdvance,l+=i.xAdvance}else c+=i.xAdvance,l+=i.xAdvance;s+=1}let h=new x(e,u,s-1,c,p,m);return h.start>=0&&h.end<e.length&&r.push(h),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,!1,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2);for(let a=0;a<d.length;a++){let{start:s,end:l,width:u}=d[a],m=c&&a<d.length-1?E(o,s,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(e.isRightToLeft?d.length-1-a:a)*t.lineHeight+x-i;d[a].startX=v,d[a].startY=y;for(let e=s;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureBinding:i.mosaicItem.textureBinding,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureBinding=p.textureBinding??i.mosaicItem.textureBinding),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(t,n){let r=n.lineHeightRatio??1,i=[];for(let n of t.runs){let t=e(n.fontSize),a=t/n.glyphs.sdfSize,o=d/24*t*r,s=(n.glyphs.faceInfo?.baseline??22)*a,c=(n.glyphs.faceInfo?.midline??16)*a,l=4*a+_(n.decoration),u=1+(n.characterSpacing??0);for(let e of n.glyphs.glyphs){let r=e.shaping.xAdvance*a,d=Math.abs(e.rect.top)*a,f=d+e.rect.height*a;i.push({glyph:e,scale:a,fontSize:t,decoration:n.decoration,underlineOffset:l,color:n.color,xAdvance:!S(e.code)&&!C(e.code)?r*u:r,top:d,bottom:f,lineHeight:o,baseline:s,midline:c})}}return i}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),!(S(n.glyph.code)||C(n.glyph.code))&&(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin,r=e[e.length-1];return{x:0,y:n,height:L(r)-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureBinding),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{nextPowerOfTwo as e}from"../../../../../../../core/mathUtils.js";import{create as t}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getDefinesKey as r}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as i,vtlHighResCutoff as a}from"../../../definitions.js";import{Mesh as o}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as c}from"../Technique.js";import{VTLShaderBackground as l}from"../shaders/vector-tiles/VTLShaderBackground.js";import{PrimitiveType as u}from"../../../../../../webgl/enums.js";function d(e,t){return{color:e.getPaintValue(`background-color`,t),opacity:e.getPaintValue(`background-opacity`,t),pattern:e.getPaintValue(`background-pattern`,Math.floor(t))}}class f extends c{constructor(){super(...arguments),this.type=38,this._color=n(1,0,0,1),this._patternMatrix=t(),this._mesh=null,this.shaders={background:new l}}render(n,o){if(o.tiles.length===0)return;this._loadResources(n);let{context:c,displayLevel:l,painter:u,spriteMosaic:f,styleLayer:p}=n,m=p,h=m.backgroundMaterial,{color:g,opacity:_,pattern:v}=d(m,l),y=v!==void 0,b=window.devicePixelRatio|1,x,S,C=h.key+r({hasPattern:y}),w=b>a?2:1,T={layerInfo:{depth:m.z,coordRange:o.tiles[0].rangeX},solidColor:null,pattern:null,patternMat:{mat:t()}},E=null;if(y){let e=f.getMosaicItemPosition(v,!0);if(e!=null){let{tl:t,br:n,page:r}=e;x=n[0]-t[0],S=n[1]-t[1];let a=f.getPageSize(r);a!=null&&(f.bind(c,9729,r,i),T.pattern={tlbr:[t[0],t[1],n[0],n[1]],mosaicSize:a,opacity:_},E={patternTexture:{texture:f.getTexture(r),unit:i}})}else return}else{let e=g[3]*_;this._color[0]=e*g[0],this._color[1]=e*g[1],this._color[2]=e*g[2],this._color[3]=e,T.solidColor={color:this._color}}u.setPipelineState(s);for(let t of o.tiles){if(T.layerInfo.coordRange=t.rangeX,y){let n=Math.max(2**(Math.round(l)-t.key.level),1),r=w*t.width*n,i=r/e(x),a=r/e(S);this._patternMatrix[0]=i,this._patternMatrix[4]=a,T.patternMat={mat:this._patternMatrix}}t.bind(c);let n={shader:this.shaders.background,uniforms:T,textures:E,defines:{renderMode:+!!y},optionalAttributes:h.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:h.getPrecisionFactors(),materialKey:C};u.submitDrawMeshUntyped(c,n,this._mesh,{stencilRef:t.stencilRef})}}shutdown(){this._mesh&&=(this._mesh.destroy(),null)}_loadResources(e){if(this._mesh)return;let{context:t,styleLayer:n}=e,r=n,i=new Int16Array([0,0,1,0,0,1,1,1]),a=r.backgroundMaterial.geometryLayout;if(!a)return;let s={vertex:{geometryVB:{data:i,layout:a}},groups:[{primitive:u.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:4}]};this._mesh=new o(t,s)}}export{f as VTLTechniqueBackground,d as getBackgroundPaintValues};
2
+ import{nextPowerOfTwo as e}from"../../../../../../../core/mathUtils.js";import{create as t}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getDefinesKey as r}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as i,vtlHighResCutoff as a}from"../../../definitions.js";import{Mesh as o}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as c}from"../Technique.js";import{VTLShaderBackground as l}from"../shaders/vector-tiles/VTLShaderBackground.js";import{PrimitiveType as u}from"../../../../../../webgl/enums.js";function d(e,t){return{color:e.getPaintValue(`background-color`,t),opacity:e.getPaintValue(`background-opacity`,t),pattern:e.getPaintValue(`background-pattern`,Math.floor(t))}}class f extends c{constructor(){super(...arguments),this.type=38,this._color=n(1,0,0,1),this._patternMatrix=t(),this._mesh=null,this.shaders={background:new l}}render(n,o){if(o.tiles.length===0)return;this._loadResources(n);let{context:c,displayLevel:l,painter:u,spriteMosaic:f,styleLayer:p}=n,m=p,h=m.backgroundMaterial,{color:g,opacity:_,pattern:v}=d(m,l),y=v!==void 0,b=window.devicePixelRatio|1,x,S,C=h.key+r({hasPattern:y}),w=b>a?2:1,T={layerInfo:{depth:m.z,coordRange:o.tiles[0].rangeX},solidColor:null,pattern:null,patternMat:{mat:t()}},E=null;if(y){let e=f.getMosaicItemPosition(v,!0);if(e!=null){let{tl:t,br:n,page:r}=e;x=n[0]-t[0],S=n[1]-t[1];let a=f.getPageSize(r);a!=null&&(f.bind(c,9729,r,i),T.pattern={tlbr:[t[0],t[1],n[0],n[1]],mosaicSize:a,opacity:_},E={patternTexture:{texture:f.getTexture(r),unit:i}})}else return}else{let e=g[3]*_;this._color[0]=e*g[0],this._color[1]=e*g[1],this._color[2]=e*g[2],this._color[3]=e,T.solidColor={color:this._color}}u.setPipelineState(s);for(let t of o.tiles){if(T.layerInfo.coordRange=t.rangeX,y){let n=Math.max(2**(Math.floor(l)-t.key.level),1),r=w*t.width*n,i=r/e(x),a=r/e(S);this._patternMatrix[0]=i,this._patternMatrix[4]=a,T.patternMat={mat:this._patternMatrix}}t.bind(c);let n={shader:this.shaders.background,uniforms:T,textures:E,defines:{renderMode:+!!y},optionalAttributes:h.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:h.getPrecisionFactors(),materialKey:C};u.submitDrawMeshUntyped(c,n,this._mesh,{stencilRef:t.stencilRef})}}shutdown(){this._mesh&&=(this._mesh.destroy(),null)}_loadResources(e){if(this._mesh)return;let{context:t,styleLayer:n}=e,r=n,i=new Int16Array([0,0,1,0,0,1,1,1]),a=r.backgroundMaterial.geometryLayout;if(!a)return;let s={vertex:{geometryVB:{data:i,layout:a}},groups:[{primitive:u.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:4}]};this._mesh=new o(t,s)}}export{f as VTLTechniqueBackground,d as getBackgroundPaintValues};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{getDefinesKey as e}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as t,vtlHighResCutoff as n}from"../../../definitions.js";import{Technique as r}from"../Technique.js";import{VTLShaderFill as i}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as a}from"../shaders/vector-tiles/VTLShaderOutline.js";const o=1/65536;class s extends r{constructor(){super(...arguments),this.type=40,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new i,outline:new a}}shutdown(){this._fillMesh=null,this._outlineMesh=null}render(e,t){let{displayLevel:n,is3D:r,renderPass:i,spriteMosaic:a,styleLayer:o,styleLayerUID:s}=e,{tiles:c}=t,l=!1;for(let e of c)if(e.layerData.has(s)){let t=e.layerData.get(s);if(t.fillIndexCount>0||t.outlineIndexCount>0){l=!0;break}}if(!l)return;let u=o,d=u.getPaintProperty(`fill-pattern`),f=d!==void 0,p=f&&d.isDataDriven,m;if(f&&!p){let e=d.getValue(n);m=a.getMosaicItemPosition(e,!0)}let h=!f&&u.getPaintValue(`fill-antialias`,n),g=!r||f,_=1;if(!f){let e=u.getPaintProperty(`fill-color`),t=u.getPaintProperty(`fill-opacity`);if(!e?.isDataDriven&&!t?.isDataDriven){let e=u.getPaintValue(`fill-color`,n);_=u.getPaintValue(`fill-opacity`,n)*e[3],_<1&&(g=!0)}}if((u.hasDataDrivenColor||u.hasDataDrivenOpacity)&&(g=!0),g&&i===`opaque`)return;let v=u.getPaintValue(`fill-translate`,n),y=u.getPaintValue(`fill-translate-anchor`,n);(i===`opaque`&&!g||i===`translucent`&&g)&&this._drawFill(e,s,u,c,v,y,f,m,p);let b=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&_<1;h&&i===`translucent`&&!b&&this._drawOutline(e,s,u,c,v,y)}_drawFill(r,i,a,s,c,l,u,d,f){if(u&&!f&&d==null)return;let{context:p,displayLevel:m,drawPhase:h,painter:g,pixelRatio:_,spriteMosaic:v}=r,y=_>n?2:1,b=a.fillMaterial,x=l===1,S={config:{depth:a.z+o,fillTranslation:c,tileOpacity:1},patternOptions:f||u&&d!=null?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0]}:null,color:null,opacity:null,colorMix:null,opacityMix:null},C={patternTexture:null},w={fillType:+!!u,translateAnchorViewport:x},T=b.key+e(w);if(d!=null){let{page:e,tl:n,br:r}=d,i=n[0],a=r[1],o=r[0],s=n[1],c=v.getPageSize(e);c!=null&&(v.bind(p,9729,e,t),S.patternOptions={mosaicSize:[c[0],c[1]],patternFactor:1,tlbr:[i,a,o,s]},C.patternTexture={texture:v.getTexture(e),unit:t})}let E=-1;for(let e of s){if(!e.layerData.has(i))continue;if(e.key.level!==E){E=e.key.level;let t=b.getUniforms();for(let e of t){let t=e.getValue(a,m,E,v);S[e.name]={value:t}}if(u&&S.patternOptions!=null){let t=Math.max(2**(Math.round(m)-e.key.level),1),n=e.rangeX/(y*e.width*t);S.patternOptions.patternFactor=n}}let n=e.layerData.get(i);if(n.isDestroyed||n.fillIndexCount===0||(this._fillMesh=n.getMesh(p,{value:0}),!this._fillMesh))continue;let{config:r}=S;r.tileOpacity=h===1?e.fader.value():1,e.bind(p);let o={shader:this.shaders.fill,uniforms:S,textures:C,defines:w,optionalAttributes:b.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:b.getPrecisionFactors(),materialKey:T};if(f){let r=S.patternOptions,i=n.patternMap;if(!i||r==null)continue;let a=0;for(let[n,s]of i){let i=v.getPageSize(n);i!=null&&(v.bind(p,9729,n,t),r.mosaicSize=i,C.patternTexture={texture:v.getTexture(n),unit:t},g.submitDrawMeshUntyped(p,o,this._fillMesh,{stencilRef:e.stencilRef,parts:[a++]}))}}else g.submitDrawMeshUntyped(p,o,this._fillMesh,{stencilRef:e.stencilRef});e.triangleCount+=n.fillIndexCount/3}}_drawOutline(t,n,r,i,a,s){let{context:c,displayLevel:l,spriteMosaic:u,painter:d,pixelRatio:f}=t,p=r.outlineMaterial,m={translateAnchorViewport:s===1},h=p.key+e(m),g=.75/f,_={config:{depth:r.z+o,fillTranslation:a,outlineWidth:g},color:null,opacity:null,colorMix:null,opacityMix:null},v=-1;for(let e of i){if(!e.layerData.has(n))continue;if(e.key.level!==v){v=e.key.level;let t=p.getUniforms();for(let e of t){let t=e.getValue(r,l,v,u);e.name in _&&(_[e.name]={value:t})}}let t=e.layerData.get(n);if(t.isDestroyed||t.outlineIndexCount===0||(this._outlineMesh=t.getMesh(c,{value:1}),this._outlineMesh==null))continue;e.bind(c);let i={shader:this.shaders.outline,uniforms:_,textures:{},defines:m,optionalAttributes:p.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:p.getPrecisionFactors(),materialKey:h};d.submitDrawMeshUntyped(c,i,this._outlineMesh,{stencilRef:e.stencilRef}),e.triangleCount+=t.outlineIndexCount/3}}}export{s as VTLTechniqueFill};
2
+ import{getDefinesKey as e}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as t,vtlHighResCutoff as n}from"../../../definitions.js";import{Technique as r}from"../Technique.js";import{VTLShaderFill as i}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as a}from"../shaders/vector-tiles/VTLShaderOutline.js";const o=1/65536;class s extends r{constructor(){super(...arguments),this.type=40,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new i,outline:new a}}shutdown(){this._fillMesh=null,this._outlineMesh=null}render(e,t){let{displayLevel:n,is3D:r,renderPass:i,spriteMosaic:a,styleLayer:o,styleLayerUID:s}=e,{tiles:c}=t,l=!1;for(let e of c)if(e.layerData.has(s)){let t=e.layerData.get(s);if(t.fillIndexCount>0||t.outlineIndexCount>0){l=!0;break}}if(!l)return;let u=o,d=u.getPaintProperty(`fill-pattern`),f=d!==void 0,p=f&&d.isDataDriven,m;if(f&&!p){let e=d.getValue(n);m=a.getMosaicItemPosition(e,!0)}let h=!f&&u.getPaintValue(`fill-antialias`,n),g=!r||f,_=1;if(!f){let e=u.getPaintProperty(`fill-color`),t=u.getPaintProperty(`fill-opacity`);if(!e?.isDataDriven&&!t?.isDataDriven){let e=u.getPaintValue(`fill-color`,n);_=u.getPaintValue(`fill-opacity`,n)*e[3],_<1&&(g=!0)}}if((u.hasDataDrivenColor||u.hasDataDrivenOpacity)&&(g=!0),g&&i===`opaque`)return;let v=u.getPaintValue(`fill-translate`,n),y=u.getPaintValue(`fill-translate-anchor`,n);(i===`opaque`&&!g||i===`translucent`&&g)&&this._drawFill(e,s,u,c,v,y,f,m,p);let b=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&_<1;h&&i===`translucent`&&!b&&this._drawOutline(e,s,u,c,v,y)}_drawFill(r,i,a,s,c,l,u,d,f){if(u&&!f&&d==null)return;let{context:p,displayLevel:m,drawPhase:h,painter:g,pixelRatio:_,spriteMosaic:v}=r,y=_>n?2:1,b=a.fillMaterial,x=l===1,S={config:{depth:a.z+o,fillTranslation:c,tileOpacity:1},patternOptions:f||u&&d!=null?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0]}:null,color:null,opacity:null,colorMix:null,opacityMix:null},C={patternTexture:null},w={fillType:+!!u,translateAnchorViewport:x},T=b.key+e(w);if(d!=null){let{page:e,tl:n,br:r}=d,i=n[0],a=r[1],o=r[0],s=n[1],c=v.getPageSize(e);c!=null&&(v.bind(p,9729,e,t),S.patternOptions={mosaicSize:[c[0],c[1]],patternFactor:1,tlbr:[i,a,o,s]},C.patternTexture={texture:v.getTexture(e),unit:t})}let E=-1;for(let e of s){if(!e.layerData.has(i))continue;if(e.key.level!==E){E=e.key.level;let t=b.getUniforms();for(let e of t){let t=e.getValue(a,m,E,v);S[e.name]={value:t}}if(u&&S.patternOptions!=null){let t=Math.max(2**(Math.floor(m)-e.key.level),1),n=e.rangeX/(y*e.width*t);S.patternOptions.patternFactor=n}}let n=e.layerData.get(i);if(n.isDestroyed||n.fillIndexCount===0||(this._fillMesh=n.getMesh(p,{value:0}),!this._fillMesh))continue;let{config:r}=S;r.tileOpacity=h===1?e.fader.value():1,e.bind(p);let o={shader:this.shaders.fill,uniforms:S,textures:C,defines:w,optionalAttributes:b.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:b.getPrecisionFactors(),materialKey:T};if(f){let r=S.patternOptions,i=n.patternMap;if(!i||r==null)continue;let a=0;for(let[n,s]of i){let i=v.getPageSize(n);i!=null&&(v.bind(p,9729,n,t),r.mosaicSize=i,C.patternTexture={texture:v.getTexture(n),unit:t},g.submitDrawMeshUntyped(p,o,this._fillMesh,{stencilRef:e.stencilRef,parts:[a++]}))}}else g.submitDrawMeshUntyped(p,o,this._fillMesh,{stencilRef:e.stencilRef});e.triangleCount+=n.fillIndexCount/3}}_drawOutline(t,n,r,i,a,s){let{context:c,displayLevel:l,spriteMosaic:u,painter:d,pixelRatio:f}=t,p=r.outlineMaterial,m={translateAnchorViewport:s===1},h=p.key+e(m),g=.75/f,_={config:{depth:r.z+o,fillTranslation:a,outlineWidth:g},color:null,opacity:null,colorMix:null,opacityMix:null},v=-1;for(let e of i){if(!e.layerData.has(n))continue;if(e.key.level!==v){v=e.key.level;let t=p.getUniforms();for(let e of t){let t=e.getValue(r,l,v,u);e.name in _&&(_[e.name]={value:t})}}let t=e.layerData.get(n);if(t.isDestroyed||t.outlineIndexCount===0||(this._outlineMesh=t.getMesh(c,{value:1}),this._outlineMesh==null))continue;e.bind(c);let i={shader:this.shaders.outline,uniforms:_,textures:{},defines:m,optionalAttributes:p.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:p.getPrecisionFactors(),materialKey:h};d.submitDrawMeshUntyped(c,i,this._outlineMesh,{stencilRef:e.stencilRef}),e.triangleCount+=t.outlineIndexCount/3}}}export{s as VTLTechniqueFill};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{equals as n}from"../../../../core/arrayUtils.js";import{equalsMaybe as r}from"../../../../core/maybe.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as s}from"../../../../geometry/support/ray.js";let c=class extends t{constructor(e){super(e)}clone(){return this}equals(e){return this.context?.type===e.context?.type&&(!this.context||!e.context||this.context.equals(e.context))&&this.id===e.id&&r(this.mapPoint,e.mapPoint)&&o(this.renderPoint,e.renderPoint)&&n(this.normal,e.normal)&&s(this.ray,e.ray)}};e([i({constructOnly:!0})],c.prototype,`context`,void 0),e([i({constructOnly:!0})],c.prototype,`id`,void 0),e([i({constructOnly:!0})],c.prototype,`mapPoint`,void 0),e([i({constructOnly:!0})],c.prototype,`renderPoint`,void 0),e([i({constructOnly:!0})],c.prototype,`normal`,void 0),e([i({constructOnly:!0})],c.prototype,`ray`,void 0),c=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult`)],c);class l{constructor(e){this.graphic=e,this.type=`graphic`}equals(e){return e.type===this.type&&this.graphic===e.graphic}}class u{constructor(){this.type=`ground`}equals(e){return e.type===this.type}}const d=new u;class f{constructor(){this.type=`gaussian-splat`}equals(e){return e.type===this.type}}const p=new f;export{l as LineOfSightIntersectionContextGraphic,c as LineOfSightIntersectionResult,p as lineOfSightIntersectionContextGaussianSplat,d as lineOfSightIntersectionContextGround};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{equalsMaybe as n}from"../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as a,exactEquals as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as s}from"../../../../geometry/support/ray.js";let c=class extends t{constructor(e){super(e)}clone(){return this}equals(e){return this.context?.type===e.context?.type&&(!this.context||!e.context||this.context.equals(e.context))&&this.id===e.id&&n(this.mapPoint,e.mapPoint)&&a(this.renderPoint,e.renderPoint)&&o(this.normal,e.normal)&&s(this.ray,e.ray)}};e([r({constructOnly:!0})],c.prototype,`context`,void 0),e([r({constructOnly:!0})],c.prototype,`id`,void 0),e([r({constructOnly:!0})],c.prototype,`mapPoint`,void 0),e([r({constructOnly:!0})],c.prototype,`renderPoint`,void 0),e([r({constructOnly:!0})],c.prototype,`normal`,void 0),e([r({constructOnly:!0})],c.prototype,`ray`,void 0),c=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult`)],c);class l{constructor(e){this.graphic=e,this.type=`graphic`}equals(e){return e.type===this.type&&this.graphic===e.graphic}}class u{constructor(){this.type=`ground`}equals(e){return e.type===this.type}}const d=new u;class f{constructor(){this.type=`gaussian-splat`}equals(e){return e.type===this.type}}const p=new f;export{l as LineOfSightIntersectionContextGraphic,c as LineOfSightIntersectionResult,p as lineOfSightIntersectionContextGaussianSplat,d as lineOfSightIntersectionContextGround};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as b}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as x}from"../../input/BrowserEventSource.js";import{InputManager as S,ViewEventPriorities as C}from"../../input/InputManager.js";import{PreventContextMenu as w}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as T}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as E}from"../../input/handlers/support.js";import{Drag as D}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as O}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as k}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as A}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as j}from"../../input/recognizers/VerticalTwoFingerDrag.js";const M=`modeDependentNavigation`;let N=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=E(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=E(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=E(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=E(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=E(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new x(this.view.surface,e.input);let t=[new O,new k,new A,new D(this.view.navigation),new j],n=new S({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new w],C.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new T(this.view)],C.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new b(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new b(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov),new b(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(M)&&n.uninstallHandlers(M),e.type){case`default`:n.installHandlers(M,o,C.INTERNAL);break;case`ground`:n.installHandlers(M,s,C.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],N.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],N.prototype,`mode`,void 0),e([o({readOnly:!0})],N.prototype,`updating`,null),e([o()],N.prototype,`latestPointerInfo`,null),e([o()],N.prototype,`latestPenInfo`,null),e([o()],N.prototype,`multiTouchActive`,null),e([o()],N.prototype,`_inputManager`,void 0),N=e([s(`esri.views.3d.input.SceneInputManager`)],N);const P=N;export{P as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as b}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as x}from"../../input/BrowserEventSource.js";import{InputManager as S,ViewEventPriorities as C}from"../../input/InputManager.js";import{PreventContextMenu as w}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as T}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as E}from"../../input/handlers/support.js";import{Drag as D}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as O}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as k}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as A}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as j}from"../../input/recognizers/VerticalTwoFingerDrag.js";const M=`modeDependentNavigation`;let N=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=E(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=E(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=E(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=E(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=E(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new x(this.view.surface,e.input);let t=[new O,new k,new A,new D(this.view.navigation),new j],n=new S({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new w],C.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new T(this.view)],C.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov,!0),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new b(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new b(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov,!1),new b(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(M)&&n.uninstallHandlers(M),e.type){case`default`:n.installHandlers(M,o,C.INTERNAL);break;case`ground`:n.installHandlers(M,s,C.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],N.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],N.prototype,`mode`,void 0),e([o({readOnly:!0})],N.prototype,`updating`,null),e([o()],N.prototype,`latestPointerInfo`,null),e([o()],N.prototype,`latestPenInfo`,null),e([o()],N.prototype,`multiTouchActive`,null),e([o()],N.prototype,`_inputManager`,void 0),N=e([s(`esri.views.3d.input.SceneInputManager`)],N);const P=N;export{P as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{FovController as t}from"../../state/controllers/FovController.js";import{ZoomControllerGlobal as n}from"../../state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as r}from"../../state/controllers/ZoomControllerLocal.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as a}from"../../../input/handlers/support.js";class o extends i{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._fovModifier=n,this.registerIncoming(`drag`,[n],e=>this._handleZoom(e)),this.registerIncoming(`drag`,e=>this._handleZoom(e))}_handleZoom(i){let o=i.data;if(o.pointers.size>1||!a(i.data,this.pointerActions))return;let s=e(o.center.x,o.center.y);switch(o.action){case`start`:{this._cameraController?.finish();let e=this._view,a=i.modifiers.has(this._fovModifier);this._cameraController=a?new t({view:e,onStop:()=>this._stopController()}):e.state.isGlobal?new n({view:e}):new r({view:e}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(s);break}case`update`:this._cameraController?.update(s);break;case`end`:this._cameraController instanceof t?this._cameraController.updateTimeout():this._stopController()}i.stopPropagation()}_stopController(){this._cameraController?.finish(),this._cameraController=null}}export{o as DragZoom};
2
+ import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{FovController as t}from"../../state/controllers/FovController.js";import{ZoomControllerGlobal as n}from"../../state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as r}from"../../state/controllers/ZoomControllerLocal.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as a}from"../../../input/handlers/support.js";class o extends i{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._fovModifier=n,this.registerIncoming(`drag`,[n],e=>this._handleZoom(e)),this.registerIncoming(`drag`,e=>this._handleZoom(e))}_handleZoom(i){let o=i.data;if(o.pointers.size>1||!a(i.data,this.pointerActions))return;let s=e(o.center.x,o.center.y);switch(o.action){case`start`:{this._cameraController?.finish();let e=this._view,a=i.modifiers.has(this._fovModifier);this._cameraController=a?new t({view:e,onStop:()=>this._stopController(),enableDolly:!0}):e.state.isGlobal?new n({view:e}):new r({view:e}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(s);break}case`update`:this._cameraController?.update(s);break;case`end`:this._cameraController instanceof t?this._cameraController.updateTimeout():this._stopController()}i.stopPropagation()}_stopController(){this._cameraController?.finish(),this._cameraController=null}}export{o as DragZoom};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{FovController as e}from"../../state/controllers/FovController.js";import{InputHandler as t}from"../../../input/InputHandler.js";class n extends t{constructor(e,t){super(!0),this._view=e,this.registerIncoming(`mouse-wheel`,[t],e=>this._handleFov(e))}_handleFov(t){this._mouseWheelFovChangeEnabled&&(!this._fovController?.running&&(this._fovController?.hideOverlay(),this._fovController=new e({view:this._view,onStop:()=>this._stopFovController()}),this._view.state.switchCameraController(this._fovController),this._fovController.state===1)?this._stopFovController():(this._fovController.updateTimeout(),this._fovController.step(t.data.deltaY/20),t.preventDefault(),t.stopPropagation()))}get _mouseWheelFovChangeEnabled(){return this._view.navigation.actionMap.mouseWheel===`zoom`}_stopFovController(){this._fovController?.finish(),this._fovController=null}}export{n as MouseWheelFov};
2
+ import{FovController as e}from"../../state/controllers/FovController.js";import{InputHandler as t}from"../../../input/InputHandler.js";class n extends t{constructor(e,t,n){super(!0),this._view=e,this._enableDolly=n,this.registerIncoming(`mouse-wheel`,[t],e=>this._handleFov(e))}_handleFov(t){this._mouseWheelFovChangeEnabled&&(!this._fovController?.running&&(this._fovController?.hideOverlay(),this._fovController=new e({view:this._view,onStop:()=>this._stopFovController(),enableDolly:this._enableDolly}),this._view.state.switchCameraController(this._fovController),this._fovController.state===1)?this._stopFovController():(this._fovController.updateTimeout(),this._fovController.step(t.data.deltaY/20),t.preventDefault(),t.stopPropagation()))}get _mouseWheelFovChangeEnabled(){return this._view.navigation.actionMap.mouseWheel===`zoom`}_stopFovController(){this._fovController?.finish(),this._fovController=null}}export{n as MouseWheelFov};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{copy as e,normalize as t,set as n,subtract as r,cross as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as o}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as s}from"../../../../geometry/support/Indices.js";function c(n,r){if(!n)return null;let{worldUp:i,height:a,spherical:c,requireElevation:u,requireNormals:d,requireSizes:f}=r;if(u&&!(`mapPositions`in n))return null;let{positions:p,polygonIndices:m,outline:h}=n,g=`mapPositions`in n?n.mapPositions:p;if(h.output!==`tessellated-indices`)return null;let _=0;for(let e=0;e<m.length;++e)_=Math.max(_,m[e]+1);let x=n.vertexCount,S=n.outlineSegmentCount,C=2*x+4*S,w=C*3,T=o(w),E=s(S*6+n.polygonIndexCount,C),D=s(n.polygonIndexCount,C);e(v,i);let O=a*i[0],k=a*i[1],A=a*i[2],j=u?o(w):void 0,M=d?o(w):void 0,N=f?o(w):void 0,P=m.length/3,F=a>0?1:-1,I=0,L=0,R=x;for(let e=0;e<x;++e){let e=p[I],n=p[I+1],r=p[I+2];c&&(v[0]=e,v[1]=n,v[2]=r,t(v,v),O=a*v[0],k=a*v[1],A=a*v[2]);let i=L*3;T[i]=e,T[i+1]=n,T[i+2]=r;let o=g[I],s=g[I+1],l=g[I+2];j!=null&&(j[i]=o,j[i+1]=s,j[i+2]=l),M!=null&&(M[i+0]=-F*v[0],M[i+1]=-F*v[1],M[i+2]=-F*v[2]),N!=null&&(N[L]=0);let u=R*3;T[u]=e+O,T[u+1]=n+k,T[u+2]=r+A,j!=null&&(j[u]=o,j[u+1]=s,j[u+2]=l),N!=null&&(N[R]=a),I+=3,++L,++R}let z=x*2,B=0;for(let e=0;e<h.outlineIndices.length;++e){let t=h.outlineIndices[e],n=t.length-1;n<=0||(l(T,j,N,M,t,n,x,z,E,B,a),z+=n*4,B+=n*2)}let V=B,H=0,U=0,W=V*3,G=a<0?b:y,K=a<0?y:b;for(let e=0;e<P;++e)D[U]=m[H+G[0]],D[U+1]=m[H+G[1]],D[U+2]=m[H+G[2]],E[W]=m[H+K[0]]+x,E[W+1]=m[H+K[1]]+x,E[W+2]=m[H+K[2]]+x,U+=3,W+=3,H+=3;return{vertices:T,indices:E,bottomIndices:D,polygonVertexCount:_,elevation:j,normals:M,sizes:N}}function l(e,t,n,r,i,a,o,s,c,l,p){t??=[],n??=[],r??=[];let m=s,h=s+1,g=s+2*a,_=s+2*a+1,v=l*3;for(let s=0;s<a;++s){let a=i[s],l=i[s+1],y=a+o,b=l+o,x=a,S=l,C=y,w=b;p<0&&(x=b,S=l,C=y,w=a),u(e,x,S,C,f),d(e,t,r,n,f,m,x),d(e,t,r,n,f,h,S),d(e,t,r,n,f,g,C),d(e,t,r,n,f,_,w),c[v]=m,c[v+1]=g,c[v+2]=_,c[v+3]=m,c[v+4]=_,c[v+5]=h,v+=6,m+=2,h+=2,g+=2,_+=2}}function u(e,a,o,s,c){a*=3,o*=3,s*=3,n(p,e[a++],e[a++],e[a++]),n(m,e[o++],e[o++],e[o++]),n(h,e[s++],e[s++],e[s++]),r(g,m,p),r(_,h,p),i(c,_,g),t(c,c)}function d(e,t,n,r,i,a,o){r[a]=r[o],o*=3,a*=3,e[a]=e[o],e[a+1]=e[o+1],e[a+2]=e[o+2],t[a]=t[o],t[a+1]=t[o+1],t[a+2]=t[o+2],n[a]=i[0],n[a+1]=i[1],n[a+2]=i[2]}const f=a(),p=a(),m=a(),h=a(),g=a(),_=a(),v=a(),y=[0,2,1],b=[0,1,2];export{c as extrudePolygon};
2
+ import{copy as e,normalize as t,set as n,subtract as r,cross as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as o}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as s}from"../../../../geometry/support/Indices.js";function c(n,r){if(!n)return null;let{worldUp:i,height:a,spherical:c,requireElevation:u,requireNormals:d,requireSizes:f}=r;if(u&&!(`mapPositions`in n))return null;let{positions:p,polygonIndices:m,outline:h}=n,g=`mapPositions`in n?n.mapPositions:p;if(h.output!==`tessellated-indices`)return null;let _=0;for(let e=0;e<m.length;++e)_=Math.max(_,m[e]+1);let x=n.vertexCount,S=n.outlineSegmentCount,C=2*x+4*S,w=C*3,T=o(w),E=s(S*6+n.polygonIndexCount,C),D=s(n.polygonIndexCount,C);e(v,i);let O=a*i[0],k=a*i[1],A=a*i[2],j=u?o(w):void 0,M=d?o(w):void 0,N=f?o(C):void 0,P=m.length/3,F=a>0?1:-1,I=0,L=0,R=x;for(let e=0;e<x;++e){let e=p[I],n=p[I+1],r=p[I+2];c&&(v[0]=e,v[1]=n,v[2]=r,t(v,v),O=a*v[0],k=a*v[1],A=a*v[2]);let i=L*3;T[i]=e,T[i+1]=n,T[i+2]=r;let o=g[I],s=g[I+1],l=g[I+2];j!=null&&(j[i]=o,j[i+1]=s,j[i+2]=l),M!=null&&(M[i+0]=-F*v[0],M[i+1]=-F*v[1],M[i+2]=-F*v[2]),N!=null&&(N[L]=0);let u=R*3;T[u]=e+O,T[u+1]=n+k,T[u+2]=r+A,j!=null&&(j[u]=o,j[u+1]=s,j[u+2]=l),N!=null&&(N[R]=a),I+=3,++L,++R}let z=x*2,B=0;for(let e=0;e<h.outlineIndices.length;++e){let t=h.outlineIndices[e],n=t.length-1;n<=0||(l(T,j,N,M,t,n,x,z,E,B,a),z+=n*4,B+=n*2)}let V=B,H=0,U=0,W=V*3,G=a<0?b:y,K=a<0?y:b;for(let e=0;e<P;++e)D[U]=m[H+G[0]],D[U+1]=m[H+G[1]],D[U+2]=m[H+G[2]],E[W]=m[H+K[0]]+x,E[W+1]=m[H+K[1]]+x,E[W+2]=m[H+K[2]]+x,U+=3,W+=3,H+=3;return{vertices:T,indices:E,bottomIndices:D,polygonVertexCount:_,elevation:j,normals:M,sizes:N}}function l(e,t,n,r,i,a,o,s,c,l,p){t??=[],n??=[],r??=[];let m=s,h=s+1,g=s+2*a,_=s+2*a+1,v=l*3;for(let s=0;s<a;++s){let a=i[s],l=i[s+1],y=a+o,b=l+o,x=a,S=l,C=y,w=b;p<0&&(x=b,S=l,C=y,w=a),u(e,x,S,C,f),d(e,t,r,n,f,m,x),d(e,t,r,n,f,h,S),d(e,t,r,n,f,g,C),d(e,t,r,n,f,_,w),c[v]=m,c[v+1]=g,c[v+2]=_,c[v+3]=m,c[v+4]=_,c[v+5]=h,v+=6,m+=2,h+=2,g+=2,_+=2}}function u(e,a,o,s,c){a*=3,o*=3,s*=3,n(p,e[a++],e[a++],e[a++]),n(m,e[o++],e[o++],e[o++]),n(h,e[s++],e[s++],e[s++]),r(g,m,p),r(_,h,p),i(c,_,g),t(c,c)}function d(e,t,n,r,i,a,o){r[a]=r[o],o*=3,a*=3,e[a]=e[o],e[a+1]=e[o+1],e[a+2]=e[o+2],t[a]=t[o],t[a+1]=t[o+1],t[a+2]=t[o+2],n[a]=i[0],n[a+1]=i[1],n[a+2]=i[2]}const f=a(),p=a(),m=a(),h=a(),g=a(),_=a(),v=a(),y=[0,2,1],b=[0,1,2];export{c as extrudePolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/has.js";import"../../../../core/Logger.js";import{trackAccess as e}from"../../../../core/accessorSupport/tracking.js";import{SimpleObservable as t}from"../../../../core/accessorSupport/tracking/SimpleObservable.js";import{e as n}from"../../../../chunks/earcut.js";import{loadLibtessF64 as r,isLibtessF64Loaded as i,triangulateIndexedF64 as a}from"../../../../geometry/libtess.js";import{isClockwise as o}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as s,doubleSubArray as c,concatDoubleArrays as l}from"../../../../geometry/support/DoubleArray.js";import{compactMeshIndices as u,newIndexArray as d,concatIndexArrays as f}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as p}from"../../../../geometry/support/polygonUtils.js";const m={method:`auto`,projectionAxis:void 0,outlines:void 0,owner:void 0};function h(e,t){let{hasZ:n,ccwRingsAsHoles:r,spatialReference:i}=t,a=t.axis??g(e,n,i),o=e.length,l=[],u=[],d=[],f=[],p=e.reduce((e,t)=>e+t.length,0),m=0,h=s(p*3),v=0,y=r&&e[0]&&_(e[0],n,a);for(let t=o-1;t>=0;t--){let i=e[t],o=N(i,n);if(o<3){o>1&&f.push(i);continue}let s=r?_(i,n,a):!1;if(y?!s:s)l[m++]=i;else{let e=i.length;for(let t=0;t<m;++t)e+=l[t].length;let t={index:v,pathLengths:Array(m+1),count:e,holeIndices:Array(m)};t.pathLengths[0]=i.length,i.length>0&&d.push({index:v,count:i.length}),v=j(i,h,v,i.length,n,y);for(let e=0;e<m;++e){let r=l[e];t.holeIndices[e]=v,t.pathLengths[e+1]=r.length,r.length>0&&d.push({index:v,count:r.length}),v=j(r,h,v,r.length,n,y)}m=0,t.count>0&&u.push(t)}}let b=v;for(let e of f)d.push({index:v,count:e.length}),v=j(e,h,v,e.length,n,y);return{positions:v*3===h.length?h:c(h,0,v*3),polygonVertexCount:b,polygons:u,outlines:d}}function g(e,t,n){if(!t)return 2;let r=null;for(let i of e){let e=N(i,t),a=e<3?2:p(i,e,n);if(r??=a,a!==r)return 2}return r??2}function _(e,t,n){if(!t)return!o(e);if(e.length<3)return!1;switch(n){case 0:return!o(e,1,2);case 1:return!o(e,0,2);case 2:return!o(e,0,1)}}const v=new t;function y(t,n){let r=x(t,n);return r.succeeded||r.message!==`libtess-not-loaded`?r:(e(v),b())}async function b(){try{await r(),v.notify()}catch(e){throw e}}function x(e,t){let n={method:t?.method??m.method,projectionAxis:t?.projectionAxis??m.projectionAxis,outlines:t?.outlines??m.outlines,owner:t?.owner??m.owner},{projectionAxis:r}=n,i=r!=null&&r!==2;i&&D(e.positions,r,2);let a=S(e,n);if(i){let t=a.succeeded?a.positions:null;t!=null&&t!==e.positions&&D(t,2,r),D(e.positions,2,r)}return a}function S(e,t){if(t.method===`libtess`)return T(e,t);let r=w(e,t),i=[],a=0;for(let o of e.polygons){let s=A(e.positions,o),c=(o.holeIndices??[]).map(e=>e-o.index),l=c.length>0?c:null,u=n(s,l,3),d=n.deviation(s,c,3,u);if(r&&d>1e-5)return T(e,t);for(let e=0;e<u.length;e++)i.push(u[e]+o.index);a=Math.max(a,d)}let{outlineIndexBuffer:o,outlineRingLengths:s}=t.outlines==null?{outlineIndexBuffer:void 0,outlineRingLengths:void 0}:O(t.outlines,e.positions);return{succeeded:!0,positions:e.positions,indices:u(i),outlineIndexBuffer:o,outlineRingLengths:s,vertexCount:e.positions.length/3,method:`earcut`,deviation:a}}let C=new WeakSet;function w(e,t){let n=t.owner!=null&&C.has(t.owner);return t.method===`auto`&&!(n&&e.polygonVertexCount>=1e4)}function T(e,t){if(!i())return P(`libtess-not-loaded`);let n=t.outlines!=null,{positions:r,mergedPathLengths:o}=F(e),s=performance.now(),{vertices:c,indices:l,outlineIndices:u,outlineRingLengths:d}=a(r,o,3,n),f=performance.now()-s;if(t.owner!=null&&f>250&&C.add(t.owner),c.length%3!=0)return P(`positions-not-multiple-of-3`);let{positions:p,outlineIndexBuffer:m,mergedOutlineRingLengths:h}=n?E(e,t.outlines,c,u,d):{positions:c,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:p,indices:l,outlineIndexBuffer:m,outlineRingLengths:h,vertexCount:p.length/3,method:`libtess`}}function E(e,t,n,r,i){let a=e.polygonVertexCount,o=n.length/3,s=(t??[]).values().filter(e=>e.index>=a).map(e=>({index:o+e.index-a,count:e.count})).toArray();if(s.length===0)return{positions:n,outlineIndexBuffer:r,mergedOutlineRingLengths:i};let u=a*3,d=c(e.positions,u,e.positions.length-u),p=l(n,d),{outlineIndexBuffer:m,outlineRingLengths:h}=O(s,p);return{positions:p,outlineIndexBuffer:f(r,m,p.length/3),mergedOutlineRingLengths:f(i,h,i.length+h.length)}}function D(e,t,n){for(let r=0;r<e.length;r+=3){let i=e[r+t];e[r+t]=e[r+n],e[r+n]=i}}function O(e,t){let n=d(e.length),r=0;for(let i=0;i<e.length;i++){let a=e[i],o=a.count;if(o<=0){n[i]=0;continue}let s=a.index*3,c=(a.index+o-1)*3,l=o>1&&t[s]===t[c]&&t[s+1]===t[c+1]&&t[s+2]===t[c+2]?o-1:o,u=l>0?l+1:0;n[i]=u,r+=u}let i=d(r,t.length/3),a=0;for(let t=0;t<e.length;t++){let r=n[t];if(r===0)continue;let o=e[t].index,s=r-1;for(let e=0;e<s;e++)i[a++]=o+e;i[a++]=o}return{outlineIndexBuffer:i,outlineRingLengths:n}}function k(e){let t=e.reduce((e,t)=>e+t.pathLengths.length,0),n=Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t].pathLengths;for(let e=0;e<i.length;e++)n[r++]=i[e]}return n}function A(e,{index:t,count:n}){let r=t*3,i=n*3;return c(e,r,i)}function j(e,t,n,r,i,a){let o=a?e.length-1:0,s=a?-1:1;n*=3;for(let a=0;a<r;++a){let r=e[o];t[n++]=r[0],t[n++]=r[1],t[n++]=i&&r[2]!=null?r[2]:0,o+=s}return n/3}function M(e,t){let n=e.length;if(n<2)return!1;let r=e[0],i=e[n-1];return r[0]===i[0]&&r[1]===i[1]&&(!t||r[2]===i[2])}function N(e,t){return M(e,t)?e.length-1:e.length}function P(e){return{succeeded:!1,message:e}}function F(e){let t=k(e.polygons),n=e.polygonVertexCount*3;return n===e.positions.length?{positions:e.positions,mergedPathLengths:t}:{positions:c(e.positions,0,n),mergedPathLengths:t}}const I=void 0;export{g as axisFromRings,_ as isCounterClockwise,b as load,h as ringsToOutlinedTessellationInfo,x as tessellate,y as tessellateOrLoad,I as tessellationTestHooks};
2
+ import"../../../../core/has.js";import"../../../../core/Logger.js";import{trackAccess as e}from"../../../../core/accessorSupport/tracking.js";import{SimpleObservable as t}from"../../../../core/accessorSupport/tracking/SimpleObservable.js";import{e as n}from"../../../../chunks/earcut.js";import{loadLibtessF64 as r,isLibtessF64Loaded as i,triangulateIndexedF64 as a}from"../../../../geometry/libtess.js";import{isClockwise as o}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as s,doubleSubArray as c,concatDoubleArrays as l}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as u,compactMeshIndices as d,concatIndexArrays as f}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as p}from"../../../../geometry/support/polygonUtils.js";const m={method:`auto`,projectionAxis:void 0,outlines:void 0,owner:void 0};function h(e,t){let{hasZ:n,ccwRingsAsHoles:r,spatialReference:i}=t,a=t.axis??g(e,n,i),o=e.length,l=[],u=[],d=[],f=[],p=e.reduce((e,t)=>e+t.length,0),m=0,h=s(p*3),v=0,y=r&&e[0]&&_(e[0],n,a);for(let t=o-1;t>=0;t--){let i=e[t],o=N(i,n);if(o<3){o>1&&f.push(i);continue}let s=r?_(i,n,a):!1;if(y?!s:s)l[m++]=i;else{let e=i.length;for(let t=0;t<m;++t)e+=l[t].length;let t={index:v,pathLengths:Array(m+1),count:e,holeIndices:Array(m)};t.pathLengths[0]=i.length,i.length>0&&d.push({index:v,count:i.length}),v=j(i,h,v,i.length,n,y);for(let e=0;e<m;++e){let r=l[e];t.holeIndices[e]=v,t.pathLengths[e+1]=r.length,r.length>0&&d.push({index:v,count:r.length}),v=j(r,h,v,r.length,n,y)}m=0,t.count>0&&u.push(t)}}let b=v;for(let e of f)d.push({index:v,count:e.length}),v=j(e,h,v,e.length,n,y);return{positions:v*3===h.length?h:c(h,0,v*3),polygonVertexCount:b,polygons:u,outlines:d}}function g(e,t,n){if(!t)return 2;let r=null;for(let i of e){let e=N(i,t),a=e<3?2:p(i,e,n);if(r??=a,a!==r)return 2}return r??2}function _(e,t,n){if(!t)return!o(e);if(e.length<3)return!1;switch(n){case 0:return!o(e,1,2);case 1:return!o(e,0,2);case 2:return!o(e,0,1)}}const v=new t;function y(t,n){let r=x(t,n);return r.succeeded||r.message!==`libtess-not-loaded`?r:(e(v),b())}async function b(){try{await r(),v.notify()}catch(e){throw e}}function x(e,t){let n={method:t?.method??m.method,projectionAxis:t?.projectionAxis??m.projectionAxis,outlines:t?.outlines??m.outlines,owner:t?.owner??m.owner},{projectionAxis:r}=n,i=r!=null&&r!==2;i&&D(e.positions,r,2);let a=S(e,n);if(i){let t=a.succeeded?a.positions:null;t!=null&&t!==e.positions&&D(t,2,r),D(e.positions,2,r)}return a}function S(e,t){if(t.method===`libtess`)return T(e,t);let r=w(e,t),i=[],a=0,o=0;for(let s of e.polygons){let c=A(e.positions,s),l=(s.holeIndices??[]).map(e=>e-s.index),u=l.length>0?l:null,d=n(c,u,3),f=n.deviation(c,l,3,d);if(r&&f>1e-5)return T(e,t);i.push({indices:d,index:s.index}),a+=d.length,o=Math.max(o,f)}let s=u(a,e.positions.length/3),c=0;for(let e of i)for(let t=0;t<e.indices.length;t++)s[c++]=e.indices[t]+e.index;let{outlineIndexBuffer:l,outlineRingLengths:f}=t.outlines==null?{outlineIndexBuffer:void 0,outlineRingLengths:void 0}:O(t.outlines,e.positions);return{succeeded:!0,positions:e.positions,indices:d(s),outlineIndexBuffer:l,outlineRingLengths:f,vertexCount:e.positions.length/3,method:`earcut`,deviation:o}}let C=new WeakSet;function w(e,t){let n=t.owner!=null&&C.has(t.owner);return t.method===`auto`&&!(n&&e.polygonVertexCount>=1e4)}function T(e,t){if(!i())return P(`libtess-not-loaded`);let n=t.outlines!=null,{positions:r,mergedPathLengths:o}=F(e),s=performance.now(),{vertices:c,indices:l,outlineIndices:u,outlineRingLengths:d}=a(r,o,3,n),f=performance.now()-s;if(t.owner!=null&&f>250&&C.add(t.owner),c.length%3!=0)return P(`positions-not-multiple-of-3`);let{positions:p,outlineIndexBuffer:m,mergedOutlineRingLengths:h}=n?E(e,t.outlines,c,u,d):{positions:c,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:p,indices:l,outlineIndexBuffer:m,outlineRingLengths:h,vertexCount:p.length/3,method:`libtess`}}function E(e,t,n,r,i){let a=e.polygonVertexCount,o=n.length/3,s=(t??[]).values().filter(e=>e.index>=a).map(e=>({index:o+e.index-a,count:e.count})).toArray();if(s.length===0)return{positions:n,outlineIndexBuffer:r,mergedOutlineRingLengths:i};let u=a*3,d=c(e.positions,u,e.positions.length-u),p=l(n,d),{outlineIndexBuffer:m,outlineRingLengths:h}=O(s,p);return{positions:p,outlineIndexBuffer:f(r,m,p.length/3),mergedOutlineRingLengths:f(i,h,i.length+h.length)}}function D(e,t,n){for(let r=0;r<e.length;r+=3){let i=e[r+t];e[r+t]=e[r+n],e[r+n]=i}}function O(e,t){let n=u(e.length),r=0;for(let i=0;i<e.length;i++){let a=e[i],o=a.count;if(o<=0){n[i]=0;continue}let s=a.index*3,c=(a.index+o-1)*3,l=o>1&&t[s]===t[c]&&t[s+1]===t[c+1]&&t[s+2]===t[c+2]?o-1:o,u=l>0?l+1:0;n[i]=u,r+=u}let i=u(r,t.length/3),a=0;for(let t=0;t<e.length;t++){let r=n[t];if(r===0)continue;let o=e[t].index,s=r-1;for(let e=0;e<s;e++)i[a++]=o+e;i[a++]=o}return{outlineIndexBuffer:i,outlineRingLengths:n}}function k(e){let t=e.reduce((e,t)=>e+t.pathLengths.length,0),n=Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t].pathLengths;for(let e=0;e<i.length;e++)n[r++]=i[e]}return n}function A(e,{index:t,count:n}){let r=t*3,i=n*3;return c(e,r,i)}function j(e,t,n,r,i,a){let o=a?e.length-1:0,s=a?-1:1;n*=3;for(let a=0;a<r;++a){let r=e[o];t[n++]=r[0],t[n++]=r[1],t[n++]=i&&r[2]!=null?r[2]:0,o+=s}return n/3}function M(e,t){let n=e.length;if(n<2)return!1;let r=e[0],i=e[n-1];return r[0]===i[0]&&r[1]===i[1]&&(!t||r[2]===i[2])}function N(e,t){return M(e,t)?e.length-1:e.length}function P(e){return{succeeded:!1,message:e}}function F(e){let t=k(e.polygons),n=e.polygonVertexCount*3;return n===e.positions.length?{positions:e.positions,mergedPathLengths:t}:{positions:c(e.positions,0,n),mergedPathLengths:t}}const I=void 0;export{g as axisFromRings,_ as isCounterClockwise,b as load,h as ringsToOutlinedTessellationInfo,x as tessellate,y as tessellateOrLoad,I as tessellationTestHooks};