@arcgis/core 4.33.0-next.20250226 → 4.33.0-next.20250227
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{2716394f121804d93b4e.js → 4253438dd3045566892d.js} +1 -1
- package/assets/esri/core/workers/chunks/823bf95f42cc42f20e22.js +1 -0
- package/assets/esri/core/workers/chunks/ae25c6108918d37e61bf.js +1 -0
- package/assets/esri/core/workers/chunks/{feb656f172ec9fe64752.js → af005704f23088db3ded.js} +1 -1
- package/assets/esri/core/workers/chunks/{dea40706ca4e37d5c6e2.js → d4d011eea16a89a5aad9.js} +1 -1
- package/core/sql/StandardizedFunctions.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/sqlCompareUtils.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/package.json +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/views/2d/engine/webgl/animations/utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TestShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BandArithmeticShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CompositeBandShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ComputeChangeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ContrastBrightnessShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ExtractBandShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/GrayscaleShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/LocalShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/NDVIShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/StretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/webgl-engine/lib/ComponentUtils.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/View.js +1 -1
- package/views/webgl/capabilities.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/assets/esri/core/workers/chunks/66338f008ff0992ffca2.js +0 -1
- package/assets/esri/core/workers/chunks/d5ebe6b7cd9c8e40b386.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import s from"../../../core/Identifiable.js";import{
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import s from"../../../core/Identifiable.js";import{watch as a,on as i,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as n}from"../../../layers/support/editableLayers.js";import c from"../../../support/actions/ActionToggle.js";import d from"../../Widget.js";import{css as h}from"../css.js";import{isValidDataCaptureLayer as p}from"../dataCaptureUtils.js";import m from"./OverlayLayersList.js";import{loadCalciteComponents as y}from"../../support/componentsUtils.js";import{globalCss as u}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{tsx as g}from"../../support/jsxFactory.js";let L=class extends(s.IdentifiableMixin(d)){constructor(e){super(e),this._previousAction=null,this.closed=!1,this.dataCaptureEnabled=!1,this.dataCaptureLayer=null,this.imageGeometryField=null,this.imageReferenceField=null,this.layerList=new m({selectionMode:"multiple"}),this.messages=null,this.overlayedLayers=new t,this.showCameraLocations=!1,this.showMapFeatures=!1,this._createSelectedItemsHandle=()=>{this.removeHandles("selected-items"),this.addHandles(this._trackLayerSelectionChanges(),"selected-items")},this._createDataCaptureLayerHandle=()=>a((()=>({dataCaptureLayer:this.dataCaptureLayer,operationalItems:this.layerList.operationalItems})),(({dataCaptureLayer:e,operationalItems:t},s)=>{if(!e&&s?.dataCaptureLayer){const e=t.find((e=>e.layer===s.dataCaptureLayer));e&&e.actionsSections?.items.forEach((e=>{e.items.forEach((e=>{"create-features"===e.id&&(e.value=!1)}))}))}}),o),this._handleSelectedItemsChange=({added:e,removed:t})=>{e.forEach((e=>{this.overlayedLayers.includes(e.layer)||this.onLayerSelected?.(e)})),t.forEach((e=>{this.overlayedLayers.includes(e.layer)&&this.onLayerDeselected?.(e)})),this.overlayedLayers.removeAll(),this.overlayedLayers.addMany(this.layerList.selectedItems.items.map((e=>e.layer)))},this._layerListTriggerActionHandle=()=>i((()=>this.layerList),"trigger-action",(e=>{const{action:t,item:{layer:s}}=e;if(this._resetPreviousAction(t),"create-features"===t.id)this._toggleDataCaptureLayer(t,s)})),this._resetPreviousAction=e=>{"toggle"===this._previousAction?.type&&this._previousAction!==e&&(this._previousAction.value=!1,this._previousAction=null)},this._toggleDataCaptureLayer=(e,t)=>{this._previousAction=e;const s=e.value;this.dataCaptureLayer=s?t:null,this.onDataCaptureLayerChanged?.(this.dataCaptureLayer)},this._trackLayerSelectionChanges=()=>i((()=>this.layerList.selectedItems),"change",this._handleSelectedItemsChange),this._watchLayerListForListItemCreatedFunction=()=>a((()=>({layerList:this.layerList,listItemCreatedFunction:this._listItemCreatedFunction})),(()=>{this.layerList.listItemCreatedFunction=this._listItemCreatedFunction}),o),this._watchSelectedItems=()=>a((()=>this.layerList.selectedItems),this._createSelectedItemsHandle,o)}initialize(){this.addHandles([this._watchSelectedItems(),this._layerListTriggerActionHandle(),this._watchLayerListForListItemCreatedFunction(),this._createDataCaptureLayerHandle()])}loadDependencies(){return y({list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get _listItemCreatedFunction(){const{dataCaptureEnabled:e,imageGeometryField:t,imageReferenceField:s}=this;return e&&t&&s?async e=>{const{item:a}=e,i=a.layer,{dataCaptureLayer:o,overlayedLayers:r,messages:{createFeaturesFromImage:l},layerList:c}=this,d=r.includes(i),{selectedItems:h}=c;if(C(d,h,a),await(i?.load()),!i||!p(i,t,s)||!n(i))return;const m=o===i,y=_(l,a,h,m);m&&(this._previousAction=y)}:null}get view(){return this.layerList?.view}set view(e){this.layerList.view=e}_renderCameraLocationsSwitch(e){return g("calcite-list-item",{bind:this,label:this.messages.overlayCameraLocations,onclick:this._toggleShowCameraLocations},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowCameraLocations,scale:"s",slot:"actions-end"}))}_renderOverlayMapFeatures(e){return g("calcite-list-item",{bind:this,label:this.messages?.overlayMapFeatures,onclick:this._toggleShowMapFeatures},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowMapFeatures,scale:"s",slot:"actions-end"}))}_renderList(e){return e?g("div",{class:h.imageOverlaysLayerList},this.layerList.render()):null}_renderPanel(){const{closed:e,messages:t,showCameraLocations:s,showMapFeatures:a}=this;return g("calcite-panel",{bind:this,closable:!0,closed:e,heading:t.imageOverlays,onCalcitePanelClose:this.onImageOverlaysClosed},g("calcite-list",{label:t.imageOverlays},this._renderCameraLocationsSwitch(s),this._renderOverlayMapFeatures(a)),this._renderList(a))}_toggleShowCameraLocations(e){e.stopPropagation(),this.showCameraLocations=!this.showCameraLocations,this.onShowCameraLocationsChanged?.(this.showCameraLocations)}_toggleShowMapFeatures(e){e.stopPropagation(),this.showMapFeatures=!this.showMapFeatures,this.onShowMapFeaturesChanged?.(this.showMapFeatures)}render(){const e=this.layerList.operationalItems.items.length,t=this.showMapFeatures&&0===e,s=this.showMapFeatures&&e>0,a={[u.widget]:!0,[h.imageOverlaysNoResult]:t,[h.imageOverlaysIncreasedHeight]:s,[h.imageOverlays]:!t&&!s};return g("div",{class:this.classes(a)},this._renderPanel())}};e([r()],L.prototype,"_previousAction",void 0),e([r()],L.prototype,"_listItemCreatedFunction",null),e([r()],L.prototype,"closed",void 0),e([r()],L.prototype,"dataCaptureEnabled",void 0),e([r()],L.prototype,"dataCaptureLayer",void 0),e([r()],L.prototype,"imageGeometryField",void 0),e([r()],L.prototype,"imageReferenceField",void 0),e([r()],L.prototype,"layerList",void 0),e([r()],L.prototype,"messages",void 0),e([r()],L.prototype,"onDataCaptureLayerChanged",void 0),e([r()],L.prototype,"onImageOverlaysClosed",void 0),e([r()],L.prototype,"onLayerDeselected",void 0),e([r()],L.prototype,"onLayerSelected",void 0),e([r()],L.prototype,"onShowCameraLocationsChanged",void 0),e([r()],L.prototype,"onShowMapFeaturesChanged",void 0),e([r()],L.prototype,"overlayedLayers",void 0),e([r()],L.prototype,"showCameraLocations",void 0),e([r()],L.prototype,"showMapFeatures",void 0),e([r()],L.prototype,"view",null),L=e([l("esri.widgets.OrientedImageryViewer.components.ImageOverlays")],L);const v=L;function C(e,t,s){e&&t.items.push(s)}function w(e,s){const a=new t;a.add(e),s.actionsSections=new t([a])}function _(e,t,s,i=!1){const r=new c({icon:"pencil",id:"create-features",title:e,value:i});return t.addHandles(a((()=>s.includes(t)),(e=>{r.visible=e}),o)),w(r,t),r}export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{or as o}from"../../layers/orientedImagery/transformations/utils.js";import{defaultImageGeometryField as t,defaultOIObjectIDField as r}from"./constants.js";import{dataCaptureFeatureSymbol as n}from"./symbols.js";function i(e,t,r){const n=e.toLowerCase(),i=t.toLowerCase()===n,l=r?.toLowerCase()===n;return o(i,l)}function l(e){return"point"===e||"polygon"===e||"polyline"===e}function a(e,o,t){return l(e.geometryType)&&2===e.fields.filter((({name:e,type:r,alias:n})=>i(t,e,n)||i(o,e,n)&&"blob"===r)).length}function y(e){return"feature"===e.type&&m(e)}function m(e){return"point"===e.geometryType||"polygon"===e.geometryType||"polyline"===e.geometryType}function s(e,o,t){if(e
|
|
5
|
+
import e from"../../core/Error.js";import{or as o}from"../../layers/orientedImagery/transformations/utils.js";import{defaultImageGeometryField as t,defaultOIObjectIDField as r}from"./constants.js";import{dataCaptureFeatureSymbol as n}from"./symbols.js";function i(e,t,r){const n=e.toLowerCase(),i=t.toLowerCase()===n,l=r?.toLowerCase()===n;return o(i,l)}function l(e){return"point"===e||"polygon"===e||"polyline"===e}function a(e,o,t){return l(e.geometryType)&&2===e.fields.filter((({name:e,type:r,alias:n})=>i(t,e,n)||i(o,e,n)&&"blob"===r)).length}function y(e){return"feature"===e.type&&m(e)}function m(e){return"point"===e.geometryType||"polygon"===e.geometryType||"polyline"===e.geometryType}function s(e,o,t){if(!e)return;const{renderer:r}=e,i=n(o),l=r?"symbol"in r?r.symbol:"defaultSymbol"in r?r.defaultSymbol:r.getSymbol():null,a=i(l?.color);t[`${o}Symbol`]=(o===e.geometryType?l:null)??a}function f(o,n,l){const a=o.fields.find((({name:e,alias:o,type:r})=>i(n?.length?n:t,e,o)&&"blob"===r)),y=o.fields.find((({name:e,alias:o})=>i(l?.length?l:r,e,o)));if(!a||!y)throw new e("invalid-data-capture-layer","Data capture layer is not configured correctly.",{layer:o,imageGeometryField:a,oiObjectIdField:y});return{imageGeometryField:a,oiObjectIdField:y}}export{s as configureSketchTool,f as extractFieldsFromDataCaptureLayer,a as isValidDataCaptureLayer,y as isValidOverlayLayer,m as supportedDigitigedGeometryType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Collection.js";import{getContrast as
|
|
5
|
+
import o from"../../Color.js";import e from"../../core/Collection.js";import{getContrast as l,multiplyOpacity as r}from"../../core/colorUtils.js";import t from"../../symbols/CIMSymbol.js";import n from"../../symbols/FillSymbol3DLayer.js";import i from"../../symbols/IconSymbol3DLayer.js";import s from"../../symbols/LineSymbol3D.js";import m from"../../symbols/MeshSymbol3D.js";import y from"../../symbols/ObjectSymbol3DLayer.js";import c from"../../symbols/PathSymbol3DLayer.js";import a from"../../symbols/PointSymbol3D.js";import b from"../../symbols/SimpleFillSymbol.js";import p from"../../symbols/SimpleLineSymbol.js";import w from"../../symbols/SimpleMarkerSymbol.js";const u=new w({size:15,style:"circle",color:[255,102,102,.5],outline:null}),d=new w({size:10,style:"circle",color:[0,128,192,.5],outline:null}),S=new b({style:"solid",color:[0,128,192,.5],outline:null}),f=new b({style:"solid",color:[255,102,102,.5],outline:null}),h=new w({size:10,style:"diamond",color:[255,102,102],outline:null}),j=new a({symbolLayers:new e([new i({size:10,material:{color:"red"},resource:{primitive:"x"},outline:{color:"black",size:1}})])}),M=new a({symbolLayers:new e([new y({width:9,height:9,depth:9,material:{color:[255,102,102]},resource:{primitive:"diamond"},castShadows:!1})])}),C=new t({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:10,frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[0,1.4142135623730951],[3.585786437626905,5],[5,3.585786437626905],[1.4142135623730951,0],[5,-3.585786437626905],[3.585786437626905,-5],[0,-1.4142135623730951],[-3.585786437626905,-5],[-5,-3.585786437626905],[-1.4142135623730951,0],[-5,3.585786437626905],[-3.585786437626905,5],[0,1.4142135623730951]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,width:1,color:[0,0,0,100]},{type:"CIMSolidFill",enable:!0,color:[255,0,0,255]}]}}]}]}}}),L=new m({symbolLayers:new e([new n({material:{color:[255,102,102,.5]},edges:null})])}),I=new m({symbolLayers:new e([new n({material:{color:[0,128,192,.25]},edges:null})])}),g=new w({size:8,style:"triangle",color:[255,165,0],outline:{color:[0,0,0],width:.5}}),k=new a({symbolLayers:new e([new y({width:12,height:12,depth:12,material:{color:[255,165,0]},resource:{primitive:"tetrahedron"},outline:{color:"black",size:1},castShadows:!1})])}),z=(o,e=3.5)=>new t({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[14,12],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:e,color:l(o).toArray()},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:e,color:o.toArray()}]}}}),D=new s({symbolLayers:new e([new c({profile:"circle",width:7,material:{color:"orange"},cap:"round"})])}),x=o=>new b({color:r(o,.3),outline:{color:o,width:2}});function P(o){switch(o){case"point":return o=>new w({size:10,style:"circle",color:o??F(),outline:new p({color:[0,0,0],width:2})});case"polygon":return o=>new b({color:null,outline:G(o),style:"none"});case"polyline":return o=>G(o)}}function F(){return new o([255,0,0])}function G(o){return new p({color:o??F(),width:2})}function R(o){return new b({color:o??F(),outline:null})}function v(o,e,l){return o===e?l:"polyline"===o?G(l?.color):R(l?.color)}export{L as activeFrustumSymbol,f as activePolygonSymbol,u as activeSourcePointSymbol,I as additionalFrustumSymbol,v as createGraphicSymbol,C as crossSymbol,j as crossSymbol3D,R as dataCaptureBoundingBoxSymbol,F as dataCaptureBoundingColor,G as dataCaptureBoundingLineSymbol,P as dataCaptureFeatureSymbol,h as diamondSymbol,M as diamondSymbol3D,g as locationSymbol,k as locationSymbol3D,x as measurementPolygonSymbol,z as measurementPolylineSymbol,S as polygonSymbol,D as polylineSymbolPanoramic,d as sourcePointSymbol};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import o from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import n from"../core/ReactiveMap.js";import{watch as l,initial as c,syncAndInitial as d,whenOnce as g}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{or as p}from"../layers/orientedImagery/transformations/utils.js";import u from"./Widget.js";import{getAllArcPath as v}from"./OrientedImageryViewer/arcUtils.js";import{defaultImageGeometryField as y,defaultOIObjectIDField as _,segmentArcs as w,sectorsRadii as b,featureCircleRadius as C,navigationToolDimensionLength as M,getDelegatedEvents as T}from"./OrientedImageryViewer/constants.js";import{css as f,navigation as I,navigationToolRotationFrom as L,navigationToolRotationTo as A,root as k}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as O,loadImageForAttachment as F,getThumbnailPixelBlock as S,renderImageWithRotation as E}from"./OrientedImageryViewer/galleryUtils.js";import V from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import P from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import x from"./OrientedImageryViewer/components/ImageLocationWidget.js";import{loadCalciteComponents as G}from"./support/componentsUtils.js";import{globalCss as $}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as j}from"./support/decorators/messageBundle.js";import{vmEvent as H}from"./support/decorators/vmEvent.js";import{tsx as D}from"./support/jsxFactory.js";import{substitute as B}from"../intl/substitute.js";const R={overlayMapFeatures:"overlay-map-features",overlayed:"overlayed",overlaysActionHandles:"overlays-action-handles"};let W=class extends u{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new V,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new P,this._actionItems=new n,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._warningTitleElement=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,this._handleDataCaptureLayerChange=e=>{this.dataCaptureLayer&&this.stopDataCapture(this.dataCaptureLayer.id),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer&&this.startDataCapture(this.dataCaptureLayer)},this._handleOverlayLayerDeselect=e=>{const t=e.layer;this.viewModel.removeOverlayedGraphicsOnImage(`${t.id}`),t===this.dataCaptureLayer&&(this.stopDataCapture(t.id),this.dataCaptureLayer=null),this.removeHandles(`${R.overlayed}-${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${R.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,r="select-feature"===s,n=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&p(r,o&&n)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeActionElement=e=>{this._actionItems.delete(e.text)},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([l((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),c),l((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),l((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),l((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),l((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),d),l((()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state})),(async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await g((()=>"image-loaded"===this.viewModel.state)),this.dataCaptureLayer&&(this.stopDataCapture(this.dataCaptureLayer.id),this.viewModel.removeOverlayedGraphicsOnImage(this.dataCaptureLayer.id)),await Promise.all(this._overlayedLayers?.map((t=>{this.viewModel.overlayMapFeatures(t,e.showMapFeatures)}))),!this.dataCaptureLayer)return;this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}}),c)])}loadDependencies(){return G({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return"image-loaded"===t&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return D("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},D("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),D("calcite-action-group",null,this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle()),D("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()),this._actionTooltips())}_actionTooltips(){return[...this._actionItems].map((([e,t])=>D("calcite-tooltip",{closeOnClick:!0,key:e,placement:"bottom",referenceElement:t},D("span",null,e))))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t}=this,{groundArea:i,heightAboveGround:a,groundDistance:s}=t;switch(e){case"area":return i;case"height":return a;default:return s}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?D("calcite-action",{active:e,...this._commonActionProperties,class:f.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?D("calcite-action",{active:e,...this._commonActionProperties,class:f.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t},id:i}=this;if("image-loaded"!==e||!t)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const a=this._imageMeasurementToolsLoaderTask?.value;return a?D("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${i}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},D(a,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _commonActionProperties(){return{afterCreate:this._storeActionElement,afterRemoved:this._removeActionElement,afterUpdate:this._storeActionElement,bind:this}}_renderRoot(){const{viewModel:{state:e}}=this;return D("calcite-panel",null,D("calcite-shell",null,D("calcite-panel",{bind:this,class:f.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")},this.visibleElements.menu?this._renderActionBar():null,this._imageViewer,this._panoramicViewer,this._messageBox,this.invalidCameraHeading?[this._renderWarning(this.messages.invalidCameraHeadingWarningTitle),this._renderWarningTooltip(this.messages.invalidCameraHeadingWarningDescription)]:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._renderSketch()),this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?D("calcite-action",{active:e,...this._commonActionProperties,class:f.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?D("calcite-panel",{bind:this,class:f.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},D("div",{class:f.imageEnhancementTools},D("div",{class:f.imageEnhancementToolContainer},D("calcite-label",null,this.messages.brightness,D("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),D("div",{class:f.imageEnhancementToolContainer},D("calcite-label",null,this.messages.contrast,D("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),D("div",{class:f.imageEnhancementToolContainer},D("calcite-label",null,this.messages.sharpness,D("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),D("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i?D("calcite-action",{active:this.imageEnhancementToolActive,...this._commonActionProperties,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return D("calcite-panel",{bind:this,class:f.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},D("div",{class:f.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?D("calcite-action",{active:this.galleryOpened,...this._commonActionProperties,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:a,dataCaptureEnabled:s,dataCaptureLayer:o,imageOverlaysOpened:r,showCameraLocations:n,showMapFeatures:l,view:c,layer:d}=this;if(!d)return null;const g=d.imageGeometryField?.length?d.imageGeometryField:y,m=d.imageReferenceField?.length?d.imageReferenceField:_;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const h=this._imageOverlaysLoaderTask?.value;return h?D(h,{closed:!r,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:m,messages:e,overlayedLayers:a,showCameraLocations:n,showMapFeatures:l,view:c,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[f.imageOverlaysContainer]:!0,[$.hidden]:!e||"image-loaded"!==t});return D("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?D("calcite-action",{active:t,...this._commonActionProperties,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i}=this.viewModel,a=null!=e||"default"!==i,s=this.classes({[f.viewer]:!a,[f.viewerHidden]:a});return D("calcite-panel",{afterCreate:t,bind:this,class:s},this._renderSketch())}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t},imageLocationToolActive:i,messages:{groundLocation:a}}=this;if("image-loaded"===e&&t&&i)return D("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:a,id:a,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},D(x,{groundCoordinates:t,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?D("calcite-action",{active:e,...this._commonActionProperties,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:s,visibleElements:{measurementTools:o}}=this,{state:r}=i,{measurementTools:n,groundDistance:l,groundArea:c,heightAboveGround:d,groundLocation:g}=s;return o?D("calcite-dropdown",{disabled:a,key:"measurement-tools",width:"m"},D("calcite-action",{...this._commonActionProperties,icon:e,slot:"trigger",text:n}),D("calcite-dropdown-group",null,D("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t},l),D("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t},c),D("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},d),D("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:e=>this._toggleLocationTool(e),selected:this.imageLocationToolActive},g))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t}}=this;if(!t)return null;const{data:i,key:a,map:s}=t,o=`${s?B(e[a],s):e[a]}`;return D("span",{class:f.messageBox},i?`${o} ${i}`:o)}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?D("calcite-action",{active:this.navigationToolActive,...this._commonActionProperties,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?D("calcite-action",{...this._commonActionProperties,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i}=this.viewModel,a=null!=e||"panoramic"!==i,s=this.classes({[f.viewer]:!a,[f.viewerHidden]:a});return D("calcite-panel",{afterCreate:t,bind:this,class:s})}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach((async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),n=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),c=n?parseFloat(n)%360:0,{layer:d,_galleryController:{signal:g}}=this;if(!s||!l)return;let m;try{m=O(s)?await F(d,l,{signal:g}):await S(s,{signal:g})}catch(i){r(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!m)return;E(m,a,c)}}))}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i((async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e}))}_loadSketchResources(){this._sketchLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default))}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e){const{invalidCameraHeading:t,viewModel:{state:i}}=this;return t&&"image-loaded"===i?[D("calcite-notice",{class:f.alert,closable:!0,icon:"exclamation-mark-triangle-f",iconFlipRtl:!0,kind:"warning",open:!0,scale:"s"},D("div",{afterCreate:e=>this._storeWarningTitleElement(e),slot:"title"},e))]:null}_renderWarningTooltip(e){const{_warningTitleElement:t}=this;if(e?.length&&t)return D("calcite-tooltip",{closeOnClick:!0,referenceElement:t},e)}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,r,n,l,c;if(i){const{x:e,y:t,direction:a}=i,[s,d,g,m]=w[a];o=`M ${e} ${t} L ${s} ${d} A ${b[2]} ${b[2]} 0 0 1 ${g} ${m} Z`,r=e,l=t,n=w[a][4],c=w[a][5]}const d=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},m=e=>{e.removeEventListener("click",g)},h=a.attributes.objectId,p=e?.map((e=>e?.items)).filter(Boolean).flatMap((e=>e?.map((({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>D("circle",{afterRemoved:m,class:this.classes(f.feature,{selected:h===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${f.feature}-${i}`,onclick:g,r:C}))))),u=e=>{e.removeEventListener("click",d)},y=this.classes({[f.navigationWrapper]:!0,[f.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?D("div",{bind:this,class:y,key:this.messages.navigationTool},D("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?I:f.rotateWithAnimation,focusable:"false",height:M,role:"img",width:M,xmlns:"http://www.w3.org/2000/svg"},D("defs",null,D("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:r,x2:n,y1:l,y2:c},D("stop",{class:f.navigationPathOffset0,offset:0}),D("stop",{class:f.navigationPathOffset1,offset:1}))),D("g",null,D("circle",{class:this.classes(f.sector,f.outerSector),cx:b[3],cy:b[3],onclick:this._scaleNavigationTool,r:b[3]}),D("circle",{class:f.sector,cx:b[3],cy:b[3],r:b[2]}),D("circle",{class:f.sector,cx:b[3],cy:b[3],r:b[1]}),D("circle",{class:f.sector,cx:b[3],cy:b[3],r:b[0]}),D("path",{class:f.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${f.pointer}-west`}),D("path",{class:this.classes(f.pointer,f.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${f.pointer}-north`}),D("path",{class:f.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${f.pointer}-east`}),D("path",{class:f.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${f.pointer}-south`}),D("path",{class:this.classes(f.sector,f.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:f.sectorSeparator}),v([b[2],b[1],b[0]],b[3],b[3]).map(((t,i)=>D("path",{afterRemoved:u,class:this.classes(f.sector,e?.[i]?.length?f.sectorEnabled:f.sectorDisabled),d:t,"data-sector":`${i}`,key:`${f.sector}-${i}`,onclick:d}))),D("path",{class:this.classes(f.sector,f.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:f.sectorCross}),p,a.attributes.cameraPitch>=5&&o?D("path",{class:f.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:f.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return D("div",{class:f.sketchTools},D(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?D("div",{class:f.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},s)=>D("div",{class:`${f.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${f.carouselItemWrapper}-${s}`},D("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:f.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight}))))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_storeActionElement(e){this._actionItems.set(e.text,e)}_storeNavigationToolReference(e){this._navigationTool=e}_storeWarningTitleElement(e){this._warningTitleElement=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation();const t=this.imageEnhancementToolActive;this._closeAllImageTools(),this.imageEnhancementToolActive=!t}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive;this._closeAllImageTools(),this.imageLocationToolActive=!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType;this._closeAllImageTools(),this.measureType=i===t?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(L,`${t}deg`),e.style.setProperty(A,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${R.overlayed}-${e.id}`),this.addHandles(l((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${R.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${R.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return D("div",{class:this.classes($.widget,k)},this._renderRoot())}async startDataCapture(e){return this.viewModel.startDataCapture(e)}stopDataCapture(e){this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([m({readOnly:!0})],W.prototype,"accuracyParametersMissing",null),e([m()],W.prototype,"activeLayer",null),e([m()],W.prototype,"currentBestFeature",null),e([m()],W.prototype,"currentCoverageVisible",null),e([m()],W.prototype,"dataCaptureEnabled",void 0),e([m()],W.prototype,"dataCaptureLayer",null),e([m()],W.prototype,"disabled",null),e([m()],W.prototype,"features",null),e([m()],W.prototype,"imagePointsInView",null),e([m()],W.prototype,"galleryOpened",void 0),e([m()],W.prototype,"icon",null),e([m()],W.prototype,"imageEnhancementToolActive",void 0),e([m({readOnly:!0})],W.prototype,"imageGalleryEnabled",null),e([m()],W.prototype,"imageLocationToolActive",null),e([m()],W.prototype,"imageOverlaysOpened",void 0),e([m({readOnly:!0})],W.prototype,"invalidCameraHeading",null),e([m()],W.prototype,"isAdditionalCoverageVisible",null),e([m()],W.prototype,"isAdditionalPointSourcesVisible",null),e([m()],W.prototype,"mapImageConversionToolState",null),e([m()],W.prototype,"measureType",null),e([m()],W.prototype,"layer",null),e([m()],W.prototype,"navigationToolActive",void 0),e([H(T()),m({type:V})],W.prototype,"viewModel",void 0),e([m(),j("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],W.prototype,"messages",void 0),e([m(),j("esri/core/t9n/Units")],W.prototype,"measurementUnitMessages",void 0),e([m(),j("esri/t9n/common")],W.prototype,"messagesCommon",void 0),e([m(),j("esri/widgets/Sketch/t9n/Sketch")],W.prototype,"messagesSketch",void 0),e([m()],W.prototype,"pixelMeasurementUnit",void 0),e([m()],W.prototype,"pixelAreaMeasurementUnit",void 0),e([m({readOnly:!0})],W.prototype,"popupEnabled",null),e([m()],W.prototype,"referencePoint",null),e([m()],W.prototype,"showCameraLocations",void 0),e([m()],W.prototype,"showMapFeatures",void 0),e([H(["create","delete","redo","undo","update"]),m({readOnly:!0})],W.prototype,"sketchViewModel",null),e([m()],W.prototype,"view",null),e([m({type:P,nonNullable:!0})],W.prototype,"visibleElements",void 0),e([m()],W.prototype,"determineWorkflowForFeature",null),e([m()],W.prototype,"updateFootprint",null),e([m()],W.prototype,"_actionItems",void 0),e([m()],W.prototype,"_activeMeasurementIcon",null),e([m()],W.prototype,"_activeMeasurementHeading",null),e([m()],W.prototype,"_imageOverlaysLoaderTask",void 0),e([m()],W.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([m()],W.prototype,"_measurementToggle",null),e([m()],W.prototype,"_commonActionProperties",null),e([m()],W.prototype,"_imageEnhancementTools",null),e([m()],W.prototype,"_imageGalleryPanel",null),e([m()],W.prototype,"_imageGalleryContext",null),e([m()],W.prototype,"_imageOverlaysComponent",null),e([m()],W.prototype,"_imageOverlayMessages",null),e([m()],W.prototype,"_imageSketchToolsMessages",null),e([m()],W.prototype,"_imageViewer",null),e([m()],W.prototype,"_locationToggle",null),e([m()],W.prototype,"_messageBox",null),e([m()],W.prototype,"_navigationToolExpanded",void 0),e([m()],W.prototype,"_navigationTool",void 0),e([m()],W.prototype,"_panoramicViewer",null),e([m()],W.prototype,"_warningTitleElement",void 0),e([m()],W.prototype,"_renderNavigation",null),e([m()],W.prototype,"_renderThumbnails",null),e([m()],W.prototype,"_sketchLoaderTask",void 0),W=e([h("esri.widgets.OrientedImageryViewer")],W);const U=W;export{U as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import o from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import n from"../core/ReactiveMap.js";import{watch as l,initial as c,syncAndInitial as d,whenOnce as g}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{or as p}from"../layers/orientedImagery/transformations/utils.js";import u from"./Widget.js";import{getAllArcPath as v}from"./OrientedImageryViewer/arcUtils.js";import{defaultImageGeometryField as y,defaultOIObjectIDField as _,segmentArcs as w,sectorsRadii as b,featureCircleRadius as C,navigationToolDimensionLength as M,getDelegatedEvents as T}from"./OrientedImageryViewer/constants.js";import{css as f,navigation as I,navigationToolRotationFrom as L,navigationToolRotationTo as A,root as k}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as O,loadImageForAttachment as F,getThumbnailPixelBlock as S,renderImageWithRotation as E}from"./OrientedImageryViewer/galleryUtils.js";import V from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import P from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import x from"./OrientedImageryViewer/components/ImageLocationWidget.js";import{loadCalciteComponents as G}from"./support/componentsUtils.js";import{globalCss as j}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as $}from"./support/decorators/messageBundle.js";import{vmEvent as D}from"./support/decorators/vmEvent.js";import{tsx as H}from"./support/jsxFactory.js";import{substitute as B}from"../intl/substitute.js";const R={overlayMapFeatures:"overlay-map-features",overlayed:"overlayed",overlaysActionHandles:"overlays-action-handles"};let W=class extends u{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new V,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new P,this._actionItems=new n,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._warningTitleElement=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(!0),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${R.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,r="select-feature"===s,n=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&p(r,o&&n)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeActionElement=e=>{this._actionItems.delete(e.text)},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map((e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures)))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([l((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),c),l((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),l((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),l((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),l((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),d),l((()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state})),(async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await g((()=>"image-loaded"===this.viewModel.state)),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}}),c)])}loadDependencies(){return G({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(o.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return"image-loaded"===t&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return H("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},H("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),H("calcite-action-group",null,this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle()),H("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()),this._actionTooltips())}_actionTooltips(){return[...this._actionItems].map((([e,t])=>H("calcite-tooltip",{closeOnClick:!0,key:e,placement:"bottom",referenceElement:t},H("span",null,e))))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t}=this,{groundArea:i,heightAboveGround:a,groundDistance:s}=t;switch(e){case"area":return i;case"height":return a;default:return s}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?H("calcite-action",{active:e,...this._commonActionProperties,class:f.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?H("calcite-action",{active:e,...this._commonActionProperties,class:f.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t},id:i}=this;if("image-loaded"!==e||!t)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const a=this._imageMeasurementToolsLoaderTask?.value;return a?H("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${i}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},H(a,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _commonActionProperties(){return{afterCreate:this._storeActionElement,afterRemoved:this._removeActionElement,afterUpdate:this._storeActionElement,bind:this}}_renderRoot(){const{viewModel:{state:e}}=this;return H("calcite-panel",null,H("calcite-shell",null,H("calcite-panel",{bind:this,class:f.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")},this.visibleElements.menu?this._renderActionBar():null,this._imageViewer,this._panoramicViewer,this._messageBox,this.invalidCameraHeading?[this._renderWarning(this.messages.invalidCameraHeadingWarningTitle),this._renderWarningTooltip(this.messages.invalidCameraHeadingWarningDescription)]:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._renderSketch()),this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?H("calcite-action",{active:e,...this._commonActionProperties,class:f.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?H("calcite-panel",{bind:this,class:f.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},H("div",{class:f.imageEnhancementTools},H("div",{class:f.imageEnhancementToolContainer},H("calcite-label",null,this.messages.brightness,H("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),H("div",{class:f.imageEnhancementToolContainer},H("calcite-label",null,this.messages.contrast,H("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),H("div",{class:f.imageEnhancementToolContainer},H("calcite-label",null,this.messages.sharpness,H("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),H("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i?H("calcite-action",{active:this.imageEnhancementToolActive,...this._commonActionProperties,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return H("calcite-panel",{bind:this,class:f.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},H("div",{class:f.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?H("calcite-action",{active:this.galleryOpened,...this._commonActionProperties,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:a,dataCaptureEnabled:s,dataCaptureLayer:o,imageOverlaysOpened:r,showCameraLocations:n,showMapFeatures:l,view:c,layer:d}=this;if(!d)return null;const g=d.imageGeometryField?.length?d.imageGeometryField:y,m=d.imageReferenceField?.length?d.imageReferenceField:_;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const h=this._imageOverlaysLoaderTask?.value;return h?H(h,{closed:!r,dataCaptureEnabled:s,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:m,messages:e,overlayedLayers:a,showCameraLocations:n,showMapFeatures:l,view:c,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[f.imageOverlaysContainer]:!0,[j.hidden]:!e||"image-loaded"!==t});return H("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?H("calcite-action",{active:t,...this._commonActionProperties,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i}=this.viewModel,a=null!=e||"default"!==i,s=this.classes({[f.viewer]:!a,[f.viewerHidden]:a});return H("calcite-panel",{afterCreate:t,bind:this,class:s},this._renderSketch())}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t},imageLocationToolActive:i,messages:{groundLocation:a}}=this;if("image-loaded"===e&&t&&i)return H("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:a,id:a,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},H(x,{groundCoordinates:t,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?H("calcite-action",{active:e,...this._commonActionProperties,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:s,visibleElements:{measurementTools:o}}=this,{state:r}=i,{measurementTools:n,groundDistance:l,groundArea:c,heightAboveGround:d,groundLocation:g}=s;return o?H("calcite-dropdown",{disabled:a,key:"measurement-tools",width:"m"},H("calcite-action",{...this._commonActionProperties,icon:e,slot:"trigger",text:n}),H("calcite-dropdown-group",null,H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t},l),H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t},c),H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},d),H("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:e=>this._toggleLocationTool(e),selected:this.imageLocationToolActive},g))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t}}=this;if(!t)return null;const{data:i,key:a,map:s}=t,o=`${s?B(e[a],s):e[a]}`;return H("span",{class:f.messageBox},i?`${o} ${i}`:o)}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?H("calcite-action",{active:this.navigationToolActive,...this._commonActionProperties,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?H("calcite-action",{...this._commonActionProperties,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i}=this.viewModel,a=null!=e||"panoramic"!==i,s=this.classes({[f.viewer]:!a,[f.viewerHidden]:a});return H("calcite-panel",{afterCreate:t,bind:this,class:s})}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach((async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),n=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),c=n?parseFloat(n)%360:0,{layer:d,_galleryController:{signal:g}}=this;if(!s||!l)return;let m;try{m=O(s)?await F(d,l,{signal:g}):await S(s,{signal:g})}catch(i){r(i)||o.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!m)return;E(m,a,c)}}))}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i((async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e}))}_loadSketchResources(){this._sketchLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default))}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e){const{invalidCameraHeading:t,viewModel:{state:i}}=this;return t&&"image-loaded"===i?[H("calcite-notice",{class:f.alert,closable:!0,icon:"exclamation-mark-triangle-f",iconFlipRtl:!0,kind:"warning",open:!0,scale:"s"},H("div",{afterCreate:e=>this._storeWarningTitleElement(e),slot:"title"},e))]:null}_renderWarningTooltip(e){const{_warningTitleElement:t}=this;if(e?.length&&t)return H("calcite-tooltip",{closeOnClick:!0,referenceElement:t},e)}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:s}}=this;if(!this.container||!a)return null;let o,r,n,l,c;if(i){const{x:e,y:t,direction:a}=i,[s,d,g,m]=w[a];o=`M ${e} ${t} L ${s} ${d} A ${b[2]} ${b[2]} 0 0 1 ${g} ${m} Z`,r=e,l=t,n=w[a][4],c=w[a][5]}const d=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},m=e=>{e.removeEventListener("click",g)},h=a.attributes.objectId,p=e?.map((e=>e?.items)).filter(Boolean).flatMap((e=>e?.map((({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>H("circle",{afterRemoved:m,class:this.classes(f.feature,{selected:h===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${f.feature}-${i}`,onclick:g,r:C}))))),u=e=>{e.removeEventListener("click",d)},y=this.classes({[f.navigationWrapper]:!0,[f.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===s?H("div",{bind:this,class:y,key:this.messages.navigationTool},H("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?I:f.rotateWithAnimation,focusable:"false",height:M,role:"img",width:M,xmlns:"http://www.w3.org/2000/svg"},H("defs",null,H("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:r,x2:n,y1:l,y2:c},H("stop",{class:f.navigationPathOffset0,offset:0}),H("stop",{class:f.navigationPathOffset1,offset:1}))),H("g",null,H("circle",{class:this.classes(f.sector,f.outerSector),cx:b[3],cy:b[3],onclick:this._scaleNavigationTool,r:b[3]}),H("circle",{class:f.sector,cx:b[3],cy:b[3],r:b[2]}),H("circle",{class:f.sector,cx:b[3],cy:b[3],r:b[1]}),H("circle",{class:f.sector,cx:b[3],cy:b[3],r:b[0]}),H("path",{class:f.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${f.pointer}-west`}),H("path",{class:this.classes(f.pointer,f.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${f.pointer}-north`}),H("path",{class:f.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${f.pointer}-east`}),H("path",{class:f.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${f.pointer}-south`}),H("path",{class:this.classes(f.sector,f.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:f.sectorSeparator}),v([b[2],b[1],b[0]],b[3],b[3]).map(((t,i)=>H("path",{afterRemoved:u,class:this.classes(f.sector,e?.[i]?.length?f.sectorEnabled:f.sectorDisabled),d:t,"data-sector":`${i}`,key:`${f.sector}-${i}`,onclick:d}))),H("path",{class:this.classes(f.sector,f.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:f.sectorCross}),p,a.attributes.cameraPitch>=5&&o?H("path",{class:f.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:f.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return H("div",{class:f.sketchTools},H(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?H("div",{class:f.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},s)=>H("div",{class:`${f.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${f.carouselItemWrapper}-${s}`},H("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:f.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight}))))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_storeActionElement(e){this._actionItems.set(e.text,e)}_storeNavigationToolReference(e){this._navigationTool=e}_storeWarningTitleElement(e){this._warningTitleElement=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation();const t=this.imageEnhancementToolActive;this._closeAllImageTools(),this.imageEnhancementToolActive=!t}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive;this._closeAllImageTools(),this.imageLocationToolActive=!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType;this._closeAllImageTools(),this.measureType=i===t?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(L,`${t}deg`),e.style.setProperty(A,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${R.overlayed}-${e.id}`),this.addHandles(l((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${R.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${R.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return H("div",{class:this.classes(j.widget,k)},this._renderRoot())}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([m({readOnly:!0})],W.prototype,"accuracyParametersMissing",null),e([m()],W.prototype,"activeLayer",null),e([m()],W.prototype,"currentBestFeature",null),e([m()],W.prototype,"currentCoverageVisible",null),e([m()],W.prototype,"dataCaptureEnabled",void 0),e([m()],W.prototype,"dataCaptureLayer",null),e([m()],W.prototype,"disabled",null),e([m()],W.prototype,"features",null),e([m()],W.prototype,"imagePointsInView",null),e([m()],W.prototype,"galleryOpened",void 0),e([m()],W.prototype,"icon",null),e([m()],W.prototype,"imageEnhancementToolActive",void 0),e([m({readOnly:!0})],W.prototype,"imageGalleryEnabled",null),e([m()],W.prototype,"imageLocationToolActive",null),e([m()],W.prototype,"imageOverlaysOpened",void 0),e([m({readOnly:!0})],W.prototype,"invalidCameraHeading",null),e([m()],W.prototype,"isAdditionalCoverageVisible",null),e([m()],W.prototype,"isAdditionalPointSourcesVisible",null),e([m()],W.prototype,"mapImageConversionToolState",null),e([m()],W.prototype,"measureType",null),e([m()],W.prototype,"layer",null),e([m()],W.prototype,"navigationToolActive",void 0),e([D(T()),m({type:V})],W.prototype,"viewModel",void 0),e([m(),$("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],W.prototype,"messages",void 0),e([m(),$("esri/core/t9n/Units")],W.prototype,"measurementUnitMessages",void 0),e([m(),$("esri/t9n/common")],W.prototype,"messagesCommon",void 0),e([m(),$("esri/widgets/Sketch/t9n/Sketch")],W.prototype,"messagesSketch",void 0),e([m()],W.prototype,"pixelMeasurementUnit",void 0),e([m()],W.prototype,"pixelAreaMeasurementUnit",void 0),e([m({readOnly:!0})],W.prototype,"popupEnabled",null),e([m()],W.prototype,"referencePoint",null),e([m()],W.prototype,"showCameraLocations",void 0),e([m()],W.prototype,"showMapFeatures",void 0),e([D(["create","delete","redo","undo","update"]),m({readOnly:!0})],W.prototype,"sketchViewModel",null),e([m()],W.prototype,"view",null),e([m({type:P,nonNullable:!0})],W.prototype,"visibleElements",void 0),e([m()],W.prototype,"determineWorkflowForFeature",null),e([m()],W.prototype,"updateFootprint",null),e([m()],W.prototype,"_actionItems",void 0),e([m()],W.prototype,"_activeMeasurementIcon",null),e([m()],W.prototype,"_activeMeasurementHeading",null),e([m()],W.prototype,"_imageOverlaysLoaderTask",void 0),e([m()],W.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([m()],W.prototype,"_measurementToggle",null),e([m()],W.prototype,"_commonActionProperties",null),e([m()],W.prototype,"_imageEnhancementTools",null),e([m()],W.prototype,"_imageGalleryPanel",null),e([m()],W.prototype,"_imageGalleryContext",null),e([m()],W.prototype,"_imageOverlaysComponent",null),e([m()],W.prototype,"_imageOverlayMessages",null),e([m()],W.prototype,"_imageSketchToolsMessages",null),e([m()],W.prototype,"_imageViewer",null),e([m()],W.prototype,"_locationToggle",null),e([m()],W.prototype,"_messageBox",null),e([m()],W.prototype,"_navigationToolExpanded",void 0),e([m()],W.prototype,"_navigationTool",void 0),e([m()],W.prototype,"_panoramicViewer",null),e([m()],W.prototype,"_warningTitleElement",void 0),e([m()],W.prototype,"_renderNavigation",null),e([m()],W.prototype,"_renderThumbnails",null),e([m()],W.prototype,"_sketchLoaderTask",void 0),W=e([h("esri.widgets.OrientedImageryViewer")],W);const U=W;export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{generateGlobalId as t}from"../../../editing/sharedTemplates/executor/support/createServiceEdit.js";import{formatNumber as e}from"../../../intl/number.js";import{isSubtypeSublayer as n}from"../../../layers/support/layerUtils.js";import o from"../../../rest/networks/support/Association.js";import i from"../../../rest/networks/support/NetworkElement.js";function r(t){const{percentAlong:n}=t;return null==n?"":e(n,{style:"percent",maximumFractionDigits:2})}function c(t){const{associationType:e}=t;return"connectivity"===e||"junction-junction-connectivity"===e||"junction-edge-from-connectivity"===e||"junction-edge-midspan-connectivity"===e||"junction-edge-to-connectivity"===e}function a(t){return"junction-edge-midspan-connectivity"===t.associationType}function s(t){const{attributes:e,sourceLayer:n}=t??{},o=n&&"displayField"in n?n.displayField:null,i=o?e?.[o]:null,r=t?.getObjectId()?.toString();return
|
|
5
|
+
import{generateGlobalId as t}from"../../../editing/sharedTemplates/executor/support/createServiceEdit.js";import{formatNumber as e}from"../../../intl/number.js";import{isSubtypeSublayer as n}from"../../../layers/support/layerUtils.js";import o from"../../../rest/networks/support/Association.js";import i from"../../../rest/networks/support/NetworkElement.js";function r(t){const{percentAlong:n}=t;return null==n?"":e(n,{style:"percent",maximumFractionDigits:2})}function c(t){const{associationType:e}=t;return"connectivity"===e||"junction-junction-connectivity"===e||"junction-edge-from-connectivity"===e||"junction-edge-midspan-connectivity"===e||"junction-edge-to-connectivity"===e}function a(t){return"junction-edge-midspan-connectivity"===t.associationType}function s(t){const{attributes:e,sourceLayer:n}=t??{},o=n&&"displayField"in n?n.displayField:null,i=o?e?.[o]:null,r=null!=i?JSON.stringify(i):null,c=t?.getObjectId()?.toString();return r||c||""}function l(t,e,n){const{associationType:o}=t;switch(o){case"attachment":return"to"===e?n.attachment:n.structure;case"containment":return"to"===e?n.content:n.container;case"junction-edge-from-connectivity":case"junction-edge-to-connectivity":case"junction-edge-midspan-connectivity":case"junction-junction-connectivity":case"connectivity":return n.connectivity}}function u(t,e){return!!(t.layer&&"globalIdField"in t.layer&&t.layer.globalIdField&&e.fromNetworkElement)&&t.attributes[t.layer.globalIdField]===e.fromNetworkElement.globalId}function d(t,e){const o=n(t.sourceLayer)?t.sourceLayer.parent:t.sourceLayer;if(o&&"globalIdField"in o&&"layerId"in o&&o.globalIdField){const n=e.getSourceIdByLayerId(o.layerId),r="junction"===e.getSourceTypeById(n)?e.getTerminalConfiguration(t):void 0,c=r?.terminals.at(0)?.id,a=o.fieldsIndex.get("assetGroup").name,s=o.fieldsIndex.get("assetType").name,l=t.attributes[a],u=t.attributes[s],d=t.attributes[o.globalIdField];if(d&&null!=n)return new i({globalId:d,networkSourceId:n,assetGroupCode:l,assetTypeCode:u,terminalId:c})}}function y(e){return new o({fromNetworkElement:d(e.fromFeature,e.utilityNetwork),toNetworkElement:d(e.toFeature,e.utilityNetwork),associationType:e.associationType,globalId:t()})}export{y as createAssociation,r as formatPercentAlong,l as getAssociationTitle,s as getFeatureTitle,c as isConnectivity,a as isConnectivityMidspan,u as isFromElement};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5455],{1262:(e,t,n)=>{n.d(t,{L8:()=>s,Z7:()=>r});var r,a,i=n(799);(a=r||(r={})).InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters";const o={[r.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[r.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[r.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[r.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[r.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[r.UnsupportedOperator]:"Unsupported operator - {operator}",[r.UnsupportedSyntax]:"Unsupported syntax - {node}",[r.UnsupportedSqlFunction]:"Sql function not found = {function}",[r.InvalidDataType]:"Invalid sql data type",[r.InvalidDate]:"Invalid date encountered",[r.InvalidOperator]:"Invalid operator encountered",[r.InvalidTime]:"Invalid time encountered",[r.IllegalInterval]:"Illegal interval",[r.FunctionNotRecognized]:"Function not recognized",[r.InvalidTimeStamp]:"Invalid timestamp encountered",[r.InvalidParameterCount]:"Invalid parameter count for call to {name}",[r.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[r.YearMonthIntervals]:"Year-Month Intervals not supported",[r.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.HC)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}},15032:(e,t,n)=>{n.d(t,{k:()=>u});var r=n(78502),a=n(73444),i=n(96285);function o(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let n="";for(const r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":n+=r;break;case"A":case"a":n+="a";break;default:n+=`'${r}'`}return n}const s="esri.core.sql.timeonly";class u{constructor(e,t,n,r){this._hour=e,this._minute=t,this._second=n,this._millisecond=r,this.declaredRootClass=s}static isTimeOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return u.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,r.Fq)(this.hour)&&(0,r.Fq)(this.minute)&&(0,r.Fq)(this.second)&&(0,r.Fq)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=o(e))?i.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,n,r){const a=new u(e,t,n,r);return a.isValid()?a:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),n=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),a=Math.floor(e%1e3);return new u(r,n,t,a)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];t?(t=o(t))&&n.push(t):null!==t&&""!==t||(n.push("HH:mm:ss"),n.push("HH:mm:ss.SSS"),n.push("hh:mm:ss a"),n.push("hh:mm:ss.SSS a"),n.push("HH:mm"),n.push("hh:mm a"),n.push("H:mm"),n.push("h:mm a"),n.push("H:mm:ss"),n.push("h:mm:ss a"),n.push("H:mm:ss.SSS"),n.push("h:mm:ss.SSS a"));for(const t of n){const n=i.c9.fromFormat(e,t);if(n.isValid)return new u(n.hour,n.minute,n.second,n.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.c9.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},44729:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(66131),a=n(73444),i=n(96285);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(n)||[])switch(r){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?t+=`'${r.slice(1,-1)}'`:t+=`'${r}'`}return t}const s="esri.core.sql.dateonly";class u{constructor(e,t,n){this._year=e,this._month=t,this._day=n,this.declaredRootClass=s}static isDateOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return u.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new u(this._year,this._month,this._day)}toDateTime(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";const n=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(n).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.c9.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.c9.fromMillis(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.c9.fromSeconds(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,n){const r=new u(e,t,n);return!1===r.isValid?null:r}static fromDateJS(e){return u.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return u.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];if(t)(t=o(t))&&n.push(t);else if(null===t||""===t){const t=i.c9.fromISO(e,{setZone:!0});return t.isValid?u.fromParts(t.year,t.month,t.day):null}for(const r of n){const n=i.c9.fromFormat(e,t??r);if(n.isValid)return new u(n.year,n.month,n.day)}return null}static fromNow(e="system"){const t=i.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new u(t.year,t.month,t.day)}}},55612:(e,t,n)=>{n.d(t,{g:()=>o});var r=n(96285);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const i="esri.core.sql.SqlTimeStampOffset";class o{constructor(e){this._timeStampOffset=e,this.declaredRootClass=i,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===i}toDateTime(){return this._date??=r.c9.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return a(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return a(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return o.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new o(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new o(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,i=0,s=0,u=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let d="";i<10&&(d="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+i.toString()}`;0!==s&&(m+="."+s.toString().padStart(3,"0"));const h=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new o(f+"T"+m+h)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return o.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>u});var r=n(44729),a=n(1262),i=n(55612),o=n(15032),s=n(96285);function u(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L8(a.Z7.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.L8(a.Z7.InvalidParameterCount,{name:e.toUpperCase()});return n.evaluate(t)}function l(e,t){const n=c[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}const c={min:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"max")},avg:{minParams:1,maxParams:1,evaluate:e=>f(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(null!==r){if(!d(r))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=h(e);return null===t?null:Math.sqrt(t)}(e[0])},count:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].length},var:{minParams:1,maxParams:1,evaluate:e=>h(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const i=e[r];if(null!==i){if(!d(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function m(e,t){if(null===e)return null;let n=null,a=null;for(const u of e){let e=u;e=r.n.isDateOnly(u)||o.k.isTimeOnly(u)?u.toNumber():s.c9.isDateTime(u)?u.toMillis():i.g.isTimestampOffset(u)?u.toMilliseconds():u,(null===n||"max"===t&&null!==a&&null!==e&&a<=e||"min"===t&&null!==a&&null!==e&&a>=e)&&(n=u,a=e)}return n}function h(e){if(null===e)return null;if(0===(e=e.filter((e=>null!==e))).length)return null;const t=f(e);if(null===t)return null;let n=0;for(const r of e){if(!d(r))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n+=(t-r)**2}return n/(e.length-1)}},78502:(e,t,n)=>{n.d(t,{Fq:()=>o,Yc:()=>a,Yq:()=>i});var r=n(5443);function a(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new r.A({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function i(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function o(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},88368:(e,t,n)=>{n.d(t,{A:()=>ee});var r=n(44208),a=n(74639),i=n(44729),o=n(1262);function s(e){if(null!==e.precision||null!==e.secondary)throw new o.L8(o.Z7.PrimarySecondaryQualifiers)}function u(e,t){if(t.includes(".")){const n=t.split(".");e.second=parseFloat(n[0]),e.millis=parseInt(n[1],10)}else e.second=parseFloat(t)}const l="esri.core.sql.SqlInterval";class c{constructor(){this.declaredRootClass=l,this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static isInterval(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===l}static createFromMilliseconds(e){const t=new c;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,n){let r=null;const a=new c;if(a.op="-"===n?"-":"+","interval-period"===t.type){s(t);const n=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new o.L8(o.Z7.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new o.L8(o.Z7.IllegalInterval);u(a,e)}else{if(!n.test(e))throw new o.L8(o.Z7.IllegalInterval);a[t.period]=parseFloat(e)}}else{if(s(t.start),s(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new o.L8(o.Z7.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(r=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);a[t.start.period]=parseFloat(e.split(" ")[0]),a[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1])}break;case"second":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1]),u(a,n[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);a.hour=parseFloat(e.split(":")[0]),a.minute=parseFloat(e.split(":")[1]);break;case"second":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),u(a,t[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new o.L8(o.Z7.IllegalInterval);if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.minute=parseFloat(t[0]),u(a,t[1])}break;default:throw new o.L8(o.Z7.IllegalInterval)}}return a}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}var f=n(55612),d=n(15032),m=n(3330),h=n(96285);const p=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2})$/,w=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,S=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function L(e,t){if(t instanceof h.bo)return t===m.GB.instance?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return h.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t})}}function N(e){return c.isInterval(e)}function O(e){return h.c9.isDateTime(e)}function C(e){return i.n.isDateOnly(e)}function Z(e){return d.k.isTimeOnly(e)}function D(e){return f.g.isTimestampOffset(e)}function F(e){let t=p.exec(e);if(null!==t){const[,e,n,r]=t,a=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),0);if(null!==a)return a;throw new o.L8(o.Z7.InvalidTime)}if(t=v.exec(e),null!==t){const[,e,n]=t,r=d.k.fromParts(parseInt(e,10),parseInt(n,10),0,0);if(null!==r)return r;throw new o.L8(o.Z7.InvalidTime)}if(t=w.exec(e),null!==t){const[,e,n,r,a]=t,i=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==i)return i;throw new o.L8(o.Z7.InvalidTime)}throw new o.L8(o.Z7.InvalidTime)}function M(e,t,n=!1){let r=y.exec(e);if(null!==r){const[,e,n,a,i,s,u,l]=r,c=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,m.Qo)(t)});if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,d]=r,m=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),parseInt(s,10),u?parseInt(u.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),0,0,"-"===s,parseInt(u,10),parseInt(l,10));if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=S.exec(e),null!==r){const[,e,n,a,i,s]=r,u=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:0},{zone:(0,m.Qo)(t)});if(!1===u.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return u}if(r=g.exec(e),null!==r){const[,e,n,a]=r,i=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,m.Qo)(t)});if(!1===i.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return i}throw new o.L8(o.Z7.InvalidTimeStamp)}function x(e,t){const n=g.exec(e);if(null===n)try{return M(e,t)}catch{throw new o.L8(o.Z7.InvalidDate)}const[,r,a,s]=n,u=i.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(s,10));if(null===u)throw new o.L8(o.Z7.InvalidDate);return u}var b=n(34727),E=n(799),A=n(54218);function _(e){return!!O(e)||!!D(e)}function P(e){return!!(O(e)||C(e)||D(e)||Z(e))}function U(e){if(O(e))return e.toMillis();if(C(e))return e.toNumber();if(D(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function R(e,t,n,r){if(null==e||null==t)return null;if((0,A.Et)(e)){if((0,A.Et)(t))return $(e,t,n);if((0,A.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return $(e,r,n);const a=e.toString();switch(n){case"<>":return a!==t;case"=":return a===t;case">":return a>t;case"<":return a<t;case">=":return a>=t;case"<=":return a<=t}}(e,t,n);if(P(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator)}else if((0,A.Kg)(e)){if((0,A.Et)(t))return function(e,t,n){const r=parseFloat(e);if(!isNaN(r))return $(r,t,n);const a=t.toString();switch(n){case"<>":return e!==a;case"=":return e===a;case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a}}(e,t,n);if((0,A.Kg)(t))return function(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}(e,t,n);if(O(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))throw new o.L8(o.Z7.InvalidOperator)}else if(O(e)){if(_(t)){if((0,m.Y4)(e.zone)){if(h.c9.isDateTime(t)&&!(0,m.Y4)(t.zone))return k(e,t,n);if(f.g.isTimestampOffset(t))return k(e,t,n)}else if(h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)){if(!(0,m.Y4)(e.zone))return k(e,t,n);if(f.g.isTimestampOffset(e))return k(e,t,n)}return $(U(e),U(t),n)}if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return $((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(D(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),$(r.toMillis(),t.toMilliseconds(),n)}(e,t,n);if(O(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),$(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return $(e.toNumber(),t.toNumber(),n);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(Z(e)){if(Z(t))return $(e.toNumber(),t.toNumber(),n);if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator)}else if(D(e)){if(_(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):$(U(e),U(t),n);if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return $((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function $(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function k(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=V(e),a=V(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function V(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function J(e,t,n){const r=Y[e.toLowerCase()];if(null==r)throw new o.L8(o.Z7.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new o.L8(o.Z7.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t,n)}function z(e){return!((0,A.$P)(e)||C(e)||O(e)||Z(e)||D(e))}function H(e){return C(e)||Z(e)?e.toString():D(e)?e.toSQLValue():O(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,A.$P)(e)?H(h.c9.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,A.$P)(t))switch(e.toUpperCase()){case"SECOND":return t.getSeconds();case"MINUTE":return t.getMinutes();case"HOUR":return t.getHours();case"DAY":return t.getDate();case"MONTH":return t.getMonth()+1;case"YEAR":return t.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(O(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(C(t))switch(e.toUpperCase()){case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(Z(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(D(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes}throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,n]=e;return null==t||null==n?null:t.toString().substring(n-1)}if(3===e.length){const[t,n,r]=e;return null==t||null==n||null==r?null:r<=0?"":t.toString().substring(n-1,n+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,t])=>null==e||null==t?null:t.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const t=3===e.length,n=t?e[1]:" ",r=t?e[2]:e[1];if(null==n||null==r)return null;const a=`(${(0,E.Cj)(n)})`;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${a}*|${a}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${a}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${a}*$`,"g"),"")}throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const t=e[0],n=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*n)/n}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length||0===e[1]?Math.trunc(e[0]):(0,b.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,A.Kg)(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let n=0;n<e.length;n++){if(null==e[n])return null;t+=e[n].toString()}return t}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const t of e)if(null!==t)return t;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:(e,t)=>R(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const n=e[0],r=e[1];if(null===n)return null;switch(r.type){case"integer":{if(!z(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"smallint":{if(!z(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);if(e>32767||e<-32767)throw new o.L8(o.Z7.CannotCastValue);return e}case"float":case"real":{if(!z(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseFloat(n);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"time":return function(e){if((0,A.$P)(e))return d.k.fromDateJS(e);if(O(e))return d.k.fromDateTime(e);if(C(e))throw new o.L8(o.Z7.CannotCastValue);if(Z(e))return e;if(D(e))return d.k.fromSqlTimeStampOffset(e);if((0,A.Kg)(e))return F(e);throw new o.L8(o.Z7.CannotCastValue)}(n);case"date":return function(e){if((0,A.$P)(e))return i.n.fromDateJS(e);if(O(e))return i.n.fromParts(e.year,e.month,e.day);if(C(e))return e;if(Z(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e)&&null===i.n.fromParts(e.year,e.month,e.day))throw new o.L8(o.Z7.CannotCastValue);if((0,A.Kg)(e)){const t=i.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new o.L8(o.Z7.CannotCastValue)}(n);case"timestamp":return function(e,t,n){if((0,A.$P)(e))return L(e,t);if(O(e))return e;if(C(e))return e.toDateTimeLuxon("unknown");if(Z(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e))return e;if((0,A.Kg)(e))return M(e,"unknown",n);throw new o.L8(o.Z7.CannotCastValue)}(n,t,!0===r.withtimezone);case"varchar":{const e=H(n);if(e.length>r.size)throw new o.L8(o.Z7.CannotCastValue);return e}default:throw new o.L8(o.Z7.InvalidDataType)}}}};function q(e,t,n,r){if("||"===e)return J("concat",[t,n],r);if(null===t||null===n)return null;if((0,A.Et)(t)){if((0,A.Et)(n))return K(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e/t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,A.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return K(e,r,n)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}if(C(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(Z(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(N(t)){if((0,A.Et)(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(O(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus({milliseconds:r});case"-":return e.minus({milliseconds:r})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(D(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.addMilliseconds(r);case"-":return e.addMilliseconds(-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if((0,A.Kg)(t)){if((0,A.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return K(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,A.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}throw new o.L8(o.Z7.InvalidOperator)}function K(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new o.L8(o.Z7.InvalidOperator)}function Q(e,t,n,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=t,a.found=n,a.location=r,a.name="SyntaxError",a}function B(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(Q,Error),Q.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n,r=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,u=B("",i.line.toString().length," "),l=r[a.line-1],c=(a.line===s.line?s.column:l.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+l+"\n"+u+" | "+B("",a.column-1," ")+B("",c,"^")}else t+="\n at "+o}return t},Q.buildMessage=function(e,t){var n={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return n[e.type](e)}return"Expected "+function(e){var t,n,r=e.map(o);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."};class j{static parse(e){return function(e,t){var n,r={},a=(t=void 0!==t?t:{}).grammarSource,i={start:ni},o=ni,s="!",u="=",l=">=",c=">",f="<=",d="<>",m="!=",h="||",p="@",v="'",w="N'",g="''",y=".",T="null",I="true",S="false",L="in",N="is",O="like",C="escape",Z="not",D="and",F="or",M="between",x="from",b="for",E="substring",A="extract",_="trim",P="position",U="timestamp",R="date",$="time",k="leading",V="trailing",J="both",z="cast",H="as",Y="integer",q="int",K="smallint",B="float",j="real",G="varchar",W="to",X="interval",ee="year",te="timezone_hour",ne="timezone_minute",re="month",ae="day",ie="hour",oe="minute",se="second",ue="case",le="end",ce="when",fe="then",de="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ge=/^[+\-]/,ye=/^[*\/]/,Te=/^[A-Za-z_\x80-\uFFFF]/,Ie=/^[A-Za-z0-9_]/,Se=/^[A-Za-z0-9_.\x80-\uFFFF]/,Le=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,Ce=/^[eE]/,Ze=/^[ \t\n\r]/,De=/^[^`]/,Fe=ja("!",!1),Me=ja("=",!1),xe=ja(">=",!1),be=ja(">",!1),Ee=ja("<=",!1),Ae=ja("<>",!1),_e=Ga([["<","="]],!1,!1),Pe=ja("!=",!1),Ue=Ga(["+","-"],!1,!1),Re=ja("||",!1),$e=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["",""]],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Je=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),ze=Ga(['"'],!1,!1),He=ja("@",!1),Ye=ja("'",!1),qe=ja("N'",!1),Ke=ja("''",!1),Qe=Ga(["'"],!0,!1),Be=ja(".",!1),je=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=ja("NULL",!0),Xe=ja("TRUE",!0),et=ja("FALSE",!0),tt=ja("IN",!0),nt=ja("IS",!0),rt=ja("LIKE",!0),at=ja("ESCAPE",!0),it=ja("NOT",!0),ot=ja("AND",!0),st=ja("OR",!0),ut=ja("BETWEEN",!0),lt=ja("FROM",!0),ct=ja("FOR",!0),ft=ja("SUBSTRING",!0),dt=ja("EXTRACT",!0),mt=ja("TRIM",!0),ht=ja("POSITION",!0),pt=ja("TIMESTAMP",!0),vt=ja("DATE",!0),wt=ja("TIME",!0),gt=ja("LEADING",!0),yt=ja("TRAILING",!0),Tt=ja("BOTH",!0),It=ja("CAST",!0),St=ja("AS",!0),Lt=ja("INTEGER",!0),Nt=ja("INT",!0),Ot=ja("SMALLINT",!0),Ct=ja("FLOAT",!0),Zt=ja("REAL",!0),Dt=ja("VARCHAR",!0),Ft=ja("TO",!0),Mt=ja("INTERVAL",!0),xt=ja("YEAR",!0),bt=ja("TIMEZONE_HOUR",!0),Et=ja("TIMEZONE_MINUTE",!0),At=ja("MONTH",!0),_t=ja("DAY",!0),Pt=ja("HOUR",!0),Ut=ja("MINUTE",!0),Rt=ja("SECOND",!0),$t=ja("CASE",!0),kt=ja("END",!0),Vt=ja("WHEN",!0),Jt=ja("THEN",!0),zt=ja("ELSE",!0),Ht=ja(",",!1),Yt=ja("(",!1),qt=ja(")",!1),Kt=Ga([" ","\t","\n","\r"],!1,!1),Qt=ja("`",!1),Bt=Ga(["`"],!0,!1),jt=function(e){return e},Gt=function(e){return{type:"expression-list",location:Qa(),value:e}},Wt=function(e,t,n){return{op:t,expr:n,location:Qa()}},Xt=function(e,t){return zo(e,t)},en=function(e,t,n){return{op:t,expr:n,location:Qa()}},tn=function(e,t){return zo(e,t)},nn=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,Qa())},rn=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?zo(e,t.tail):Vo(t.op,e,t.right,t.escape,Qa())},an=function(e,t){return{op:e,expr:t,location:Qa()}},on=function(e){return{type:"arithmetic",tail:e}},sn=function(e,t){return{op:e+"NOT",right:t}},un=function(e,t){return{op:e,right:t}},ln=function(e,t,n){return Jo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},fn=function(e,t,n){return Jo(Qa(),t,n)},dn=function(e,t){return{op:e,right:t}},mn=function(e){return e[0]+" "+e[2]},hn=function(e){return e[0]+" "+e[2]},pn=function(e,t,n){return{op:e,right:t,escape:n.value}},vn=function(e,t){return{op:e,right:t,escape:""}},wn=function(e,t){return{op:e,right:t}},gn=function(e,t){return{op:e,right:t}},yn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Tn=function(e,t){return zo(e,t)},In=function(e,t,n){return{op:t,expr:n,location:Qa()}},Sn=function(e,t){return zo(e,t)},Ln=function(e){return e.paren=!0,e},Nn=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:Qa(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:Qa(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:Qa(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:Qa()}:{type:"column-reference",location:Qa(),table:"",column:e}},On=function(e){return{type:"column-reference",location:Qa(),table:"",column:e,delimited:!0}},Cn=function(e){return e},Zn=function(e,t){return e+t.join("")},Dn=function(e,t){return e+t.join("")},Fn=function(e){return e},Mn=function(e){return e.join("")},xn=function(){return'"'},bn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return Jo(Qa(),e,t)},An=function(e,t){return Jo(Qa(),e,t)},_n=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return Jo(Qa(),e,t,...n?[n]:[])},Un=function(e,t,n){return Jo(Qa(),e,t,n)},Rn=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},$n=function(e,t){return Jo(Qa(),e,t)},kn=function(e,t){return Jo(Qa(),e,t)},Vn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},Jn=function(){return{type:"data-type",location:Qa(),value:{type:"integer"}}},zn=function(){return{type:"data-type",location:Qa(),value:{type:"smallint"}}},Hn=function(){return{type:"data-type",location:Qa(),value:{type:"float"}}},Yn=function(){return{type:"data-type",location:Qa(),value:{type:"real"}}},qn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},Kn=function(){return{type:"data-type",location:Qa(),value:{type:"timestamp"}}},Qn=function(){return{type:"data-type",location:Qa(),value:{type:"time"}}},Bn=function(e){return{type:"data-type",location:Qa(),value:{type:"varchar",size:parseInt(e)}}},jn=function(e,t,n){return Jo(Qa(),e,t,n)},Gn=function(e,t){return Jo(Qa(),e,t)},Wn=function(e){return{type:"function",location:Qa(),name:"trim",args:e}},Xn=function(e){return{type:"string",location:Qa(),value:e??"BOTH"}},er=function(e,t){return Jo(Qa(),e,t)},tr=function(e,t){return Jo(Qa(),e,t)},nr=function(e){return{type:"function",location:Qa(),name:"position",args:e}},rr=function(e,t){return{type:"function",location:Qa(),name:e,args:t}},ar=function(e){return{type:"string",location:Qa(),value:e}},ir=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Ba("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:Qa(),value:e.value}},or=function(e){return"string"===e.type&&function(e){!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)&&Ba("Time literal is invalid")}(e.value),{type:"time",location:Qa(),value:e.value}},sr=function(e,t,n){return{type:"interval",location:Qa(),value:t,qualifier:n,op:e}},ur=function(e,t){return{type:"interval",location:Qa(),value:e,qualifier:t,op:""}},lr=function(e,t){return{type:"interval-qualifier",location:Qa(),start:e,end:t}},cr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},fr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},mr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},hr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},pr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},vr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},wr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},gr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},yr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Tr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Ir=function(){return{type:"string",location:Qa(),value:"day"}},Sr=function(){return{type:"string",location:Qa(),value:"hour"}},Lr=function(){return{type:"string",location:Qa(),value:"minute"}},Nr=function(){return{type:"string",location:Qa(),value:"month"}},Or=function(){return{type:"string",location:Qa(),value:"year"}},Cr=function(e){return parseFloat(e)},Zr=function(e){return parseFloat(e)},Dr=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Ba("Date literal is invalid")}(e.value),{type:"date",location:Qa(),value:e.value}},Fr=function(){return{type:"null",location:Qa(),value:null}},Mr=function(){return{type:"boolean",location:Qa(),value:!0}},xr=function(){return{type:"boolean",location:Qa(),value:!1}},br=function(){return"'"},Er=function(e){return{type:"string",location:Qa(),value:e.join("")}},Ar=function(e,t){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}},_r=function(e,t,n){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}},Pr=function(e){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:null,elseLocation:null}},Ur=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},$r=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},Vr=function(e){return{type:"number",location:Qa(),value:e}},Jr=function(e,t,n){return parseFloat(e+t+n)},zr=function(e,t){return parseFloat(e+t)},Hr=function(e,t){return parseFloat(e+t)},Yr=function(e){return parseFloat(e)},qr=function(e,t){return e[0]+t},Kr=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},Br=function(e){return e.join("")},jr=function(e,t){return"e"+(null===t?"":t)},Gr=function(){return"IN"},Wr=function(){return"IS"},Xr=function(){return"LIKE"},ea=function(){return"ESCAPE"},ta=function(){return"NOT"},na=function(){return"AND"},ra=function(){return"OR"},aa=function(){return"BETWEEN"},ia=function(){return"FROM"},oa=function(){return"FOR"},sa=function(){return"SUBSTRING"},ua=function(){return"EXTRACT"},la=function(){return"TRIM"},ca=function(){return"POSITION"},fa=function(){return"TIMESTAMP"},da=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ga=function(){return"AS"},ya=function(){return"INTEGER"},Ta=function(){return"INT"},Ia=function(){return"SMALLINT"},Sa=function(){return"FLOAT"},La=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Ca=function(){return"INTERVAL"},Za=function(){return"YEAR"},Da=function(){return"TIMEZONE_HOUR"},Fa=function(){return"TIMEZONE_MINUTE"},Ma=function(){return"MONTH"},xa=function(){return"DAY"},ba=function(){return"HOUR"},Ea=function(){return"MINUTE"},Aa=function(){return"SECOND"},_a=function(){return"CASE"},Pa=function(){return"END"},Ua=function(){return"WHEN"},Ra=function(){return"THEN"},$a=function(){return"ELSE"},ka=function(e){return e},Va=function(e){return e.join("")},Ja=0|t.peg$currPos,za=Ja,Ha=[{line:1,column:1}],Ya=Ja,qa=t.peg$maxFailExpected||[],Ka=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=i[t.startRule]}function Qa(){return Xa(za,Ja)}function Ba(e,t){throw ti(e,t=void 0!==t?t:Xa(za,Ja))}function ja(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ga(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Wa(t){var n,r=Ha[t];if(r)return r;if(t>=Ha.length)n=Ha.length-1;else for(n=t;!Ha[--n];);for(r={line:(r=Ha[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return Ha[t]=r,r}function Xa(e,t,n){var r=Wa(e),i=Wa(t);return{source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}}}function ei(e){Ja<Ya||(Ja>Ya&&(Ya=Ja,qa=[]),qa.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=Ja,Ro(),(t=ai())!==r?(Ro(),za=e,e=jt(t)):(Ja=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=Ja,Po()!==r){for(Ro(),t=[],n=ai();n!==r;)t.push(n),n=Ja,a=Ja,i=Ro(),(o=_o())!==r?a=i=[i,o,Ro()]:(Ja=a,a=r),a!==r&&(a=ai())===r?(Ja=n,n=r):n=a;n=Ro(),(a=Uo())!==r?(za=e,e=Gt(t)):(Ja=e,e=r)}else Ja=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=Ja,(t=ii())!==r){for(n=[],a=Ja,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(za=a,a=Wt(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(za=a,a=Wt(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=Xt(t,n)}else Ja=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=Ja,(t=oi())!==r){for(n=[],a=Ja,Ro(),(i=ji())!==r?(Ro(),(o=oi())!==r?(za=a,a=en(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=ji())!==r?(Ro(),(o=oi())!==r?(za=a,a=en(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=tn(t,n)}else Ja=e,e=r;return e}function oi(){var t,n,a,i,o;return t=Ja,(n=Bi())===r&&(n=Ja,33===e.charCodeAt(Ja)?(a=s,Ja++):(a=r,0===Ka&&ei(Fe)),a!==r?(i=Ja,Ka++,61===e.charCodeAt(Ja)?(o=u,Ja++):(o=r,0===Ka&&ei(Me)),Ka--,o===r?i=void 0:(Ja=i,i=r),i!==r?n=a=[a,i]:(Ja=n,n=r)):(Ja=n,n=r)),n!==r?(a=Ro(),(i=oi())!==r?(za=t,t=nn(i)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=Ja,(t=ci())!==r?(n=Ja,Ro(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Ja,t=[],n=Ja,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(za=n,n=an(a,i)):(Ja=n,n=r)):(Ja=n,n=r),n!==r)for(;n!==r;)t.push(n),n=Ja,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(za=n,n=an(a,i)):(Ja=n,n=r)):(Ja=n,n=r);else t=r;return t!==r&&(za=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=Ja,(t=li())!==r?(Ro(),(n=ri())!==r?(za=e,e=wn(t,n)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=li())!==r?(Ro(),(n=Si())!==r?(za=e,e=gn(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=Ja,(t=Bi())!==r?(Ro(),(n=Wi())!==r?(a=Ro(),i=Ja,(o=ci())!==r?(Ro(),(s=ji())!==r?(Ro(),(u=ci())!==r?(za=i,i=ln(n,o,u)):(Ja=i,i=r)):(Ja=i,i=r)):(Ja=i,i=r),i!==r?(za=e,e=cn(n,i)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Wi())!==r?(Ro(),n=Ja,(a=ci())!==r?(i=Ro(),(o=ji())!==r?(Ro(),(s=ci())!==r?(za=n,n=fn(t,a,s)):(Ja=n,n=r)):(Ja=n,n=r)):(Ja=n,n=r),n!==r?(za=e,e=dn(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,(t=qi())!==r?(Ro(),(n=Bi())!==r?(Ro(),(a=ci())!==r?(za=e,e=sn(t,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=qi())!==r?(Ro(),(n=ci())!==r?(za=e,e=un(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,(t=ui())!==r?(Ro(),(n=xi())!==r?(Ro(),Qi()!==r?(Ro(),(a=bi())!==r?(za=e,e=pn(t,n,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=ui())!==r?(Ro(),(n=xi())!==r?(za=e,e=vn(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}()),e}())!==r?n=a:(Ja=n,n=r),n===r&&(n=null),za=e,e=rn(t,n)):(Ja=e,e=r),e}()),t}function si(){var t;return e.substr(Ja,2)===l?(t=l,Ja+=2):(t=r,0===Ka&&ei(xe)),t===r&&(62===e.charCodeAt(Ja)?(t=c,Ja++):(t=r,0===Ka&&ei(be)),t===r&&(e.substr(Ja,2)===f?(t=f,Ja+=2):(t=r,0===Ka&&ei(Ee)),t===r&&(e.substr(Ja,2)===d?(t=d,Ja+=2):(t=r,0===Ka&&ei(Ae)),t===r&&(t=e.charAt(Ja),we.test(t)?Ja++:(t=r,0===Ka&&ei(_e)),t===r&&(e.substr(Ja,2)===m?(t=m,Ja+=2):(t=r,0===Ka&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=Ja,t=Ja,(n=Bi())!==r?(a=Ro(),(i=Ki())!==r?t=n=[n,a,i]:(Ja=t,t=r)):(Ja=t,t=r),t!==r&&(za=e,t=mn(t)),(e=t)===r&&(e=Ki()),e}function li(){var e,t,n,a,i;return e=Ja,t=Ja,(n=Bi())!==r?(a=Ro(),(i=Yi())!==r?t=n=[n,a,i]:(Ja=t,t=r)):(Ja=t,t=r),t!==r&&(za=e,t=hn(t)),(e=t)===r&&(e=Yi()),e}function ci(){var e,t,n,a,i,o;if(e=Ja,(t=di())!==r){for(n=[],a=Ja,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(za=a,a=yn(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(za=a,a=yn(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=Tn(t,n)}else Ja=e,e=r;return e}function fi(){var t;return t=e.charAt(Ja),ge.test(t)?Ja++:(t=r,0===Ka&&ei(Ue)),t===r&&(e.substr(Ja,2)===h?(t=h,Ja+=2):(t=r,0===Ka&&ei(Re))),t}function di(){var e,t,n,a,i,o;if(e=Ja,(t=hi())!==r){for(n=[],a=Ja,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(za=a,a=In(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(za=a,a=In(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=Sn(t,n)}else Ja=e,e=r;return e}function mi(){var t;return t=e.charAt(Ja),ye.test(t)?Ja++:(t=r,0===Ka&&ei($e)),t}function hi(){var e,t;return(e=function(){var e;return(e=bi())===r&&(e=function(){var e,t,n,a;return e=Ja,(t=function(){var e,t,n,a;return e=Ja,(t=Pi())!==r&&(n=Ui())!==r&&(a=Ri())!==r?(za=e,e=Jr(t,n,a)):(Ja=e,e=r),e===r&&(e=Ja,(t=Pi())!==r&&(n=Ui())!==r?(za=e,e=zr(t,n)):(Ja=e,e=r),e===r&&(e=Ja,(t=Pi())!==r&&(n=Ri())!==r?(za=e,e=Hr(t,n)):(Ja=e,e=r),e===r&&(e=Ja,(t=Pi())!==r&&(za=e,t=Yr(t)),e=t))),e}())!==r?(n=Ja,Ka++,a=vi(),Ka--,a===r?n=void 0:(Ja=n,n=r),n!==r?(za=e,e=Vr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t;return e=Ja,(t=zi())!==r&&(za=e,t=Mr()),(e=t)===r&&(e=Ja,(t=Hi())!==r&&(za=e,t=xr()),e=t),e}())===r&&(e=function(){var e,t;return e=Ja,(t=Ji())!==r&&(za=e,t=Fr()),t}())===r&&(e=function(){var e,t;return e=Ja,oo()!==r?(Ro(),(t=xi())!==r?(za=e,e=Dr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t;return e=Ja,io()!==r?(Ro(),(t=xi())!==r?(za=e,e=ir(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=Ci())===r&&(e=function(){var e,t;return e=Ja,so()!==r?(Ro(),(t=xi())!==r?(za=e,e=or(t)):(Ja=e,e=r)):(Ja=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,no()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=En(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),_o()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=An(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=_n(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=Ja,to()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),i=Ja,eo()!==r?(o=Ro(),(s=ai())!==r?(Ro(),i=s):(Ja=i,i=r)):(Ja=i,i=r),i===r&&(i=null),Uo()!==r?(za=t,t=Pn(n,a,i)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),_o()!==r?(Ro(),(a=ai())!==r?(Ro(),(i=_o())!==r?(Ro(),(o=ai())!==r&&(s=Uo())!==r?(za=t,t=Un(n,a,o)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=Rn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=Ja,ro()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Xi()!==r?(Ro(),(i=ai())!==r?(Ro(),Uo()!==r?(za=t,t=jn(n,a,i)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=Gn(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=Wn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,ao()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Yi()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=er(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),_o()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=tr(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=nr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,fo()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),mo()!==r?(Ro(),(a=Li())!==r?(Ro(),Uo()!==r?(za=t,t=$n(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),_o()!==r?(Ro(),(a=Li())!==r?(Ro(),Uo()!==r?(za=t,t=kn(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=Vn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,t=Ja,Ka++,n=no(),Ka--,n===r?t=void 0:(Ja=t,t=r),t!==r&&(n=ko())!==r?(Ro(),(a=ri())!==r?(za=e,e=rr(n,a)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Ja,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);(a=xo())!==r?(za=e,e=Ar(t,n)):(Ja=e,e=r)}else Ja=e,e=r;else Ja=e,e=r;if(e===r)if(e=Ja,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);(a=_i())!==r?(i=Ro(),xo()!==r?(za=e,e=_r(t,n,a)):(Ja=e,e=r)):(Ja=e,e=r)}else Ja=e,e=r;else Ja=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=Ja,Mo()!==r){for(Ro(),t=[],n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);n!==r;)t.push(n),n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);(n=xo())!==r?(za=e,e=Pr(t)):(Ja=e,e=r)}else Ja=e,e=r;if(e===r)if(e=Ja,Mo()!==r){for(Ro(),t=[],n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);n!==r;)t.push(n),n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);(n=_i())!==r?(a=Ro(),xo()!==r?(za=e,e=Ur(t,n)):(Ja=e,e=r)):(Ja=e,e=r)}else Ja=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=Ja,(t=function(){var e,t;return e=Ja,(t=function(){var e,t,n,a;if(e=Ja,(t=vi())!==r){for(n=[],a=gi();a!==r;)n.push(a),a=gi();za=e,e=Zn(t,n)}else Ja=e,e=r;return e}())!==r&&(za=e,t=Cn(t)),t}())!==r&&(za=e,t=Nn(t)),(e=t)===r&&(e=Ja,(t=function(){var e,t;return e=Ja,Ii()!==r?(t=function(){var e,t,n;for(e=Ja,t=[],n=yi();n!==r;)t.push(n),n=yi();return za=e,Mn(t)}(),Ii()!==r?(za=e,e=Fn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())!==r&&(za=e,t=On(t)),e=t),e}())===r&&(e=Si())===r&&(e=Ja,Po()!==r?(Ro(),(t=ai())!==r?(Ro(),Uo()!==r?(za=e,e=Ln(t)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)),e}function pi(){var e,t,n,a;if(e=Ja,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();za=e,e=Dn(t,n)}else Ja=e,e=r;return e}function vi(){var t;return t=e.charAt(Ja),Te.test(t)?Ja++:(t=r,0===Ka&&ei(ke)),t}function wi(){var t;return t=e.charAt(Ja),Ie.test(t)?Ja++:(t=r,0===Ka&&ei(Ve)),t}function gi(){var t;return t=e.charAt(Ja),Se.test(t)?Ja++:(t=r,0===Ka&&ei(Je)),t}function yi(){var e;return(e=Ti())===r&&(e=function(){var e;return e=Ja,Ii()!==r&&Ii()!==r?(za=e,e=xn()):(Ja=e,e=r),e}()),e}function Ti(){var t;return t=e.charAt(Ja),Se.test(t)?Ja++:(t=r,0===Ka&&ei(Je)),t}function Ii(){var t;return t=e.charAt(Ja),Le.test(t)?Ja++:(t=r,0===Ka&&ei(ze)),t}function Si(){var t,n,a,i;return t=Ja,n=Ja,64===e.charCodeAt(Ja)?(a=p,Ja++):(a=r,0===Ka&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(Ja=n,n=r),n!==r&&(za=t,n=bn(n)),n}function Li(){var e,t,n;return e=Ja,(t=ho())===r&&(t=po()),t!==r&&(za=e,t=Jn()),(e=t)===r&&(e=Ja,(t=vo())!==r&&(za=e,t=zn()),(e=t)===r&&(e=Ja,(t=wo())!==r&&(za=e,t=Hn()),(e=t)===r&&(e=Ja,(t=go())!==r&&(za=e,t=Yn()),(e=t)===r&&(e=Ja,(t=oo())!==r&&(za=e,t=qn()),(e=t)===r&&(e=Ja,(t=io())!==r&&(za=e,t=Kn()),(e=t)===r&&(e=Ja,(t=so())!==r&&(za=e,t=Qn()),(e=t)===r&&(e=Ja,(t=yo())!==r?(Ro(),Po()!==r?(Ro(),(n=$i())!==r?(Ro(),Uo()!==r?(za=e,e=Bn(n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)))))))),e}function Ni(){var e,t;return e=Ja,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),za=e,Xn(t)}function Oi(){var e,t;return e=Ja,(t=So())===r&&(t=Oo())===r&&(t=Co())===r&&(t=Zo())===r&&(t=Do())===r&&(t=Fo())===r&&(t=Lo())===r&&(t=No()),t!==r&&(za=e,t=ar(t)),t}function Ci(){var t,n,a,i;return t=Ja,Io()!==r?(Ro(),n=e.charAt(Ja),ge.test(n)?Ja++:(n=r,0===Ka&&ei(Ue)),n!==r?(Ro(),(a=xi())!==r?(Ro(),(i=Zi())!==r?(za=t,t=sr(n,a,i)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Io()!==r?(Ro(),(n=xi())!==r?(Ro(),(a=Zi())!==r?(za=t,t=ur(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t}function Zi(){var e,t,n;return e=Ja,(t=function(){var e,t,n;return e=Ja,(t=Di())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Uo()!==r?(za=e,e=cr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Di())!==r&&(za=e,t=fr(t)),e=t),e}())!==r?(Ro(),To()!==r?(Ro(),(n=function(){var e,t,n,a;return e=Ja,(t=Di())!==r&&(za=e,t=dr(t)),(e=t)===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),_o()!==r?(Ro(),(a=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=mr(n,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Uo()!==r?(za=e,e=hr(n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r&&(za=e,t=pr()),e=t))),e}())!==r?(za=e,e=lr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=Ja,(t=Di())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=vr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Di())!==r&&(za=e,t=wr(t)),(e=t)===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),_o()!==r?(Ro(),(a=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=gr(n,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=yr(n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r&&(za=e,t=Tr()),e=t)))),e}()),e}function Di(){var e,t;return e=Ja,(t=Co())!==r&&(za=e,t=Ir()),(e=t)===r&&(e=Ja,(t=Zo())!==r&&(za=e,t=Sr()),(e=t)===r&&(e=Ja,(t=Do())!==r&&(za=e,t=Lr()),(e=t)===r&&(e=Ja,(t=Oo())!==r&&(za=e,t=Nr()),(e=t)===r&&(e=Ja,(t=So())!==r&&(za=e,t=Or()),e=t)))),e}function Fi(){var e,t;return e=Ja,(t=$i())!==r&&(za=e,t=Cr(t)),t}function Mi(){var e,t;return e=Ja,(t=$i())!==r&&(za=e,t=Zr(t)),t}function xi(){var e;return(e=bi())===r&&(e=Si()),e}function bi(){var t,n,a,i,o;if(t=Ja,39===e.charCodeAt(Ja)?(n=v,Ja++):(n=r,0===Ka&&ei(Ye)),n===r&&(e.substr(Ja,2)===w?(n=w,Ja+=2):(n=r,0===Ka&&ei(qe))),n!==r){for(a=[],i=Ja,e.substr(Ja,2)===g?(o=g,Ja+=2):(o=r,0===Ka&&ei(Ke)),o!==r&&(za=i,o=br()),(i=o)===r&&(i=e.charAt(Ja),Ne.test(i)?Ja++:(i=r,0===Ka&&ei(Qe)));i!==r;)a.push(i),i=Ja,e.substr(Ja,2)===g?(o=g,Ja+=2):(o=r,0===Ka&&ei(Ke)),o!==r&&(za=i,o=br()),(i=o)===r&&(i=e.charAt(Ja),Ne.test(i)?Ja++:(i=r,0===Ka&&ei(Qe)));39===e.charCodeAt(Ja)?(i=v,Ja++):(i=r,0===Ka&&ei(Ye)),i!==r?(za=t,t=Er(a)):(Ja=t,t=r)}else Ja=t,t=r;return t}function Ei(){var e,t,n;return e=Ja,bo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(za=e,e=Rr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e}function Ai(){var e,t,n;return e=Ja,bo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(za=e,e=$r(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e}function _i(){var e,t;return e=Ja,Ao()!==r?(Ro(),(t=ai())!==r?(za=e,e=kr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}function Pi(){var t,n,a;return(t=$i())===r&&(t=Ja,n=e.charAt(Ja),ge.test(n)?Ja++:(n=r,0===Ka&&ei(Ue)),n!==r&&(a=$i())!==r?(za=t,t=qr(n,a)):(Ja=t,t=r)),t}function Ui(){var t,n,a;return t=Ja,46===e.charCodeAt(Ja)?(n=y,Ja++):(n=r,0===Ka&&ei(Be)),n!==r?((a=$i())===r&&(a=null),za=t,t=Kr(a)):(Ja=t,t=r),t}function Ri(){var e,t,n;return e=Ja,(t=Vi())!==r&&(n=$i())!==r?(za=e,e=Qr(t,n)):(Ja=e,e=r),e}function $i(){var e,t,n;if(e=Ja,t=[],(n=ki())!==r)for(;n!==r;)t.push(n),n=ki();else t=r;return t!==r&&(za=e,t=Br(t)),t}function ki(){var t;return t=e.charAt(Ja),Oe.test(t)?Ja++:(t=r,0===Ka&&ei(je)),t}function Vi(){var t,n,a;return t=Ja,n=e.charAt(Ja),Ce.test(n)?Ja++:(n=r,0===Ka&&ei(Ge)),n!==r?(a=e.charAt(Ja),ge.test(a)?Ja++:(a=r,0===Ka&&ei(Ue)),a===r&&(a=null),za=t,t=jr(n,a)):(Ja=t,t=r),t}function Ji(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===T?Ja+=4:(n=r,0===Ka&&ei(We)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?t=n=[n,a]:(Ja=t,t=r)):(Ja=t,t=r),t}function zi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===I?Ja+=4:(n=r,0===Ka&&ei(Xe)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?t=n=[n,a]:(Ja=t,t=r)):(Ja=t,t=r),t}function Hi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,5)).toLowerCase()===S?Ja+=5:(n=r,0===Ka&&ei(et)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?t=n=[n,a]:(Ja=t,t=r)):(Ja=t,t=r),t}function Yi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===L?Ja+=2:(n=r,0===Ka&&ei(tt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Gr()):(Ja=t,t=r)):(Ja=t,t=r),t}function qi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===N?Ja+=2:(n=r,0===Ka&&ei(nt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Wr()):(Ja=t,t=r)):(Ja=t,t=r),t}function Ki(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===O?Ja+=4:(n=r,0===Ka&&ei(rt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Xr()):(Ja=t,t=r)):(Ja=t,t=r),t}function Qi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,6)).toLowerCase()===C?Ja+=6:(n=r,0===Ka&&ei(at)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ea()):(Ja=t,t=r)):(Ja=t,t=r),t}function Bi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===Z?Ja+=3:(n=r,0===Ka&&ei(it)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ta()):(Ja=t,t=r)):(Ja=t,t=r),t}function ji(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===D?Ja+=3:(n=r,0===Ka&&ei(ot)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=na()):(Ja=t,t=r)):(Ja=t,t=r),t}function Gi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===F?Ja+=2:(n=r,0===Ka&&ei(st)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ra()):(Ja=t,t=r)):(Ja=t,t=r),t}function Wi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===M?Ja+=7:(n=r,0===Ka&&ei(ut)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=aa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Xi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===x?Ja+=4:(n=r,0===Ka&&ei(lt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ia()):(Ja=t,t=r)):(Ja=t,t=r),t}function eo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===b?Ja+=3:(n=r,0===Ka&&ei(ct)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=oa()):(Ja=t,t=r)):(Ja=t,t=r),t}function to(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,9)).toLowerCase()===E?Ja+=9:(n=r,0===Ka&&ei(ft)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=sa()):(Ja=t,t=r)):(Ja=t,t=r),t}function no(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===A?Ja+=7:(n=r,0===Ka&&ei(dt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ua()):(Ja=t,t=r)):(Ja=t,t=r),t}function ro(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===_?Ja+=4:(n=r,0===Ka&&ei(mt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=la()):(Ja=t,t=r)):(Ja=t,t=r),t}function ao(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===P?Ja+=8:(n=r,0===Ka&&ei(ht)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ca()):(Ja=t,t=r)):(Ja=t,t=r),t}function io(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,9)).toLowerCase()===U?Ja+=9:(n=r,0===Ka&&ei(pt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=fa()):(Ja=t,t=r)):(Ja=t,t=r),t}function oo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===R?Ja+=4:(n=r,0===Ka&&ei(vt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=da()):(Ja=t,t=r)):(Ja=t,t=r),t}function so(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===$?Ja+=4:(n=r,0===Ka&&ei(wt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ma()):(Ja=t,t=r)):(Ja=t,t=r),t}function uo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===k?Ja+=7:(n=r,0===Ka&&ei(gt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ha()):(Ja=t,t=r)):(Ja=t,t=r),t}function lo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===V?Ja+=8:(n=r,0===Ka&&ei(yt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=pa()):(Ja=t,t=r)):(Ja=t,t=r),t}function co(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===J?Ja+=4:(n=r,0===Ka&&ei(Tt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=va()):(Ja=t,t=r)):(Ja=t,t=r),t}function fo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===z?Ja+=4:(n=r,0===Ka&&ei(It)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=wa()):(Ja=t,t=r)):(Ja=t,t=r),t}function mo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===H?Ja+=2:(n=r,0===Ka&&ei(St)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ga()):(Ja=t,t=r)):(Ja=t,t=r),t}function ho(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===Y?Ja+=7:(n=r,0===Ka&&ei(Lt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ya()):(Ja=t,t=r)):(Ja=t,t=r),t}function po(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===q?Ja+=3:(n=r,0===Ka&&ei(Nt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ta()):(Ja=t,t=r)):(Ja=t,t=r),t}function vo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===K?Ja+=8:(n=r,0===Ka&&ei(Ot)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ia()):(Ja=t,t=r)):(Ja=t,t=r),t}function wo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,5)).toLowerCase()===B?Ja+=5:(n=r,0===Ka&&ei(Ct)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Sa()):(Ja=t,t=r)):(Ja=t,t=r),t}function go(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===j?Ja+=4:(n=r,0===Ka&&ei(Zt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=La()):(Ja=t,t=r)):(Ja=t,t=r),t}function yo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===G?Ja+=7:(n=r,0===Ka&&ei(Dt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Na()):(Ja=t,t=r)):(Ja=t,t=r),t}function To(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===W?Ja+=2:(n=r,0===Ka&&ei(Ft)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Oa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Io(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===X?Ja+=8:(n=r,0===Ka&&ei(Mt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ca()):(Ja=t,t=r)):(Ja=t,t=r),t}function So(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ee?Ja+=4:(n=r,0===Ka&&ei(xt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Za()):(Ja=t,t=r)):(Ja=t,t=r),t}function Lo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,13)).toLowerCase()===te?Ja+=13:(n=r,0===Ka&&ei(bt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Da()):(Ja=t,t=r)):(Ja=t,t=r),t}function No(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,15)).toLowerCase()===ne?Ja+=15:(n=r,0===Ka&&ei(Et)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Fa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Oo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,5)).toLowerCase()===re?Ja+=5:(n=r,0===Ka&&ei(At)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ma()):(Ja=t,t=r)):(Ja=t,t=r),t}function Co(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===ae?Ja+=3:(n=r,0===Ka&&ei(_t)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=xa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Zo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ie?Ja+=4:(n=r,0===Ka&&ei(Pt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ba()):(Ja=t,t=r)):(Ja=t,t=r),t}function Do(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,6)).toLowerCase()===oe?Ja+=6:(n=r,0===Ka&&ei(Ut)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ea()):(Ja=t,t=r)):(Ja=t,t=r),t}function Fo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,6)).toLowerCase()===se?Ja+=6:(n=r,0===Ka&&ei(Rt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Aa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Mo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ue?Ja+=4:(n=r,0===Ka&&ei($t)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=_a()):(Ja=t,t=r)):(Ja=t,t=r),t}function xo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===le?Ja+=3:(n=r,0===Ka&&ei(kt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Pa()):(Ja=t,t=r)):(Ja=t,t=r),t}function bo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ce?Ja+=4:(n=r,0===Ka&&ei(Vt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ua()):(Ja=t,t=r)):(Ja=t,t=r),t}function Eo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===fe?Ja+=4:(n=r,0===Ka&&ei(Jt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ra()):(Ja=t,t=r)):(Ja=t,t=r),t}function Ao(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===de?Ja+=4:(n=r,0===Ka&&ei(zt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=$a()):(Ja=t,t=r)):(Ja=t,t=r),t}function _o(){var t;return 44===e.charCodeAt(Ja)?(t=me,Ja++):(t=r,0===Ka&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(Ja)?(t=he,Ja++):(t=r,0===Ka&&ei(Yt)),t}function Uo(){var t;return 41===e.charCodeAt(Ja)?(t=pe,Ja++):(t=r,0===Ka&&ei(qt)),t}function Ro(){var e,t;for(e=[],t=$o();t!==r;)e.push(t),t=$o();return e}function $o(){var t;return t=e.charAt(Ja),Ze.test(t)?Ja++:(t=r,0===Ka&&ei(Kt)),t}function ko(){var t,n,a,i;if(t=Ja,(n=pi())!==r&&(za=t,n=ka(n)),(t=n)===r)if(t=Ja,96===e.charCodeAt(Ja)?(n=ve,Ja++):(n=r,0===Ka&&ei(Qt)),n!==r){if(a=[],i=e.charAt(Ja),De.test(i)?Ja++:(i=r,0===Ka&&ei(Bt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(Ja),De.test(i)?Ja++:(i=r,0===Ka&&ei(Bt));else a=r;a!==r?(96===e.charCodeAt(Ja)?(i=ve,Ja++):(i=r,0===Ka&&ei(Qt)),i!==r?(za=t,t=Va(a)):(Ja=t,t=r)):(Ja=t,t=r)}else Ja=t,t=r;return t}function Vo(e,t,n,r,a){const i={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(i.escape=r),i}function Jo(e,...t){return{type:"expression-list",location:e,value:t}}function zo(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=Vo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:Ja,peg$FAILED:r,peg$maxFailExpected:qa,peg$maxFailPos:Ya};if(n!==r&&Ja===e.length)return n;throw n!==r&&Ja<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(qa,Ya<e.length?e.charAt(Ya):null,Ya<e.length?Xa(Ya,Ya+1):Xa(Ya,Ya))}(e)}}function G(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":G(e.operand,t),G(e.value,t);break;case"case-expression":for(const n of e.clauses)G(n,t);"simple"===e.format&&G(e.operand,t),null!==e.else&&G(e.else,t);break;case"expression-list":for(const n of e.value)G(n,t);break;case"unary-expression":G(e.expr,t);break;case"binary-expression":G(e.left,t),G(e.right,t);break;case"function":G(e.args,t);break;case"interval":G(e.value,t),G(e.qualifier,t);break;case"interval-qualifier":G(e.start,t),G(e.end,t)}}const W=new Set(["current_timestamp","current_date","current_time"]);class X{static makeBool(e){return te(e)}static featureValue(e,t,n,r){return ce(e,t,n,r)}static equalsNull(e){return null===e}static applyLike(e,t,n){return le(e,t,n)}static ensureArray(e){return ne(e)}static applyIn(e,t,n){return oe(e,t)}static currentTimestamp(e){return L(new Date,e)}static currentDate(e){return i.n.fromNow(e)}static currentTime(e){const t=L(new Date,e);return d.k.fromDateTime(t)}static makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}static convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}static compare(e,t,n,r){return R(t,n,e)}static calculate(e,t,n,r){return q(e,t,n,r)}static evaluateTime(e){return F(e)}static evaluateTimestamp(e,t,n){return M(e,t,n)}static evaluateDate(e,t){return x(e,t)}static evaluateFunction(e,t,n){return J(e,t,n)}static lookup(e,t){const n=t[e];return void 0===n?null:n}static between(e,t,n){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],">=")&&R(e,t[1],"<=")}static notbetween(e,t,n){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],"<")||R(e,t[1],">")}static ternaryNot(e){return re(e)}static ternaryAnd(e,t){return ae(e,t)}static ternaryOr(e,t){return ie(e,t)}}class ee{constructor(e,t,n="UTC",r=null){this.fieldsIndex=t,this.timeZone=n,this.currentUser=r,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=j.parse(e);const{isStandardized:a,isAggregate:i,currentUserRequired:o,referencedFieldNames:s}=this._extractExpressionInfo(t);this._referencedFieldNames=s,this.isStandardized=a,this.isAggregate=i,this.currentUserRequired=o}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,A.$P)(e)?e.getTime():O(e)?e.toMillis():D(e)?e.toStorageFormat():Z(e)?e.toStorageString():C(e)?e.toStorageFormat():e;switch(t){case"date":return(0,A.$P)(e)?e.getTime():O(e)?e.toMillis():D(e)?e.toMilliseconds():C(e)?e.toNumber():e;case"date-only":return(0,A.$P)(e)?i.n.fromDateJS(e).toString():D(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,A.$P)(e)?d.k.fromDateJS(e).toStorageString():O(e)?d.k.fromDateTime(e).toStorageString():D(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():Z(e)?e.toStorageString():e;case"timestamp-offset":if((0,A.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(O(e))return f.g.fromDateTime(e).toStorageFormat();if(D(e))return e.toStorageFormat()}return e}static create(e,t={}){return new ee(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=fe,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=fe,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=fe,n=this.currentUser){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null):(0,r.A)("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null))}testFeature(e,t=fe,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=fe,n=this.currentUser){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null):(0,r.A)("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,G(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||W.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return G(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return G(this.parseTree,(t=>{if("function"===t.type){const n=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,a=`${n}-${t}`;e.has(a)||e.set(a,{aggregateType:n,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return G(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone","currentUser",e).bind(X)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,i=!1,o=!1;return G(this.parseTree,(s=>{switch(s.type){case"column-reference":{const r=e?.get(s.column);let a,i;r?a=i=r.name??"":(i=s.column,a=i.toLowerCase()),n.has(a)||(n.add(a),t.push(i)),s.column=i;break}case"current-user":o=!0;break;case"function":{const{name:e,args:t}=s,n=t.value.length;r&&(r=function(e,t){const n=Y[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===i&&(i=(0,a.M)(e,n));break}}})),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:i,currentUserRequired:o}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const n=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let r=0;r<e.clauses.length;r++)t+=" (this.compare('=',"+n+","+this.evaluateNodeToJavaScript(e.clauses[r].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let n=0;n<e.clauses.length;n++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[n].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[n].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const n of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(n);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"), timeZone)";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"), timeZone))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";default:throw new o.L8(o.Z7.UnsupportedOperator,{operator:e.operator})}case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"time":return"this.evaluateTime("+JSON.stringify(e.value)+")";case"date":return"this.evaluateDate("+JSON.stringify(e.value)+", 'unknown')";case"timestamp":return"this.evaluateTimestamp("+JSON.stringify(e.value)+", 'unknown')";case"current-time":return"date"===e.mode?"this.currentDate(timeZone)":"time"===e.mode?"this.currentTime(timeZone)":"this.currentTimestamp(timeZone)";case"current-user":return"currentUser";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",fieldsIndex,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+", timeZone)"}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}_evaluateNode(e,t,n,r,i){let s;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,i);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,i);for(let o=0;o<e.clauses.length;o++)if(R(a,this._evaluateNode(e.clauses[o].operand,t,n,r,i),"=",this.timeZone))return this._evaluateNode(e.clauses[o].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}else{for(let a=0;a<e.clauses.length;a++)if(te(this._evaluateNode(e.clauses[a].operand,t,n,r,i)))return this._evaluateNode(e.clauses[a].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],(0,A.$P)(s)?h.c9.fromJSDate(s):null!=s&&"object"==typeof s&&"toDateTime"in s?s.toDateTime():s;case"expression-list":{const a=[];for(const o of e.value)a.push(this._evaluateNode(o,t,n,r,i));return a}case"unary-expression":return re(this._evaluateNode(e.expr,t,n,r,i));case"binary-expression":switch(e.operator){case"AND":return ae(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"OR":return ie(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,n,r,i);case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,n,r,i);case"IN":{const a=ne(this._evaluateNode(e.right,t,n,r,i));return oe(this._evaluateNode(e.left,t,n,r,i),a,this.timeZone)}case"NOT IN":{const a=ne(this._evaluateNode(e.right,t,n,r,i));return re(oe(this._evaluateNode(e.left,t,n,r,i),a,this.timeZone))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],">=",this.timeZone)&&R(a,o[1],"<=",this.timeZone)}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],"<",this.timeZone)||R(a,o[1],">",this.timeZone)}case"LIKE":return le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return re(le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return R(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return q(e.operator,this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=x(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"time":return F(e.value);case"current-time":return"date"===e.mode?X.currentDate(this.timeZone):"time"===e.mode?X.currentTime(this.timeZone):X.currentTimestamp(this.timeZone);case"current-user":return i??null;case"column-reference":return ce(t,e.column,this.fieldsIndex,n);case"data-type":return e.value;case"function":{if(this.isAggregate&&(0,a.M)(e.name,e.args.value.length)){const t=[];for(const a of e.args?.value||[]){const e=[];for(const t of r||[])e.push(this._evaluateNode(a,t,n,null,i));t.push(e)}return(0,a.s)(e.name,t)}const o=this._evaluateNode(e.args,t,n,r,i);return J(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function te(e){return!0===e}function ne(e){return Array.isArray(e)?e:[e]}function re(e){return null!==e?!0!==e:null}function ae(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function ie(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function oe(e,t,n){if(null==e)return null;let r=!1;for(const n of t)if(null==n)r=null;else{if(e===n){r=!0;break}if(P(e)&&P(n)&&(r=R(e,n,"="),r))break}return r}const se="-[]/{}()*+?.\\^$|";var ue;function le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=ue.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case ue.Normal:i===n?a=ue.Escaped:se.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case ue.Escaped:se.includes(i)?r+="\\"+i:r+=i,a=ue.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function ce(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t),o=n?.get(t);return null==a||"esriFieldTypeDate"!==o?.type&&"date"!==o?.type?null==a||"esriFieldTypeDateOnly"!==o?.type&&"date-only"!==o?.type?null==a||"esriFieldTypeTimeOnly"!==o?.type&&"time-only"!==o?.type?null==a||"esriFieldTypeTimestampOffset"!==o?.type&&"timestamp-offset"!==o?.type?a:new f.g(a):d.k.fromReader(a):i.n.fromReader(a):L(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(ue||(ue={}));const fe={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}},95466:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(49186),a=n(25482),i=n(53966),o=n(91869),s=n(3330),u=n(30524),l=n(56400),c=n(96285);const f=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],v(e))}static fromLayerJSON(e){return new d(e.fields??[],v(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const e of this.fields){const t=e?.name,r=h(t);if(t&&r){const a=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(a,e),this._normalizedFieldsMap.set(r,e),n.push(`${a}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,u.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,u.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,u.te)(e)||(0,u.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,u.te)(e)||(0,u.Xz)(e)||e.nullable||void 0!==(0,u.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(i.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),l.n$):p.has(t.type)?l.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===l.L5?s.GB.instance:t===l.n$?c.mQ.utcInstance:(0,o.tE)(f,t,(()=>c.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,u.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>a.A.isSerializable(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,u.rS)(e)?.toLowerCase()??""}const p=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function v(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:a}=e,i=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",s=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,u=a?function(e){return"timeZone"in e}(a)?a.timeZone??s:a.dateFieldsTimeReference?(0,l.ZS)(a.dateFieldsTimeReference):s??l.n$:null,c=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,l.ZS)(r.timeReference):s:null,f=new Map([[m(a?.creationDateField??""),u],[m(a?.editDateField??""),u],[m(i),c],[m(o),c]]);for(const{name:r,type:a}of e.fields)if(p.has(a))t.set(r,l.L5);else if("date"!==a&&"esriFieldTypeDate"!==a)t.set(r,null);else if(n)t.set(r,l.L5);else{const e=f.get(m(r??""))??s;t.set(r,e)}return t}}}]);
|