@arcgis/core 4.26.0-next.20230207 → 4.26.0-next.20230209
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/arcade/ArcadeDate.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/icon/bookmark16F.json +1 -0
- package/assets/components/assets/icon/bookmark24F.json +1 -0
- package/assets/components/assets/icon/bookmark32F.json +1 -0
- package/assets/components/assets/icon/borderRadiusFullyRounded16.json +1 -0
- package/assets/components/assets/icon/borderRadiusFullyRounded24.json +1 -0
- package/assets/components/assets/icon/borderRadiusFullyRounded32.json +1 -0
- package/assets/components/assets/icon/borderRadiusRounded16.json +1 -0
- package/assets/components/assets/icon/borderRadiusRounded24.json +1 -0
- package/assets/components/assets/icon/borderRadiusRounded32.json +1 -0
- package/assets/components/assets/icon/borderRadiusSharp16.json +1 -0
- package/assets/components/assets/icon/borderRadiusSharp24.json +1 -0
- package/assets/components/assets/icon/borderRadiusSharp32.json +1 -0
- package/assets/components/assets/icon/faceId16.json +1 -0
- package/assets/components/assets/icon/faceId24.json +1 -0
- package/assets/components/assets/icon/faceId32.json +1 -0
- package/assets/components/assets/icon/personalHomepage16.json +1 -0
- package/assets/components/assets/icon/personalHomepage24.json +1 -0
- package/assets/components/assets/icon/personalHomepage32.json +1 -0
- package/assets/components/assets/icon/satellite016F.json +1 -0
- package/assets/components/assets/icon/satellite024F.json +1 -0
- package/assets/components/assets/icon/satellite032F.json +1 -0
- package/assets/components/assets/icon/satellite116F.json +1 -0
- package/assets/components/assets/icon/satellite124F.json +1 -0
- package/assets/components/assets/icon/satellite132F.json +1 -0
- package/assets/components/assets/icon/satellite216F.json +1 -0
- package/assets/components/assets/icon/satellite224F.json +1 -0
- package/assets/components/assets/icon/satellite232F.json +1 -0
- package/assets/components/assets/icon/satellite316F.json +1 -0
- package/assets/components/assets/icon/satellite324F.json +1 -0
- package/assets/components/assets/icon/satellite332F.json +1 -0
- package/assets/components/assets/icon/usbSecurityKey16.json +1 -0
- package/assets/components/assets/icon/usbSecurityKey24.json +1 -0
- package/assets/components/assets/icon/usbSecurityKey32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/14b113a6fdcf81e56674.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{04136234f40040df0287.js → 2f0dd66dbc9bf850ed76.js} +1 -1
- package/assets/esri/core/workers/chunks/3cc798de0c78c2a9b2c8.js +1 -0
- package/assets/esri/core/workers/chunks/4cddaa79af86b0981baa.js +1 -0
- package/assets/esri/core/workers/chunks/5fb56471008b7c601b48.js +1 -0
- package/assets/esri/core/workers/chunks/72c827a5388a4b1112e3.js +1 -0
- package/assets/esri/core/workers/chunks/7347f0007cfe4e373157.js +1 -0
- package/assets/esri/core/workers/chunks/7db8a429ef7bf11c5bb6.js +1 -0
- package/assets/esri/core/workers/chunks/816934f56aeab93cd1b8.js +1 -0
- package/assets/esri/core/workers/chunks/{88654a5a27bc63b4b42f.js → a7e63b6c6d462fb9cff0.js} +25 -25
- package/assets/esri/core/workers/chunks/b4946205951f40f68357.js +1 -0
- package/assets/esri/core/workers/chunks/b8ed81e6b3eda25064d6.js +1 -0
- package/assets/esri/core/workers/chunks/bdc01fbee999fb848db2.js +1 -0
- package/assets/esri/core/workers/chunks/bf5c34d81724e9bdc182.js +1 -0
- package/assets/esri/core/workers/chunks/{338097cbcdaaed2ff889.js → d940b285d08b3b7f2a8b.js} +1 -1
- package/assets/esri/core/workers/chunks/eccc725bc3f8047171f7.js +1 -0
- package/assets/esri/core/workers/chunks/fc2177397ec09e9c16d4.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +4 -0
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -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/core/Version.js +1 -1
- package/core/workers/loaderConfig.js +1 -1
- package/interfaces.d.ts +22 -16
- package/layers/BaseTileLayer.js +1 -1
- package/package.json +2 -2
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/views/2d/engine/flow/FlowView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/GroupLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/KnowledgeGraphLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/moveUtils.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/snapping/SnapToScene.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/PreserveAspectRatio.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainConst.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +10 -10
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/snapping/Settings.js +1 -1
- package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/assets/esri/core/workers/chunks/06b50ac3478de95a0024.js +0 -1
- package/assets/esri/core/workers/chunks/29b98afa757052f9fa47.js +0 -1
- package/assets/esri/core/workers/chunks/3b5003256e7f780b0a71.js +0 -1
- package/assets/esri/core/workers/chunks/58bf1fd84a357ab118dc.js +0 -1
- package/assets/esri/core/workers/chunks/9a6fd3b3232b6df0cb09.js +0 -1
- package/assets/esri/core/workers/chunks/9da848d13c5f2ca4ba95.js +0 -1
- package/assets/esri/core/workers/chunks/b13ae901ebf3f6aee714.js +0 -1
- package/assets/esri/core/workers/chunks/b3999ed9f69b3852f48d.js +0 -1
- package/assets/esri/core/workers/chunks/c6eb6a97ecc6ed9ce713.js +0 -1
- package/assets/esri/core/workers/chunks/c704ca53f18751204949.js +0 -1
- package/assets/esri/core/workers/chunks/ce702aa7ab1d01dc3289.js +0 -1
- package/assets/esri/core/workers/chunks/d310dac246690a874948.js +0 -1
- package/assets/esri/core/workers/chunks/fa2695b40825b85320e2.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ArcadeDate as e}from"../ArcadeDate.js";import t from"../ArcadePortal.js";import n from"../Dictionary.js";import{ArcadeExecutionError as i,ExecutionErrorCodes as a}from"../executionError.js";import r from"../Feature.js";import s from"../featureSetCollection.js";import{convertToFeatureSet as o,constructFeatureSetFromPortalItem as l,constructFeatureSet as f,constructFeatureSetFromRelationship as c,constructFeatureSetFromUrl as u,constructAssociationMetaDataFeatureSetFromUrl as d}from"../featureSetUtils.js";import m from"../ImmutableArray.js";import{y as p,T as y,c as h,j as w,l as g,C as I,k as F,A as E,h as D,m as b,w as x,x as A,i as N,g as S,X as T,L}from"../../chunks/languageUtils.js";import{getPortal as $}from"../portalUtils.js";import{SqlExpressionAdapted as v,StringToCodeAdapted as P,FieldRename as j,AdaptedFeatureSet as R,OriginalField as C}from"../featureset/actions/Adapted.js";import M from"../featureset/actions/AttributeFilter.js";import O from"../featureset/actions/OrderBy.js";import k from"../featureset/actions/Top.js";import z from"../featureset/sources/Empty.js";import H from"../featureset/sources/FeatureLayerMemory.js";import G from"../featureset/support/OrderbyClause.js";import{cloneField as Z}from"../featureset/support/shared.js";import{isSingleField as W}from"../featureset/support/sqlUtils.js";import{calculateStat as _}from"./fieldStats.js";import{isPromiseLike as U}from"../../core/promiseUtils.js";import{WhereClause as q}from"../../core/sql/WhereClause.js";import B from"../../layers/FeatureLayer.js";import V from"../../layers/support/Field.js";function Q(e,t,n,i){if(1===i.length){if(b(i[0]))return _(e,i[0],-1);if(A(i[0]))return _(e,i[0].toArray(),-1)}return _(e,i,-1)}async function J(e,t,n){const i=e.getVariables();if(i.length>0){const a=[];for(let e=0;e<i.length;e++){const r={name:i[e]};a.push(await t.evaluateIdentifier(n,r))}const r={};for(let e=0;e<i.length;e++)r[i[e]]=a[e];return e.parameters=r,e}return e}function K(e,t,n=null){for(const i in e)if(i.toLowerCase()===t.toLowerCase())return e[i];return n}function X(e){if(null===e)return null;const t={type:K(e,"type",""),name:K(e,"name","")};if("range"===t.type)t.range=K(e,"range",[]);else{t.codedValues=[];for(const n of K(e,"codedValues",[]))t.codedValues.push({name:K(n,"name",""),code:K(n,"code",null)})}return t}function Y(e){if(null===e)return null;const t={},n=K(e,"wkt",null);null!==n&&(t.wkt=n);const i=K(e,"wkid",null);return null!==i&&(t.wkid=i),t}function ee(e){if(null===e)return null;const t={hasZ:K(e,"hasz",!1),hasM:K(e,"hasm",!1)},n=K(e,"spatialreference",null);n&&(t.spatialReference=Y(n));const i=K(e,"x",null);if(null!==i)return t.x=i,t.y=K(e,"y",null),t;const a=K(e,"rings",null);if(null!==a)return t.rings=a,t;const r=K(e,"paths",null);if(null!==r)return t.paths=r,t;const s=K(e,"points",null);if(null!==s)return t.points=s,t;for(const o of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const n=K(e,o,null);null!==n&&(t[o]=n)}return t}function te(e,t){for(const n of t)if(n===e)return!0;return!1}function ne(e){return!!e.layerDefinition&&(!!e.featureSet&&(!1!==te(e.layerDefinition.geometryType,["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])&&(null!==e.layerDefinition.objectIdField&&""!==e.layerDefinition.objectIdField&&(!1!==b(e.layerDefinition.fields)&&!1!==b(e.featureSet.features)))))}function ie(_){"async"===_.mode&&(_.functions.timezone=function(t,r){return _.standardFunctionAsync(t,r,(async(s,o,l)=>{if(p(l,1,2,t,r),y(l[0])){if(await l[0].load(),1===l.length||null===l[1])return l[0].dateTimeReferenceFieldIndex.layerDateFieldsTimeZone;if(!(l[1]instanceof n)||!1===l[1].hasField("type"))throw new i(t,a.InvalidParameter,r);const e=l[1].field("type");if(!1===h(e))throw new i(t,a.InvalidParameter,r);switch(w(e).toLowerCase()){case"preferredtimezone":return l[0].dateTimeReferenceFieldIndex.layerPreferredTimeZone;case"editfieldsinfo":return l[0].dateTimeReferenceFieldIndex.layerEditFieldsTimeZone;case"timeinfo":return l[0].dateTimeReferenceFieldIndex.layerTimeInfoTimeZone;case"field":if(l[1].hasField("fieldname")&&h(l[1].field("fieldname")))return l[0].dateTimeReferenceFieldIndex.fieldTimeZone(w(l[1].field("fieldname")))}throw new i(t,a.InvalidParameter,r)}const f=g(l[0],I(t));if(null===f)return null;const c=f.timeZone;return"system"===c?e.systemTimeZoneCanonicalName:c}))},_.functions.sqltimestamp=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,1,3,e,t);const o=s[0];if(F(o)){if(1===s.length)return o.toSQLString();if(2===s.length)return o.changeTimeZone(w(s[1])).toSQLString();throw new i(e,a.InvalidParameter,t)}if(y(o)){if(3!==s.length)throw new i(e,a.InvalidParameter,t);await o.load();const n=w(s[1]);if(!1===F(s[2]))throw new i(e,a.InvalidParameter,t);const r=o.fieldTimeZone(n);return null===r?s[2].toSQLString():s[2].changeTimeZone(r).toSQLString()}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"sqltimestamp",min:2,max:4}),_.functions.featuresetbyid=function(e,t){return _.standardFunctionAsync(e,t,((n,r,o)=>{if(p(o,2,4,e,t),o[0]instanceof s){const n=w(o[1]);let r=E(o[2],null);const s=D(E(o[3],!0));if(null===r&&(r=["*"]),!1===b(r))throw new i(e,a.InvalidParameter,t);return o[0].featureSetById(n,s,r)}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"featuresetbyid",min:2,max:4}),_.functions.getfeatureset=function(e,t){return _.standardFunctionAsync(e,t,((n,r,s)=>{if(p(s,1,2,e,t),x(s[0])){let t=E(s[1],"datasource");return null===t&&(t="datasource"),t=w(t).toLowerCase(),o(s[0].fullSchema(),t,e.lrucache,e.interceptor,e.spatialReference)}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"getfeatureset",min:1,max:2}),_.functions.featuresetbyportalitem=function(e,n){return _.standardFunctionAsync(e,n,((r,s,o)=>{if(p(o,2,5,e,n),null===o[0])throw new i(e,a.PortalRequired,n);if(o[0]instanceof t){const t=w(o[1]),r=w(o[2]);let s=E(o[3],null);const f=D(E(o[4],!0));if(null===s&&(s=["*"]),!1===b(s))throw new i(e,a.InvalidParameter,n);let c=null;return e.services&&e.services.portal&&(c=e.services.portal),c=$(o[0],c),l(t,r,e.spatialReference,s,f,c,e.lrucache,e.interceptor)}if(!1===h(o[0]))throw new i(e,a.PortalRequired,n);const f=w(o[0]),c=w(o[1]);let u=E(o[2],null);const d=D(E(o[3],!0));if(null===u&&(u=["*"]),!1===b(u))throw new i(e,a.InvalidParameter,n);if(e.services&&e.services.portal)return l(f,c,e.spatialReference,u,d,e.services.portal,e.lrucache,e.interceptor);throw new i(e,a.PortalRequired,n)}))},_.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),_.functions.featuresetbyname=function(e,t){return _.standardFunctionAsync(e,t,((n,r,o)=>{if(p(o,2,4,e,t),o[0]instanceof s){const n=w(o[1]);let r=E(o[2],null);const s=D(E(o[3],!0));if(null===r&&(r=["*"]),!1===b(r))throw new i(e,a.InvalidParameter,t);return o[0].featureSetByName(n,s,r)}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"featuresetbyname",min:2,max:4}),_.functions.featureset=function(e,t){return _.standardFunction(e,t,((r,s,o)=>{p(o,1,1,e,t);let l=o[0];const f={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(h(l))l=JSON.parse(l),void 0!==l.layerDefinition?(f.layerDefinition=l.layerDefinition,f.featureSet=l.featureSet,l.layerDefinition.spatialReference&&(f.layerDefinition.spatialReference=l.layerDefinition.spatialReference)):(f.featureSet.features=l.features,f.featureSet.geometryType=l.geometryType,f.layerDefinition.geometryType=f.featureSet.geometryType,f.layerDefinition.objectIdField=l.objectIdFieldName,f.layerDefinition.typeIdField=l.typeIdFieldName,f.layerDefinition.globalIdField=l.globalIdFieldName,f.layerDefinition.fields=l.fields,l.spatialReference&&(f.layerDefinition.spatialReference=l.spatialReference));else{if(!(o[0]instanceof n))throw new i(e,a.InvalidParameter,t);{l=JSON.parse(o[0].castToText(!0));const e=K(l,"layerdefinition");if(null!==e){f.layerDefinition.geometryType=K(e,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.globalIdField=K(e,"globalidfield",""),f.layerDefinition.objectIdField=K(e,"objectidfield",""),f.layerDefinition.typeIdField=K(e,"typeidfield","");const t=K(e,"spatialreference",null);t&&(f.layerDefinition.spatialReference=Y(t));for(const i of K(e,"fields",[])){const e={name:K(i,"name",""),alias:K(i,"alias",""),type:K(i,"type",""),nullable:K(i,"nullable",!0),editable:K(i,"editable",!0),length:K(i,"length",null),domain:X(K(i,"domain"))};f.layerDefinition.fields.push(e)}const n=K(l,"featureset",null);if(n){const e={};for(const t of f.layerDefinition.fields)e[t.name.toLowerCase()]=t.name;for(const t of K(n,"features",[])){const n={},i=K(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];f.featureSet.features.push({attributes:n,geometry:ee(K(t,"geometry",null))})}}}else{f.layerDefinition.geometryType=K(l,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.objectIdField=K(l,"objectidfieldname",""),f.layerDefinition.typeIdField=K(l,"typeidfieldname","");const e=K(l,"spatialreference",null);e&&(f.layerDefinition.spatialReference=Y(e));for(const n of K(l,"fields",[])){const e={name:K(n,"name",""),alias:K(n,"alias",""),type:K(n,"type",""),nullable:K(n,"nullable",!0),editable:K(n,"editable",!0),length:K(n,"length",null),domain:X(K(n,"domain"))};f.layerDefinition.fields.push(e)}const t={};for(const n of f.layerDefinition.fields)t[n.name.toLowerCase()]=n.name;for(const n of K(l,"features",[])){const e={},i=K(n,"attributes",{});for(const n in i)e[t[n.toLowerCase()]]=i[n];f.featureSet.features.push({attributes:e,geometry:ee(K(n,"geometry",null))})}}}}if(!1===ne(f))throw new i(e,a.InvalidParameter,t);return""===(f?.layerDefinition?.geometryType||"")&&(f.layerDefinition.geometryType="esriGeometryNull"),H.create(f,e.spatialReference)}))},_.signatures.push({name:"featureset",min:1,max:1}),_.functions.filter=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),b(s[0])||A(s[0])){const n=[];let r=s[0];r instanceof m&&(r=r.toArray());let o=null;if(!N(s[1]))throw new i(e,a.InvalidParameter,t);o=s[1].createFunction(e);for(const e of r){const t=o(e);U(t)?!0===await t&&n.push(e):!0===t&&n.push(e)}return n}if(y(s[0])){const t=await s[0].load(),n=q.create(s[1],t.getFieldsIndex()),i=n.getVariables();if(i.length>0){const t=[];for(let n=0;n<i.length;n++){const a={name:i[n]};t.push(await _.evaluateIdentifier(e,a))}const a={};for(let e=0;e<i.length;e++)a[i[e]]=t[e];return n.parameters=a,new M({parentfeatureset:s[0],whereclause:n})}return new M({parentfeatureset:s[0],whereclause:n})}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"filter",min:2,max:2}),_.functions.orderby=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),y(s[0])){const e=new G(s[1]);return new O({parentfeatureset:s[0],orderbyclause:e})}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"orderby",min:2,max:2}),_.functions.top=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),y(s[0]))return new k({parentfeatureset:s[0],topnum:s[1]});if(b(s[0]))return S(s[1])>=s[0].length?s[0].slice(0):s[0].slice(0,S(s[1]));if(A(s[0]))return S(s[1])>=s[0].length()?s[0].slice(0):s[0].slice(0,S(s[1]));throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"top",min:2,max:2}),_.functions.first=function(e,t){return _.standardFunctionAsync(e,t,(async(n,i,a)=>{if(p(a,1,1,e,t),y(a[0])){const e=await a[0].first(n.abortSignal);if(null!==e){const t=r.createFromGraphicLikeObject(e.geometry,e.attributes,a[0]);return t._underlyingGraphic=e,t}return e}return b(a[0])?0===a[0].length?null:a[0][0]:A(a[0])?0===a[0].length()?null:a[0].get(0):null}))},_.signatures.push({name:"first",min:1,max:1}),_.functions.attachments=function(e,t){return _.standardFunctionAsync(e,t,(async(r,s,o)=>{p(o,1,2,e,t);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(o.length>1)if(o[1]instanceof n){if(o[1].hasField("minsize")&&(l.minsize=S(o[1].field("minsize"))),o[1].hasField("metadata")&&(l.returnMetadata=D(o[1].field("metadata"))),o[1].hasField("maxsize")&&(l.maxsize=S(o[1].field("maxsize"))),o[1].hasField("types")){const e=T(o[1].field("types"),!1);e.length>0&&(l.types=e)}}else if(null!==o[1])throw new i(e,a.InvalidParameter,t);if(x(o[0])){let t=o[0]._layer;return t instanceof B&&(t=f(t,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===t?[]:!1===y(t)?[]:(await t.load(),t.queryAttachments(o[0].field(t.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===o[0])return[];throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"attachments",min:1,max:2}),_.functions.featuresetbyrelationshipname=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,2,4,e,t);const o=s[0],l=w(s[1]);let d=E(s[2],null);const m=D(E(s[3],!0));if(null===d&&(d=["*"]),!1===b(d))throw new i(e,a.InvalidParameter,t);if(null===s[0])return null;if(!x(s[0]))throw new i(e,a.InvalidParameter,t);let h=o._layer;if(h instanceof B&&(h=f(h,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===h)return null;if(!1===y(h))return null;h=await h.load();const g=h.relationshipMetaData().filter((e=>e.name===l));if(0===g.length)return null;if(void 0!==g[0].relationshipTableId&&null!==g[0].relationshipTableId&&g[0].relationshipTableId>-1)return c(h,g[0],o.field(h.objectIdField),h.spatialReference,d,m,e.lrucache,e.interceptor);let I=h.serviceUrl();if(!I)return null;I="/"===I.charAt(I.length-1)?I+g[0].relatedTableId.toString():I+"/"+g[0].relatedTableId.toString();const F=await u(I,h.spatialReference,d,m,e.lrucache,e.interceptor);await F.load();let A=F.relationshipMetaData();if(A=A.filter((e=>e.id===g[0].id)),!1===o.hasField(g[0].keyField)||null===o.field(g[0].keyField)){const e=await h.getFeatureByObjectId(o.field(h.objectIdField),[g[0].keyField]);if(e){const t=q.create(A[0].keyField+"= @id",F.getFieldsIndex());return t.parameters={id:e.attributes[g[0].keyField]},F.filter(t)}return new z({parentfeatureset:F})}const N=q.create(A[0].keyField+"= @id",F.getFieldsIndex());return N.parameters={id:o.field(g[0].keyField)},F.filter(N)}))},_.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),_.functions.featuresetbyassociation=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,2,3,e,t);const o=s[0],l=w(E(s[1],"")).toLowerCase(),c=h(s[2])?w(s[2]):null;if(null===s[0])return null;if(!x(s[0]))throw new i(e,a.InvalidParameter,t);let u=o._layer;if(u instanceof B&&(u=f(u,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===u)return null;if(!1===y(u))return null;await u.load();const m=u.serviceUrl(),g=await d(m,e.spatialReference);let I=null,F=null,D=!1;if(null!==c&&""!==c&&void 0!==c){for(const e of g.terminals)e.terminalName===c&&(F=e.terminalId);null===F&&(D=!0)}const b=g.associations.getFieldsIndex(),A=b.get("TOGLOBALID").name,N=b.get("FROMGLOBALID").name,S=b.get("TOTERMINALID").name,T=b.get("FROMTERMINALID").name,$=b.get("FROMNETWORKSOURCEID").name,M=b.get("TONETWORKSOURCEID").name,O=b.get("ASSOCIATIONTYPE").name,k=b.get("ISCONTENTVISIBLE").name,z=b.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){I=o.field(e.name);break}let H=null,G=new v(new V({name:"percentalong",alias:"percentalong",type:"double"}),q.create("0",g.associations.getFieldsIndex())),W=new v(new V({name:"side",alias:"side",type:"string"}),q.create("''",g.associations.getFieldsIndex()));const _="globalid",U="globalId",Q={};for(const e in g.lkp)Q[e]=g.lkp[e].sourceId;const J=new P(new V({name:"classname",alias:"classname",type:"string"}),null,Q);let K="";switch(l){case"midspan":{K=`((${A}='${I}') OR ( ${N}='${I}')) AND (${O} IN (5))`,J.codefield=q.create(`CASE WHEN (${A}='${I}') THEN ${$} ELSE ${M} END`,g.associations.getFieldsIndex());const e=Z(R.findField(g.associations.fields,N));e.name=_,e.alias=_,H=new v(e,q.create(`CASE WHEN (${N}='${I}') THEN ${A} ELSE ${N} END`,g.associations.getFieldsIndex())),G=g.unVersion>=4?new C(R.findField(g.associations.fields,b.get("PERCENTALONG").name)):new v(new V({name:"percentalong",alias:"percentalong",type:"double"}),q.create("0",g.associations.getFieldsIndex()));break}case"junctionedge":{K=`((${A}='${I}') OR ( ${N}='${I}')) AND (${O} IN (4,6))`,J.codefield=q.create(`CASE WHEN (${A}='${I}') THEN ${$} ELSE ${M} END`,g.associations.getFieldsIndex());const e=Z(R.findField(g.associations.fields,N));e.name=_,e.alias=_,H=new v(e,q.create(`CASE WHEN (${N}='${I}') THEN ${A} ELSE ${N} END`,g.associations.getFieldsIndex())),W=new v(new V({name:"side",alias:"side",type:"string"}),q.create(`CASE WHEN (${O}=4) THEN 'from' ELSE 'to' END`,g.associations.getFieldsIndex()));break}case"connected":{let e=`${A}='@T'`,t=`${N}='@T'`;null!==F&&(e+=` AND ${S}=@A`,t+=` AND ${T}=@A`),K="(("+e+") OR ("+t+"))",K=L(K,"@T",I??""),e=L(e,"@T",I??""),null!==F&&(e=L(e,"@A",F.toString()),K=L(K,"@A",F.toString())),J.codefield=q.create("CASE WHEN "+e+` THEN ${$} ELSE ${M} END`,g.associations.getFieldsIndex());const n=Z(R.findField(g.associations.fields,N));n.name=_,n.alias=_,H=new v(n,q.create("CASE WHEN "+e+` THEN ${N} ELSE ${A} END`,g.associations.getFieldsIndex()));break}case"container":K=`${A}='${I}' AND ${O} = 2`,null!==F&&(K+=` AND ${S} = `+F.toString()),J.codefield=$,K="( "+K+" )",H=new j(R.findField(g.associations.fields,N),_,_);case"content":K=`(${N}='${I}' AND ${O} = 2)`,null!==F&&(K+=` AND ${T} = `+F.toString()),J.codefield=M,K="( "+K+" )",H=new j(R.findField(g.associations.fields,A),_,_);break;case"structure":K=`(${A}='${I}' AND ${O} = 3)`,null!==F&&(K+=` AND ${S} = `+F.toString()),J.codefield=$,K="( "+K+" )",H=new j(R.findField(g.associations.fields,N),_,U);break;case"attached":K=`(${N}='${I}' AND ${O} = 3)`,null!==F&&(K+=` AND ${T} = `+F.toString()),J.codefield=M,K="( "+K+" )",H=new j(R.findField(g.associations.fields,A),_,U);break;default:throw new i(e,a.InvalidParameter,t)}D&&(K="1 <> 1");return new R({parentfeatureset:g.associations,adaptedFields:[new C(R.findField(g.associations.fields,z)),new C(R.findField(g.associations.fields,k)),H,W,J,G],extraFilter:K?q.create(K,g.associations.getFieldsIndex()):null})}))},_.signatures.push({name:"featuresetbyassociation",min:2,max:6}),_.functions.groupby=function(e,t){return _.standardFunctionAsync(e,t,(async(r,s,o)=>{if(p(o,3,3,e,t),!y(o[0]))throw new i(e,a.InvalidParameter,t);const l=await o[0].load(),f=[],c=[];let u=!1,d=[];if(h(o[1]))d.push(o[1]);else if(o[1]instanceof n)d.push(o[1]);else if(b(o[1]))d=o[1];else{if(!A(o[1]))throw new i(e,a.InvalidParameter,t);d=o[1].toArray()}for(const m of d)if(h(m)){const e=q.create(w(m),l.getFieldsIndex()),t=!0===W(e)?w(m):"%%%%FIELDNAME";f.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(u=!0)}else{if(!(m instanceof n))throw new i(e,a.InvalidParameter,t);{const n=m.hasField("name")?m.field("name"):"%%%%FIELDNAME",r=m.hasField("expression")?m.field("expression"):"";if("%%%%FIELDNAME"===n&&(u=!0),!n)throw new i(e,a.InvalidParameter,t);f.push({name:n,expression:q.create(r||n,l.getFieldsIndex())})}}if(d=[],h(o[2]))d.push(o[2]);else if(b(o[2]))d=o[2];else if(A(o[2]))d=o[2].toArray();else{if(!(o[2]instanceof n))throw new i(e,a.InvalidParameter,t);d.push(o[2])}for(const m of d){if(!(m instanceof n))throw new i(e,a.InvalidParameter,t);{const n=m.hasField("name")?m.field("name"):"",r=m.hasField("statistic")?m.field("statistic"):"",s=m.hasField("expression")?m.field("expression"):"";if(!n||!r||!s)throw new i(e,a.InvalidParameter,t);c.push({name:n,statistic:r.toLowerCase(),expression:q.create(s,l.getFieldsIndex())})}}if(u){const e={};for(const n of l.fields)e[n.name.toLowerCase()]=1;for(const n of f)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);for(const n of c)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of f)await J(t.expression,_,e);for(const t of c)await J(t.expression,_,e);return o[0].groupby(f,c)}))},_.signatures.push({name:"groupby",min:3,max:3}),_.functions.distinct=function(e,t){return _.standardFunctionAsync(e,t,(async(r,s,o)=>{if(y(o[0])){p(o,2,2,e,t);const r=await o[0].load(),s=[];let l=[];if(h(o[1]))l.push(o[1]);else if(o[1]instanceof n)l.push(o[1]);else if(b(o[1]))l=o[1];else{if(!A(o[1]))throw new i(e,a.InvalidParameter,t);l=o[1].toArray()}let f=!1;for(const o of l)if(h(o)){const e=q.create(w(o),r.getFieldsIndex()),t=!0===W(e)?w(o):"%%%%FIELDNAME";s.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(f=!0)}else{if(!(o instanceof n))throw new i(e,a.InvalidParameter,t);{const n=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if("%%%%FIELDNAME"===n&&(f=!0),!n)throw new i(e,a.InvalidParameter,t);s.push({name:n,expression:q.create(l||n,r.getFieldsIndex())})}}if(f){const e={};for(const n of r.fields)e[n.name.toLowerCase()]=1;for(const n of s)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of s)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of s)await J(t.expression,_,e);return o[0].groupby(s,[])}return Q("distinct",r,s,o)}))})}export{ie as registerFunctions};
|
|
5
|
+
import{ArcadeDate as e}from"../ArcadeDate.js";import t from"../ArcadePortal.js";import n from"../Dictionary.js";import{ArcadeExecutionError as i,ExecutionErrorCodes as a}from"../executionError.js";import r from"../Feature.js";import s from"../featureSetCollection.js";import{convertToFeatureSet as o,constructFeatureSetFromPortalItem as l,constructFeatureSet as f,constructFeatureSetFromRelationship as c,constructFeatureSetFromUrl as u,constructAssociationMetaDataFeatureSetFromUrl as d}from"../featureSetUtils.js";import m from"../ImmutableArray.js";import{y as p,T as y,c as h,j as w,l as g,C as I,k as F,A as E,h as D,m as b,w as x,x as A,i as N,g as S,X as T,L}from"../../chunks/languageUtils.js";import{getPortal as $}from"../portalUtils.js";import{SqlExpressionAdapted as v,StringToCodeAdapted as P,FieldRename as R,AdaptedFeatureSet as j,OriginalField as C}from"../featureset/actions/Adapted.js";import M from"../featureset/actions/AttributeFilter.js";import O from"../featureset/actions/OrderBy.js";import k from"../featureset/actions/Top.js";import z from"../featureset/sources/Empty.js";import H from"../featureset/sources/FeatureLayerMemory.js";import G from"../featureset/support/OrderbyClause.js";import{cloneField as Z}from"../featureset/support/shared.js";import{isSingleField as W}from"../featureset/support/sqlUtils.js";import{calculateStat as _}from"./fieldStats.js";import{isPromiseLike as U}from"../../core/promiseUtils.js";import{WhereClause as q}from"../../core/sql/WhereClause.js";import B from"../../layers/FeatureLayer.js";import V from"../../layers/support/Field.js";function Q(e,t,n,i){if(1===i.length){if(b(i[0]))return _(e,i[0],-1);if(A(i[0]))return _(e,i[0].toArray(),-1)}return _(e,i,-1)}async function J(e,t,n){const i=e.getVariables();if(i.length>0){const a=[];for(let e=0;e<i.length;e++){const r={name:i[e]};a.push(await t.evaluateIdentifier(n,r))}const r={};for(let e=0;e<i.length;e++)r[i[e]]=a[e];return e.parameters=r,e}return e}function K(e,t,n=null){for(const i in e)if(i.toLowerCase()===t.toLowerCase())return e[i];return n}function X(e){if(null===e)return null;const t={type:K(e,"type",""),name:K(e,"name","")};if("range"===t.type)t.range=K(e,"range",[]);else{t.codedValues=[];for(const n of K(e,"codedValues",[]))t.codedValues.push({name:K(n,"name",""),code:K(n,"code",null)})}return t}function Y(e){if(null===e)return null;const t={},n=K(e,"wkt",null);null!==n&&(t.wkt=n);const i=K(e,"wkid",null);return null!==i&&(t.wkid=i),t}function ee(e){if(null===e)return null;const t={hasZ:K(e,"hasz",!1),hasM:K(e,"hasm",!1)},n=K(e,"spatialreference",null);n&&(t.spatialReference=Y(n));const i=K(e,"x",null);if(null!==i)return t.x=i,t.y=K(e,"y",null),t;const a=K(e,"rings",null);if(null!==a)return t.rings=a,t;const r=K(e,"paths",null);if(null!==r)return t.paths=r,t;const s=K(e,"points",null);if(null!==s)return t.points=s,t;for(const o of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const n=K(e,o,null);null!==n&&(t[o]=n)}return t}function te(e,t){for(const n of t)if(n===e)return!0;return!1}function ne(e){return!!e.layerDefinition&&(!!e.featureSet&&(!1!==te(e.layerDefinition.geometryType,["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])&&(null!==e.layerDefinition.objectIdField&&""!==e.layerDefinition.objectIdField&&(!1!==b(e.layerDefinition.fields)&&!1!==b(e.featureSet.features)))))}function ie(_){"async"===_.mode&&(_.functions.timezone=function(t,r){return _.standardFunctionAsync(t,r,(async(s,o,l)=>{if(p(l,1,2,t,r),y(l[0])){if(await l[0].load(),1===l.length||null===l[1])return l[0].dateTimeReferenceFieldIndex.layerDateFieldsTimeZone;if(!(l[1]instanceof n)||!1===l[1].hasField("type"))throw new i(t,a.InvalidParameter,r);const e=l[1].field("type");if(!1===h(e))throw new i(t,a.InvalidParameter,r);switch(w(e).toLowerCase()){case"preferredtimezone":return l[0].dateTimeReferenceFieldIndex.layerPreferredTimeZone;case"editfieldsinfo":return l[0].dateTimeReferenceFieldIndex.layerEditFieldsTimeZone;case"timeinfo":return l[0].dateTimeReferenceFieldIndex.layerTimeInfoTimeZone;case"field":if(l[1].hasField("fieldname")&&h(l[1].field("fieldname")))return l[0].dateTimeReferenceFieldIndex.fieldTimeZone(w(l[1].field("fieldname")))}throw new i(t,a.InvalidParameter,r)}const f=g(l[0],I(t));if(null===f)return null;const c=f.timeZone;return"system"===c?e.systemTimeZoneCanonicalName:c}))},_.functions.sqltimestamp=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,1,3,e,t);const o=s[0];if(F(o)){if(1===s.length)return o.toSQLString();if(2===s.length)return o.changeTimeZone(w(s[1])).toSQLString();throw new i(e,a.InvalidParameter,t)}if(y(o)){if(3!==s.length)throw new i(e,a.InvalidParameter,t);await o.load();const n=w(s[1]);if(!1===F(s[2]))throw new i(e,a.InvalidParameter,t);const r=o.fieldTimeZone(n);return null===r?s[2].toSQLString():s[2].changeTimeZone(r).toSQLString()}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"sqltimestamp",min:2,max:4}),_.functions.featuresetbyid=function(e,t){return _.standardFunctionAsync(e,t,((n,r,o)=>{if(p(o,2,4,e,t),o[0]instanceof s){const n=w(o[1]);let r=E(o[2],null);const s=D(E(o[3],!0));if(null===r&&(r=["*"]),!1===b(r))throw new i(e,a.InvalidParameter,t);return o[0].featureSetById(n,s,r)}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"featuresetbyid",min:2,max:4}),_.functions.getfeatureset=function(e,t){return _.standardFunctionAsync(e,t,((n,r,s)=>{if(p(s,1,2,e,t),x(s[0])){let t=E(s[1],"datasource");return null===t&&(t="datasource"),t=w(t).toLowerCase(),o(s[0].fullSchema(),t,e.lrucache,e.interceptor,e.spatialReference)}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"getfeatureset",min:1,max:2}),_.functions.featuresetbyportalitem=function(e,n){return _.standardFunctionAsync(e,n,((r,s,o)=>{if(p(o,2,5,e,n),null===o[0])throw new i(e,a.PortalRequired,n);if(o[0]instanceof t){const t=w(o[1]),r=w(o[2]);let s=E(o[3],null);const f=D(E(o[4],!0));if(null===s&&(s=["*"]),!1===b(s))throw new i(e,a.InvalidParameter,n);let c=null;return e.services&&e.services.portal&&(c=e.services.portal),c=$(o[0],c),l(t,r,e.spatialReference,s,f,c,e.lrucache,e.interceptor)}if(!1===h(o[0]))throw new i(e,a.PortalRequired,n);const f=w(o[0]),c=w(o[1]);let u=E(o[2],null);const d=D(E(o[3],!0));if(null===u&&(u=["*"]),!1===b(u))throw new i(e,a.InvalidParameter,n);if(e.services&&e.services.portal)return l(f,c,e.spatialReference,u,d,e.services.portal,e.lrucache,e.interceptor);throw new i(e,a.PortalRequired,n)}))},_.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),_.functions.featuresetbyname=function(e,t){return _.standardFunctionAsync(e,t,((n,r,o)=>{if(p(o,2,4,e,t),o[0]instanceof s){const n=w(o[1]);let r=E(o[2],null);const s=D(E(o[3],!0));if(null===r&&(r=["*"]),!1===b(r))throw new i(e,a.InvalidParameter,t);return o[0].featureSetByName(n,s,r)}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"featuresetbyname",min:2,max:4}),_.functions.featureset=function(e,t){return _.standardFunction(e,t,((r,s,o)=>{p(o,1,1,e,t);let l=o[0];const f={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(h(l))l=JSON.parse(l),void 0!==l.layerDefinition?(f.layerDefinition=l.layerDefinition,f.featureSet=l.featureSet,l.layerDefinition.spatialReference&&(f.layerDefinition.spatialReference=l.layerDefinition.spatialReference)):(f.featureSet.features=l.features,f.featureSet.geometryType=l.geometryType,f.layerDefinition.geometryType=f.featureSet.geometryType,f.layerDefinition.objectIdField=l.objectIdFieldName,f.layerDefinition.typeIdField=l.typeIdFieldName,f.layerDefinition.globalIdField=l.globalIdFieldName,f.layerDefinition.fields=l.fields,l.spatialReference&&(f.layerDefinition.spatialReference=l.spatialReference));else{if(!(o[0]instanceof n))throw new i(e,a.InvalidParameter,t);{l=JSON.parse(o[0].castToText(!0));const e=K(l,"layerdefinition");if(null!==e){f.layerDefinition.geometryType=K(e,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.globalIdField=K(e,"globalidfield",""),f.layerDefinition.objectIdField=K(e,"objectidfield",""),f.layerDefinition.typeIdField=K(e,"typeidfield","");const t=K(e,"spatialreference",null);t&&(f.layerDefinition.spatialReference=Y(t));for(const i of K(e,"fields",[])){const e={name:K(i,"name",""),alias:K(i,"alias",""),type:K(i,"type",""),nullable:K(i,"nullable",!0),editable:K(i,"editable",!0),length:K(i,"length",null),domain:X(K(i,"domain"))};f.layerDefinition.fields.push(e)}const n=K(l,"featureset",null);if(n){const e={};for(const t of f.layerDefinition.fields)e[t.name.toLowerCase()]=t.name;for(const t of K(n,"features",[])){const n={},i=K(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];f.featureSet.features.push({attributes:n,geometry:ee(K(t,"geometry",null))})}}}else{f.layerDefinition.geometryType=K(l,"geometrytype",""),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.objectIdField=K(l,"objectidfieldname",""),f.layerDefinition.typeIdField=K(l,"typeidfieldname","");const e=K(l,"spatialreference",null);e&&(f.layerDefinition.spatialReference=Y(e));for(const n of K(l,"fields",[])){const e={name:K(n,"name",""),alias:K(n,"alias",""),type:K(n,"type",""),nullable:K(n,"nullable",!0),editable:K(n,"editable",!0),length:K(n,"length",null),domain:X(K(n,"domain"))};f.layerDefinition.fields.push(e)}const t={};for(const n of f.layerDefinition.fields)t[n.name.toLowerCase()]=n.name;for(const n of K(l,"features",[])){const e={},i=K(n,"attributes",{});for(const n in i)e[t[n.toLowerCase()]]=i[n];f.featureSet.features.push({attributes:e,geometry:ee(K(n,"geometry",null))})}}}}if(!1===ne(f))throw new i(e,a.InvalidParameter,t);return""===(f?.layerDefinition?.geometryType||"")&&(f.layerDefinition.geometryType="esriGeometryNull"),H.create(f,e.spatialReference)}))},_.signatures.push({name:"featureset",min:1,max:1}),_.functions.filter=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),b(s[0])||A(s[0])){const n=[];let r=s[0];r instanceof m&&(r=r.toArray());let o=null;if(!N(s[1]))throw new i(e,a.InvalidParameter,t);o=s[1].createFunction(e);for(const e of r){const t=o(e);U(t)?!0===await t&&n.push(e):!0===t&&n.push(e)}return n}if(y(s[0])){const t=await s[0].load(),n=q.create(s[1],t.getFieldsIndex()),i=n.getVariables();if(i.length>0){const t=[];for(let n=0;n<i.length;n++){const a={name:i[n]};t.push(await _.evaluateIdentifier(e,a))}const a={};for(let e=0;e<i.length;e++)a[i[e]]=t[e];return n.parameters=a,new M({parentfeatureset:s[0],whereclause:n})}return new M({parentfeatureset:s[0],whereclause:n})}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"filter",min:2,max:2}),_.functions.orderby=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),y(s[0])){const e=new G(s[1]);return new O({parentfeatureset:s[0],orderbyclause:e})}throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"orderby",min:2,max:2}),_.functions.top=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),y(s[0]))return new k({parentfeatureset:s[0],topnum:s[1]});if(b(s[0]))return S(s[1])>=s[0].length?s[0].slice(0):s[0].slice(0,S(s[1]));if(A(s[0]))return S(s[1])>=s[0].length()?s[0].slice(0):s[0].slice(0,S(s[1]));throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"top",min:2,max:2}),_.functions.first=function(e,t){return _.standardFunctionAsync(e,t,(async(n,i,a)=>{if(p(a,1,1,e,t),y(a[0])){const t=await a[0].first(n.abortSignal);if(null!==t){const n=r.createFromGraphicLikeObject(t.geometry,t.attributes,a[0],e.timeReference);return n._underlyingGraphic=t,n}return t}return b(a[0])?0===a[0].length?null:a[0][0]:A(a[0])?0===a[0].length()?null:a[0].get(0):null}))},_.signatures.push({name:"first",min:1,max:1}),_.functions.attachments=function(e,t){return _.standardFunctionAsync(e,t,(async(r,s,o)=>{p(o,1,2,e,t);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(o.length>1)if(o[1]instanceof n){if(o[1].hasField("minsize")&&(l.minsize=S(o[1].field("minsize"))),o[1].hasField("metadata")&&(l.returnMetadata=D(o[1].field("metadata"))),o[1].hasField("maxsize")&&(l.maxsize=S(o[1].field("maxsize"))),o[1].hasField("types")){const e=T(o[1].field("types"),!1);e.length>0&&(l.types=e)}}else if(null!==o[1])throw new i(e,a.InvalidParameter,t);if(x(o[0])){let t=o[0]._layer;return t instanceof B&&(t=f(t,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===t?[]:!1===y(t)?[]:(await t.load(),t.queryAttachments(o[0].field(t.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===o[0])return[];throw new i(e,a.InvalidParameter,t)}))},_.signatures.push({name:"attachments",min:1,max:2}),_.functions.featuresetbyrelationshipname=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,2,4,e,t);const o=s[0],l=w(s[1]);let d=E(s[2],null);const m=D(E(s[3],!0));if(null===d&&(d=["*"]),!1===b(d))throw new i(e,a.InvalidParameter,t);if(null===s[0])return null;if(!x(s[0]))throw new i(e,a.InvalidParameter,t);let h=o._layer;if(h instanceof B&&(h=f(h,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===h)return null;if(!1===y(h))return null;h=await h.load();const g=h.relationshipMetaData().filter((e=>e.name===l));if(0===g.length)return null;if(void 0!==g[0].relationshipTableId&&null!==g[0].relationshipTableId&&g[0].relationshipTableId>-1)return c(h,g[0],o.field(h.objectIdField),h.spatialReference,d,m,e.lrucache,e.interceptor);let I=h.serviceUrl();if(!I)return null;I="/"===I.charAt(I.length-1)?I+g[0].relatedTableId.toString():I+"/"+g[0].relatedTableId.toString();const F=await u(I,h.spatialReference,d,m,e.lrucache,e.interceptor);await F.load();let A=F.relationshipMetaData();if(A=A.filter((e=>e.id===g[0].id)),!1===o.hasField(g[0].keyField)||null===o.field(g[0].keyField)){const e=await h.getFeatureByObjectId(o.field(h.objectIdField),[g[0].keyField]);if(e){const t=q.create(A[0].keyField+"= @id",F.getFieldsIndex());return t.parameters={id:e.attributes[g[0].keyField]},F.filter(t)}return new z({parentfeatureset:F})}const N=q.create(A[0].keyField+"= @id",F.getFieldsIndex());return N.parameters={id:o.field(g[0].keyField)},F.filter(N)}))},_.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),_.functions.featuresetbyassociation=function(e,t){return _.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,2,3,e,t);const o=s[0],l=w(E(s[1],"")).toLowerCase(),c=h(s[2])?w(s[2]):null;if(null===s[0])return null;if(!x(s[0]))throw new i(e,a.InvalidParameter,t);let u=o._layer;if(u instanceof B&&(u=f(u,e.spatialReference,["*"],!0,e.lrucache,e.interceptor)),null===u)return null;if(!1===y(u))return null;await u.load();const m=u.serviceUrl(),g=await d(m,e.spatialReference);let I=null,F=null,D=!1;if(null!==c&&""!==c&&void 0!==c){for(const e of g.terminals)e.terminalName===c&&(F=e.terminalId);null===F&&(D=!0)}const b=g.associations.getFieldsIndex(),A=b.get("TOGLOBALID").name,N=b.get("FROMGLOBALID").name,S=b.get("TOTERMINALID").name,T=b.get("FROMTERMINALID").name,$=b.get("FROMNETWORKSOURCEID").name,M=b.get("TONETWORKSOURCEID").name,O=b.get("ASSOCIATIONTYPE").name,k=b.get("ISCONTENTVISIBLE").name,z=b.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){I=o.field(e.name);break}let H=null,G=new v(new V({name:"percentalong",alias:"percentalong",type:"double"}),q.create("0",g.associations.getFieldsIndex())),W=new v(new V({name:"side",alias:"side",type:"string"}),q.create("''",g.associations.getFieldsIndex()));const _="globalid",U="globalId",Q={};for(const e in g.lkp)Q[e]=g.lkp[e].sourceId;const J=new P(new V({name:"classname",alias:"classname",type:"string"}),null,Q);let K="";switch(l){case"midspan":{K=`((${A}='${I}') OR ( ${N}='${I}')) AND (${O} IN (5))`,J.codefield=q.create(`CASE WHEN (${A}='${I}') THEN ${$} ELSE ${M} END`,g.associations.getFieldsIndex());const e=Z(j.findField(g.associations.fields,N));e.name=_,e.alias=_,H=new v(e,q.create(`CASE WHEN (${N}='${I}') THEN ${A} ELSE ${N} END`,g.associations.getFieldsIndex())),G=g.unVersion>=4?new C(j.findField(g.associations.fields,b.get("PERCENTALONG").name)):new v(new V({name:"percentalong",alias:"percentalong",type:"double"}),q.create("0",g.associations.getFieldsIndex()));break}case"junctionedge":{K=`((${A}='${I}') OR ( ${N}='${I}')) AND (${O} IN (4,6))`,J.codefield=q.create(`CASE WHEN (${A}='${I}') THEN ${$} ELSE ${M} END`,g.associations.getFieldsIndex());const e=Z(j.findField(g.associations.fields,N));e.name=_,e.alias=_,H=new v(e,q.create(`CASE WHEN (${N}='${I}') THEN ${A} ELSE ${N} END`,g.associations.getFieldsIndex())),W=new v(new V({name:"side",alias:"side",type:"string"}),q.create(`CASE WHEN (${O}=4) THEN 'from' ELSE 'to' END`,g.associations.getFieldsIndex()));break}case"connected":{let e=`${A}='@T'`,t=`${N}='@T'`;null!==F&&(e+=` AND ${S}=@A`,t+=` AND ${T}=@A`),K="(("+e+") OR ("+t+"))",K=L(K,"@T",I??""),e=L(e,"@T",I??""),null!==F&&(e=L(e,"@A",F.toString()),K=L(K,"@A",F.toString())),J.codefield=q.create("CASE WHEN "+e+` THEN ${$} ELSE ${M} END`,g.associations.getFieldsIndex());const n=Z(j.findField(g.associations.fields,N));n.name=_,n.alias=_,H=new v(n,q.create("CASE WHEN "+e+` THEN ${N} ELSE ${A} END`,g.associations.getFieldsIndex()));break}case"container":K=`${A}='${I}' AND ${O} = 2`,null!==F&&(K+=` AND ${S} = `+F.toString()),J.codefield=$,K="( "+K+" )",H=new R(j.findField(g.associations.fields,N),_,_);case"content":K=`(${N}='${I}' AND ${O} = 2)`,null!==F&&(K+=` AND ${T} = `+F.toString()),J.codefield=M,K="( "+K+" )",H=new R(j.findField(g.associations.fields,A),_,_);break;case"structure":K=`(${A}='${I}' AND ${O} = 3)`,null!==F&&(K+=` AND ${S} = `+F.toString()),J.codefield=$,K="( "+K+" )",H=new R(j.findField(g.associations.fields,N),_,U);break;case"attached":K=`(${N}='${I}' AND ${O} = 3)`,null!==F&&(K+=` AND ${T} = `+F.toString()),J.codefield=M,K="( "+K+" )",H=new R(j.findField(g.associations.fields,A),_,U);break;default:throw new i(e,a.InvalidParameter,t)}D&&(K="1 <> 1");return new j({parentfeatureset:g.associations,adaptedFields:[new C(j.findField(g.associations.fields,z)),new C(j.findField(g.associations.fields,k)),H,W,J,G],extraFilter:K?q.create(K,g.associations.getFieldsIndex()):null})}))},_.signatures.push({name:"featuresetbyassociation",min:2,max:6}),_.functions.groupby=function(e,t){return _.standardFunctionAsync(e,t,(async(r,s,o)=>{if(p(o,3,3,e,t),!y(o[0]))throw new i(e,a.InvalidParameter,t);const l=await o[0].load(),f=[],c=[];let u=!1,d=[];if(h(o[1]))d.push(o[1]);else if(o[1]instanceof n)d.push(o[1]);else if(b(o[1]))d=o[1];else{if(!A(o[1]))throw new i(e,a.InvalidParameter,t);d=o[1].toArray()}for(const m of d)if(h(m)){const e=q.create(w(m),l.getFieldsIndex()),t=!0===W(e)?w(m):"%%%%FIELDNAME";f.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(u=!0)}else{if(!(m instanceof n))throw new i(e,a.InvalidParameter,t);{const n=m.hasField("name")?m.field("name"):"%%%%FIELDNAME",r=m.hasField("expression")?m.field("expression"):"";if("%%%%FIELDNAME"===n&&(u=!0),!n)throw new i(e,a.InvalidParameter,t);f.push({name:n,expression:q.create(r||n,l.getFieldsIndex())})}}if(d=[],h(o[2]))d.push(o[2]);else if(b(o[2]))d=o[2];else if(A(o[2]))d=o[2].toArray();else{if(!(o[2]instanceof n))throw new i(e,a.InvalidParameter,t);d.push(o[2])}for(const m of d){if(!(m instanceof n))throw new i(e,a.InvalidParameter,t);{const n=m.hasField("name")?m.field("name"):"",r=m.hasField("statistic")?m.field("statistic"):"",s=m.hasField("expression")?m.field("expression"):"";if(!n||!r||!s)throw new i(e,a.InvalidParameter,t);c.push({name:n,statistic:r.toLowerCase(),expression:q.create(s,l.getFieldsIndex())})}}if(u){const e={};for(const n of l.fields)e[n.name.toLowerCase()]=1;for(const n of f)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);for(const n of c)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of f)await J(t.expression,_,e);for(const t of c)await J(t.expression,_,e);return o[0].groupby(f,c)}))},_.signatures.push({name:"groupby",min:3,max:3}),_.functions.distinct=function(e,t){return _.standardFunctionAsync(e,t,(async(r,s,o)=>{if(y(o[0])){p(o,2,2,e,t);const r=await o[0].load(),s=[];let l=[];if(h(o[1]))l.push(o[1]);else if(o[1]instanceof n)l.push(o[1]);else if(b(o[1]))l=o[1];else{if(!A(o[1]))throw new i(e,a.InvalidParameter,t);l=o[1].toArray()}let f=!1;for(const o of l)if(h(o)){const e=q.create(w(o),r.getFieldsIndex()),t=!0===W(e)?w(o):"%%%%FIELDNAME";s.push({name:t,expression:e}),"%%%%FIELDNAME"===t&&(f=!0)}else{if(!(o instanceof n))throw new i(e,a.InvalidParameter,t);{const n=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if("%%%%FIELDNAME"===n&&(f=!0),!n)throw new i(e,a.InvalidParameter,t);s.push({name:n,expression:q.create(l||n,r.getFieldsIndex())})}}if(f){const e={};for(const n of r.fields)e[n.name.toLowerCase()]=1;for(const n of s)"%%%%FIELDNAME"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of s)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const t of s)await J(t.expression,_,e);return o[0].groupby(s,[])}return Q("distinct",r,s,o)}))})}export{ie as registerFunctions};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../Dictionary.js";import n from"../Feature.js";import t from"../ImmutablePointArray.js";import{y as r,m as a,x as i,q as o,F as s,G as l,v as c,c as f,j as u,k as m,b as h,a as p,i as w,f as d,C as y,w as g,s as R,H as I}from"../../chunks/languageUtils.js";import v from"../../geometry/Extent.js";import P from"../../geometry/Geometry.js";import x from"../../geometry/Multipoint.js";import b from"../../geometry/Point.js";import F from"../../geometry/Polygon.js";import j from"../../geometry/Polyline.js";import{angle2D as O,angleBetween2D as S,bearing2D as N,bearingBetween2D as k,pathsSelfIntersecting as J}from"./centroid.js";import{fromJSON as G}from"../../geometry/support/jsonUtils.js";import{ArcadeExecutionError as z,ExecutionErrorCodes as D}from"../executionError.js";import _ from"../ImmutablePathArray.js";import{isClockwise as C}from"../../geometry/support/coordsUtils.js";function M(e){return e&&"esri.arcade.Feature"===e.arcadeDeclaredClass}function Z(_,Z){_.ringisclockwise=function(e,n){return Z(e,n,((o,s,l)=>{r(l,1,1,e,n);let c=[],f=!1,u=!1;if(null===l[0])return!1;if(a(l[0])){for(const t of l[0]){if(!(t instanceof b))throw new z(e,D.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0][0].hasZ,u=l[0][0].hasM)}else if(l[0]instanceof t)c=l[0]._elements,c.length>0&&(f=l[0]._hasZ,u=l[0]._hasM);else{if(!i(l[0]))throw new z(e,D.InvalidParameter,n);for(const t of l[0].toArray()){if(!(t instanceof b))throw new z(e,D.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0].get(0).hasZ,u=l[0].get(0).hasM)}return!(c.length<3)&&C(c,u,f)}))},_.polygon=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof F==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof F?G(c[0].toJSON()):o(new F(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.polyline=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof j==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof j?G(c[0].toJSON()):o(new j(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.point=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof b==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof b?G(c[0].toJSON()):o(new b(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.multipoint=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof x==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof x?G(c[0].toJSON()):o(new x(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.extent=function(t,a){return Z(t,a,((i,c,f)=>{f=l(f),r(f,1,1,t,a);let u=null;if(f[0]instanceof e)u=o(n.parseGeometryFromDictionary(f[0]),t.spatialReference);else if(f[0]instanceof b){const e={xmin:f[0].x,ymin:f[0].y,xmax:f[0].x,ymax:f[0].y,spatialReference:f[0].spatialReference.toJSON()},n=f[0];n.hasZ?(e.zmin=n.z,e.zmax=n.z):n.hasM&&(e.mmin=n.m,e.mmax=n.m),u=G(e)}else u=f[0]instanceof F||f[0]instanceof j||f[0]instanceof x?G(f[0].extent?.toJSON()):f[0]instanceof v?G(f[0].toJSON()):o(new v(JSON.parse(f[0])),t.spatialReference);if(null!==u&&!1===u.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(u)}))},_.geometry=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(null===c[0])return null;if(f=M(c[0])?o(c[0].geometry(),t.spatialReference):c[0]instanceof e?o(n.parseGeometryFromDictionary(c[0]),t.spatialReference):o(G(JSON.parse(c[0])),t.spatialReference),null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.setgeometry=function(e,n){return Z(e,n,((t,a,i)=>{if(r(i,2,2,e,n),!M(i[0]))throw new z(e,D.InvalidParameter,n);if(!0===i[0].immutable)throw new z(e,D.Immutable,n);if(!(i[1]instanceof P||null===i[1]))throw new z(e,D.InvalidParameter,n);return i[0]._geometry=i[1],c}))},_.feature=function(t,r){return Z(t,r,((a,i,s)=>{if(0===s.length)throw new z(t,D.WrongNumberOfParameters,r);let l=null;if(1===s.length)if(f(s[0]))l=n.fromJson(JSON.parse(s[0]));else if(M(s[0]))l=n.createFromArcadeFeature(s[0]);else if(s[0]instanceof P)l=n.createFromGraphicLikeObject(s[0],null,null);else{if(!(s[0]instanceof e))throw new z(t,D.InvalidParameter,r);{let t=s[0].hasField("geometry")?s[0].field("geometry"):null,r=s[0].hasField("attributes")?s[0].field("attributes"):null;null!==t&&t instanceof e&&(t=n.parseGeometryFromDictionary(t)),null!==r&&(r=n.parseAttributesFromDictionary(r)),l=n.createFromGraphicLikeObject(t,r,null)}}else if(2===s.length){let a=null,i=null;if(null!==s[0])if(s[0]instanceof P)a=s[0];else{if(!(a instanceof e))throw new z(t,D.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}if(null!==s[1]){if(!(s[1]instanceof e))throw new z(t,D.InvalidParameter,r);i=n.parseAttributesFromDictionary(s[1])}l=n.createFromGraphicLikeObject(a,i,null)}else{let a=null;const i={};if(null!==s[0])if(s[0]instanceof P)a=s[0];else{if(!(a instanceof e))throw new z(t,D.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}for(let e=1;e<s.length;e+=2){const n=u(s[e]),a=s[e+1];if(!(null==a||f(a)||isNaN(a)||m(a)||h(a)||p(a)))throw new z(t,D.InvalidParameter,r);if(w(a)||!1===d(a))throw new z(t,D.InvalidParameter,r);i[n]=a===c?null:a}l=n.createFromGraphicLikeObject(a,i,null)}return l._geometry=o(l.geometry(),t.spatialReference),l.immutable=!1,l}))},_.dictionary=function(n,t){return Z(n,t,((r,o,s)=>{if(0===s.length){const n=new e;return n.immutable=!1,n}if(1===s.length&&f(s[0]))try{const t=JSON.parse(s[0]),r=e.convertObjectToArcadeDictionary(t,y(n),!1);return r.immutable=!1,r}catch(g){throw new z(n,D.InvalidParameter,t)}if(s.length%2!=0)throw new z(n,D.WrongNumberOfParameters,t);const l={};for(let e=0;e<s.length;e+=2){const r=u(s[e]),o=s[e+1];if(!(null==o||f(o)||isNaN(o)||m(o)||h(o)||p(o)||a(o)||i(o)))throw new z(n,D.InvalidParameter,t);if(w(o))throw new z(n,D.InvalidParameter,t);l[r]=o===c?null:o}const d=new e(l);return d.immutable=!1,d}))},_.haskey=function(n,t){return Z(n,t,((a,i,o)=>{r(o,2,2,n,t);const s=u(o[1]);if(M(o[0]))return o[0].hasField(s);if(o[0]instanceof e)return o[0].hasField(s);if(o[0]instanceof P){const e=q(o[0],s,null,null,2);return!e||"notfound"!==e.keystate}throw new z(n,D.InvalidParameter,t)}))},_.hasvalue=function(n,t){return Z(n,t,((a,i,o)=>{if(r(o,2,2,n,t),null===o[0]||null===o[1])return!1;const s=u(o[1]);if(g(o[0]))return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof e)return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof P){return null!==q(o[0],s,null,null,0)}return!1}))},_.indexof=function(e,n){return Z(e,n,((t,o,s)=>{r(s,2,2,e,n);const l=s[1];if(a(s[0])){for(let e=0;e<s[0].length;e++)if(R(l,s[0][e]))return e;return-1}if(i(s[0])){const e=s[0].length();for(let n=0;n<e;n++)if(R(l,s[0].get(n)))return n;return-1}throw new z(e,D.InvalidParameter,n)}))},_.angle=function(e,n){return Z(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof b))throw new z(e,D.InvalidParameter,n);if(!(i[1]instanceof b))throw new z(e,D.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof b))throw new z(e,D.InvalidParameter,n);return 2===i.length?O(i[0],i[1]):S(i[0],i[1],i[2])}))},_.bearing=function(e,n){return Z(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof b))throw new z(e,D.InvalidParameter,n);if(!(i[1]instanceof b))throw new z(e,D.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof b))throw new z(e,D.InvalidParameter,n);return 2===i.length?N(i[0],i[1]):k(i[0],i[1],i[2])}))},_.isselfintersecting=function(e,n){return Z(e,n,((t,o,s)=>{s=l(s),r(s,1,1,e,n);let c=s[0];if(c instanceof F)return c.isSelfIntersecting;if(c instanceof j)return c=c.paths,J(c);if(c instanceof x){const e=c.points;for(let n=0;n<e.length;n++)for(let t=0;t<e.length;t++)if(t!==n){let r=!0;for(let a=0;a<e[n].length;a++)if(e[n][a]!==e[t][a]){r=!1;break}if(!0===r)return!0}}return!(!a(c)&&!i(c))&&(c=I(c,e.spatialReference),null!==c&&(c=c.paths),J(c))}))}}let W=0;function q(n,r,a,i,o=1){let s;switch(r=r.toLowerCase()){case"hasz":{const e=n.hasZ;return void 0!==e&&e}case"hasm":{const e=n.hasM;return void 0!==e&&e}case"spatialreference":{let t=n.spatialReference._arcadeCacheId;if(void 0===t){let e=!0;Object.freeze&&Object.isFrozen(n.spatialReference)&&(e=!1),e&&(W++,n.spatialReference._arcadeCacheId=W,t=W)}const r=new e({wkt:n.spatialReference.wkt,wkid:n.spatialReference.wkid});return void 0!==t&&(r._arcadeCacheId="SPREF"+t.toString()),r}}switch(n.type){case"extent":switch(r){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const e=n[r];return void 0!==e?e:null}case"type":return"Extent"}break;case"polygon":switch(r){case"rings":s=n.cache._arcadeCacheId,void 0===s&&(W++,s=W,n.cache._arcadeCacheId=s);return new _(n.rings,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polygon"}break;case"point":switch(r){case"x":case"y":case"z":case"m":return void 0!==n[r]?n[r]:null;case"type":return"Point"}break;case"polyline":switch(r){case"paths":s=n.cache._arcadeCacheId,void 0===s&&(W++,s=W,n.cache._arcadeCacheId=s);return new _(n.paths,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polyline"}break;case"multipoint":switch(r){case"points":s=n.cache._arcadeCacheId,void 0===s&&(W++,s=W,n.cache._arcadeCacheId=s);return new t(n.points,n.spatialReference,!0===n.hasZ,!0===n.hasM,s,1);case"type":return"Multipoint"}}if(1===o)throw new z(a,D.InvalidIdentifier,i);return 2===o?{keystate:"notfound"}:null}export{q as geometryMember,Z as registerFunctions};
|
|
5
|
+
import e from"../Dictionary.js";import n from"../Feature.js";import t from"../ImmutablePointArray.js";import{y as r,m as a,x as i,q as o,F as s,G as l,v as c,c as f,j as u,k as m,b as h,a as p,i as w,f as d,C as y,w as g,s as R,H as I}from"../../chunks/languageUtils.js";import v from"../../geometry/Extent.js";import P from"../../geometry/Geometry.js";import x from"../../geometry/Multipoint.js";import b from"../../geometry/Point.js";import F from"../../geometry/Polygon.js";import j from"../../geometry/Polyline.js";import{angle2D as O,angleBetween2D as S,bearing2D as N,bearingBetween2D as k,pathsSelfIntersecting as J}from"./centroid.js";import{fromJSON as G}from"../../geometry/support/jsonUtils.js";import{ArcadeExecutionError as z,ExecutionErrorCodes as D}from"../executionError.js";import _ from"../ImmutablePathArray.js";import{isClockwise as C}from"../../geometry/support/coordsUtils.js";function M(e){return e&&"esri.arcade.Feature"===e.arcadeDeclaredClass}function Z(_,Z){_.ringisclockwise=function(e,n){return Z(e,n,((o,s,l)=>{r(l,1,1,e,n);let c=[],f=!1,u=!1;if(null===l[0])return!1;if(a(l[0])){for(const t of l[0]){if(!(t instanceof b))throw new z(e,D.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0][0].hasZ,u=l[0][0].hasM)}else if(l[0]instanceof t)c=l[0]._elements,c.length>0&&(f=l[0]._hasZ,u=l[0]._hasM);else{if(!i(l[0]))throw new z(e,D.InvalidParameter,n);for(const t of l[0].toArray()){if(!(t instanceof b))throw new z(e,D.InvalidParameter,n);c.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}c.length>0&&(f=l[0].get(0).hasZ,u=l[0].get(0).hasM)}return!(c.length<3)&&C(c,u,f)}))},_.polygon=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof F==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof F?G(c[0].toJSON()):o(new F(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.polyline=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof j==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof j?G(c[0].toJSON()):o(new j(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.point=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof b==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof b?G(c[0].toJSON()):o(new b(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.multipoint=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(c[0]instanceof e){if(f=o(n.parseGeometryFromDictionary(c[0]),t.spatialReference),f instanceof x==!1)throw new z(t,D.InvalidParameter,a)}else f=c[0]instanceof x?G(c[0].toJSON()):o(new x(JSON.parse(c[0])),t.spatialReference);if(null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.extent=function(t,a){return Z(t,a,((i,c,f)=>{f=l(f),r(f,1,1,t,a);let u=null;if(f[0]instanceof e)u=o(n.parseGeometryFromDictionary(f[0]),t.spatialReference);else if(f[0]instanceof b){const e={xmin:f[0].x,ymin:f[0].y,xmax:f[0].x,ymax:f[0].y,spatialReference:f[0].spatialReference.toJSON()},n=f[0];n.hasZ?(e.zmin=n.z,e.zmax=n.z):n.hasM&&(e.mmin=n.m,e.mmax=n.m),u=G(e)}else u=f[0]instanceof F||f[0]instanceof j||f[0]instanceof x?G(f[0].extent?.toJSON()):f[0]instanceof v?G(f[0].toJSON()):o(new v(JSON.parse(f[0])),t.spatialReference);if(null!==u&&!1===u.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(u)}))},_.geometry=function(t,a){return Z(t,a,((i,l,c)=>{r(c,1,1,t,a);let f=null;if(null===c[0])return null;if(f=M(c[0])?o(c[0].geometry(),t.spatialReference):c[0]instanceof e?o(n.parseGeometryFromDictionary(c[0]),t.spatialReference):o(G(JSON.parse(c[0])),t.spatialReference),null!==f&&!1===f.spatialReference.equals(t.spatialReference))throw new z(t,D.WrongSpatialReference,a);return s(f)}))},_.setgeometry=function(e,n){return Z(e,n,((t,a,i)=>{if(r(i,2,2,e,n),!M(i[0]))throw new z(e,D.InvalidParameter,n);if(!0===i[0].immutable)throw new z(e,D.Immutable,n);if(!(i[1]instanceof P||null===i[1]))throw new z(e,D.InvalidParameter,n);return i[0]._geometry=i[1],c}))},_.feature=function(t,r){return Z(t,r,((a,i,s)=>{if(0===s.length)throw new z(t,D.WrongNumberOfParameters,r);let l=null;if(1===s.length)if(f(s[0]))l=n.fromJson(JSON.parse(s[0]),t.timeReference);else if(M(s[0]))l=n.createFromArcadeFeature(s[0]);else if(s[0]instanceof P)l=n.createFromGraphicLikeObject(s[0],null,null,t.timeReference);else{if(!(s[0]instanceof e))throw new z(t,D.InvalidParameter,r);{let r=s[0].hasField("geometry")?s[0].field("geometry"):null,a=s[0].hasField("attributes")?s[0].field("attributes"):null;null!==r&&r instanceof e&&(r=n.parseGeometryFromDictionary(r)),null!==a&&(a=n.parseAttributesFromDictionary(a)),l=n.createFromGraphicLikeObject(r,a,null,t.timeReference)}}else if(2===s.length){let a=null,i=null;if(null!==s[0])if(s[0]instanceof P)a=s[0];else{if(!(a instanceof e))throw new z(t,D.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}if(null!==s[1]){if(!(s[1]instanceof e))throw new z(t,D.InvalidParameter,r);i=n.parseAttributesFromDictionary(s[1])}l=n.createFromGraphicLikeObject(a,i,null,t.timeReference)}else{let a=null;const i={};if(null!==s[0])if(s[0]instanceof P)a=s[0];else{if(!(a instanceof e))throw new z(t,D.InvalidParameter,r);a=n.parseGeometryFromDictionary(s[0])}for(let e=1;e<s.length;e+=2){const n=u(s[e]),a=s[e+1];if(!(null==a||f(a)||isNaN(a)||m(a)||h(a)||p(a)))throw new z(t,D.InvalidParameter,r);if(w(a)||!1===d(a))throw new z(t,D.InvalidParameter,r);i[n]=a===c?null:a}l=n.createFromGraphicLikeObject(a,i,null,t.timeReference)}return l._geometry=o(l.geometry(),t.spatialReference),l.immutable=!1,l}))},_.dictionary=function(n,t){return Z(n,t,((r,o,s)=>{if(0===s.length){const n=new e;return n.immutable=!1,n}if(1===s.length&&f(s[0]))try{const t=JSON.parse(s[0]),r=e.convertObjectToArcadeDictionary(t,y(n),!1);return r.immutable=!1,r}catch(g){throw new z(n,D.InvalidParameter,t)}if(s.length%2!=0)throw new z(n,D.WrongNumberOfParameters,t);const l={};for(let e=0;e<s.length;e+=2){const r=u(s[e]),o=s[e+1];if(!(null==o||f(o)||isNaN(o)||m(o)||h(o)||p(o)||a(o)||i(o)))throw new z(n,D.InvalidParameter,t);if(w(o))throw new z(n,D.InvalidParameter,t);l[r]=o===c?null:o}const d=new e(l);return d.immutable=!1,d}))},_.haskey=function(n,t){return Z(n,t,((a,i,o)=>{r(o,2,2,n,t);const s=u(o[1]);if(M(o[0]))return o[0].hasField(s);if(o[0]instanceof e)return o[0].hasField(s);if(o[0]instanceof P){const e=q(o[0],s,null,null,2);return!e||"notfound"!==e.keystate}throw new z(n,D.InvalidParameter,t)}))},_.hasvalue=function(n,t){return Z(n,t,((a,i,o)=>{if(r(o,2,2,n,t),null===o[0]||null===o[1])return!1;const s=u(o[1]);if(g(o[0]))return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof e)return!!o[0].hasField(s)&&null!==o[0].field(s);if(o[0]instanceof P){return null!==q(o[0],s,null,null,0)}return!1}))},_.indexof=function(e,n){return Z(e,n,((t,o,s)=>{r(s,2,2,e,n);const l=s[1];if(a(s[0])){for(let e=0;e<s[0].length;e++)if(R(l,s[0][e]))return e;return-1}if(i(s[0])){const e=s[0].length();for(let n=0;n<e;n++)if(R(l,s[0].get(n)))return n;return-1}throw new z(e,D.InvalidParameter,n)}))},_.angle=function(e,n){return Z(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof b))throw new z(e,D.InvalidParameter,n);if(!(i[1]instanceof b))throw new z(e,D.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof b))throw new z(e,D.InvalidParameter,n);return 2===i.length?O(i[0],i[1]):S(i[0],i[1],i[2])}))},_.bearing=function(e,n){return Z(e,n,((t,a,i)=>{if(i=l(i),r(i,2,3,e,n),!(i[0]instanceof b))throw new z(e,D.InvalidParameter,n);if(!(i[1]instanceof b))throw new z(e,D.InvalidParameter,n);if(i.length>2&&!(i[2]instanceof b))throw new z(e,D.InvalidParameter,n);return 2===i.length?N(i[0],i[1]):k(i[0],i[1],i[2])}))},_.isselfintersecting=function(e,n){return Z(e,n,((t,o,s)=>{s=l(s),r(s,1,1,e,n);let c=s[0];if(c instanceof F)return c.isSelfIntersecting;if(c instanceof j)return c=c.paths,J(c);if(c instanceof x){const e=c.points;for(let n=0;n<e.length;n++)for(let t=0;t<e.length;t++)if(t!==n){let r=!0;for(let a=0;a<e[n].length;a++)if(e[n][a]!==e[t][a]){r=!1;break}if(!0===r)return!0}}return!(!a(c)&&!i(c))&&(c=I(c,e.spatialReference),null!==c&&(c=c.paths),J(c))}))}}let W=0;function q(n,r,a,i,o=1){let s;switch(r=r.toLowerCase()){case"hasz":{const e=n.hasZ;return void 0!==e&&e}case"hasm":{const e=n.hasM;return void 0!==e&&e}case"spatialreference":{let t=n.spatialReference._arcadeCacheId;if(void 0===t){let e=!0;Object.freeze&&Object.isFrozen(n.spatialReference)&&(e=!1),e&&(W++,n.spatialReference._arcadeCacheId=W,t=W)}const r=new e({wkt:n.spatialReference.wkt,wkid:n.spatialReference.wkid});return void 0!==t&&(r._arcadeCacheId="SPREF"+t.toString()),r}}switch(n.type){case"extent":switch(r){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const e=n[r];return void 0!==e?e:null}case"type":return"Extent"}break;case"polygon":switch(r){case"rings":s=n.cache._arcadeCacheId,void 0===s&&(W++,s=W,n.cache._arcadeCacheId=s);return new _(n.rings,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polygon"}break;case"point":switch(r){case"x":case"y":case"z":case"m":return void 0!==n[r]?n[r]:null;case"type":return"Point"}break;case"polyline":switch(r){case"paths":s=n.cache._arcadeCacheId,void 0===s&&(W++,s=W,n.cache._arcadeCacheId=s);return new _(n.paths,n.spatialReference,!0===n.hasZ,!0===n.hasM,s);case"type":return"Polyline"}break;case"multipoint":switch(r){case"points":s=n.cache._arcadeCacheId,void 0===s&&(W++,s=W,n.cache._arcadeCacheId=s);return new t(n.points,n.spatialReference,!0===n.hasZ,!0===n.hasM,s,1);case"type":return"Multipoint"}}if(1===o)throw new z(a,D.InvalidIdentifier,i);return 2===o?{keystate:"notfound"}:null}export{q as geometryMember,Z as registerFunctions};
|
package/arcade.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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"./Graphic.js";import{ArcadeDate as t}from"./arcade/ArcadeDate.js";import r from"./arcade/ImmutableArray.js";import a from"./core/Error.js";import{clone as n}from"./core/lang.js";import o from"./layers/FeatureLayer.js";import c from"./portal/Portal.js";import s from"./rest/support/FeatureSet.js";import{loadArcade as i}from"./support/arcadeOnDemand.js";let u=null;function p(e,t,a,n={}){const o=t.elementType,c="value",s="array"===o.type?[{name:c,type:o.type,elementType:o.elementType}]:"dictionary"===o.type?[{name:c,type:o.type,properties:o.properties}]:[{name:c,type:o.type}];return new r(e.map((e=>{const t={};return y(t,s,{[c]:e},a,n),t[c]})))}function l(e,t,r={}){const a=e instanceof s?new o({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return t.constructFeatureSet(a,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function f(e,t,r={}){const{spatialReference:a,interceptor:n,lruCache:o}=r;return"string"==typeof e?t.createFeatureSetCollectionFromService(e,a,o,n):t.createFeatureSetCollectionFromMap(e,a,o,n)}function m(e,t,r,a={}){const n={};return y(n,t.properties,e,r,a),new u.Dictionary(n)}function y(e,r,a,n,o={}){const c={};for(const t of Object.keys(a))c[t.toLowerCase()]=a[t];for(const s of r){const r=s.name.toLowerCase();if(o.variablesPreProcessed)e[r]=c[r];else switch(s.type){case"array":{const t=c[r];e[r]=p(t,s,n,o);break}case"feature":{const t=c[r];e[r]=null==t?null:u.Feature.createFromGraphic(t);break}case"featureSet":{const t=c[r];e[r]=n?l(t,n,o):null;break}case"featureSetCollection":{const t=c[r];e[r]=n?f(t,n,o):null;break}case"dictionary":{const t=c[r];e[r]=m(t,s,n,o);break}case"date":{const a=c[r];e[r]=a?a instanceof t?a:o?.timeReference?.timeZone?t.dateJSAndZoneToArcadeDate(a,o?.timeReference?.timeZone):t.dateJSToArcadeDate(a):null;break}case"geometry":case"boolean":case"text":case"number":e[r]=c[r]}}}function d(e,t){for(const r of e)t.push(r),"dictionary"===r.type&&d(r.properties,t);return t}function b(e,t,r,a,n){const{spatialReference:o,interceptor:s,lruCache:i,console:u,abortSignal:p,timeReference:l,services:f={portal:c.getDefault()}}=r,m={vars:{},spatialReference:o,interceptor:s,timeReference:l,lrucache:i,useAsync:n,services:f,console:u,abortSignal:p};return t?(y(m.vars,e.variables,t,a,r),m):m}function S(t,r){switch(r.getArcadeType(t)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return t;case"date":return t.toJSDate();case"feature":{const r=(t.type,t),a="geometry"in r?r.geometry():null,n="readAttributes"in r?r.readAttributes():r.attributes;return new e({geometry:a,attributes:n})}case"dictionary":{const e=t,a=e.attributes,n={};for(const t of Object.keys(a))n[t]=S(e.field(t),r);return n}case"array":return("toArray"in t?t.toArray():t).map((e=>S(e,r)))}return t}const v={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]},w={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},$=new Map([["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",v],["popup-element",v],["feature-reduction-popup",w],["feature-reduction-popup-element",w],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function g(e){const t=$.get(e);if(!t){const t=Array.from($.keys()).map((e=>`'${e}'`)).join(", ");throw new a("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${t}`)}return n(t)}async function C(e,t,r={}){u||(u=await i());const{arcade:n,arcadeUtils:o}=u,{loadScriptDependencies:c,referencesMember:s,scriptIsAsync:p}=n,l=d(t.variables,[]),f=l.filter((e=>"featureSet"===e.type||"featureSetCollection"===e.type)).map((e=>e.name.toLowerCase())),m=n.parseScript(e,f);if(!m)throw new a("arcade:invalid-script","Unable to create SyntaxTree");const y=o.extractFieldNames(m),v=n.scriptTouchesGeometry(m),w=l.map((e=>e.name.toLowerCase())).filter((e=>s(m,e))),$=p(m,f);await c(m,$,f);const g={vars:{},spatialReference:null,useAsync:$};for(const a of w)g.vars[a]="any";const{lruCache:C}=r,h=n.compileScript(m,g),A=n.featureSetUtils();return{execute:(e,r={})=>{if($)throw new a("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const n=h(b(t,e,{lruCache:C,...r},A,$));return r.rawOutput?n:S(n,o)},executeAsync:async(e,r={})=>{const a=await h(b(t,e,{lruCache:C,...r},A,$));return r.rawOutput?a:S(a,o)},isAsync:$,variablesUsed:w,fieldsUsed:y,geometryUsed:v,syntaxTree:m}}export{C as createArcadeExecutor,g as createArcadeProfile};
|
|
5
|
+
import e from"./Graphic.js";import{ArcadeDate as t}from"./arcade/ArcadeDate.js";import r from"./arcade/ImmutableArray.js";import a from"./core/Error.js";import{clone as n}from"./core/lang.js";import o from"./layers/FeatureLayer.js";import c from"./portal/Portal.js";import s from"./rest/support/FeatureSet.js";import{loadArcade as i}from"./support/arcadeOnDemand.js";let u=null;function p(e,t,a,n={}){const o=t.elementType,c="value",s="array"===o.type?[{name:c,type:o.type,elementType:o.elementType}]:"dictionary"===o.type?[{name:c,type:o.type,properties:o.properties}]:[{name:c,type:o.type}];return new r(e.map((e=>{const t={};return y(t,s,{[c]:e},a,n),t[c]})))}function l(e,t,r={}){const a=e instanceof s?new o({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return t.constructFeatureSet(a,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function f(e,t,r={}){const{spatialReference:a,interceptor:n,lruCache:o}=r;return"string"==typeof e?t.createFeatureSetCollectionFromService(e,a,o,n):t.createFeatureSetCollectionFromMap(e,a,o,n)}function m(e,t,r,a={}){const n={};return y(n,t.properties,e,r,a),new u.Dictionary(n)}function y(e,r,a,n,o={}){const c={};for(const t of Object.keys(a))c[t.toLowerCase()]=a[t];for(const s of r){const r=s.name.toLowerCase();if(o.variablesPreProcessed)e[r]=c[r];else switch(s.type){case"array":{const t=c[r];e[r]=p(t,s,n,o);break}case"feature":{const t=c[r];e[r]=null==t?null:u.Feature.createFromGraphic(t,o?.timeReference);break}case"featureSet":{const t=c[r];e[r]=n?l(t,n,o):null;break}case"featureSetCollection":{const t=c[r];e[r]=n?f(t,n,o):null;break}case"dictionary":{const t=c[r];e[r]=m(t,s,n,o);break}case"date":{const a=c[r];e[r]=a?a instanceof t?a:o?.timeReference?.timeZone?t.dateJSAndZoneToArcadeDate(a,o?.timeReference?.timeZone):t.dateJSToArcadeDate(a):null;break}case"geometry":case"boolean":case"text":case"number":e[r]=c[r]}}}function d(e,t){for(const r of e)t.push(r),"dictionary"===r.type&&d(r.properties,t);return t}function b(e,t,r,a,n){const{spatialReference:o,interceptor:s,lruCache:i,console:u,abortSignal:p,timeReference:l,services:f={portal:c.getDefault()}}=r,m={vars:{},spatialReference:o,interceptor:s,timeReference:l,lrucache:i,useAsync:n,services:f,console:u,abortSignal:p};return t?(y(m.vars,e.variables,t,a,r),m):m}function S(t,r){switch(r.getArcadeType(t)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return t;case"date":return t.toJSDate();case"feature":{const r=(t.type,t),a="geometry"in r?r.geometry():null,n="readAttributes"in r?r.readAttributes():r.attributes;return new e({geometry:a,attributes:n})}case"dictionary":{const e=t,a=e.attributes,n={};for(const t of Object.keys(a))n[t]=S(e.field(t),r);return n}case"array":return("toArray"in t?t.toArray():t).map((e=>S(e,r)))}return t}const v={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]},w={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},$=new Map([["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",v],["popup-element",v],["feature-reduction-popup",w],["feature-reduction-popup-element",w],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function g(e){const t=$.get(e);if(!t){const t=Array.from($.keys()).map((e=>`'${e}'`)).join(", ");throw new a("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${t}`)}return n(t)}async function C(e,t,r={}){u||(u=await i());const{arcade:n,arcadeUtils:o}=u,{loadScriptDependencies:c,referencesMember:s,scriptIsAsync:p}=n,l=d(t.variables,[]),f=l.filter((e=>"featureSet"===e.type||"featureSetCollection"===e.type)).map((e=>e.name.toLowerCase())),m=n.parseScript(e,f);if(!m)throw new a("arcade:invalid-script","Unable to create SyntaxTree");const y=o.extractFieldNames(m),v=n.scriptTouchesGeometry(m),w=l.map((e=>e.name.toLowerCase())).filter((e=>s(m,e))),$=p(m,f);await c(m,$,f);const g={vars:{},spatialReference:null,useAsync:$};for(const a of w)g.vars[a]="any";const{lruCache:C}=r,h=n.compileScript(m,g),A=n.featureSetUtils();return{execute:(e,r={})=>{if($)throw new a("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const n=h(b(t,e,{lruCache:C,...r},A,$));return r.rawOutput?n:S(n,o)},executeAsync:async(e,r={})=>{const a=await h(b(t,e,{lruCache:C,...r},A,$));return r.rawOutput?a:S(a,o)},isAsync:$,variablesUsed:w,fieldsUsed:y,geometryUsed:v,syntaxTree:m}}export{C as createArcadeExecutor,g as createArcadeProfile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M13 0v15.469l-5-3.556-5 3.556V0z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M20 1v22.444l-8-5.44-8 5.44V1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M25 2v27.493l-9-6.67-9 6.67V2z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M9 14v1h2v-1H9zm5-1v1h-1v1h2v-2h-1zm0-6h1V5h-1v2zm-.5-6C6.61 1 1 6.61 1 13.5V15h2v-1H2v-.5C2 7.16 7.16 2 13.5 2h.5v1h1V1h-1.5zm.5 8v2h1V9h-1zm-9 5v1h2v-1H5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M13 22h-2v-1h2v1zm-5-1H6v1h2v-1zm10 0h-2v1h2v-1zm4-13V6h-1v2h1zm0 5v-2h-1v2h1zm0 5v-2h-1v2h1zm0 0v-2h-1v2h1zM18.5 2C9.4 2 2 9.4 2 18.5V22h2v-1H3v-2.5C3 9.95 9.95 3 18.5 3H21v1h1V2h-3.5zM21 20v1h-1v1h2v-2h-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M9 29H7v-1h2v1zm4-1h-2v1h2v-1zM25.5 3C13.09 3 3 13.09 3 25.5V29h2v-1H4v-2.5C4 13.65 13.64 4 25.5 4H28v1h1V3h-3.5zM21 28h-2v1h2v-1zm-4 0h-2v1h2v-1zm8 0h-2v1h2v-1zm4-19V7h-1v2h1zm0 4v-2h-1v2h1zm0 8v-2h-1v2h1zm0-4v-2h-1v2h1zm0 8v-2h-1v2h1zm-1 2v1h-1v1h2v-2h-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M9 14v1h2v-1H9zm5-1v1h-1v1h2v-2h-1zm0-6h1V5h-1v2zM7.5 1C3.92 1 1 3.92 1 7.5V15h2v-1H2V7.5C2 4.47 4.47 2 7.5 2H14v1h1V1H7.5zM14 9v2h1V9h-1zm-9 5v1h2v-1H5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M13 22h-2v-1h2v1zm-5-1H6v1h2v-1zm10 0h-2v1h2v-1zm4-13V6h-1v2h1zm0 5v-2h-1v2h1zm0 5v-2h-1v2h1zm0 0v-2h-1v2h1zM10.5 2C5.81 2 2 5.81 2 10.5V22h2v-1H3V10.5C3 6.36 6.36 3 10.5 3H21v1h1V2H10.5zM21 20v1h-1v1h2v-2h-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M29 3v2h-1V4H13.5C8.26 4 4 8.26 4 13.5V28h1v1H3V13.5C3 7.71 7.71 3 13.5 3H29zM9 28H7v1h2v-1zm4 0h-2v1h2v-1zm8 0h-2v1h2v-1zm-4 0h-2v1h2v-1zm8 0h-2v1h2v-1zm4-19V7h-1v2h1zm0 4v-2h-1v2h1zm0 8v-2h-1v2h1zm0-4v-2h-1v2h1zm0 8v-2h-1v2h1zm-1 2v1h-1v1h2v-2h-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M9 14v1h2v-1H9zm5-1v1h-1v1h2v-2h-1zm0-6h1V5h-1v2zM1 1v14h2v-1H2V2h12v1h1V1H1zm13 8v2h1V9h-1zm-9 5v1h2v-1H5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M13 22h-2v-1h2v1zm-5-1H6v1h2v-1zm10 0h-2v1h2v-1zm4-13V6h-1v2h1zm0 5v-2h-1v2h1zm0 5v-2h-1v2h1zm0 0v-2h-1v2h1zM2 2v20h2v-1H3V3h18v1h1V2H2zm19 18v1h-1v1h2v-2h-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M29 3v2h-1V4H4v24h1v1H3V3h26zM9 28H7v1h2v-1zm4 0h-2v1h2v-1zm8 0h-2v1h2v-1zm-4 0h-2v1h2v-1zm8 0h-2v1h2v-1zm4-19V7h-1v2h1zm0 4v-2h-1v2h1zm0 8v-2h-1v2h1zm0-4v-2h-1v2h1zm0 8v-2h-1v2h1zm-1 2v1h-1v1h2v-2h-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M3 11.5V14h10l-.009-2.5A2.495 2.495 0 0 0 10.5 9h-5A2.503 2.503 0 0 0 3 11.5zm9 0V13H4v-1.5A1.502 1.502 0 0 1 5.5 10h5a1.502 1.502 0 0 1 1.5 1.5zM8 7.8A2.8 2.8 0 1 0 5.2 5 2.803 2.803 0 0 0 8 7.8zm0-4.6A1.8 1.8 0 1 1 6.2 5 1.802 1.802 0 0 1 8 3.2zM16 0v4h-1V1h-3V0zm-1 12h1v4h-4v-1h3zM1 15h3v1H0v-4h1zM1 4H0V0h4v1H1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12 11.8A3.8 3.8 0 1 0 8.2 8a3.804 3.804 0 0 0 3.8 3.8zm0-6.6A2.8 2.8 0 1 1 9.2 8 2.803 2.803 0 0 1 12 5.2zM9.5 13a4.497 4.497 0 0 0-4.491 4.5L5 20h14v-2.5a4.505 4.505 0 0 0-4.5-4.5zm8.5 4.5V19H6v-1.5A3.504 3.504 0 0 1 9.5 14h5a3.504 3.504 0 0 1 3.5 3.5zm4-.5h1v6h-6v-1h5zM2 22h5v1H1v-6h1zM2 7H1V1h6v1H2zm21-6v6h-1V2h-5V1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M7.009 22.5L7 27h18v-4.5a5.506 5.506 0 0 0-5.5-5.5h-7a5.499 5.499 0 0 0-5.491 5.5zM24 22.5V26H8v-3.5a4.505 4.505 0 0 1 4.5-4.5h7a4.505 4.505 0 0 1 4.5 4.5zm-8-7.7a4.8 4.8 0 1 0-4.8-4.8 4.805 4.805 0 0 0 4.8 4.8zm0-8.6a3.8 3.8 0 1 1-3.8 3.8A3.804 3.804 0 0 1 16 6.2zM3 9H2V2h7v1H3zm27-7v7h-1V3h-6V2zm-1 21h1v7h-7v-1h6zM3 29h6v1H2v-7h1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M9.756 11a3.22 3.22 0 0 0 .166 1H8V9H7v3H2V7H.335L3 4.656V1h3.006L5.98 2.05 7.466.75 14.603 7H13v.732a3.206 3.206 0 0 0-1 .175V6.05L7.466 2.08l-2.51 2.198V3.175L4.982 2H4v3.108L2.985 6H3v5h3V8h3v3zm4.635 1.33a1.9 1.9 0 0 0 .564-1.331 1.95 1.95 0 1 0-3.9 0 1.905 1.905 0 0 0 .566 1.334 2.804 2.804 0 0 0-1.571 2.649v1h.955v-1a1.99 1.99 0 0 1 .764-1.572 2.034 2.034 0 0 1 1.74-.367 2.08 2.08 0 0 1 1.496 2.059v.88h.9v-.88a3.069 3.069 0 0 0-1.514-2.773zM13 12a1 1 0 1 1 1-1 1.001 1.001 0 0 1-1 1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M13 20v-6H9v6H3v-9.001l-1.745-.003L4 8.43 4.003 3H8v1.743l3.052-2.88L20.756 11H19v1.55a3.973 3.973 0 0 0-1 .248V10h.234l-7.182-6.763-4.048 3.822L7 4H5v4.864L3.784 10l.216.001V19h4v-6h6v6h1.17a5.008 5.008 0 0 0-.427 1zm8.083-1.635a2.433 2.433 0 0 0 .892-1.867 2.475 2.475 0 0 0-4.95 0 2.433 2.433 0 0 0 .89 1.866 3.22 3.22 0 0 0-.658.418A3.492 3.492 0 0 0 16 21.468V23h1v-1.532a2.503 2.503 0 0 1 2.97-2.457A2.61 2.61 0 0 1 22 21.615V23h1v-1.385a3.638 3.638 0 0 0-1.917-3.25zM19.5 15a1.5 1.5 0 1 1-1.5 1.5 1.502 1.502 0 0 1 1.5-1.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M19 27h1.694a5.994 5.994 0 0 0-.17 1H18v-8h-6v8H4V16H1.5L5 12.5V4h5v3.5l5-5L28.5 16H26v.55a4.934 4.934 0 0 0-1 .205V15h1.086L15 3.914l-6 6V5H6v7.914L3.914 15H5v12h6v-8h8zm11.95 1.64L31 31h-1v-2.36a3.583 3.583 0 0 0-2.771-3.578 3.64 3.64 0 0 0-.716-.063L26.5 25c-.024 0-.045-.006-.069-.007A3.495 3.495 0 0 0 23 28.489V31h-1v-2.51a4.425 4.425 0 0 1 2.591-4.063A3.486 3.486 0 1 1 29.95 21.5a3.452 3.452 0 0 1-1.54 2.926 4.608 4.608 0 0 1 2.54 4.214zM29 21.5a2.5 2.5 0 1 0-2.5 2.5 2.503 2.503 0 0 0 2.5-2.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M15.28 11.57l-1.71 1.71L9.79 9.5l.5-.5-.29-.29-1.5 1.5L5.79 7.5 7.29 6l-.36-.36-.5.5L2.79 2.5 4.5.79l3.64 3.64-.5.5.36.36 1.5-1.5 2.71 2.71-1.5 1.5.29.29.5-.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M24 14.29l-4.5-4.5-1 1-1.29-1.29 2-2-2.71-2.71-2 2-1.29-1.29 1-1L9.71 0h-.42l-2.5 2.5 4.71 4.71 1-1 1.29 1.29-2 2 2.71 2.71 2-2 1.29 1.29-1 1 4.71 4.71 2.5-2.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M31.21 21.5l-2.71 2.71-6.71-6.71 1-1-1.29-1.29-3 3-4.71-4.71 3-3-1.29-1.29-1 1L7.79 3.5 10.5.79l6.71 6.71-1 1 1.29 1.29 3-3 4.71 4.71-3 3 1.29 1.29 1-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M5 8H4a3.999 3.999 0 0 0 4 4v-1a3.009 3.009 0 0 1-3-3zm10.28 3.57l-1.71 1.71L9.79 9.5l.5-.5-.29-.29-1.5 1.5L5.79 7.5 7.29 6l-.36-.36-.5.5L2.79 2.5 4.5.79l3.64 3.64-.5.5.36.36 1.5-1.5 2.71 2.71-1.5 1.5.29.29.5-.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M9 9H8a7.008 7.008 0 0 0 7 7v-1a6.005 6.005 0 0 1-6-6zm.71-9l4.5 4.5-1 1 1.29 1.29 2-2 2.71 2.71-2 2 1.29 1.29 1-1 4.5 4.5v.42l-2.5 2.5-4.71-4.71 1-1-1.29-1.29-2 2-2.71-2.71 2-2-1.29-1.29-1 1L6.79 2.5 9.29 0z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M11.78 20.22A6.093 6.093 0 0 1 10 15.99l-1 .02A7.105 7.105 0 0 0 15.99 23l.02-1a6.093 6.093 0 0 1-4.23-1.78zm19.43 1.28l-2.71 2.71-6.71-6.71 1-1-1.29-1.29-3 3-4.71-4.71 3-3-1.29-1.29-1 1L7.79 3.5 10.5.79l6.71 6.71-1 1 1.29 1.29 3-3 4.71 4.71-3 3 1.29 1.29 1-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M3 8H2a6.005 6.005 0 0 0 6 6v-1a5.002 5.002 0 0 1-5-5zm2 0H4a3.999 3.999 0 0 0 4 4v-1a3.009 3.009 0 0 1-3-3zm10.28 3.57l-1.71 1.71L9.79 9.5l.5-.5-.29-.29-1.5 1.5L5.79 7.5 7.29 6l-.36-.36-.5.5L2.79 2.5 4.5.79l3.64 3.64-.5.5.36.36 1.5-1.5 2.71 2.71-1.5 1.5.29.29.5-.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M5 9H4a11.007 11.007 0 0 0 11 11v-1A10.016 10.016 0 0 1 5 9zm4 0H8a7.008 7.008 0 0 0 7 7v-1a6.005 6.005 0 0 1-6-6zm15 5.29l-4.5-4.5-1 1-1.29-1.29 2-2-2.71-2.71-2 2-1.29-1.29 1-1L9.71 0h-.42l-2.5 2.5 4.71 4.71 1-1 1.29 1.29-2 2 2.71 2.71 2-2 1.29 1.29-1 1 4.71 4.71 2.5-2.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M6 16H5a11.007 11.007 0 0 0 11 11v-1A10.016 10.016 0 0 1 6 16zm5.78 4.22A6.093 6.093 0 0 1 10 15.99l-1 .02A7.105 7.105 0 0 0 15.99 23l.02-1a6.093 6.093 0 0 1-4.23-1.78zm19.43 1.28l-2.71 2.71-6.71-6.71 1-1-1.29-1.29-3 3-4.71-4.71 3-3-1.29-1.29-1 1L7.79 3.5 10.5.79l6.71 6.71-1 1 1.29 1.29 3-3 4.71 4.71-3 3 1.29 1.29 1-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M1 8H0a8.01 8.01 0 0 0 8 8v-1a7.008 7.008 0 0 1-7-7zm4 0H4a3.999 3.999 0 0 0 4 4v-1a3.009 3.009 0 0 1-3-3zM3 8H2a6.005 6.005 0 0 0 6 6v-1a5.002 5.002 0 0 1-5-5zm12.28 3.57l-1.71 1.71L9.79 9.5l.5-.5-.29-.29-1.5 1.5L5.79 7.5 7.29 6l-.36-.36-.5.5L2.79 2.5 4.5.79l3.64 3.64-.5.5.36.36 1.5-1.5 2.71 2.71-1.5 1.5.29.29.5-.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M1 9H0a15.018 15.018 0 0 0 15 15v-1A14.015 14.015 0 0 1 1 9zm4 0H4a11.007 11.007 0 0 0 11 11v-1A10.016 10.016 0 0 1 5 9zm4 0H8a7.008 7.008 0 0 0 7 7v-1a6.005 6.005 0 0 1-6-6zm15 5.29l-4.5-4.5-1 1-1.29-1.29 2-2-2.71-2.71-2 2-1.29-1.29 1-1L9.71 0h-.42l-2.5 2.5 4.71 4.71 1-1 1.29 1.29-2 2 2.71 2.71 2-2 1.29 1.29-1 1 4.71 4.71 2.5-2.5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M2 16H1a15.018 15.018 0 0 0 15 15v-1A14.015 14.015 0 0 1 2 16zm4 0H5a11.007 11.007 0 0 0 11 11v-1A10.016 10.016 0 0 1 6 16zm5.78 4.22A6.093 6.093 0 0 1 10 15.99l-1 .02A7.105 7.105 0 0 0 15.99 23l.02-1a6.093 6.093 0 0 1-4.23-1.78zm19.43 1.28l-2.71 2.71-6.71-6.71 1-1-1.29-1.29-3 3-4.71-4.71 3-3-1.29-1.29-1 1L7.79 3.5 10.5.79l6.71 6.71-1 1 1.29 1.29 3-3 4.71 4.71-3 3 1.29 1.29 1-1z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M5 14a2.002 2.002 0 0 1-2-2V4h7v1.74a1.702 1.702 0 0 0 .33-.214l.494-.453A.967.967 0 0 1 11 4.964V4a1 1 0 0 0-1-1H9V.5a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 0-.5.5V3H3a1 1 0 0 0-1 1v8a3 3 0 0 0 3 3h3a2.948 2.948 0 0 0 .33-.033A7.985 7.985 0 0 1 7.48 14zM5 1h3v2H5zm10.928 6.912l-.058-.628-.63-.033a5.325 5.325 0 0 1-3.248-.989L11.5 5.81l-.493.452a5.324 5.324 0 0 1-3.247.99l-.63.032-.058.629c-.228 2.512-.07 5.614 4.08 7.878l.348.189.348-.189c4.15-2.264 4.308-5.366 4.08-7.879zM11.5 14.841a6.098 6.098 0 0 1-3.452-6.605A6.325 6.325 0 0 0 11.5 7.155a6.328 6.328 0 0 0 3.452 1.08 6.1 6.1 0 0 1-3.452 6.606zM4 5h2v1H4z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M11 22H7a3.003 3.003 0 0 1-3-3V8h10v4.1a6.805 6.805 0 0 0 1-.357V8a1 1 0 0 0-1-1h-1V2a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v5H4a1 1 0 0 0-1 1v11a4 4 0 0 0 4 4h4a3.957 3.957 0 0 0 1.945-.525 10.217 10.217 0 0 1-.7-.753A2.97 2.97 0 0 1 11 22zM6 2h6v5H6zm15.933 11.55c-2.42-.14-4.331-.627-5.433-1.561-1.102.934-3.013 1.421-5.433 1.562-.428 5.12 1.295 7.977 5.433 10.266 4.138-2.289 5.861-5.147 5.433-10.266zM16.5 22.665c-3.312-1.973-4.622-4.35-4.488-8.183a10.584 10.584 0 0 0 4.488-1.264 10.584 10.584 0 0 0 4.488 1.264c.134 3.834-1.175 6.21-4.488 8.183zM5 9h2v1H5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16 29H8a3.003 3.003 0 0 1-3-3V10h14v3.935a7.692 7.692 0 0 0 1-.369V10a1 1 0 0 0-1-1h-2V2a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7H5a1 1 0 0 0-1 1v16a4 4 0 0 0 4 4h8a3.966 3.966 0 0 0 2.374-.796c-.253-.232-.49-.468-.716-.707A2.98 2.98 0 0 1 16 29zM8 2h8v7H8zm21.874 14.242l-.07-.78-.774-.04c-2.86-.145-4.826-.81-6.188-2.088l-.342-.322-.342.321c-1.341 1.26-3.357 1.944-6.2 2.09l-.773.04-.07.78c-.382 4.295-.092 10.56 6.953 14.491l.432.24.432-.24c7.02-3.916 7.323-10.19 6.942-14.492zM22.5 29.83c-6.438-3.624-6.74-9.41-6.396-13.413a10.737 10.737 0 0 0 6.396-2.054c1.5 1.241 3.547 1.897 6.385 2.054.344 4.01.027 9.804-6.385 13.413zM6 12h2v1H6z"
|