@arcgis/core 5.0.0-next.56 → 5.0.0-next.58

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 (86) hide show
  1. package/applications/Components/arcadeFeatureUtils.d.ts +20 -1
  2. package/applications/Components/arcadeFeatureUtils.js +1 -1
  3. package/arcade.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/18ce7b1559a45d017c45.js +1 -0
  6. package/assets/esri/core/workers/chunks/3405a23973f9e701a4d6.js +1 -0
  7. package/assets/esri/core/workers/chunks/352c674730c7b7258ae3.js +1 -0
  8. package/assets/esri/core/workers/chunks/62752cd6821959cf6751.js +1 -0
  9. package/assets/esri/core/workers/chunks/72e3a48aa365542b0689.js +1 -0
  10. package/assets/esri/core/workers/chunks/a6b1e3ec30f6d641aea9.js +1 -0
  11. package/assets/esri/core/workers/chunks/{da2c41ac0f82f32013c1.js → a7aa87e2c4197ba595ef.js} +10 -10
  12. package/assets/esri/core/workers/chunks/{d76513a6260d9ec4ea25.js → bf82bb1cdd8b31e7f2aa.js} +1 -1
  13. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  14. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  15. package/assets/esri/themes/base/widgets/_FeatureTable.scss +24 -0
  16. package/assets/esri/themes/dark/main.css +1 -1
  17. package/assets/esri/themes/light/main.css +1 -1
  18. package/assets/esri/themes/light/view.css +1 -1
  19. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  20. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  21. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fr.json +1 -1
  22. package/config.js +1 -1
  23. package/core/workers/workerFactory.js +1 -1
  24. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  25. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  26. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  27. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  28. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  29. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  30. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  31. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  32. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  33. package/geometry/projection/projectBoundingSphere.js +1 -1
  34. package/geometry/support/curves/curveUtils.js +1 -1
  35. package/geometry/support/sphere.js +1 -1
  36. package/kernel.js +1 -1
  37. package/layers/KnowledgeGraphLayer.js +1 -1
  38. package/layers/LinkChartLayer.js +1 -1
  39. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  40. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  41. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  42. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  43. package/layers/knowledgeGraph/layerUtils.js +1 -1
  44. package/package.json +2 -2
  45. package/support/revision.js +1 -1
  46. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  47. package/views/2d/engine/webgl/Painter.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  52. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  53. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  54. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  55. package/views/3d/layers/I3SMeshView3D.js +1 -1
  56. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  57. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  58. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  59. package/views/3d/layers/i3s/I3SNode.js +1 -1
  60. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  61. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  62. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  63. package/views/3d/support/ElevationRange.js +1 -1
  64. package/views/3d/terrain/TerrainSurface.js +1 -1
  65. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  66. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  67. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  68. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  69. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +44 -3
  70. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  71. package/widgets/FeatureTable/FieldColumn.js +1 -1
  72. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  73. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  74. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  75. package/widgets/FeatureTable/VisibleElements.d.ts +2 -2
  76. package/widgets/FeatureTable/VisibleElements.js +1 -1
  77. package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -0
  78. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  79. package/widgets/FeatureTable.d.ts +46 -5
  80. package/widgets/FeatureTable.js +1 -1
  81. package/assets/esri/core/workers/chunks/30184e39129d9c66ea54.js +0 -1
  82. package/assets/esri/core/workers/chunks/5340887a4a48bde3407a.js +0 -1
  83. package/assets/esri/core/workers/chunks/537de53ef1e9101468f5.js +0 -1
  84. package/assets/esri/core/workers/chunks/94f02082a006003ef5a9.js +0 -1
  85. package/assets/esri/core/workers/chunks/d3db7244fac7398cc700.js +0 -1
  86. package/assets/esri/core/workers/chunks/d94a2ad5a91de7086fbe.js +0 -1
@@ -1 +1 @@
1
- {"widgetLabel":"Feature table","header":"{title} (Total: {count} | Selection: {selected})","headerNoSelection":"{title} (Total: {count})","untitled":"Untitled","relatedRecords":"Related records","attachments":"Attachments","loading":"Loading...","syncing":"Syncing...","errorData":"Data error.","errorLayer":"Layer error.","errorUpdateFailed":"Update failed.","errorDomainType":"Domain type is not supported.","show":"Show","hide":"Hide","menu":"Menu","options":"Options","allColums":"All columns","sortAsc":"Sort ascending","sortDesc":"Sort descending","toggleColumns":"Show/hide columns","clearSelection":"Clear selection","centerOnSelection":"Center on selection","showSelected":"Show selection","filter":"Filter","addField":"Add field","refreshData":"Refresh data","date":"Date","number":"Number","string":"String","showAllRecords":"Show all","zoomToSelection":"Zoom to selection","deleteSelection":"Delete selection","deleteSelectionCount":"Delete selection: {count}","deleteRecordsRemoved":"These records will be permanently removed","keepRecords":"Keep records","recordsCount":"Records ({count})","noLayer":"No layer","exitRelatedRecords":"Exit related records","showAllTables":"Show all tables","selectALayer":"Select a layer","exportSelectionCSV":"Export selection to CSV","noValue":"No value","editingPreventedColumn":"Editing is prevented for cells in this column.","subtypes":{"changeWarning":"The subtype {newType} may have different default values from {originalType}. Keeping the current values may cause unexpected results.","changeWarningTitle":"Subtype changed","useDefaultValuesOption":"Use default values","keepCurrentValuesOption":"Keep current values","unsupportedDomainGroupTitle":"Unsupported","fieldOutOfSubtypeDomainWarning":"This field's value is out of range for its domain."},"addAttachment":"Add attachment","attachmentsCount":"Attachments ({count})","attachmentThumbnail":"Attachment thumbnail","deleteAttachment":"Delete attachment","deleteAttachmentConfirmation":"Are you sure you want to delete the attachments?","deleteAttachmentCount":"Delete attachments ({count})","downloadAttachment":"Download attachment","dragAndDropToUpload":"Drag and drop file to upload an attachment.","editingDisabled":"Editing is disabled","editingRestricted":"Editing is restricted","errorFileName":"Upload failed. File name is too long.","errorFileSize":"Upload failed. File size too large","errorFileUnsupported":"Upload failed. File type not supported","errorOccured":"An error occurred","exitAttachments":"Exit attachments view","fileName":"File name","noAttachments":"There are no attachments","noFeature":"No feature provided","replaceFile":"Replace file","selectedCount":"Selected: {count}","selectFile":"Select file","size":"Size","updateAttachment":"Update attachment","viewAttachment":"View attachment","viewAttachments":"View attachments","noDataFound":"No data found","menuText":{"default":"Default","deselectAll":"Deselect all","displayName":"Display name","fieldName":"Field name","fieldVisibility":"Field visibility","filterFields":"Filter fields","orderBy":"Order by","selectAll":"Select all","type":"Type"}}
1
+ {"widgetLabel":"Feature table","header":"{title} (Total: {count} | Selection: {selected})","headerNoSelection":"{title} (Total: {count})","untitled":"Untitled","relatedRecords":"Related records","attachments":"Attachments","loading":"Loading...","syncing":"Syncing...","errorData":"Data error.","errorLayer":"Layer error.","errorUpdateFailed":"Update failed.","errorDomainType":"Domain type is not supported.","show":"Show","hide":"Hide","menu":"Menu","options":"Options","allColums":"All columns","sortAsc":"Sort ascending","sortDesc":"Sort descending","toggleColumns":"Show/hide columns","clearSelection":"Clear selection","centerOnSelection":"Center on selection","showSelected":"Show selection","filter":"Filter","addField":"Add field","refreshData":"Refresh data","date":"Date","number":"Number","string":"String","showAllRecords":"Show all","zoomToSelection":"Zoom to selection","deleteSelection":"Delete selection","deleteSelectionCount":"Delete selection: {count}","deleteRecordsRemoved":"These records will be permanently removed","keepRecords":"Keep records","recordsCount":"Records ({count})","noLayer":"No layer","exitRelatedRecords":"Exit related records","showAllTables":"Show all tables","selectALayer":"Select a layer","exportSelectionCSV":"Export selection to CSV","noValue":"No value","editingPreventedColumn":"Editing is prevented for cells in this column.","subtypes":{"changeWarning":"The subtype {newType} may have different default values from {originalType}. Keeping the current values may cause unexpected results.","changeWarningTitle":"Subtype changed","useDefaultValuesOption":"Use default values","keepCurrentValuesOption":"Keep current values","unsupportedDomainGroupTitle":"Unsupported","fieldOutOfSubtypeDomainWarning":"This field's value is out of range for its domain."},"addAttachment":"Add attachment","attachmentsCount":"Attachments ({count})","attachmentThumbnail":"Attachment thumbnail","deleteAttachment":"Delete attachment","deleteAttachmentConfirmation":"Are you sure you want to delete the attachments?","deleteAttachmentCount":"Delete attachments ({count})","downloadAttachment":"Download attachment","dragAndDropToUpload":"Drag and drop file to upload an attachment.","editingDisabled":"Editing is disabled","editingRestricted":"Editing is restricted","errorFileName":"Upload failed. File name is too long.","errorFileSize":"Upload failed. File size too large","errorFileUnsupported":"Upload failed. File type not supported","errorOccured":"An error occurred","exitAttachments":"Exit attachments view","fileName":"File name","noAttachments":"There are no attachments","noFeature":"No feature provided","replaceFile":"Replace file","scrollToFeature":"Scroll to feature","selectedCount":"Selected: {count}","selectFile":"Select file","size":"Size","updateAttachment":"Update attachment","viewAttachment":"View attachment","viewAttachments":"View attachments","noDataFound":"No data found","menuText":{"default":"Default","deselectAll":"Deselect all","displayName":"Display name","fieldName":"Field name","fieldVisibility":"Field visibility","filterFields":"Filter fields","orderBy":"Order by","selectAll":"Select all","type":"Type"},"contingentValues":{"hasInvalidValues":"Select a valid combination of values to enable saving","hasValidValues":"The value combination is valid. Saving is enabled.","other":"Other","recommended":"Recommended"}}
@@ -1 +1 @@
1
- {"widgetLabel":"Feature table","header":"{title} (Total: {count} | Selection: {selected})","headerNoSelection":"{title} (Total: {count})","untitled":"Untitled","relatedRecords":"Related records","attachments":"Attachments","loading":"Loading...","syncing":"Syncing...","errorData":"Data error.","errorLayer":"Layer error.","errorUpdateFailed":"Update failed.","errorDomainType":"Domain type is not supported.","show":"Show","hide":"Hide","menu":"Menu","options":"Options","allColums":"All columns","sortAsc":"Sort ascending","sortDesc":"Sort descending","toggleColumns":"Show/hide columns","clearSelection":"Clear selection","centerOnSelection":"Center on selection","showSelected":"Show selection","filter":"Filter","addField":"Add field","refreshData":"Refresh data","date":"Date","number":"Number","string":"String","showAllRecords":"Show all","zoomToSelection":"Zoom to selection","deleteSelection":"Delete selection","deleteSelectionCount":"Delete selection: {count}","deleteRecordsRemoved":"These records will be permanently removed","keepRecords":"Keep records","recordsCount":"Records ({count})","noLayer":"No layer","exitRelatedRecords":"Exit related records","showAllTables":"Show all tables","selectALayer":"Select a layer","exportSelectionCSV":"Export selection to CSV","noValue":"No value","editingPreventedColumn":"Editing is prevented for cells in this column.","subtypes":{"changeWarning":"The subtype {newType} may have different default values from {originalType}. Keeping the current values may cause unexpected results.","changeWarningTitle":"Subtype changed","useDefaultValuesOption":"Use default values","keepCurrentValuesOption":"Keep current values","unsupportedDomainGroupTitle":"Unsupported","fieldOutOfSubtypeDomainWarning":"This field's value is out of range for its domain."},"addAttachment":"Add attachment","attachmentsCount":"Attachments ({count})","attachmentThumbnail":"Attachment thumbnail","deleteAttachment":"Delete attachment","deleteAttachmentConfirmation":"Are you sure you want to delete the attachments?","deleteAttachmentCount":"Delete attachments ({count})","downloadAttachment":"Download attachment","dragAndDropToUpload":"Drag and drop file to upload an attachment.","editingDisabled":"Editing is disabled","editingRestricted":"Editing is restricted","errorFileName":"Upload failed. File name is too long.","errorFileSize":"Upload failed. File size too large","errorFileUnsupported":"Upload failed. File type not supported","errorOccured":"An error occurred","exitAttachments":"Exit attachments view","fileName":"File name","noAttachments":"There are no attachments","noFeature":"No feature provided","replaceFile":"Replace file","selectedCount":"Selected: {count}","selectFile":"Select file","size":"Size","updateAttachment":"Update attachment","viewAttachment":"View attachment","viewAttachments":"View attachments","noDataFound":"No data found","menuText":{"default":"Default","deselectAll":"Deselect all","displayName":"Display name","fieldName":"Field name","fieldVisibility":"Field visibility","filterFields":"Filter fields","orderBy":"Order by","selectAll":"Select all","type":"Type"}}
1
+ {"widgetLabel":"Feature table","header":"{title} (Total: {count} | Selection: {selected})","headerNoSelection":"{title} (Total: {count})","untitled":"Untitled","relatedRecords":"Related records","attachments":"Attachments","loading":"Loading...","syncing":"Syncing...","errorData":"Data error.","errorLayer":"Layer error.","errorUpdateFailed":"Update failed.","errorDomainType":"Domain type is not supported.","show":"Show","hide":"Hide","menu":"Menu","options":"Options","allColums":"All columns","sortAsc":"Sort ascending","sortDesc":"Sort descending","toggleColumns":"Show/hide columns","clearSelection":"Clear selection","centerOnSelection":"Center on selection","showSelected":"Show selection","filter":"Filter","addField":"Add field","refreshData":"Refresh data","date":"Date","number":"Number","string":"String","showAllRecords":"Show all","zoomToSelection":"Zoom to selection","deleteSelection":"Delete selection","deleteSelectionCount":"Delete selection: {count}","deleteRecordsRemoved":"These records will be permanently removed","keepRecords":"Keep records","recordsCount":"Records ({count})","noLayer":"No layer","exitRelatedRecords":"Exit related records","showAllTables":"Show all tables","selectALayer":"Select a layer","exportSelectionCSV":"Export selection to CSV","noValue":"No value","editingPreventedColumn":"Editing is prevented for cells in this column.","subtypes":{"changeWarning":"The subtype {newType} may have different default values from {originalType}. Keeping the current values may cause unexpected results.","changeWarningTitle":"Subtype changed","useDefaultValuesOption":"Use default values","keepCurrentValuesOption":"Keep current values","unsupportedDomainGroupTitle":"Unsupported","fieldOutOfSubtypeDomainWarning":"This field's value is out of range for its domain."},"addAttachment":"Add attachment","attachmentsCount":"Attachments ({count})","attachmentThumbnail":"Attachment thumbnail","deleteAttachment":"Delete attachment","deleteAttachmentConfirmation":"Are you sure you want to delete the attachments?","deleteAttachmentCount":"Delete attachments ({count})","downloadAttachment":"Download attachment","dragAndDropToUpload":"Drag and drop file to upload an attachment.","editingDisabled":"Editing is disabled","editingRestricted":"Editing is restricted","errorFileName":"Upload failed. File name is too long.","errorFileSize":"Upload failed. File size too large","errorFileUnsupported":"Upload failed. File type not supported","errorOccured":"An error occurred","exitAttachments":"Exit attachments view","fileName":"File name","noAttachments":"There are no attachments","noFeature":"No feature provided","replaceFile":"Replace file","scrollToFeature":"Scroll to feature","selectedCount":"Selected: {count}","selectFile":"Select file","size":"Size","updateAttachment":"Update attachment","viewAttachment":"View attachment","viewAttachments":"View attachments","noDataFound":"No data found","menuText":{"default":"Default","deselectAll":"Deselect all","displayName":"Display name","fieldName":"Field name","fieldVisibility":"Field visibility","filterFields":"Filter fields","orderBy":"Order by","selectAll":"Select all","type":"Type"},"contingentValues":{"hasInvalidValues":"Select a valid combination of values to enable saving","hasValidValues":"The value combination is valid. Saving is enabled.","other":"Other","recommended":"Recommended"}}
@@ -1 +1 @@
1
- {"beginning":"Début","color":"Couleur","end":"Fin","errorLoadingLayer":"Erreur lors du chargement de la couche","follow":"Suivre","forward":"Avancer","frame":"Image","frameCenter":"Centre de l’image","frameInfo":"Informations sur l’image","frameOutline":"Contour de l’image","graphics":"Graphiques","layers":"Couches","metadata":"Métadonnées","metadataDescription":"Appuyer sur le bouton Lecture ou ajuster la poignée du curseur pour charger les métadonnées","metadataNotLoaded":"Les métadonnées ne sont pas encore disponibles","missionInfo":"Informations sur la mission","none":"Aucun","pause":"Pause","platformInfo":"Informations sur la plateforme","play":"Lecture","playbackSpeed":"Vitesse de lecture","quality":"Qualité","reverse":"Inverser","sensor":"Capteur","sensorTrail":"Piste du capteur","settings":"Paramètres","sightLine":"Ligne de visée","speed":"Vitesse","video":"Vidéo"}
1
+ {"beginning":"Début","color":"Couleur","end":"Fin","errorLoadingLayer":"Erreur lors du chargement de la couche","follow":"Suivre","forward":"Avancer","frame":"Image","frameCenter":"Centre de l’image","frameInfo":"Informations sur l’image","frameOutline":"Contour de l’image","graphics":"Graphisme","layers":"Couches","metadata":"Métadonnées","metadataDescription":"Appuyer sur le bouton Lecture ou ajuster la poignée du curseur pour charger les métadonnées","metadataNotLoaded":"Les métadonnées ne sont pas encore disponibles","missionInfo":"Informations sur la mission","none":"Aucun","pause":"Pause","platformInfo":"Informations sur la plateforme","play":"Lecture","playbackSpeed":"Vitesse de lecture","quality":"Qualité","reverse":"Inverser","sensor":"Capteur","sensorTrail":"Piste du capteur","settings":"Paramètres","sightLine":"Ligne de visée","speed":"Vitesse","video":"Vidéo"}
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={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}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.56";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={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}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.58";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../../assets.js";import r from"../../config.js";import{getLocale as t}from"../../intl.js";import{fullVersion as o}from"../../kernel.js";import has from"../has.js";import s from"../Logger.js";import{makeAbsolute as a}from"../urlUtils.js";import{loaderConfig as n}from"./loaderConfig.js";import{receiveMessage as i,MessageType as l}from"./utils.js";import f from"./WorkerFallback.js";import{commitHash as u,buildDate as c}from"../../support/revision.js";const d=()=>s.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:m}=l,p='let globalId=0;const outgoing=new Map,configuration={CONFIGURATION};self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;let s=null;return new Promise((r,i)=>{if(t){if(t.aborted)return i(createAbortError());s=()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))},t.addEventListener("abort",s)}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}).finally(()=>{t&&t.removeEventListener("abort",s)})}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://esriurl.com/using-local-assets.\nModules version: ${r}\nAssets version: ${n??s}\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(e=>e||new Promise(e=>{require([o.modulePath],e)})).then(t)}):"System"in self&&"function"==typeof System.import?System.import(workerPath).then(e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath))).then(e=>e||System.import(o.modulePath)).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(e=>e||import(o.modulePath)).then(t)}):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let g,y;const h="Failed to create Worker. Fallback to execute module in main thread";async function k(){if(!has("esri-workers"))return w(new f);if(!g&&!y)try{const e=p.split("{CONFIGURATION}").join(b());g=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(r){y=r||{}}let e;if(g)try{e=new Worker(g,{name:"esri-worker-"+v++})}catch(r){d().warn(h,y),e=new f}else d().warn(h,y),e=new f;return w(e)}async function w(e){return new Promise(r=>{function t(s){const a=i(s);a&&a.type===m&&(e.removeEventListener("message",t),e.removeEventListener("error",o),r(e))}function o(r){r.preventDefault(),e.removeEventListener("message",t),e.removeEventListener("error",o),d().warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new f).addEventListener("message",t),e.addEventListener("error",o)}e.addEventListener("message",t),e.addEventListener("error",o)})}function b(){let s;if(null!=r.default){const e={...r};delete e.default,s=JSON.parse(JSON.stringify(e))}else s=JSON.parse(JSON.stringify(r));s.assetsPath=a(s.assetsPath),s.defaultAssetsPath=s.defaultAssetsPath?a(s.defaultAssetsPath):void 0,s.request.interceptors=[],s.log.interceptors=[],s.locale=t(),s.has={"esri-csp-restrictions":has("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":has("esri-2d-update-debug"),"esri-2d-log-updating":has("esri-2d-log-updating"),"featurelayer-pbf":has("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":has("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":has("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":has("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":has("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":has("featurelayer-query-max-depth"),"featurelayer-query-tile-max-features":has("featurelayer-query-tile-max-features"),"featurelayer-query-tile-concurrency":has("featurelayer-query-tile-concurrency"),"featurelayer-query-pausing-enabled":has("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-concurrency":has("featurelayer-snapshot-concurrency"),"featurelayer-snapshot-enabled":has("featurelayer-snapshot-enabled"),"parquetlayer-full-query-feature-count":has("parquetlayer-full-query-feature-count"),"esri-atomics":has("esri-atomics"),"esri-shared-array-buffer":has("esri-shared-array-buffer"),"esri-tiles-debug":has("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":has("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":has("feature-polyline-generalization-factor"),"host-webworker":1},s.workers.loaderUrl&&(s.workers.loaderUrl=a(s.workers.loaderUrl)),s.workers.workerPath?s.workers.workerPath=a(s.workers.workerPath):s.workers.workerPath=a(e("esri/core/workers/RemoteClient.js")),s.workers.useDynamicImport=has("esri-esbuild-build");const i=r.workers.loaderConfig,l=n({baseUrl:i?.baseUrl,locale:t(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...i?.has},map:{...i?.map},paths:{...i?.paths},packages:i?.packages||[]}),f={buildDate:c,fullVersion:o,revision:u};return JSON.stringify({esriConfig:s,loaderConfig:l,kernelInfo:f})}let v=0;export{k as createWorker};
5
+ import{getAssetUrl as e}from"../../assets.js";import r from"../../config.js";import{getLocale as t}from"../../intl.js";import{fullVersion as o}from"../../kernel.js";import has from"../has.js";import s from"../Logger.js";import{makeAbsolute as a}from"../urlUtils.js";import{loaderConfig as n}from"./loaderConfig.js";import{receiveMessage as i,MessageType as l}from"./utils.js";import f from"./WorkerFallback.js";import{commitHash as u,buildDate as c}from"../../support/revision.js";const d=()=>s.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:m}=l,p='"use strict";let globalId=0;const outgoing=new Map,configuration={CONFIGURATION};self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}self.invokeStaticMessage=(e,o,r)=>{const t=r&&r.signal,n=globalId++;let s=null;return new Promise((r,i)=>{if(t){if(t.aborted)return i(createAbortError());s=()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))},t.addEventListener("abort",s)}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}).finally(()=>{t&&t.removeEventListener("abort",s)})};let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://esriurl.com/using-local-assets.\nModules version: ${r}\nAssets version: ${n??s}\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let t;function n(e){const o=t.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||new Promise(e=>{require([o.modulePath],e)})).then(n)}):"System"in self&&"function"==typeof System.import?System.import(workerPath).then(e=>(t=e.default,checkWorkerRevision(t),t.loadWorker(o.modulePath))).then(e=>e||System.import(o.modulePath)).then(n):esriConfig.workers.useDynamicImport?import(workerPath).then(e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||import(o.modulePath)).then(n)}):(self.RemoteClient||importScripts(workerPath),t=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(n));break;case 3:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let g,y;const h="Failed to create Worker. Fallback to execute module in main thread";async function k(){if(!has("esri-workers"))return w(new f);if(!g&&!y)try{const e=p.split("{CONFIGURATION}").join(b());g=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(r){y=r||{}}let e;if(g)try{e=new Worker(g,{name:"esri-worker-"+v++})}catch(r){d().warn(h,y),e=new f}else d().warn(h,y),e=new f;return w(e)}async function w(e){return new Promise(r=>{function t(s){const a=i(s);a&&a.type===m&&(e.removeEventListener("message",t),e.removeEventListener("error",o),r(e))}function o(r){r.preventDefault(),e.removeEventListener("message",t),e.removeEventListener("error",o),d().warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new f).addEventListener("message",t),e.addEventListener("error",o)}e.addEventListener("message",t),e.addEventListener("error",o)})}function b(){let s;if(null!=r.default){const e={...r};delete e.default,s=JSON.parse(JSON.stringify(e))}else s=JSON.parse(JSON.stringify(r));s.assetsPath=a(s.assetsPath),s.defaultAssetsPath=s.defaultAssetsPath?a(s.defaultAssetsPath):void 0,s.request.interceptors=[],s.log.interceptors=[],s.locale=t(),s.has={"esri-csp-restrictions":has("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":has("esri-2d-update-debug"),"esri-2d-log-updating":has("esri-2d-log-updating"),"featurelayer-pbf":has("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":has("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":has("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":has("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":has("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":has("featurelayer-query-max-depth"),"featurelayer-query-tile-max-features":has("featurelayer-query-tile-max-features"),"featurelayer-query-tile-concurrency":has("featurelayer-query-tile-concurrency"),"featurelayer-query-pausing-enabled":has("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-concurrency":has("featurelayer-snapshot-concurrency"),"featurelayer-snapshot-enabled":has("featurelayer-snapshot-enabled"),"parquetlayer-full-query-feature-count":has("parquetlayer-full-query-feature-count"),"esri-atomics":has("esri-atomics"),"esri-shared-array-buffer":has("esri-shared-array-buffer"),"esri-tiles-debug":has("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":has("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":has("feature-polyline-generalization-factor"),"host-webworker":1},s.workers.loaderUrl&&(s.workers.loaderUrl=a(s.workers.loaderUrl)),s.workers.workerPath?s.workers.workerPath=a(s.workers.workerPath):s.workers.workerPath=a(e("esri/core/workers/RemoteClient.js")),s.workers.useDynamicImport=has("esri-esbuild-build");const i=r.workers.loaderConfig,l=n({baseUrl:i?.baseUrl,locale:t(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...i?.has},map:{...i?.map},paths:{...i?.paths},packages:i?.packages||[]}),f={buildDate:c,fullVersion:o,revision:u};return JSON.stringify({esriConfig:s,loaderConfig:l,kernelInfo:f})}let v=0;export{k as createWorker};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{readOffsetDistance as t,makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{offset as s}from"./support/offsetUtils.js";import{convertRadialToPolylines as o}from"./support/shapeUtils.js";import{isRadial as r,isPolyline as i,maxDigitizingDisplayEdits as p}from"../support/executorUtils.js";import a from"../../../../geometry/Polyline.js";function l({templatePart:l,shape:f,edits:n,relationships:m,mode:h}){let c=[];if(r(f))c=o(f);else{if(!i(f))return;c=[f]}const u=t(l.builderConfig);for(const t of c){const o=t.clone();for(const t of o.paths){let r=new a({spatialReference:o.spatialReference,paths:[t],hasZ:o.hasZ,hasM:o.hasM});r&&u&&(r=s(r,u)),r&&e({templatePart:l,shape:r,edits:n,relationships:m,mode:h})}if("digitizing"===h&&n.length>p)break}}const f=!1;export{l as execute,f as isAsync};
5
+ import{readOffsetDistance as t,makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{offset as s}from"./support/offsetUtils.js";import{convertRadialToPolylines as o}from"./support/shapeUtils.js";import{isRadial as r,isPolyline as i,maxDigitizingDisplayEdits as p}from"../support/executorUtils.js";import a from"../../../../geometry/Polyline.js";import{getPaths as l,pathHasCurves as f}from"../../../../geometry/support/curves/curveUtils.js";function m({templatePart:m,shape:n,edits:c,relationships:u,mode:h}){let d=[];if(r(n))d=o(n);else{if(!i(n))return;d=[n]}const g=t(m.builderConfig);for(const t of d){const o=t.clone();for(const t of l(o)){let r=new a({spatialReference:o.spatialReference,...f(t)?{curvePaths:[t]}:{paths:[t]},hasZ:o.hasZ,hasM:o.hasM});r&&g&&(r=s(r,g)),r&&e({templatePart:m,shape:r,edits:c,relationships:u,mode:h})}if("digitizing"===h&&c.length>p)break}}const n=!1;export{m as execute,n as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{readOffsetDistance as t,makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{offset as s}from"./support/offsetUtils.js";import{convertRadialToPolylines as o}from"./support/shapeUtils.js";import{isRadial as r,isPolyline as i,maxDigitizingDisplayEdits as p}from"../support/executorUtils.js";import a from"../../../../geometry/Polyline.js";function l({templatePart:l,shape:f,edits:n,relationships:m,mode:h}){let c=[];if(r(f))c=o(f);else{if(!i(f))return;c=[f]}const u=t(l.builderConfig);for(const t of c){const o=t.clone();for(const t of o.paths){let r=new a({spatialReference:o.spatialReference,paths:[t],hasZ:o.hasZ,hasM:o.hasM});r&&u&&(r=s(r,u)),r&&e({templatePart:l,shape:r,edits:n,relationships:m,mode:h})}if("digitizing"===h&&n.length>p)break}}const f=!1;export{l as execute,f as isAsync};
5
+ import{readOffsetDistance as t,makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{offset as s}from"./support/offsetUtils.js";import{convertRadialToPolylines as o}from"./support/shapeUtils.js";import{isRadial as r,isPolyline as i,maxDigitizingDisplayEdits as p}from"../support/executorUtils.js";import a from"../../../../geometry/Polyline.js";import{getPaths as l,pathHasCurves as f}from"../../../../geometry/support/curves/curveUtils.js";function m({templatePart:m,shape:n,edits:c,relationships:u,mode:h}){let d=[];if(r(n))d=o(n);else{if(!i(n))return;d=[n]}const g=t(m.builderConfig);for(const t of d){const o=t.clone();for(const t of l(o)){let r=new a({spatialReference:o.spatialReference,...f(t)?{curvePaths:[t]}:{paths:[t]},hasZ:o.hasZ,hasM:o.hasM});r&&g&&(r=s(r,g)),r&&e({templatePart:m,shape:r,edits:c,relationships:u,mode:h})}if("digitizing"===h&&c.length>p)break}}const n=!1;export{m as execute,n as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{makeFeatureFromGroupPart as s}from"./support/builderUtils.js";import{sameStartEndPoint as t}from"./support/shapeUtils.js";import{isPolygon as e,maxDigitizingDisplayEdits as o}from"../support/executorUtils.js";import i from"../../../../geometry/Polyline.js";function r({templatePart:r,shape:p,edits:n,relationships:a,mode:l}){if(!e(p))return;const f=p.clone(),h=[];for(const s of f.rings){const e=s.slice();t(s)||e.push(e[0].slice()),h.push(e)}if(h.length>0)for(const t of h){if("digitizing"===l&&n.length>o)break;const e=new i({paths:[t],spatialReference:f.spatialReference,hasZ:f.hasZ,hasM:f.hasM});s({templatePart:r,shape:e,edits:n,relationships:a,mode:l})}}const p=!1;export{r as execute,p as isAsync};
5
+ import{makeFeatureFromGroupPart as t}from"./support/builderUtils.js";import{sameStartEndPoint as e}from"./support/shapeUtils.js";import{isPolygon as s,maxDigitizingDisplayEdits as o}from"../support/executorUtils.js";import r from"../../../../geometry/Polyline.js";import{getPaths as i,cloneCurve as p,pathHasCurves as a}from"../../../../geometry/support/curves/curveUtils.js";function n({templatePart:n,shape:l,edits:m,relationships:c,mode:f}){if(!s(l))return;const h=l.clone(),u=[];for(const t of i(h)){const s=t.slice();e(t)||s.push(p(s[0])),u.push(s)}if(u.length>0)for(const e of u){if("digitizing"===f&&m.length>o)break;const s=new r({...a(e)?{curvePaths:[e]}:{paths:[e]},spatialReference:h.spatialReference,hasZ:h.hasZ,hasM:h.hasM});t({templatePart:n,shape:s,edits:m,relationships:c,mode:f})}}const l=!1;export{n as execute,l as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{makeFeatureFromGroupPart as s}from"./support/builderUtils.js";import{sameStartEndPoint as t,convertToTwoPoint as e}from"./support/shapeUtils.js";import{isPolygon as o,maxDigitizingDisplayEdits as i}from"../support/executorUtils.js";import r from"../../../../geometry/Polyline.js";function p({templatePart:p,shape:a,edits:n,relationships:l,mode:f}){if(!o(a))return;const h=[];for(const s of a.rings){const e=s.slice();t(s)||e.push(e[0].slice()),h.push(e)}if(h.length>0){const t=new r({paths:h,spatialReference:a.spatialReference,hasZ:a.hasZ,hasM:a.hasM}),o=e(t);for(const e of o){if("digitizing"===f&&n.length>i)break;s({templatePart:p,shape:e,edits:n,relationships:l,mode:f})}}}const a=!1;export{p as execute,a as isAsync};
5
+ import{makeFeatureFromGroupPart as t}from"./support/builderUtils.js";import{sameStartEndPoint as e,convertToTwoPoint as s}from"./support/shapeUtils.js";import{isPolygon as o,maxDigitizingDisplayEdits as r}from"../support/executorUtils.js";import i from"../../../../geometry/Polyline.js";import{getPaths as p,cloneCurve as a,pathHasCurves as n}from"../../../../geometry/support/curves/curveUtils.js";function l({templatePart:l,shape:m,edits:f,relationships:h,mode:c}){if(!o(m))return;const u=[];let d=!1;for(const t of p(m)){const s=t.slice();e(t)||s.push(a(s[0])),d||=n(s),u.push(s)}if(u.length>0){const e=new i({...d?{curvePaths:u}:{paths:u},spatialReference:m.spatialReference,hasZ:m.hasZ,hasM:m.hasM}),o=s(e);for(const s of o){if("digitizing"===c&&f.length>r)break;t({templatePart:l,shape:s,edits:f,relationships:h,mode:c})}}}const m=!1;export{l as execute,m as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{makeFeatureFromGroupPart as t}from"./support/builderUtils.js";import{sameStartEndPoint as i,pointFromPolygonVertex as e}from"./support/shapeUtils.js";import{isPolygon as s,maxDigitizingDisplayEdits as o}from"../support/executorUtils.js";function r({templatePart:r,shape:p,edits:n,relationships:l,mode:a}){if(s(p))for(let s=0;s<p.rings.length;s++){const g=p.rings[s],m=g.length,h=i(g)?m-1:m;if("digitizing"===a&&n.length>o)break;for(let i=0;i<h&&!("digitizing"===a&&n.length>o);i++){const o=e(p,s,i);t({templatePart:r,shape:o,edits:n,relationships:l,mode:a})}}}const p=!1;export{r as execute,p as isAsync};
5
+ import{makeFeatureFromGroupPart as t}from"./support/builderUtils.js";import{sameStartEndPoint as e,pointFromPolygonVertex as r}from"./support/shapeUtils.js";import{isPolygon as i,maxDigitizingDisplayEdits as o}from"../support/executorUtils.js";import{getPaths as s}from"../../../../geometry/support/curves/curveUtils.js";function p({templatePart:p,shape:l,edits:n,relationships:m,mode:a}){if(!i(l))return;const u=s(l);for(let i=0;i<u.length;i++){const s=u[i],f=s.length,g=e(s)?f-1:f;if("digitizing"===a&&n.length>o)break;for(let e=0;e<g&&!("digitizing"===a&&n.length>o);e++){const o=r(l,i,e);t({templatePart:p,shape:o,edits:n,relationships:m,mode:a})}}}const l=!1;export{p as execute,l as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import{isLoadedSharedTemplate as t,isSharedPresetTemplate as o,isSharedFeatureTemplate as r}from"../../../../templateUtils.js";import{createFeatureServiceEdit as n}from"../../support/createFeatureServiceEdit.js";import{createPresetServiceEdit as s}from"../../support/createPresetServiceEdit.js";import i from"../../../../../geometry/Polygon.js";import{isPoint as a,isPolygon as l}from"../../../../../geometry/support/jsonTypeUtils.js";function u({edits:i,mode:l,relationships:u,shape:p,templatePart:f},c=""){if(null===f)return;const{template:m}=f;if(!t(m))throw new e("shared-template:template-not-loaded","A template part's template must be loaded before use");if(o(m)){if(!a(p))throw new e("shared-template:invalid-geometry","Preset templates must have a point geometry");s({geometry:p,template:m,edits:i,relationships:u,rotation:0,mode:l,tag:c})}else r(m)&&n({geometry:p,template:m,edits:i,relationships:u,tag:c})}function p(e,t){if(!e||!l(e))return null;if(!t.hasZ&&!t.hasM)return e;let o=null,r=null;const n=t.hasZ&&t.hasM?3:2;switch(t.type){case"point":o=t.hasZ?t.z:null,r=t.hasM?t.m:null;break;case"polygon":case"polyline":{const e="polygon"===t.type?t.rings:t.paths;for(const s of e)for(const e of s)t.hasZ&&(null===o||e[2]>o)&&(o=e[2]),t.hasM&&(null===r||e[n]>r)&&(r=e[n])}break;case"multipoint":for(const e of t.points)t.hasZ&&(null===o||e[2]>o)&&(o=e[2]),t.hasM&&(null===r||e[n]>r)&&(r=e[n]);break;default:return e}const s=v(e.rings,t.hasZ,t.hasM,o,r);return new i({rings:s,spatialReference:e.spatialReference,hasZ:t.hasZ,hasM:t.hasM})}function f(e){let t=!1;return void 0!==e.byNumber&&(t=!0===e.byNumber),t}function c(e){let t=0;return void 0!==e.count&&(t=e.count),t}function m(e,t){let o=0;return t?void 0!==e.proportional&&(o=e.proportional):void 0!==e.distanceValue&&(o=e.distanceValue),t&&(o/=100),o}function h(e){return!0===e.isProportional}function d(e){return!1!==e.createUnique}function y(e){let t=0;return void 0!==e.offsetDistance&&(t=e.offsetDistance),void 0!==e.side&&1===e.side&&(t*=-1),t}function g(e){return!0===e.vertexBeforeOffset}function v(e,t,o,r,n){const s=[];for(const i of e)s.push(b(i,t,o,r,n));return s}function b(e,t,o,r,n){const s=[];for(const i of e){const e=[i[0],i[1]];t&&(e[2]=r),o&&(e[t?3:2]=n),s.push(e)}return s}export{p as correctZandMFollowingBuffer,u as makeFeatureFromGroupPart,f as readByNumber,c as readCount,m as readDistance,h as readIsProportional,d as readIsUnique,y as readOffsetDistance,g as readVertexBeforeOffset};
5
+ import e from"../../../../../core/Error.js";import{isLoadedSharedTemplate as t,isSharedPresetTemplate as o,isSharedFeatureTemplate as r}from"../../../../templateUtils.js";import{createFeatureServiceEdit as n}from"../../support/createFeatureServiceEdit.js";import{createPresetServiceEdit as s}from"../../support/createPresetServiceEdit.js";import a from"../../../../../geometry/Polygon.js";import{isPoint as i,isPolygon as u}from"../../../../../geometry/support/jsonTypeUtils.js";import{getPaths as l,getEndpoint as c,isCurvedGeometry as f,cloneCurve as p}from"../../../../../geometry/support/curves/curveUtils.js";function m({edits:a,mode:u,relationships:l,shape:c,templatePart:f},p=""){if(null===f)return;const{template:m}=f;if(!t(m))throw new e("shared-template:template-not-loaded","A template part's template must be loaded before use");if(o(m)){if(!i(c))throw new e("shared-template:invalid-geometry","Preset templates must have a point geometry");s({geometry:c,template:m,edits:a,relationships:l,rotation:0,mode:u,tag:p})}else r(m)&&n({geometry:c,template:m,edits:a,relationships:l,tag:p})}function h(e,t){if(!e||!u(e))return null;if(!t.hasZ&&!t.hasM)return e;let o=null,r=null;const n=t.hasZ&&t.hasM?3:2;switch(t.type){case"point":o=t.hasZ?t.z:null,r=t.hasM?t.m:null;break;case"polygon":case"polyline":{const e=l(t);for(const s of e)for(const e of s){const s=c(e);t.hasZ&&(null===o||s[2]>o)&&(o=s[2]),t.hasM&&(null===r||s[n]>r)&&(r=s[n])}}break;case"multipoint":for(const e of t.points)t.hasZ&&(null===o||e[2]>o)&&(o=e[2]),t.hasM&&(null===r||e[n]>r)&&(r=e[n]);break;default:return e}return f(e)?new a({curveRings:R(e.curveRings,t.hasZ,t.hasM,o,r),spatialReference:e.spatialReference,hasZ:t.hasZ,hasM:t.hasM}):new a({rings:j(e.rings,t.hasZ,t.hasM,o,r),spatialReference:e.spatialReference,hasZ:t.hasZ,hasM:t.hasM})}function d(e){let t=!1;return void 0!==e.byNumber&&(t=!0===e.byNumber),t}function g(e){let t=0;return void 0!==e.count&&(t=e.count),t}function v(e,t){let o=0;return t?void 0!==e.proportional&&(o=e.proportional):void 0!==e.distanceValue&&(o=e.distanceValue),t&&(o/=100),o}function y(e){return!0===e.isProportional}function M(e){return!1!==e.createUnique}function Z(e){let t=0;return void 0!==e.offsetDistance&&(t=e.offsetDistance),void 0!==e.side&&1===e.side&&(t*=-1),t}function b(e){return!0===e.vertexBeforeOffset}function j(e,t,o,r,n){const s=[];for(const a of e)s.push(w(a,t,o,r,n));return s}function w(e,t,o,r,n){const s=[];for(const a of e){const e=[a[0],a[1]];t&&(e[2]=r),o&&(e[t?3:2]=n),s.push(e)}return s}function R(e,t,o,r,n){const s=[];for(const a of e)s.push(P(a,t,o,r,n));return s}function P(e,t,o,r,n){const s=[];for(const a of e){const e=p(a),i=c(e);t&&(i[2]=r),o&&(i[t?3:2]=n),s.push(e)}return s}export{h as correctZandMFollowingBuffer,m as makeFeatureFromGroupPart,d as readByNumber,g as readCount,v as readDistance,y as readIsProportional,M as readIsUnique,Z as readOffsetDistance,b as readVertexBeforeOffset};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{equals as e}from"../../../../../core/arrayUtils.js";import{fromArray as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getHeightUnitCorrectionFactor as s,interpolateM as n}from"../../../../geometry/coordUtils.js";import{segmentLength3d as a,distanceAlongLineSegmentWithZ as r,distanceAlongLineSegment as o}from"../../../../geometry/lineUtils.js";import h from"../../../../../geometry/Point.js";import c from"../../../../../geometry/Polyline.js";import{getLength as i}from"../../../../../geometry/support/coordsUtils.js";function f(e){let t=0;const n=s(e.spatialReference);for(let s=0;s<e.paths.length;s++){const r=e.paths[s].length;for(let o=0;o<r;o++)o>0&&(t+=e.hasZ?a(e.paths[s][o-1],e.paths[s][o],n):i(e.paths[s][o-1],e.paths[s][o]))}return t}function l(e){const t=e.geometry.clone();return t.paths.map(s=>new c({spatialReference:e.geometry.spatialReference,paths:[s],hasZ:t.hasZ,hasM:t.hasM}))}function p(e){const t=[];for(const s of e.paths)for(let n=1;n<s.length;n++){const a=[[s[n-1].slice(),s[n].slice()]];t.push(new c({paths:a,spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM}))}return t}function u(e,t,s){const n=t[0],a=t[1],r=i(n,a),o=e.x+s*((t[1][0]-t[0][0])/r),c=e.y+s*((t[1][1]-t[0][1])/r),f={};return e.hasM&&(f.m=e.m),new h({x:o,y:c,spatialReference:e.spatialReference,...f})}function m(e,t,s,n){const r=t[0],o=t[1],c=a(r,o,n),i=e.x+s*((t[1][0]-t[0][0])/c),f=e.y+s*((t[1][1]-t[0][1])/c),l=e.z+s*((t[1][2]-t[0][2])/c),p={};return e.hasM&&(p.m=e.m),new h({x:i,y:f,z:l,spatialReference:e.spatialReference,...p})}function R(e,t,s){const n=t[0],a=t[1],r=[a[0]-n[0],a[1]-n[1]],o=Math.sqrt(r[0]**2+r[1]**2),h=[r[0]/o,r[1]/o];return e.x+=s*h[0],e.y+=s*h[1],e}function y(e,t,s){let a=0,r=null;if(t<=0){const n=[e.paths[0][0],e.paths[0][1]];let a=Z(e,0,0);return a=u(a,n,t),R(a,n,s)}const c=e.hasM?e.hasZ?3:2:-1;for(const u of e.paths)for(let f=0;f<u.length-1;f++){const l=i(u[f],u[f+1]),p=a+l;if(p===t)return r=new h({x:u[f+1][0],y:u[f+1][1],...e.hasM?{m:u[f+1][c]}:{},spatialReference:e.spatialReference}),0===s?r:R(r,[u[f],u[f+1]],s);if(p>t){const i=o(u[f],u[f+1],t-a);return r=new h({x:i[0],y:i[1],...c>-1?{m:n(u[f][c],u[f+1][c],l,t-a)??void 0}:{},spatialReference:e.spatialReference}),0===s?r:R(r,[u[f],u[f+1]],s)}a+=l}if(0===a)return null;const f=e.paths.length-1,l=e.paths[f].length-1,p=[e.paths[f][l-1],e.paths[f][l]];let m=Z(e,f,l);return m=u(m,p,t-a),R(m,p,s)}function g(e,s,o,c){let i=0;if(s<=0){const t=[e.paths[0][0],e.paths[0][1]];let n=Z(e,0,0);return n=m(n,t,s,c),R(n,t,o)}const f=e.hasM?e.hasZ?3:2:-1;for(const m of e.paths)for(let l=0;l<m.length-1;l++){const p=a(m[l],m[l+1],c),u=i+p;if(u===s){const t=new h({x:m[l+1][0],y:m[l+1][1],z:m[l+1][2],...e.hasM?{m:m[l+1][f]}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?t:R(t,[m[l],m[l+1]],o)}if(u>s){const a=r(t(m[l]),t(m[l+1]),s-i,c),u=new h({x:a[0],y:a[1],z:a[2],...f>-1?{m:n(m[l][f],m[l+1][f],p,s-i)}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?u:R(u,[m[l],m[l+1]],o)}i+=p}if(0===i)return null;const l=e.paths.length-1,p=e.paths[l].length-1,u=[e.paths[l][p-1],e.paths[l][p]];let y=Z(e,l,p);return y=m(y,u,s-i,c),R(y,u,o)}function M(e,t,s){const n=e.rings[t][s];return new h({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function Z(e,t,s){const n=e.paths[t][s];return new h({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function x(t){return e(t.at(0),t.at(-1))}export{f as computedTotalLength,l as convertRadialToPolylines,p as convertToTwoPoint,R as offsetPointFromSegment,y as pointAlongLineAndOffset,g as pointAlongLineWithZAndOffset,M as pointFromPolygonVertex,Z as pointFromPolylineVertex,x as sameStartEndPoint};
5
+ import{equals as e}from"../../../../../core/arrayUtils.js";import{fromArray as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getHeightUnitCorrectionFactor as s,interpolateM as n}from"../../../../geometry/coordUtils.js";import{segmentLength3d as a,distanceAlongLineSegmentWithZ as r,distanceAlongLineSegment as o}from"../../../../geometry/lineUtils.js";import c from"../../../../../geometry/Point.js";import h from"../../../../../geometry/Polyline.js";import{getLength as i}from"../../../../../geometry/support/coordsUtils.js";import{getPaths as f,getEndpoint as l}from"../../../../../geometry/support/curves/curveUtils.js";function p(e){let t=0;const n=s(e.spatialReference);for(let s=0;s<e.paths.length;s++){const r=e.paths[s].length;for(let o=0;o<r;o++)o>0&&(t+=e.hasZ?a(e.paths[s][o-1],e.paths[s][o],n):i(e.paths[s][o-1],e.paths[s][o]))}return t}function u(e){const t=e.geometry.clone();return t.paths.map(s=>new h({spatialReference:e.geometry.spatialReference,paths:[s],hasZ:t.hasZ,hasM:t.hasM}))}function m(e){const t=[];for(const s of f(e))for(let n=1;n<s.length;n++){const a=[[l(s[n-1]).slice(),l(s[n]).slice()]];t.push(new h({paths:a,spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM}))}return t}function y(e,t,s){const n=t[0],a=t[1],r=i(n,a),o=e.x+s*((t[1][0]-t[0][0])/r),h=e.y+s*((t[1][1]-t[0][1])/r),f={};return e.hasM&&(f.m=e.m),new c({x:o,y:h,spatialReference:e.spatialReference,...f})}function R(e,t,s,n){const r=t[0],o=t[1],h=a(r,o,n),i=e.x+s*((t[1][0]-t[0][0])/h),f=e.y+s*((t[1][1]-t[0][1])/h),l=e.z+s*((t[1][2]-t[0][2])/h),p={};return e.hasM&&(p.m=e.m),new c({x:i,y:f,z:l,spatialReference:e.spatialReference,...p})}function g(e,t,s){const n=t[0],a=t[1],r=[a[0]-n[0],a[1]-n[1]],o=Math.sqrt(r[0]**2+r[1]**2),c=[r[0]/o,r[1]/o];return e.x+=s*c[0],e.y+=s*c[1],e}function M(e,t,s){let a=0,r=null;if(t<=0){const n=[e.paths[0][0],e.paths[0][1]];let a=w(e,0,0);return a=y(a,n,t),g(a,n,s)}const h=e.hasM?e.hasZ?3:2:-1;for(const m of e.paths)for(let f=0;f<m.length-1;f++){const l=i(m[f],m[f+1]),p=a+l;if(p===t)return r=new c({x:m[f+1][0],y:m[f+1][1],...e.hasM?{m:m[f+1][h]}:{},spatialReference:e.spatialReference}),0===s?r:g(r,[m[f],m[f+1]],s);if(p>t){const i=o(m[f],m[f+1],t-a);return r=new c({x:i[0],y:i[1],...h>-1?{m:n(m[f][h],m[f+1][h],l,t-a)??void 0}:{},spatialReference:e.spatialReference}),0===s?r:g(r,[m[f],m[f+1]],s)}a+=l}if(0===a)return null;const f=e.paths.length-1,l=e.paths[f].length-1,p=[e.paths[f][l-1],e.paths[f][l]];let u=w(e,f,l);return u=y(u,p,t-a),g(u,p,s)}function Z(e,s,o,h){let i=0;if(s<=0){const t=[e.paths[0][0],e.paths[0][1]];let n=w(e,0,0);return n=R(n,t,s,h),g(n,t,o)}const f=e.hasM?e.hasZ?3:2:-1;for(const y of e.paths)for(let l=0;l<y.length-1;l++){const p=a(y[l],y[l+1],h),u=i+p;if(u===s){const t=new c({x:y[l+1][0],y:y[l+1][1],z:y[l+1][2],...e.hasM?{m:y[l+1][f]}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?t:g(t,[y[l],y[l+1]],o)}if(u>s){const a=r(t(y[l]),t(y[l+1]),s-i,h),u=new c({x:a[0],y:a[1],z:a[2],...f>-1?{m:n(y[l][f],y[l+1][f],p,s-i)}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?u:g(u,[y[l],y[l+1]],o)}i+=p}if(0===i)return null;const l=e.paths.length-1,p=e.paths[l].length-1,u=[e.paths[l][p-1],e.paths[l][p]];let m=w(e,l,p);return m=R(m,u,s-i,h),g(m,u,o)}function x(e,t,s){const n=l(f(e)[t][s]);return new c({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function w(e,t,s){const n=l(f(e)[t][s]);return new c({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function j(t){return e(l(t.at(0)),l(t.at(-1)))}export{p as computedTotalLength,u as convertRadialToPolylines,m as convertToTwoPoint,g as offsetPointFromSegment,M as pointAlongLineAndOffset,Z as pointAlongLineWithZAndOffset,x as pointFromPolygonVertex,w as pointFromPolylineVertex,j as sameStartEndPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Graphic.js";import t from"../../../../core/Error.js";import{generateBracedUUID as a}from"../../../../core/uuid.js";import{isLoadedSharedTemplate as s}from"../../../templateUtils.js";import{isRadial as r}from"./executorUtils.js";import i from"../../../../geometry/Multipoint.js";import o from"../../../../geometry/Point.js";import n from"../../../../geometry/Polygon.js";import l from"../../../../geometry/Polyline.js";import{isSubtypeGroupLayer as h}from"../../../../layers/support/layerUtils.js";function p({edits:i,geometry:o,relationships:n,tag:h="",template:f}){if(r(o)){const e=o.geometry.clone();for(const t of e.paths){p({geometry:new l({spatialReference:e.spatialReference,paths:[t],hasZ:e.hasZ,hasM:e.hasM}),template:f,edits:i,relationships:n,tag:h})}return}const{definition:c,layer:m}=f;o=u(o,m);const d=new e({attributes:c.defaultValues?{...c.defaultValues}:{},geometry:o,sourceLayer:m});if(y(d,m),m.globalIdField&&(d.attributes[m.globalIdField]=a()),i.push({id:m.layerId,graphic:d,tag:h,layer:m}),0!==c.relationships.length)for(const r of c.relationships||[]){const o=r.template;if(null==r.relationshipMetadata||!s(o))throw new t("shared-template:missing-relationship-metadata-or-definition","Relationship part must have metadata and a fully loaded template with definition");const{layer:l}=o,h=new e({attributes:{...c.defaultValues},sourceLayer:l});y(h,l),l.globalIdField&&(h.attributes[l.globalIdField]=a()),i.push({graphic:h,id:l.layerId,tag:"",layer:l}),n.push({...r.relationshipMetadata,sourceGraphic:d,destinationGraphic:h})}}function u(e,t){if(!e)return null;if(e.hasZ===t.hasZ&&e.hasM===t.hasM)return e;switch(e.type){case"point":return new o({spatialReference:e.spatialReference,x:e.x,y:e.y,...t.hasZ?e.hasZ?{z:e.z}:{z:m(t)}:{},...t.hasM?e.hasM?{m:e.m}:{m:d(t)??void 0}:{}});case"polygon":return new n({spatialReference:e.spatialReference,rings:f(e.rings,t.hasZ,t.hasM,m(t),d(t),e.hasM?e.hasZ?3:2:-1,e.hasZ?2:-1),hasZ:t.hasZ,hasM:t.hasM});case"polyline":return new l({spatialReference:e.spatialReference,paths:f(e.paths,t.hasZ,t.hasM,m(t),d(t),e.hasM?e.hasZ?3:2:-1,e.hasZ?2:-1),hasZ:t.hasZ,hasM:t.hasM});case"multipoint":return new i({spatialReference:e.spatialReference,hasZ:t.hasZ,hasM:t.hasM,points:c(e.points,t.hasZ,t.hasM,m(t),d(t),e.hasM?e.hasZ?3:2:-1,e.hasZ?2:-1)});default:return e}}function f(e,t,a,s,r,i,o){const n=[];for(const l of e)n.push(c(l,t,a,s,r,i,o));return n}function c(e,t,a,s,r,i,o){const n=[];for(const l of e){const e=[l[0],l[1]];t&&(e[2]=o>-1?l[2]:s),a&&(e[t?3:2]=i>-1?l[i]:r),n.push(e)}return n}function m(e){return e.capabilities.editing?.zDefault??0}function d(e){return e.capabilities.editing.supportsUpdateWithoutM?void 0:0}function y(e,t){h(t)&&(e.sourceLayer=t.findSublayerForFeature(e))}export{p as createFeatureServiceEdit};
5
+ import e from"../../../../Graphic.js";import a from"../../../../core/Error.js";import{generateBracedUUID as t}from"../../../../core/uuid.js";import{isLoadedSharedTemplate as s}from"../../../templateUtils.js";import{isRadial as r}from"./executorUtils.js";import n from"../../../../geometry/Multipoint.js";import i from"../../../../geometry/Point.js";import o from"../../../../geometry/Polygon.js";import h from"../../../../geometry/Polyline.js";import{isCurvedGeometry as l,isCoordinate as u,cloneCurve as f,isBezierCurve as p,isCircularArc as d}from"../../../../geometry/support/curves/curveUtils.js";import{isSubtypeGroupLayer as c}from"../../../../layers/support/layerUtils.js";function m({edits:n,geometry:i,relationships:o,tag:l="",template:u}){if(r(i)){const e=i.geometry.clone();for(const a of e.paths){m({geometry:new h({spatialReference:e.spatialReference,paths:[a],hasZ:e.hasZ,hasM:e.hasM}),template:u,edits:n,relationships:o,tag:l})}return}const{definition:f,layer:p}=u;i=Z(i,p);const d=new e({attributes:f.defaultValues?{...f.defaultValues}:{},geometry:i,sourceLayer:p});if(j(d,p),p.globalIdField&&(d.attributes[p.globalIdField]=t()),n.push({id:p.layerId,graphic:d,tag:l,layer:p}),0!==f.relationships.length)for(const r of f.relationships||[]){const i=r.template;if(null==r.relationshipMetadata||!s(i))throw new a("shared-template:missing-relationship-metadata-or-definition","Relationship part must have metadata and a fully loaded template with definition");const{layer:h}=i,l=new e({attributes:{...f.defaultValues},sourceLayer:h});j(l,h),h.globalIdField&&(l.attributes[h.globalIdField]=t()),n.push({graphic:l,id:h.layerId,tag:"",layer:h}),o.push({...r.relationshipMetadata,sourceGraphic:d,destinationGraphic:l})}}function Z(e,a){if(!e)return null;if(e.hasZ===a.hasZ&&e.hasM===a.hasM)return e;switch(e.type){case"point":return new i({spatialReference:e.spatialReference,x:e.x,y:e.y,...a.hasZ?e.hasZ?{z:e.z}:{z:b(a)}:{},...a.hasM?e.hasM?{m:e.m}:{m:R(a)??void 0}:{}});case"polygon":return new o({spatialReference:e.spatialReference,...l(e)?{curveRings:y(e.curveRings,{hasZ:a.hasZ,hasM:a.hasM,defaultZ:b(a),defaultM:R(a),mIndex:e.hasM?e.hasZ?3:2:-1,zIndex:e.hasZ?2:-1})}:{rings:M(e.rings,{hasZ:a.hasZ,hasM:a.hasM,defaultZ:b(a),defaultM:R(a),mIndex:e.hasM?e.hasZ?3:2:-1,zIndex:e.hasZ?2:-1})},hasZ:a.hasZ,hasM:a.hasM});case"polyline":return new h({spatialReference:e.spatialReference,...l(e)?{curvePaths:y(e.curvePaths,{hasZ:a.hasZ,hasM:a.hasM,defaultZ:b(a),defaultM:R(a),mIndex:e.hasM?e.hasZ?3:2:-1,zIndex:e.hasZ?2:-1})}:{paths:M(e.paths,{hasZ:a.hasZ,hasM:a.hasM,defaultZ:b(a),defaultM:R(a),mIndex:e.hasM?e.hasZ?3:2:-1,zIndex:e.hasZ?2:-1})},hasZ:a.hasZ,hasM:a.hasM});case"multipoint":return new n({spatialReference:e.spatialReference,hasZ:a.hasZ,hasM:a.hasM,points:g(e.points,{hasZ:a.hasZ,hasM:a.hasM,defaultZ:b(a),defaultM:R(a),mIndex:e.hasM?e.hasZ?3:2:-1,zIndex:e.hasZ?2:-1})});default:return e}}function M(e,a){const t=[];for(const s of e)t.push(g(s,a));return t}function g(e,a){const t=[];for(const s of e){const e=[s[0],s[1]];a.hasZ&&(e[2]=a.zIndex>-1?s[2]:a.defaultZ),a.hasM&&(a.mIndex>-1?e[a.hasZ?3:2]=s[a.mIndex]:e[a.hasZ?3:2]=a.defaultM),t.push(e)}return t}function y(e,a){return e.map(e=>I(e,a))}function I(e,a){const t=[];for(const s of e)if(u(s)){const e=x(s,a);t.push(e)}else{const e=f(s);p(e)?e.b[0]=x(e.b[0],a):d(e)?e.c[0]=x(e.c[0],a):e.a[0]=x(e.a[0],a),t.push(e)}return t}function x(e,a){const t=[e[0],e[1]];return a.hasZ&&(t[2]=a.zIndex>-1?e[2]:a.defaultZ),a.hasM&&(a.mIndex>-1?t[a.hasZ?3:2]=e[a.mIndex]:t[a.hasZ?3:2]=a.defaultM),t}function b(e){return e.capabilities.editing?.zDefault??0}function R(e){return e.capabilities.editing.supportsUpdateWithoutM?void 0:0}function j(e,a){c(a)&&(e.sourceLayer=a.findSublayerForFeature(e))}export{m as createFeatureServiceEdit};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{isLoadedSharedTemplate as t,isSharedFeatureTemplate as o,isSharedPresetTemplate as s}from"../../../templateUtils.js";import{createFeatureServiceEdit as r}from"./createFeatureServiceEdit.js";import{maxDigitizingDisplayEdits as i}from"./executorUtils.js";import n from"../../../../geometry/Multipoint.js";import a from"../../../../geometry/Point.js";import l from"../../../../geometry/Polygon.js";import p from"../../../../geometry/Polyline.js";import{execute as h}from"../../../../geometry/operators/affineTransformOperator.js";import f from"../../../../geometry/operators/support/Transformation.js";function m({edits:n,geometry:a,mode:l,relationships:p,rotation:c,tag:u="",template:y}){const{definition:d}=y,Z=a.x-d.origin.x,M=a.y-d.origin.y,j=d.origin.hasZ&&a.hasZ?a.z-d.origin.z:0,R=g(d.origin.clone(),Z,M,j),w=(new f).rotate(c,R.x,R.y);for(const f of d.parts){if(n.length>i&&"digitizing"===l)break;const c=f.template;if(!t(c))throw new e("shared-template:template-not-loaded","A template part's template must be loaded before use");if(o(c)){let e=g(f.geometry,Z,M,j);w.isIdentity()||(e=h(e,w)),r({edits:n,geometry:e,relationships:p,tag:u,template:c})}else if(s(c)){const e=[];if(m({edits:w.isIdentity()?e:n,geometry:a,mode:l,relationships:p,rotation:0,tag:u,template:c}),!w.isIdentity())for(const t of e){const{geometry:e}=t.graphic;e&&"mesh"!==e.type&&(t.graphic.geometry=h(e,w),n.push(t))}}}return R}function g(e,t,o,s=0){if(!e)return null;if("point"===e.type)return new a({spatialReference:e.spatialReference,x:e.x+t,y:e.y+o,...e.hasZ?{z:e.z+s}:{},...e.hasM?{m:e.m}:{}});if("multipoint"===e.type){const r=[];if(e.hasZ&&e.hasM)for(let i=0;i<e.points.length;i++){const n=e.points[i];r.push([n[0]+t,n[1]+o,n[2]+s,n[3]])}else if(e.hasZ)for(let i=0;i<e.points.length;i++){const n=e.points[i];r.push([n[0]+t,n[1]+o,n[2]+s])}else if(e.hasM)for(let s=0;s<e.points.length;s++){const i=e.points[s];r.push([i[0]+t,i[1]+o,i[2]])}else for(let s=0;s<e.points.length;s++){const i=e.points[s];r.push([i[0]+t,i[1]+o])}return new n({spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM,points:r})}if("polygon"===e.type){const r=new l({spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM});for(let i=0;i<e.rings.length;i++){const n=e.rings[i],a=[];if(e.hasZ&&e.hasM)for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o,n[e][2]+s,n[e][3]]);else if(e.hasM)for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o,n[e][2]]);else if(e.hasZ)for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o,n[e][2]+s]);else for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o]);r.addRing(a)}return r}if("polyline"===e.type){const r=new p({spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM});for(let i=0;i<e.paths.length;i++){const n=e.paths[i],a=[];if(e.hasZ&&e.hasM)for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o,n[e][2]+s,n[e][3]]);else if(e.hasZ)for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o,n[e][2]+s]);else if(e.hasM)for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o,n[e][2]]);else for(let e=0;e<n.length;e++)a.push([n[e][0]+t,n[e][1]+o]);r.addPath(a)}return r}return e.clone()}export{m as createPresetServiceEdit,g as translate};
5
+ import t from"../../../../core/Error.js";import{isLoadedSharedTemplate as e,isSharedFeatureTemplate as o,isSharedPresetTemplate as r}from"../../../templateUtils.js";import{createFeatureServiceEdit as i}from"./createFeatureServiceEdit.js";import{maxDigitizingDisplayEdits as s}from"./executorUtils.js";import n from"../../../../geometry/Multipoint.js";import p from"../../../../geometry/Point.js";import{execute as a}from"../../../../geometry/operators/affineTransformOperator.js";import f from"../../../../geometry/operators/support/Transformation.js";import{getPaths as m,getEndpoint as l}from"../../../../geometry/support/curves/curveUtils.js";function c({edits:n,geometry:p,mode:m,relationships:l,rotation:g,tag:u="",template:y}){const{definition:d}=y,j=p.x-d.origin.x,Z=p.y-d.origin.y,x=d.origin.hasZ&&p.hasZ?p.z-d.origin.z:0,w=h(d.origin.clone(),j,Z,x),M=(new f).rotate(g,w.x,w.y);for(const f of d.parts){if(n.length>s&&"digitizing"===m)break;const g=f.template;if(!e(g))throw new t("shared-template:template-not-loaded","A template part's template must be loaded before use");if(o(g)){let t=h(f.geometry,j,Z,x);M.isIdentity()||(t=a(t,M)),i({edits:n,geometry:t,relationships:l,tag:u,template:g})}else if(r(g)){const t=[];if(c({edits:M.isIdentity()?t:n,geometry:p,mode:m,relationships:l,rotation:0,tag:u,template:g}),!M.isIdentity())for(const e of t){const{geometry:t}=e.graphic;t&&"mesh"!==t.type&&(e.graphic.geometry=a(t,M),n.push(e))}}}return w}function h(t,e,o,r=0){if(!t)return null;if("point"===t.type)return new p({spatialReference:t.spatialReference,x:t.x+e,y:t.y+o,...t.hasZ?{z:t.z+r}:{},...t.hasM?{m:t.m}:{}});if("multipoint"===t.type){const i=[];if(t.hasZ&&t.hasM)for(let s=0;s<t.points.length;s++){const n=t.points[s];i.push([n[0]+e,n[1]+o,n[2]+r,n[3]])}else if(t.hasZ)for(let s=0;s<t.points.length;s++){const n=t.points[s];i.push([n[0]+e,n[1]+o,n[2]+r])}else if(t.hasM)for(let r=0;r<t.points.length;r++){const s=t.points[r];i.push([s[0]+e,s[1]+o,s[2]])}else for(let r=0;r<t.points.length;r++){const s=t.points[r];i.push([s[0]+e,s[1]+o])}return new n({spatialReference:t.spatialReference,hasZ:t.hasZ,hasM:t.hasM,points:i})}if("polygon"===t.type||"polyline"===t.type){const i=g(t,e,o);return 0!==r&&t.hasZ&&u(i,r),i}return t.clone()}function g(t,e,o){const r=new f;return r.shift(e,o),a(t,r)}function u(t,e){for(const o of m(t))for(const t of o){l(t)[2]+=e}}export{c as createPresetServiceEdit,h as translate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as e}from"../../core/mathUtils.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getProjectorClassification as t,copy3 as n,projectionTable as s,wgs84ToWebMercator as c}from"./projectors.js";import{earth as i}from"../support/Ellipsoid.js";function o(e,r,o,l){if(null==e||null==r||null==l)return!1;const f=t(r,l);if(null==f?.projector)return!1;if(f.projector===n)return o.copy(e),!0;const{source:p,dest:d,projector:m}=f;if(3===d.spatialReferenceId){const r=s[p.spatialReferenceId][2];return null!=r&&(r(e.center,0,u,0),c(u,0,o.center,0),o.radius=a(u[1],e.center[2],e.radius,i.radius),!0)}if(2!==p.spatialReferenceId&&5!==p.spatialReferenceId||11!==d.spatialReferenceId){m(e.center,0,o.center,0);const r=p.metersPerUnit??1,t=d.metersPerUnit??1;o.radius=e.radius*r/t}else{const r=s[p.spatialReferenceId][1],t=s[1][11];let n=e.radius;null!=r&&null!=t&&(n=a(e.center[1],e.center[2],e.radius,i.radius)),m(e.center,0,o.center,0),o.radius=n}return!0}function a(e,r,t,n){const s=n+r;if(s<n/2||t>s)return Number.MAX_VALUE;const c=Math.abs(l*e)+Math.asin(t/s);return c>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(c)}const u=r(),l=e(1);export{o as projectBoundingSphere};
5
+ import{deg2rad as e}from"../../core/mathUtils.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getProjectorClassification as t,copy3 as n,projectionTable as s,wgs84ToWebMercator as c}from"./projectors.js";import{earth as i}from"../support/Ellipsoid.js";function o(e,r,o,l){if(null==e||null==r||null==l)return!1;const f=t(r,l);if(null==f?.projector)return!1;if(f.projector===n)return o.copyFrom(e),!0;const{source:p,dest:d,projector:m}=f;if(3===d.spatialReferenceId){const r=s[p.spatialReferenceId][2];return null!=r&&(r(e.center,0,u,0),c(u,0,o.center,0),o.radius=a(u[1],e.center[2],e.radius,i.radius),!0)}if(2!==p.spatialReferenceId&&5!==p.spatialReferenceId||11!==d.spatialReferenceId){m(e.center,0,o.center,0);const r=p.metersPerUnit??1,t=d.metersPerUnit??1;o.radius=e.radius*r/t}else{const r=s[p.spatialReferenceId][1],t=s[1][11];let n=e.radius;null!=r&&null!=t&&(n=a(e.center[1],e.center[2],e.radius,i.radius)),m(e.center,0,o.center,0),o.radius=n}return!0}function a(e,r,t,n){const s=n+r;if(s<n/2||t>s)return Number.MAX_VALUE;const c=Math.abs(l*e)+Math.asin(t/s);return c>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(c)}const u=r(),l=e(1);export{o as projectBoundingSphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- function n(n){return"curveRings"in n&&!!n.curveRings?.length||"curvePaths"in n&&!!n.curvePaths?.length}function r(n){return"curveRings"in n?n.curveRings:n.curvePaths}function t(n){return"b"in n}function u(n){return"c"in n}function i(n){return Array.isArray(n)}function e(n){return"a"in n}function c(n){return"a"in n&&4===n.a.length}function f(n){return"a"in n&&7===n.a.length}function o(n,r){return i(n)?i(r):t(n)?t(r):u(n)?u(r):c(n)?c(r):!!f(n)&&f(r)}function a(n){return i(n)?n:t(n)?n.b[0]:u(n)?n.c[0]:n.a[0]}function s(n){if(t(n)){const[r,t,u]=n.b;return{b:[[...r],[...t],[...u]]}}if(u(n)){const[r,t]=n.c;return{c:[[...r],[...t]]}}if(i(n))return[...n];if(c(n)){const[r,t,u,i]=n.a;return{a:[[...r],[...t],u,i]}}if(f(n)){const[r,t,u,i,e,c,f]=n.a;return{a:[[...r],[...t],u,i,e,c,f]}}return n}export{s as cloneCurve,o as curvesAreSameType,r as getCurves,a as getEndpoint,t as isBezierCurve,u as isCircularArc,i as isCoordinate,n as isCurvedGeometry,e as isEllipticArc,c as isEllipticArc4,f as isEllipticArc7};
5
+ function n(n){return"curveRings"in n&&!!n.curveRings?.length||"curvePaths"in n&&!!n.curvePaths?.length}function r(n){return"curveRings"in n?n.curveRings:n.curvePaths}function t(n){return"b"in n}function u(n){return"c"in n}function i(n){return Array.isArray(n)}function e(n){return"a"in n}function c(n){return"a"in n&&4===n.a.length}function o(n){return"a"in n&&7===n.a.length}function s(n,r){return i(n)?i(r):t(n)?t(r):u(n)?u(r):c(n)?c(r):!!o(n)&&o(r)}function f(n){return i(n)?n:t(n)?n.b[0]:u(n)?n.c[0]:n.a[0]}function a(n){if(t(n)){const[r,t,u]=n.b;return{b:[[...r],[...t],[...u]]}}if(u(n)){const[r,t]=n.c;return{c:[[...r],[...t]]}}if(i(n))return[...n];if(c(n)){const[r,t,u,i]=n.a;return{a:[[...r],[...t],u,i]}}if(o(n)){const[r,t,u,i,e,c,o]=n.a;return{a:[[...r],[...t],u,i,e,c,o]}}return n}function g(r){return n(r)?"curveRings"in r?r.curveRings:r.curvePaths:"rings"in r?r.rings:r.paths}function v(n){return n.some(n=>!i(n))}export{a as cloneCurve,s as curvesAreSameType,r as getCurves,f as getEndpoint,g as getPaths,t as isBezierCurve,u as isCircularArc,i as isCoordinate,n as isCurvedGeometry,e as isEllipticArc,c as isEllipticArc4,o as isEllipticArc7,v as pathHasCurves};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import"../../core/Logger.js";import{acosClamped as t}from"../../core/mathUtils.js";import{getEpsilon as e}from"../../core/libs/gl-matrix-2/math/common.js";import{fromRotation as r}from"../../core/libs/gl-matrix-2/math/mat4.js";import{d as s,G as i,s as n,e as o,j as c,b as a,i as h,f as u,p as l,D as m,l as d,c as g,F as f,n as p,h as M}from"../../chunks/vec32.js";import{fromValues as j,fromArray as y,clone as _,create as x}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as b}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isVec3 as S}from"../../core/libs/gl-matrix-2/types/vec3.js";import{isVec4 as v}from"../../core/libs/gl-matrix-2/types/vec4.js";import{fromPoints as P,closestPoint as A}from"./ray.js";import{cartesianToSpherical as R}from"./sphereUtils.js";import{angle as q}from"./vector.js";import{sv3d as O,sm4d as w}from"./vectorStacks.js";class E{constructor(t=0,e=0,r=0,s=0){this.radius=s,"number"==typeof t?this._center=j(t,e,r):S(t)||v(t)?(this._center=y(t),this.radius=4===t.length?t[3]:e):(this._center=_(t.center),this.radius=t.radius)}get center(){return this._center}set center(t){s(this.center,t)}exactEquals(t){return i(this._center,t.center)&&this.radius===t.radius}copy(t){return t!==this&&(s(this._center,t.center),this.radius=t.radius),this}clone(){return new E(this.center,this.radius)}toVec4(){return b(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return n(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,C))return!1;let{t0:r,t1:s}=C;if((r<0||s<r&&s>0)&&(r=s),r<0)return!1;if(e){const{origin:s,direction:i}=t;e[0]=s[0]+i[0]*r,e[1]=s[1]+i[1]*r,e[2]=s[2]+i[2]*r}return!0}intersectLine(t,r){const s=P(t,r);if(!this._intersect(s,C))return[];const{origin:i,direction:n}=s,{t0:o,t1:c}=C,a=t=>{const e=x();return g(e,i,n,t),this.projectPoint(e,e)};return Math.abs(o-c)<e()?[a(o)]:[a(o),a(c)]}_intersect(t,e){const{origin:r,direction:s}=t,i=L;i[0]=r[0]-this.center[0],i[1]=r[1]-this.center[1],i[2]=r[2]-this.center[2];const n=s[0]*s[0]+s[1]*s[1]+s[2]*s[2];if(0===n)return!1;const o=2*(s[0]*i[0]+s[1]*i[1]+s[2]*i[2]),c=o*o-4*n*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-o-a)/(2*n),e.t1=(-o+a)/(2*n),!0}projectPoint(t,e){const r=o(O.get(),t,this.center),s=c(O.get(),r,this.radius/a(r));return h(e,s,this.center)}closestPointOnSilhouette(t,e){const s=O.get(),i=w.get();u(s,t.origin,t.direction),u(e,s,t.origin),c(e,e,1/a(e)*this.radius);const n=this._angleToSilhouette(t.origin),o=q(t.origin,e);return r(i,o+n,s),l(e,e,i),e}frustumCoverage(t,e,r){const s=this.radius,i=s*s,n=t+.5*Math.PI,o=e*e+i-2*Math.cos(n)*e*s,c=Math.sqrt(o),a=o-i;if(a<=0)return.5;const h=Math.sqrt(a),u=Math.acos(h/c)-Math.asin(s/(c/Math.sin(n)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const r=o(O.get(),e,this.center),s=a(r),i=this.radius,n=i+Math.abs(i-s);return t(i/n)}union(t){const e=m(this._center,t.center),r=this.radius,s=t.radius;return e+s<r?this:e+r<s?(this.copy(t),this):(d(this._center,this._center,t.center,(e+s-r)/(2*e)),this.radius=(e+r+s)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}const T={create:t=>new E(t),copy:(t,e)=>e.copy(t),setExtent:(t,e,r)=>r.copy(t),getExtent:(t,e)=>e,elevate:(t,e,r)=>(r.copy(t),r.radius+=e,r),axisAt(t,e,r,s){const i=o(U,e,t.center);switch(r){case 0:{const t=R(i,U)[2];return M(s,-Math.sin(t),Math.cos(t),0)}case 1:{const t=R(i,U),e=t[1],r=t[2],n=Math.sin(e);return M(s,-n*Math.cos(r),-n*Math.sin(r),Math.cos(e))}case 2:return p(s,i);default:return}},altitudeAt(t,e){const r=o(V,e,t.center);return a(r)-t.radius},setAltitudeAt(t,e,r,s){const i=T.altitudeAt(t,e),n=T.axisAt(t,e,2,V),o=c(V,n,r-i);return h(s,e,o)},intersectRay:(t,e,r)=>t.intersectRay(e,r),closestPoint:(t,e,r)=>t.intersectRay(e,r)?r:(A(e,t.center,r),t.projectPoint(r,r)),intersectRayClosestSilhouette(t,e,r){if(t.intersectRay(e,r))return r;const s=t.closestPointOnSilhouette(e,O.get());return h(r,e.origin,c(O.get(),e.direction,m(e.origin,s)/a(e.direction))),r},closestPointOnSilhouette:(t,e,r)=>t.closestPointOnSilhouette(e,r),distanceToSilhouette(t,e){const r=o(O.get(),e,t.center),s=f(r),i=t.radius**2;return Math.sqrt(Math.abs(s-i))}},k=new E,C={t0:0,t1:0},L=x(),U=x(),V=x();export{k as NullSphere,E as Sphere,T as sphereCSO};
5
+ import"../../core/has.js";import"../../core/Logger.js";import{acosClamped as t}from"../../core/mathUtils.js";import{getEpsilon as e}from"../../core/libs/gl-matrix-2/math/common.js";import{fromRotation as r}from"../../core/libs/gl-matrix-2/math/mat4.js";import{d as s,G as i,s as n,e as o,j as c,b as a,i as h,f as u,p as m,D as l,l as d,c as g,F as f,n as p,h as M}from"../../chunks/vec32.js";import{fromValues as j,fromArray as y,clone as _,create as x}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as b}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isVec3 as v}from"../../core/libs/gl-matrix-2/types/vec3.js";import{isVec4 as S}from"../../core/libs/gl-matrix-2/types/vec4.js";import{fromPoints as P,closestPoint as A}from"./ray.js";import{cartesianToSpherical as F}from"./sphereUtils.js";import{angle as R}from"./vector.js";import{sv3d as q,sm4d as O}from"./vectorStacks.js";class w{constructor(t=0,e=0,r=0,s=0){this.radius=s,"number"==typeof t?this._center=j(t,e,r):v(t)||S(t)?(this._center=y(t),this.radius=4===t.length?t[3]:e):(this._center=_(t.center),this.radius=t.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(t){s(this.center,t)}exactEquals(t){return i(this._center,t.center)&&this.radius===t.radius}copyFrom(t){return t!==this&&(s(this._center,t.center),this.radius=t.radius),this}clone(){return new w(this.center,this.radius)}toVec4(){return b(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return n(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,V))return!1;let{t0:r,t1:s}=V;if((r<0||s<r&&s>0)&&(r=s),r<0)return!1;if(e){const{origin:s,direction:i}=t;e[0]=s[0]+i[0]*r,e[1]=s[1]+i[1]*r,e[2]=s[2]+i[2]*r}return!0}intersectLine(t,r){const s=P(t,r);if(!this._intersect(s,V))return[];const{origin:i,direction:n}=s,{t0:o,t1:c}=V,a=t=>{const e=x();return g(e,i,n,t),this.projectPoint(e,e)};return Math.abs(o-c)<e()?[a(o)]:[a(o),a(c)]}_intersect(t,e){const{origin:r,direction:s}=t,i=k;i[0]=r[0]-this.center[0],i[1]=r[1]-this.center[1],i[2]=r[2]-this.center[2];const n=s[0]*s[0]+s[1]*s[1]+s[2]*s[2];if(0===n)return!1;const o=2*(s[0]*i[0]+s[1]*i[1]+s[2]*i[2]),c=o*o-4*n*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-o-a)/(2*n),e.t1=(-o+a)/(2*n),!0}projectPoint(t,e){const r=o(q.get(),t,this.center),s=c(q.get(),r,this.radius/a(r));return h(e,s,this.center)}closestPointOnSilhouette(t,e){const s=q.get(),i=O.get();u(s,t.origin,t.direction),u(e,s,t.origin),c(e,e,1/a(e)*this.radius);const n=this._angleToSilhouette(t.origin),o=R(t.origin,e);return r(i,o+n,s),m(e,e,i),e}frustumCoverage(t,e,r){const s=this.radius,i=s*s,n=t+.5*Math.PI,o=e*e+i-2*Math.cos(n)*e*s,c=Math.sqrt(o),a=o-i;if(a<=0)return.5;const h=Math.sqrt(a),u=Math.acos(h/c)-Math.asin(s/(c/Math.sin(n)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const r=o(q.get(),e,this.center),s=a(r),i=this.radius,n=i+Math.abs(i-s);return t(i/n)}union(t){const e=l(this._center,t.center),r=this.radius,s=t.radius;return e+s<r?this:e+r<s?(this.copyFrom(t),this):(d(this._center,this._center,t.center,(e+s-r)/(2*e)),this.radius=(e+r+s)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}const E={create:t=>new w(t),copy:(t,e)=>e.copyFrom(t),setExtent:(t,e,r)=>r.copyFrom(t),getExtent:(t,e)=>e,elevate:(t,e,r)=>(r.copyFrom(t),r.radius+=e,r),axisAt(t,e,r,s){const i=o(C,e,t.center);switch(r){case 0:{const t=F(i,C)[2];return M(s,-Math.sin(t),Math.cos(t),0)}case 1:{const t=F(i,C),e=t[1],r=t[2],n=Math.sin(e);return M(s,-n*Math.cos(r),-n*Math.sin(r),Math.cos(e))}case 2:return p(s,i);default:return}},altitudeAt(t,e){const r=o(L,e,t.center);return a(r)-t.radius},setAltitudeAt(t,e,r,s){const i=E.altitudeAt(t,e),n=E.axisAt(t,e,2,L),o=c(L,n,r-i);return h(s,e,o)},intersectRay:(t,e,r)=>t.intersectRay(e,r),closestPoint:(t,e,r)=>t.intersectRay(e,r)?r:(A(e,t.center,r),t.projectPoint(r,r)),intersectRayClosestSilhouette(t,e,r){if(t.intersectRay(e,r))return r;const s=t.closestPointOnSilhouette(e,q.get());return h(r,e.origin,c(q.get(),e.direction,l(e.origin,s)/a(e.direction))),r},closestPointOnSilhouette:(t,e,r)=>t.closestPointOnSilhouette(e,r),distanceToSilhouette(t,e){const r=o(q.get(),e,t.center),s=f(r),i=t.radius**2;return Math.sqrt(Math.abs(s-i))}},T=new w,V={t0:0,t1:0},k=x(),C=x(),L=x();export{T as NullSphere,w as Sphere,E as sphereCSO};
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.56",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.58",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as d,sync as h}from"../core/reactiveUtils.js";import{isAbsolute as p,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{idToName as f,nameToId as g}from"../core/accessorSupport/PropertyOrigin.js";import w from"./Layer.js";import{KnowledgeGraphLayerDataManager as b}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import M from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as T,createCapabilitiesFromKnowledgeGraph as D}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as S}from"./mixins/BlendLayer.js";import{CustomParametersMixin as L}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as k}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{fetchKnowledgeGraph as N}from"../rest/knowledgeGraphService.js";import{f as A,t as I}from"../chunks/persistableUrlUtils.js";import{reader as x}from"../core/accessorSupport/decorators/reader.js";import{writer as E}from"../core/accessorSupport/decorators/writer.js";let O=class extends(S(C(j(_(v(k(r(L(w))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(M)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(M)),this.type="knowledge-graph",this.url=null,this.addHandles(d(()=>this.layers.concat(this.tables),(e,i)=>this._handleSublayersChange(e,i),h))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){l(i)}await this._fetchMetadata(),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await T(this)}async _fetchMetadata(){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await N(this.url);this.knowledgeGraph=e,this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new b({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await i(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,f(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return o.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(o.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))});else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(i=>{e(i)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));n(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await T(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach(e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new M({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach(i=>{i.parentCompositeLayer=this;const t=e.find(e=>e.type===i.graphType&&e.name===i.graphTypeName);t&&(i.objectType=t,this._updateSublayerCaches(t))})}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a){e[i]="<pending>",t.pendingOperations.push(K(this.inclusionModeDefinition).then(s=>{const o=U(a);e[i]=o.itemRelativeUrl,t.toAdd.push({resource:o,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,i,t){return A(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,o=a?.resources,n=g(a?.origin);if(!s||!o||null==n)return void(e&&(i[t]=I(e,a)));const{inclusionModeDefinition:r}=this;if(!r||this._displaysAllRecords(r))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||n<l)this._saveUrlAsNewResource(i,t,o,s);else if(n===l&&e){const n=I(e,a);p(n)?this._saveUrlAsNewResource(i,t,o,s):i[t]=n}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return D(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,i)=>{const t=n(this.sublayerIdsCache,i,()=>new Set);e.members?.forEach(e=>{t.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),n(this.sublayerIdsCache,e,()=>new Set);const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await T(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?o.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||o.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&o.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())n(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],O.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],O.prototype,"definitionSetMap",void 0),e([x("definitionSetMap")],O.prototype,"readDefinitionSetMap",null),e([E("definitionSetMap")],O.prototype,"writeDefinitionSetMap",null),e([m()],O.prototype,"inclusionModeDefinition",null),e([m()],O.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(M),json:{write:{ignoreOrigin:!0}}})],O.prototype,"layers",void 0),e([m()],O.prototype,"memberEntityTypes",void 0),e([m()],O.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],O.prototype,"operationalLayerType",void 0),e([m()],O.prototype,"sublayerCapabilities",null),e([m()],O.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(M),json:{write:{ignoreOrigin:!0}}})],O.prototype,"tables",void 0),e([m({json:{read:!1}})],O.prototype,"type",void 0),e([m(G)],O.prototype,"url",void 0),O=e([u("esri.layers.KnowledgeGraphLayer")],O);const R=O;async function K(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function U(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{R as default};
5
+ import{__decorate as e}from"tslib";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as d,sync as h}from"../core/reactiveUtils.js";import{isAbsolute as p,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as u,subclass as m}from"../core/accessorSupport/decorators.js";import{idToName as f,nameToId as g}from"../core/accessorSupport/PropertyOrigin.js";import w from"./Layer.js";import{KnowledgeGraphLayerDataManager as b}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import M from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as T,getUserKGSPrivileges as D,createCapabilitiesFromKnowledgeGraph as _}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as v}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{PortalLayer as j}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as G}from"./mixins/ScaleRangeLayer.js";import{url as I}from"./support/commonProperties.js";import{fetchKnowledgeGraph as N}from"../rest/knowledgeGraphService.js";import{f as A,t as E}from"../chunks/persistableUrlUtils.js";import{reader as x}from"../core/accessorSupport/decorators/reader.js";import{writer as O}from"../core/accessorSupport/decorators/writer.js";let R=class extends(L(G(C(S(k(j(r(v(w))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(M)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(M)),this.type="knowledge-graph",this.url=null,this.addHandles(d(()=>this.layers.concat(this.tables),(e,i)=>this._handleSublayersChange(e,i),h))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){l(i)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await T(this)}async _fetchMetadata(e){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const i=await N(this.url);this.knowledgeGraph=i;const{edit:t,fullEdit:a,updateItem:n}=await D(i.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",n),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new b({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await i(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,f(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))});else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(i=>{e(i)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));o(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await T(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach(e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new M({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach(i=>{i.parentCompositeLayer=this;const t=e.find(e=>e.type===i.graphType&&e.name===i.graphTypeName);t&&(i.objectType=t,this._updateSublayerCaches(t))})}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a){e[i]="<pending>",t.pendingOperations.push(P(this.inclusionModeDefinition).then(s=>{const n=U(a);e[i]=n.itemRelativeUrl,t.toAdd.push({resource:n,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,i,t){return A(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,n=a?.resources,o=g(a?.origin);if(!s||!n||null==o)return void(e&&(i[t]=E(e,a)));const{inclusionModeDefinition:r}=this;if(!r||this._displaysAllRecords(r))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||o<l)this._saveUrlAsNewResource(i,t,n,s);else if(o===l&&e){const o=E(e,a);p(o)?this._saveUrlAsNewResource(i,t,n,s):i[t]=o}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):n.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return _(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,i)=>{const t=o(this.sublayerIdsCache,i,()=>new Set);e.members?.forEach(e=>{t.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,()=>new Set);const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await T(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?n.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||n.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())o(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([u()],R.prototype,"dataManager",void 0),e([u({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],R.prototype,"definitionSetMap",void 0),e([x("definitionSetMap")],R.prototype,"readDefinitionSetMap",null),e([O("definitionSetMap")],R.prototype,"writeDefinitionSetMap",null),e([u()],R.prototype,"inclusionModeDefinition",null),e([u()],R.prototype,"knowledgeGraph",void 0),e([u({type:a.ofType(M),json:{write:{ignoreOrigin:!0}}})],R.prototype,"layers",void 0),e([u()],R.prototype,"memberEntityTypes",void 0),e([u()],R.prototype,"memberRelationshipTypes",void 0),e([u({type:["KnowledgeGraphLayer"]})],R.prototype,"operationalLayerType",void 0),e([u()],R.prototype,"sublayerCapabilities",null),e([u()],R.prototype,"sublayerIdsCache",void 0),e([u({type:a.ofType(M),json:{write:{ignoreOrigin:!0}}})],R.prototype,"tables",void 0),e([u({json:{read:!1}})],R.prototype,"type",void 0),e([u(I)],R.prototype,"url",void 0),R=e([m("esri.layers.KnowledgeGraphLayer")],R);const K=R;async function P(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function U(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{K as default};