@arcgis/core 4.31.0-next.20240612 → 4.31.0-next.20240614
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.
- package/UndoRedo.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{97ede2198c6d1cbc02b7.js → 13c07e4f298ff27ef5a2.js} +1 -1
- package/assets/esri/core/workers/chunks/1d585f1f90dec39ab9d6.js +1 -0
- package/assets/esri/core/workers/chunks/{82f982d9dde0ab137403.js → 339929c10fa8366b1615.js} +1 -1
- package/assets/esri/core/workers/chunks/5925e26c488a416223f8.js +1 -0
- package/assets/esri/core/workers/chunks/{de21dffe546dd45dd1fb.js → 7fd9134246a9dbfa603b.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe59b594d2d8c536e649.js → a4a1c3943324963ebae4.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b4c91833fb7b99c6cfe.js → ad0a87dba95785ad6171.js} +1 -1
- package/assets/esri/core/workers/chunks/d3aa4dfcccfd8d47b445.js +1 -0
- package/assets/esri/core/workers/chunks/e331618aecdc2f110e15.js +1 -0
- package/assets/esri/core/workers/chunks/fc02cdf12252c9f3d814.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +0 -4
- package/assets/esri/themes/base/widgets/_SnappingControls.scss +5 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/ShadowHighlight.glsl.js +4 -29
- package/chunks/Viewshed.glsl.js +145 -84
- package/grids/MeasuredGrid.js +5 -0
- package/interfaces.d.ts +481 -721
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/DictionaryRenderer.js +1 -1
- package/renderers/HeatmapRenderer.js +1 -1
- package/renderers/PieChartRenderer.js +1 -1
- package/renderers/SimpleRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/knowledgeGraph/GraphApplyEdits.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/AttachmentQuery.js +1 -1
- package/rest/support/BufferParameters.js +1 -1
- package/rest/support/DensifyParameters.js +1 -1
- package/rest/support/DirectionsFeature.js +1 -1
- package/rest/support/DistanceParameters.js +1 -1
- package/rest/support/geometryOperationLengthUnit.js +5 -0
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/undoredo/support/ServiceVersionInfo.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/GridView2D.js +5 -0
- package/views/2d/engine/webgl/shaders/GridPrograms.js +5 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/support/clusterUtils.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js +23 -0
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechniqueConfiguration.js +5 -0
- package/views/MapView.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/css.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
- package/widgets/support/SnappingControls/SnappingListItem.js +1 -1
- package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/1a64e0020d12c251ad4b.js +0 -1
- package/assets/esri/core/workers/chunks/38b6e897150b627c8228.js +0 -1
- package/assets/esri/core/workers/chunks/665f50803ad595e38f84.js +0 -1
- package/assets/esri/core/workers/chunks/a8a19e5a7ae4ec16480a.js +0 -1
- package/assets/esri/core/workers/chunks/dc48bb481020ceb05a16.js +0 -1
package/UndoRedo.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/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"./chunks/tslib.es6.js";import s from"./core/Accessor.js";import i from"./core/Collection.js";import{whenOnce as o}from"./core/reactiveUtils.js";import{property as a}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/Logger.js";import"./core/RandomLCG.js";import{subclass as e}from"./core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as n}from"./core/support/UpdatingHandles.js";import{OperationStatus as r}from"./undoredo/OperationStatus.js";import{UndoRedoExecutionMethod as c}from"./undoredo/UndoableOperation.js";import{UndoInvalidError as d,UndoRedoUpdatingError as h,RedoInvalidError as p}from"./undoredo/UndoRedoError.js";let u=class extends s{constructor(){super(...arguments),this._stack=new i,this._stackPosition=-1,this._updatingHandles=new n}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPosition<this._stack.length-1}_truncateForwardStack(){this._stack.splice(this._stackPosition+1,this._stack.length-this._stackPosition).forEach((t=>t.destroy()))}_drainStack(){this._stack.drain((t=>t.destroy())),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new d;if(this.updating)throw new h;const t=this._stack.getItemAt(this._stackPosition);await this._updatingHandles.addPromise((async()=>{await t.executeUndoRedoOperation(c.Undo),--this._stackPosition,t.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new p;if(this.updating)throw new h;const t=this._stack.getItemAt(this._stackPosition+1);await this._updatingHandles.addPromise((async()=>{await t.executeUndoRedoOperation(c.Redo),++this._stackPosition})())}async inject(t){if(this.updating)throw new h;await this._updatingHandles.addPromise((async()=>{t.status===r.NeverApplied&&await t.executeUndoRedoOperation(c.Apply),t.canUndo?(this._stack.splice(this._stackPosition+1,0,t),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach((t=>t.destroy())),this._stackPosition=-1)})())}async add(t){if(this.updating)throw new h;await this._updatingHandles.addPromise((async()=>{t.status===r.NeverApplied&&await t.executeUndoRedoOperation(c.Apply),this._stackPosition
|
|
5
|
+
import{_ as t}from"./chunks/tslib.es6.js";import s from"./core/Accessor.js";import i from"./core/Collection.js";import{whenOnce as o}from"./core/reactiveUtils.js";import{property as a}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/Logger.js";import"./core/RandomLCG.js";import{subclass as e}from"./core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as n}from"./core/support/UpdatingHandles.js";import{OperationStatus as r}from"./undoredo/OperationStatus.js";import{UndoRedoExecutionMethod as c}from"./undoredo/UndoableOperation.js";import{UndoInvalidError as d,UndoRedoUpdatingError as h,RedoInvalidError as p}from"./undoredo/UndoRedoError.js";let u=class extends s{constructor(){super(...arguments),this._stack=new i,this._stackPosition=-1,this._updatingHandles=new n}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPosition<this._stack.length-1}_truncateForwardStack(){this._stack.splice(this._stackPosition+1,this._stack.length-this._stackPosition).forEach((t=>t.destroy()))}_drainStack(){this._stack.drain((t=>t.destroy())),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new d;if(this.updating)throw new h;const t=this._stack.getItemAt(this._stackPosition);await this._updatingHandles.addPromise((async()=>{await t.executeUndoRedoOperation(c.Undo),--this._stackPosition,t.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new p;if(this.updating)throw new h;const t=this._stack.getItemAt(this._stackPosition+1);await this._updatingHandles.addPromise((async()=>{await t.executeUndoRedoOperation(c.Redo),++this._stackPosition})())}peekUndo(){return this.canUndo?this._stack.getItemAt(this._stackPosition):null}peekRedo(){return this.canRedo?this._stack.getItemAt(this._stackPosition+1):null}async inject(t){if(this.updating)throw new h;await this._updatingHandles.addPromise((async()=>{t.status===r.NeverApplied&&await t.executeUndoRedoOperation(c.Apply),t.canUndo?(this._stack.splice(this._stackPosition+1,0,t),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach((t=>t.destroy())),this._stackPosition=-1)})())}async add(t){if(this.updating)throw new h;await this._updatingHandles.addPromise((async()=>{t.status===r.NeverApplied&&await t.executeUndoRedoOperation(c.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),t.canUndo?(this._stack.push(t),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(t,s=!1){if(this.updating&&!s)return;await o((()=>!this.updating));const a=new i;for(let i=0;i<this._stack.length;i++){const s=this._stack.getItemAt(i);s.tag===t?(s.destroy(),i===this._stackPosition&&(this._stackPosition=a.length-1)):a.push(s)}this._stack=a,this._stackPosition>a.length-1&&(this._stackPosition=a.length-1)}async clear(t=!1){if(this.updating&&!t)throw new h;await o((()=>!this.updating)),this._drainStack()}};t([a()],u.prototype,"_stack",void 0),t([a()],u.prototype,"_stackPosition",void 0),t([a()],u.prototype,"updating",null),t([a({readOnly:!0})],u.prototype,"canUndo",null),t([a({readOnly:!0})],u.prototype,"hasUndo",null),t([a({readOnly:!0})],u.prototype,"canRedo",null),t([a({readOnly:!0})],u.prototype,"hasRedo",null),u=t([e("esri.UndoRedo")],u);export{u as UndoRedo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../ArcadePortal.js";import e from"../Attachment.js";import r from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as a}from"../executionError.js";import{H as o,j as i,P as u,g as s,B as l,K as d,h as p,t as c,o as f,q as h,T as y,r as m,U as g,N as A,V as w,W as I,X as v,Y as U,c as b,Z as j,k as x,m as N,n as P,a as F,b as T,i as C,u as O,s as k}from"../../chunks/languageUtils.js";import{layerFieldEsriConstants as L}from"../featureset/support/shared.js";import{convertDirection as S}from"./convertdirection.js";import{XXH as z}from"./hash.js";import{hasSamePortal as D}from"../../core/urlUtils.js";import{generateUUID as R}from"../../core/uuid.js";import H from"../../geometry/Extent.js";import M from"../../geometry/Multipoint.js";import V from"../../geometry/Point.js";import W from"../../geometry/Polygon.js";import J from"../../geometry/Polyline.js";import B from"../../geometry/SpatialReference.js";import Z from"../../portal/Portal.js";function E(t){if("loaded"===t.loadStatus&&t.user?.sourceJSON){return t.user.sourceJSON}return null}function q(t,e){return!!t&&D(t,e?.restUrl||"")}function K(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function X(o,i,u){if(null!==o)if(f(o)){if(i.updateUint8Array([61]),u.map.has(o)){const t=u.map.get(o);i.updateIntArray([61237541^t])}else{u.map.set(o,u.currentLength++);for(const t of o)X(t,i,u);u.map.delete(o),u.currentLength--}i.updateUint8Array([199])}else if(h(o)){if(i.updateUint8Array([61]),u.map.has(o)){const t=u.map.get(o);i.updateIntArray([61237541^t])}else{u.map.set(o,u.currentLength++);for(const t of o.toArray())X(t,i,u);u.map.delete(o),u.currentLength--}i.updateUint8Array([199])}else{if(x(o))return i.updateIntArray([o.toNumber()]),void i.updateUint8Array([241]);if(N(o))return i.updateIntArray([o.toNumber()]),void i.updateIntArray([257]);if(P(o))return i.updateIntArray([o.toNumber()]),void i.updateIntArray([263]);if(b(o))return i.updateIntArray([o.length]),i.updateWithString(o),void i.updateUint8Array([41]);if(F(o))i.updateUint8Array([!0===o?1:0,113]);else{if(T(o))return i.updateFloatArray([o]),void i.updateUint8Array([173]);if(o instanceof e)throw new n(u.context,a.UnsupportedHashType,u.node);if(o instanceof t)throw new n(u.context,a.UnsupportedHashType,u.node);if(!(o instanceof r)){if(m(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(o instanceof V)return i.updateIntArray([3833836621]),i.updateIntArray([0]),i.updateFloatArray([o.x]),i.updateIntArray([1]),i.updateFloatArray([o.y]),o.hasZ&&(i.updateIntArray([2]),i.updateFloatArray([o.z])),o.hasM&&(i.updateIntArray([3]),i.updateFloatArray([o.m])),i.updateIntArray([3765347959]),void X(o.spatialReference.wkid,i,u);if(o instanceof W){i.updateIntArray([1266616829]);for(let t=0;t<o.rings.length;t++){const e=o.rings[t],r=[];let n=null,a=null;for(let i=0;i<e.length;i++){const u=o.getPoint(t,i);if(0===i)n=u;else if(K(a,u))continue;a=u,i===e.length-1&&K(n,u)||r.push(u)}i.updateIntArray([1397116793,r.length]);for(let t=0;t<r.length;t++){const e=r[t];i.updateIntArray([3962308117,t]),X(e,i,u),i.updateIntArray([2716288009])}i.updateIntArray([2278822459])}return i.updateIntArray([3878477243]),void X(o.spatialReference.wkid,i,u)}if(o instanceof J){i.updateIntArray([4106883559]);for(let t=0;t<o.paths.length;t++){const e=o.paths[t];i.updateIntArray([1397116793,e.length]);for(let r=0;r<e.length;r++)i.updateIntArray([3962308117,r]),X(o.getPoint(t,r),i,u),i.updateIntArray([2716288009]);i.updateIntArray([2278822459])}return i.updateIntArray([2568784753]),void X(o.spatialReference.wkid,i,u)}if(o instanceof M){i.updateIntArray([588535921,o.points.length]);for(let t=0;t<o.points.length;t++){const e=o.getPoint(t);i.updateIntArray([t]),X(e,i,u)}return i.updateIntArray([1700171621]),void X(o.spatialReference.wkid,i,u)}if(o instanceof H)return i.updateIntArray([3483648373]),i.updateIntArray([0]),i.updateFloatArray([o.xmax]),i.updateIntArray([1]),i.updateFloatArray([o.xmin]),i.updateIntArray([2]),i.updateFloatArray([o.ymax]),i.updateIntArray([3]),i.updateFloatArray([o.ymin]),o.hasZ&&(i.updateIntArray([4]),i.updateFloatArray([o.zmax]),i.updateIntArray([5]),i.updateFloatArray([o.zmin])),o.hasM&&(i.updateIntArray([6]),i.updateFloatArray([o.mmax]),i.updateIntArray([7]),i.updateFloatArray([o.mmin])),i.updateIntArray([3622027469]),void X(o.spatialReference.wkid,i,u);if(o instanceof B)return i.updateIntArray([14]),void 0!==o.wkid&&null!==o.wkid&&i.updateIntArray([o.wkid]),o.wkt&&i.updateWithString(o.wkt),void(o.wkt2&&i.updateWithString(o.wkt2));if(C(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(O(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(k(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(o===l)throw new n(u.context,a.UnsupportedHashType,u.node);throw new n(u.context,a.UnsupportedHashType,u.node)}if(i.updateUint8Array([223]),u.map.has(o)){const t=u.map.get(o);i.updateIntArray([61237541^t])}else{u.map.set(o,u.currentLength++);for(const t of o.keys()){i.updateIntArray([t.length]),i.updateWithString(t),i.updateUint8Array([251]);X(o.field(t),i,u),i.updateUint8Array([239])}u.map.delete(o),u.currentLength--}i.updateUint8Array([73])}}else i.updateUint8Array([0,139])}function Y(e,x){e.portal=function(e,r){return x(e,r,((n,a,u)=>(o(u,1,1,e,r),new t(i(u[0])))))},e.typeof=function(t,e){return x(t,e,((r,i,s)=>{o(s,1,1,t,e);const l=u(s[0]);if("Unrecognized Type"===l)throw new n(t,a.UnrecognizedType,e);return l}))},e.trim=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,1,t,e),i(a[0]).trim())))},e.tohex=function(t,e){return x(t,e,((r,n,a)=>{o(a,1,1,t,e);const i=s(a[0]);return isNaN(i)?i:i.toString(16)}))},e.upper=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,1,t,e),i(a[0]).toUpperCase())))},e.proper=function(t,e){return x(t,e,((r,n,a)=>{o(a,1,2,t,e);let u=1;2===a.length&&"firstword"===i(a[1]).toLowerCase()&&(u=2);const s=/\s/,l=i(a[0]);let d="",p=!0;for(let t=0;t<l.length;t++){let e=l[t];if(s.test(e))1===u&&(p=!0);else{e.toUpperCase()!==e.toLowerCase()&&(p?(e=e.toUpperCase(),p=!1):e=e.toLowerCase())}d+=e}return d}))},e.lower=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,1,t,e),i(a[0]).toLowerCase())))},e.guid=function(t,e){return x(t,e,((r,n,a)=>{if(o(a,0,1,t,e),a.length>0)switch(i(a[0]).toLowerCase()){case"digits":return R().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return R();case"digits-hyphen-braces":return"{"+R()+"}";case"digits-hyphen-parentheses":return"("+R()+")"}return"{"+R()+"}"}))},e.standardizeguid=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,2,t,e);let u=i(a[0]);if(""===u||null===u)return"";const s=/^(\{|\()?(?<partA>[0-9a-z]{8})(-?)(?<partB>[0-9a-z]{4})(-?)(?<partC>[0-9a-z]{4})(-?)(?<partD>[0-9a-z]{4})(-?)(?<partE>[0-9a-z]{12})(\}|\))?$/gim.exec(u);if(!s)return"";const l=s.groups;switch(u=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,i(a[1]).toLowerCase()){case"digits":return u.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return u;case"digits-hyphen-braces":return"{"+u+"}";case"digits-hyphen-parentheses":return"("+u+")"}return"{"+u+"}"}))},e.console=function(t,e){return x(t,e,((e,r,n)=>(0===n.length||(1===n.length?t.console(i(n[0])):t.console(i(n))),l)))},e.mid=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,3,t,e);let u=s(a[1]);if(isNaN(u))return"";if(u<0&&(u=0),2===a.length)return i(a[0]).substring(u);let l=s(a[2]);return isNaN(l)?"":(l<0&&(l=0),i(a[0]).substring(u,u+l))}))},e.find=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,3,t,e);let u=0;if(a.length>2){if(u=s(d(a[2],0)),isNaN(u))return-1;u<0&&(u=0)}return i(a[1]).indexOf(i(a[0]),u)}))},e.left=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,2,t,e);let u=s(a[1]);return isNaN(u)?"":(u<0&&(u=0),i(a[0]).substring(0,u))}))},e.right=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,2,t,e);let u=s(a[1]);if(isNaN(u))return"";u<0&&(u=0);return i(a[0]).slice(-u)}))},e.split=function(t,e){return x(t,e,((r,n,a)=>{let u;o(a,2,4,t,e);let l=s(d(a[2],-1));const c=p(d(a[3],!1));if(-1===l||null===l||!0===c?u=i(a[0]).split(i(a[1])):(isNaN(l)&&(l=-1),l<-1&&(l=-1),u=i(a[0]).split(i(a[1]),l)),!1===c)return u;const f=[];for(let t=0;t<u.length&&!(-1!==l&&f.length>=l);t++)""!==u[t]&&void 0!==u[t]&&f.push(u[t]);return f}))},e.text=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,2,t,e),c(a[0],a[1]))))},e.concatenate=function(t,e){return x(t,e,((t,e,r)=>{const n=[];if(r.length<1)return"";if(f(r[0])){const t=d(r[2],"");for(let e=0;e<r[0].length;e++)n[e]=c(r[0][e],t);return r.length>1?n.join(r[1]):n.join("")}if(h(r[0])){const t=d(r[2],"");for(let e=0;e<r[0].length();e++)n[e]=c(r[0].get(e),t);return r.length>1?n.join(r[1]):n.join("")}for(let a=0;a<r.length;a++)n[a]=c(r[a]);return n.join("")}))},e.reverse=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),f(u[0])){const t=u[0].slice(0);return t.reverse(),t}if(h(u[0])){const t=u[0].toArray().slice(0);return t.reverse(),t}throw new n(t,a.InvalidParameter,e)}))},e.replace=function(t,e){return x(t,e,((r,n,a)=>{o(a,3,4,t,e);const u=i(a[0]),s=i(a[1]),l=i(a[2]);return 4!==a.length||p(a[3])?y(u,s,l):u.replace(s,l)}))},e.schema=function(t,e){return x(t,e,((o,i,u)=>{if(m(u[0])){const e=g(u[0]);return e?r.convertObjectToArcadeDictionary(e,A(t)):null}throw new n(t,a.InvalidParameter,e)}))},e.subtypes=function(t,e){return x(t,e,((i,u,s)=>{if(o(s,1,1,t,e),m(s[0])){const e=w(s[0]);return e?r.convertObjectToArcadeDictionary(e,A(t)):null}throw new n(t,a.InvalidParameter,e)}))},e.subtypecode=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),m(u[0])){const t=w(u[0]);if(!t)return null;if(t.subtypeField&&u[0].hasField(t.subtypeField)){const e=u[0].field(t.subtypeField);for(const r of t.subtypes)if(r.code===e)return r.code;return null}return null}throw new n(t,a.InvalidParameter,e)}))},e.subtypename=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),m(u[0])){const t=w(u[0]);if(!t)return"";if(t.subtypeField&&u[0].hasField(t.subtypeField)){const e=u[0].field(t.subtypeField);for(const r of t.subtypes)if(r.code===e)return r.name;return""}return""}throw new n(t,a.InvalidParameter,e)}))},e.gdbversion=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),m(u[0]))return u[0].gdbVersion();throw new n(t,a.InvalidParameter,e)}))},e.domain=function(t,e){return x(t,e,((u,s,l)=>{if(o(l,2,3,t,e),m(l[0])){const e=I(l[0],i(l[1]),void 0===l[2]?void 0:l[2]);return e&&e.domain?"coded-value"===e.domain.type||"codedValue"===e.domain.type?r.convertObjectToArcadeDictionary({type:"codedValue",name:e.domain.name,dataType:L[e.field.type],codedValues:e.domain.codedValues.map((t=>({name:t.name,code:t.code})))},A(t)):r.convertObjectToArcadeDictionary({type:"range",name:e.domain.name,dataType:L[e.field.type],min:e.domain.minValue,max:e.domain.maxValue},A(t)):null}throw new n(t,a.InvalidParameter,e)}))},e.domainname=function(t,e){return x(t,e,((r,u,s)=>{if(o(s,2,4,t,e),m(s[0]))return v(s[0],i(s[1]),s[2],void 0===s[3]?void 0:s[3]);throw new n(t,a.InvalidParameter,e)}))},e.domaincode=function(t,e){return x(t,e,((r,u,s)=>{if(o(s,2,4,t,e),m(s[0]))return U(s[0],i(s[1]),s[2],void 0===s[3]?void 0:s[3]);throw new n(t,a.InvalidParameter,e)}))},e.urlencode=function(t,e){return x(t,e,((n,a,u)=>{if(o(u,1,1,t,e),null===u[0])return"";if(u[0]instanceof r){let t="";for(const e of u[0].keys()){const r=u[0].field(e);""!==t&&(t+="&"),t+=null===r?encodeURIComponent(e)+"=":encodeURIComponent(e)+"="+encodeURIComponent(r)}return t}return encodeURIComponent(i(u[0]))}))},e.hash=function(t,e){return x(t,e,((r,n,a)=>{o(a,1,1,t,e);const i=new z(0);return X(a[0],i,{context:t,node:e,map:new Map,currentLength:0}),i.digest()}))},e.convertdirection=function(t,e){return x(t,e,((r,n,a)=>(o(a,3,3,t,e),S(a[0],a[1],a[2]))))},e.fromjson=function(t,e){return x(t,e,((u,s,l)=>{if(o(l,1,1,t,e),!1===b(l[0]))throw new n(t,a.InvalidParameter,e);return r.convertJsonToArcade(JSON.parse(i(l[0])),A(t))}))},e.expects=function(t,e){return x(t,e,((r,o,i)=>{if(i.length<1)throw new n(t,a.WrongNumberOfParameters,e);return l}))},e.tocharcode=function(t,e){return x(t,e,((r,u,l)=>{o(l,1,2,t,e);const p=s(d(l[1],0)),c=i(l[0]);if(0===c.length&&1===l.length)return null;if(c.length<=p||p<0)throw new n(t,a.OutOfBounds,e);return c.charCodeAt(p)}))},e.tocodepoint=function(t,e){return x(t,e,((r,u,l)=>{o(l,1,2,t,e);const p=s(d(l[1],0)),c=i(l[0]);if(0===c.length&&1===l.length)return null;if(c.length<=p||p<0)throw new n(t,a.OutOfBounds,e);return c.codePointAt(p)}))},e.fromcharcode=function(t,e){return x(t,e,((r,o,i)=>{if(i.length<1)throw new n(t,a.WrongNumberOfParameters,e);const u=i.map((t=>Math.trunc(s(t)))).filter((t=>t>=0&&t<=65535));return 0===u.length?null:String.fromCharCode.apply(null,u)}))},e.fromcodepoint=function(t,e){return x(t,e,((r,o,i)=>{if(i.length<1)throw new n(t,a.WrongNumberOfParameters,e);let u;try{u=i.map((t=>Math.trunc(s(t)))).filter((t=>t<=1114111&&t>>>0===t))}catch(l){return null}return 0===u.length?null:String.fromCodePoint.apply(null,u)}))},e.getuser=function(e,u){return x(e,u,((s,l,p)=>{o(p,0,2,e,u);let c=d(p[1],"");if(c=!0===c||!1===c?"":i(c),null!==c&&""!==c)return null;if(0===p.length||p[0]instanceof t){let t=null;if(t=e.services?.portal?e.services.portal:Z.getDefault(),p.length>0){if(!q(p[0].field("url"),t))return null}if(!t)return null;if(""===c){const n=E(t);if(n){const t=JSON.parse(JSON.stringify(n));for(const e of["lastLogin","created","modified"])void 0!==t[e]&&null!==t[e]&&(t[e]=new Date(t[e]));return r.convertObjectToArcadeDictionary(t,A(e))}}return null}throw new n(e,a.InvalidParameter,u)}))},e.getenvironment=function(t,e){return x(t,e,((n,a,i)=>(o(i,0,0,t,e),r.convertObjectToArcadeDictionary(j(A(t),t.spatialReference),A(t),!0))))}}export{Y as registerFunctions};
|
|
5
|
+
import t from"../ArcadePortal.js";import e from"../Attachment.js";import r from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as a}from"../executionError.js";import{H as o,j as i,P as u,g as s,B as l,K as d,h as p,t as c,o as f,q as h,T as y,r as m,U as g,N as A,V as w,W as I,X as v,Y as U,c as b,Z as j,k as x,m as N,n as P,a as F,b as T,i as C,u as O,s as k}from"../../chunks/languageUtils.js";import{layerFieldEsriConstants as L}from"../featureset/support/shared.js";import{convertDirection as S}from"./convertdirection.js";import{XXH as z}from"./hash.js";import{hasSamePortal as D}from"../../core/urlUtils.js";import{generateUUID as R}from"../../core/uuid.js";import H from"../../geometry/Extent.js";import M from"../../geometry/Multipoint.js";import V from"../../geometry/Point.js";import W from"../../geometry/Polygon.js";import J from"../../geometry/Polyline.js";import B from"../../geometry/SpatialReference.js";import Z from"../../portal/Portal.js";function E(t){if("loaded"===t.loadStatus&&t.user?.sourceJSON){return t.user.sourceJSON}return null}function q(t,e){return!!t&&D(t,e?.restUrl||"")}function K(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function X(o,i,u){if(null!==o)if(f(o)){if(i.updateUint8Array([61]),u.map.has(o)){const t=u.map.get(o);i.updateIntArray([61237541^t])}else{u.map.set(o,u.currentLength++);for(const t of o)X(t,i,u);u.map.delete(o),u.currentLength--}i.updateUint8Array([199])}else if(h(o)){if(i.updateUint8Array([61]),u.map.has(o)){const t=u.map.get(o);i.updateIntArray([61237541^t])}else{u.map.set(o,u.currentLength++);for(const t of o.toArray())X(t,i,u);u.map.delete(o),u.currentLength--}i.updateUint8Array([199])}else{if(x(o))return i.updateIntArray([o.toNumber()]),void i.updateUint8Array([241]);if(N(o))return i.updateIntArray([o.toNumber()]),void i.updateIntArray([257]);if(P(o))return i.updateIntArray([o.toNumber()]),void i.updateIntArray([263]);if(b(o))return i.updateIntArray([o.length]),i.updateWithString(o),void i.updateUint8Array([41]);if(F(o))i.updateUint8Array([!0===o?1:0,113]);else{if(T(o))return i.updateFloatArray([o]),void i.updateUint8Array([173]);if(o instanceof e)throw new n(u.context,a.UnsupportedHashType,u.node);if(o instanceof t)throw new n(u.context,a.UnsupportedHashType,u.node);if(!(o instanceof r)){if(m(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(o instanceof V)return i.updateIntArray([3833836621]),i.updateIntArray([0]),i.updateFloatArray([o.x]),i.updateIntArray([1]),i.updateFloatArray([o.y]),o.hasZ&&(i.updateIntArray([2]),i.updateFloatArray([o.z])),o.hasM&&(i.updateIntArray([3]),i.updateFloatArray([o.m])),i.updateIntArray([3765347959]),void X(o.spatialReference.wkid,i,u);if(o instanceof W){i.updateIntArray([1266616829]);for(let t=0;t<o.rings.length;t++){const e=o.rings[t],r=[];let n=null,a=null;for(let i=0;i<e.length;i++){const u=o.getPoint(t,i);if(0===i)n=u;else if(K(a,u))continue;a=u,i===e.length-1&&K(n,u)||r.push(u)}i.updateIntArray([1397116793,r.length]);for(let t=0;t<r.length;t++){const e=r[t];i.updateIntArray([3962308117,t]),X(e,i,u),i.updateIntArray([2716288009])}i.updateIntArray([2278822459])}return i.updateIntArray([3878477243]),void X(o.spatialReference.wkid,i,u)}if(o instanceof J){i.updateIntArray([4106883559]);for(let t=0;t<o.paths.length;t++){const e=o.paths[t];i.updateIntArray([1397116793,e.length]);for(let r=0;r<e.length;r++)i.updateIntArray([3962308117,r]),X(o.getPoint(t,r),i,u),i.updateIntArray([2716288009]);i.updateIntArray([2278822459])}return i.updateIntArray([2568784753]),void X(o.spatialReference.wkid,i,u)}if(o instanceof M){i.updateIntArray([588535921,o.points.length]);for(let t=0;t<o.points.length;t++){const e=o.getPoint(t);i.updateIntArray([t]),X(e,i,u)}return i.updateIntArray([1700171621]),void X(o.spatialReference.wkid,i,u)}if(o instanceof H)return i.updateIntArray([3483648373]),i.updateIntArray([0]),i.updateFloatArray([o.xmax]),i.updateIntArray([1]),i.updateFloatArray([o.xmin]),i.updateIntArray([2]),i.updateFloatArray([o.ymax]),i.updateIntArray([3]),i.updateFloatArray([o.ymin]),o.hasZ&&(i.updateIntArray([4]),i.updateFloatArray([o.zmax]),i.updateIntArray([5]),i.updateFloatArray([o.zmin])),o.hasM&&(i.updateIntArray([6]),i.updateFloatArray([o.mmax]),i.updateIntArray([7]),i.updateFloatArray([o.mmin])),i.updateIntArray([3622027469]),void X(o.spatialReference.wkid,i,u);if(o instanceof B)return i.updateIntArray([14]),void 0!==o.wkid&&null!==o.wkid&&i.updateIntArray([o.wkid]),o.wkt&&i.updateWithString(o.wkt),void(o.wkt2&&i.updateWithString(o.wkt2));if(C(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(O(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(k(o))throw new n(u.context,a.UnsupportedHashType,u.node);if(o===l)throw new n(u.context,a.UnsupportedHashType,u.node);throw new n(u.context,a.UnsupportedHashType,u.node)}if(i.updateUint8Array([223]),u.map.has(o)){const t=u.map.get(o);i.updateIntArray([61237541^t])}else{u.map.set(o,u.currentLength++);for(const t of o.keys()){i.updateIntArray([t.length]),i.updateWithString(t),i.updateUint8Array([251]);X(o.field(t),i,u),i.updateUint8Array([239])}u.map.delete(o),u.currentLength--}i.updateUint8Array([73])}}else i.updateUint8Array([0,139])}function Y(e,x){e.portal=function(e,r){return x(e,r,((n,a,u)=>(o(u,1,1,e,r),new t(i(u[0])))))},e.typeof=function(t,e){return x(t,e,((r,i,s)=>{o(s,1,1,t,e);const l=u(s[0]);if("Unrecognized Type"===l)throw new n(t,a.UnrecognizedType,e);return l}))},e.trim=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,1,t,e),i(a[0]).trim())))},e.tohex=function(t,e){return x(t,e,((r,n,a)=>{o(a,1,1,t,e);const i=s(a[0]);return isNaN(i)?i:i.toString(16)}))},e.upper=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,1,t,e),i(a[0]).toUpperCase())))},e.proper=function(t,e){return x(t,e,((r,n,a)=>{o(a,1,2,t,e);let u=1;2===a.length&&"firstword"===i(a[1]).toLowerCase()&&(u=2);const s=/\s/,l=i(a[0]);let d="",p=!0;for(let t=0;t<l.length;t++){let e=l[t];if(s.test(e))1===u&&(p=!0);else{e.toUpperCase()!==e.toLowerCase()&&(p?(e=e.toUpperCase(),p=!1):e=e.toLowerCase())}d+=e}return d}))},e.lower=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,1,t,e),i(a[0]).toLowerCase())))},e.guid=function(t,e){return x(t,e,((r,n,a)=>{if(o(a,0,1,t,e),a.length>0)switch(i(a[0]).toLowerCase()){case"digits":return R().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return R();case"digits-hyphen-braces":return"{"+R()+"}";case"digits-hyphen-parentheses":return"("+R()+")"}return"{"+R()+"}"}))},e.standardizeguid=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,2,t,e);let u=i(a[0]);if(""===u||null===u)return"";const s=/^(\{|\()?(?<partA>[0-9a-z]{8})(-?)(?<partB>[0-9a-z]{4})(-?)(?<partC>[0-9a-z]{4})(-?)(?<partD>[0-9a-z]{4})(-?)(?<partE>[0-9a-z]{12})(\}|\))?$/gim.exec(u);if(!s)return"";const l=s.groups;switch(u=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,i(a[1]).toLowerCase()){case"digits":return u.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return u;case"digits-hyphen-braces":return"{"+u+"}";case"digits-hyphen-parentheses":return"("+u+")"}return"{"+u+"}"}))},e.console=function(t,e){return x(t,e,((e,r,n)=>(0===n.length||(1===n.length?t.console(i(n[0])):t.console(i(n))),l)))},e.mid=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,3,t,e);let u=s(a[1]);if(isNaN(u))return"";if(u<0&&(u=0),2===a.length)return i(a[0]).substring(u);let l=s(a[2]);return isNaN(l)?"":(l<0&&(l=0),i(a[0]).substring(u,u+l))}))},e.find=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,3,t,e);let u=0;if(a.length>2){if(u=s(d(a[2],0)),isNaN(u))return-1;u<0&&(u=0)}return i(a[1]).indexOf(i(a[0]),u)}))},e.left=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,2,t,e);let u=s(a[1]);return isNaN(u)?"":(u<0&&(u=0),i(a[0]).substring(0,u))}))},e.right=function(t,e){return x(t,e,((r,n,a)=>{o(a,2,2,t,e);const u=s(a[1]);if(isNaN(u)||u<=0)return"";return i(a[0]).slice(-u)}))},e.split=function(t,e){return x(t,e,((r,n,a)=>{let u;o(a,2,4,t,e);let l=s(d(a[2],-1));const c=p(d(a[3],!1));if(-1===l||null===l||!0===c?u=i(a[0]).split(i(a[1])):(isNaN(l)&&(l=-1),l<-1&&(l=-1),u=i(a[0]).split(i(a[1]),l)),!1===c)return u;const f=[];for(let t=0;t<u.length&&!(-1!==l&&f.length>=l);t++)""!==u[t]&&void 0!==u[t]&&f.push(u[t]);return f}))},e.text=function(t,e){return x(t,e,((r,n,a)=>(o(a,1,2,t,e),c(a[0],a[1]))))},e.concatenate=function(t,e){return x(t,e,((t,e,r)=>{const n=[];if(r.length<1)return"";if(f(r[0])){const t=d(r[2],"");for(let e=0;e<r[0].length;e++)n[e]=c(r[0][e],t);return r.length>1?n.join(r[1]):n.join("")}if(h(r[0])){const t=d(r[2],"");for(let e=0;e<r[0].length();e++)n[e]=c(r[0].get(e),t);return r.length>1?n.join(r[1]):n.join("")}for(let a=0;a<r.length;a++)n[a]=c(r[a]);return n.join("")}))},e.reverse=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),f(u[0])){const t=u[0].slice(0);return t.reverse(),t}if(h(u[0])){const t=u[0].toArray().slice(0);return t.reverse(),t}throw new n(t,a.InvalidParameter,e)}))},e.replace=function(t,e){return x(t,e,((r,n,a)=>{o(a,3,4,t,e);const u=i(a[0]),s=i(a[1]),l=i(a[2]);return 4!==a.length||p(a[3])?y(u,s,l):u.replace(s,l)}))},e.schema=function(t,e){return x(t,e,((o,i,u)=>{if(m(u[0])){const e=g(u[0]);return e?r.convertObjectToArcadeDictionary(e,A(t)):null}throw new n(t,a.InvalidParameter,e)}))},e.subtypes=function(t,e){return x(t,e,((i,u,s)=>{if(o(s,1,1,t,e),m(s[0])){const e=w(s[0]);return e?r.convertObjectToArcadeDictionary(e,A(t)):null}throw new n(t,a.InvalidParameter,e)}))},e.subtypecode=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),m(u[0])){const t=w(u[0]);if(!t)return null;if(t.subtypeField&&u[0].hasField(t.subtypeField)){const e=u[0].field(t.subtypeField);for(const r of t.subtypes)if(r.code===e)return r.code;return null}return null}throw new n(t,a.InvalidParameter,e)}))},e.subtypename=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),m(u[0])){const t=w(u[0]);if(!t)return"";if(t.subtypeField&&u[0].hasField(t.subtypeField)){const e=u[0].field(t.subtypeField);for(const r of t.subtypes)if(r.code===e)return r.name;return""}return""}throw new n(t,a.InvalidParameter,e)}))},e.gdbversion=function(t,e){return x(t,e,((r,i,u)=>{if(o(u,1,1,t,e),m(u[0]))return u[0].gdbVersion();throw new n(t,a.InvalidParameter,e)}))},e.domain=function(t,e){return x(t,e,((u,s,l)=>{if(o(l,2,3,t,e),m(l[0])){const e=I(l[0],i(l[1]),void 0===l[2]?void 0:l[2]);return e&&e.domain?"coded-value"===e.domain.type||"codedValue"===e.domain.type?r.convertObjectToArcadeDictionary({type:"codedValue",name:e.domain.name,dataType:L[e.field.type],codedValues:e.domain.codedValues.map((t=>({name:t.name,code:t.code})))},A(t)):r.convertObjectToArcadeDictionary({type:"range",name:e.domain.name,dataType:L[e.field.type],min:e.domain.minValue,max:e.domain.maxValue},A(t)):null}throw new n(t,a.InvalidParameter,e)}))},e.domainname=function(t,e){return x(t,e,((r,u,s)=>{if(o(s,2,4,t,e),m(s[0]))return v(s[0],i(s[1]),s[2],void 0===s[3]?void 0:s[3]);throw new n(t,a.InvalidParameter,e)}))},e.domaincode=function(t,e){return x(t,e,((r,u,s)=>{if(o(s,2,4,t,e),m(s[0]))return U(s[0],i(s[1]),s[2],void 0===s[3]?void 0:s[3]);throw new n(t,a.InvalidParameter,e)}))},e.urlencode=function(t,e){return x(t,e,((n,a,u)=>{if(o(u,1,1,t,e),null===u[0])return"";if(u[0]instanceof r){let t="";for(const e of u[0].keys()){const r=u[0].field(e);""!==t&&(t+="&"),t+=null===r?encodeURIComponent(e)+"=":encodeURIComponent(e)+"="+encodeURIComponent(r)}return t}return encodeURIComponent(i(u[0]))}))},e.hash=function(t,e){return x(t,e,((r,n,a)=>{o(a,1,1,t,e);const i=new z(0);return X(a[0],i,{context:t,node:e,map:new Map,currentLength:0}),i.digest()}))},e.convertdirection=function(t,e){return x(t,e,((r,n,a)=>(o(a,3,3,t,e),S(a[0],a[1],a[2]))))},e.fromjson=function(t,e){return x(t,e,((u,s,l)=>{if(o(l,1,1,t,e),!1===b(l[0]))throw new n(t,a.InvalidParameter,e);return r.convertJsonToArcade(JSON.parse(i(l[0])),A(t))}))},e.expects=function(t,e){return x(t,e,((r,o,i)=>{if(i.length<1)throw new n(t,a.WrongNumberOfParameters,e);return l}))},e.tocharcode=function(t,e){return x(t,e,((r,u,l)=>{o(l,1,2,t,e);const p=s(d(l[1],0)),c=i(l[0]);if(0===c.length&&1===l.length)return null;if(c.length<=p||p<0)throw new n(t,a.OutOfBounds,e);return c.charCodeAt(p)}))},e.tocodepoint=function(t,e){return x(t,e,((r,u,l)=>{o(l,1,2,t,e);const p=s(d(l[1],0)),c=i(l[0]);if(0===c.length&&1===l.length)return null;if(c.length<=p||p<0)throw new n(t,a.OutOfBounds,e);return c.codePointAt(p)}))},e.fromcharcode=function(t,e){return x(t,e,((r,o,i)=>{if(i.length<1)throw new n(t,a.WrongNumberOfParameters,e);const u=i.map((t=>Math.trunc(s(t)))).filter((t=>t>=0&&t<=65535));return 0===u.length?null:String.fromCharCode.apply(null,u)}))},e.fromcodepoint=function(t,e){return x(t,e,((r,o,i)=>{if(i.length<1)throw new n(t,a.WrongNumberOfParameters,e);let u;try{u=i.map((t=>Math.trunc(s(t)))).filter((t=>t<=1114111&&t>>>0===t))}catch(l){return null}return 0===u.length?null:String.fromCodePoint.apply(null,u)}))},e.getuser=function(e,u){return x(e,u,((s,l,p)=>{o(p,0,2,e,u);let c=d(p[1],"");if(c=!0===c||!1===c?"":i(c),null!==c&&""!==c)return null;if(0===p.length||p[0]instanceof t){let t=null;if(t=e.services?.portal?e.services.portal:Z.getDefault(),p.length>0){if(!q(p[0].field("url"),t))return null}if(!t)return null;if(""===c){const n=E(t);if(n){const t=JSON.parse(JSON.stringify(n));for(const e of["lastLogin","created","modified"])void 0!==t[e]&&null!==t[e]&&(t[e]=new Date(t[e]));return r.convertObjectToArcadeDictionary(t,A(e))}}return null}throw new n(e,a.InvalidParameter,u)}))},e.getenvironment=function(t,e){return x(t,e,((n,a,i)=>(o(i,0,0,t,e),r.convertObjectToArcadeDictionary(j(A(t),t.spatialReference),A(t),!0))))}}export{Y as registerFunctions};
|