@esri/solutions-components 5.1.0-next.94 → 5.1.0-next.95
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/dist/cdn/2ID55IJB.js +2 -0
- package/dist/cdn/2SGR44DX.js +2 -0
- package/dist/cdn/{C4UB6MNN.js → 3J47AYBV.js} +97 -97
- package/dist/cdn/{VOF34LDF.js → 4B7NJE47.js} +1 -1
- package/dist/cdn/{YVDSW2OQ.js → 5LTIZSXG.js} +1 -1
- package/dist/cdn/74MDW73I.js +2 -0
- package/dist/cdn/ADPYDJG6.js +2 -0
- package/dist/cdn/{FDE2V7FU.js → AJZHT4GA.js} +1 -1
- package/dist/cdn/{JQXKQHAG.js → DI7PQSFH.js} +1 -1
- package/dist/cdn/FVXS4LF5.js +2 -0
- package/dist/cdn/IRRMUFW7.js +2 -0
- package/dist/cdn/ITLTQWCX.js +2 -0
- package/dist/cdn/IYUTLV2O.js +2 -0
- package/dist/cdn/{3XGF3ZJO.js → KW6YOUWC.js} +1 -1
- package/dist/cdn/{LUZYJVG5.js → KYFNXHOH.js} +1 -1
- package/dist/cdn/{NXL2QN3P.js → R3MCMOLS.js} +1 -1
- package/dist/cdn/R4VHCXKS.js +2 -0
- package/dist/cdn/{5Z45KDQY.js → UHPN75WT.js} +1 -1
- package/dist/cdn/VESARS2D.js +7 -0
- package/dist/cdn/{D4GI6KPZ.js → WVRKV5SS.js} +1 -1
- package/dist/cdn/assets/solution-details-card/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-details-card/t9n/messages.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solutions-deployed-list/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/solutions-deployed-list/t9n/messages.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/converter.js +82 -86
- package/dist/chunks/get.js +387 -0
- package/dist/components/arcgis-solutions-assistant/customElement.js +5766 -5676
- package/dist/components/consent-manager/customElement.js +609 -638
- package/dist/components/solution-configure-titles/customElement.js +31 -28
- package/dist/components/solution-delete-dialog/customElement.js +57 -54
- package/dist/components/solution-deployed-card-panel/customElement.js +40 -37
- package/dist/components/solution-details-card/customElement.d.ts +4 -0
- package/dist/components/solution-details-card/customElement.js +45 -29
- package/dist/components/solution-details-card/index.js +1 -0
- package/dist/components/solution-item-accordion/customElement.d.ts +3 -2
- package/dist/components/solution-item-accordion/customElement.js +52 -35
- package/dist/components/solution-item-accordion/index.js +2 -0
- package/dist/components/solutions-all-panel/customElement.js +11 -11
- package/dist/components/solutions-deployed-list/customElement.d.ts +33 -0
- package/dist/components/solutions-deployed-list/customElement.js +38 -0
- package/dist/components/solutions-deployed-list/index.d.ts +1 -0
- package/dist/components/solutions-deployed-list/index.js +1 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/loader.js +3 -2
- package/dist/solutions-components_commit.txt +7 -7
- package/dist/types/lumina.d.ts +6 -0
- package/dist/types/preact.d.ts +7 -0
- package/dist/types/react.d.ts +8 -0
- package/dist/types/stencil.d.ts +6 -0
- package/dist/utils/getRelatedInfos.d.ts +4 -0
- package/dist/utils/interfaces.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cdn/2L3RREZ4.js +0 -2
- package/dist/cdn/2WHAF4H7.js +0 -2
- package/dist/cdn/AKKTG2RD.js +0 -2
- package/dist/cdn/DLH53PYM.js +0 -7
- package/dist/cdn/P24CZ4HM.js +0 -2
- package/dist/cdn/R2G4DDRZ.js +0 -2
- package/dist/cdn/SO3S3WP4.js +0 -2
- package/dist/cdn/UBLDT5XD.js +0 -2
- package/dist/cdn/ZONXYZVU.js +0 -2
- package/dist/chunks/get-portal-url.js +0 -345
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import f from"./
|
|
2
|
+
import f from"./WVRKV5SS.js";import e from"./JC5EXPFH.js";import d from"./DI7PQSFH.js";import"./QPNIPE5H.js";import"./ZYCAAXQF.js";import"./O3O4EPB6.js";import"./FVXS4LF5.js";import c from"./ZP6VPBP4.js";import b from"./XXT542UR.js";import a from"./X5EABWHE.js";import"./2B4SGB3I.js";import"./YKQDHR27.js";import"./J75MHJID.js";import"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import"./KIUBUHVM.js";import"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,,,a])=>{return a},a,b,c,d,e,f)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import x from"./5BU6XZAD.js";import t from"./ZGEMIOB5.js";import s from"./K6WLYYPH.js";import r from"./5OF3YOO7.js";import q from"./ELPH6EFW.js";import n from"./SO3S3WP4.js";import m from"./NPOHA56R.js";import l from"./D4GI6KPZ.js";import k from"./JC5EXPFH.js";import j from"./2VXTMCRJ.js";import i from"./JQXKQHAG.js";import"./QPNIPE5H.js";import"./ZYCAAXQF.js";import g from"./XAW6KPKL.js";import"./O3O4EPB6.js";import{a as L}from"./L33BENH7.js";import"./2WHAF4H7.js";import e from"./ZP6VPBP4.js";import c from"./XXT542UR.js";import b from"./X5EABWHE.js";import{a as S,b as D,c as A}from"./2B4SGB3I.js";import{a as u}from"./YKQDHR27.js";import"./J75MHJID.js";import{a as w}from"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as C}from"./KIUBUHVM.js";import{E as o,F as a,G as f,I as p,K as T,h as v,i as h,q as d}from"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,,,,{c:x,g:I,k:F,l:O,o:c},,{b:$},,,,{g:P,h:k},,,,,{a:m,b:B},{a:y}])=>{var M=v`.back-color-override{background-color:var(--calcite-color-surface-3);--calcite-tab-border-color: var(--calcite-color-surface-4)}:host{--panel-edge-adjustment: 2vw;--assistant-panel-min-width: 420px;--assistant-panel-width: max(var(--assistant-panel-min-width), calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment) - 15px))}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-2);flex:1;min-height:0}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-2);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}.main-content{container-type:inline-size;display:flex;flex-direction:column;height:100%;overflow:hidden}.main-content.assistant-open{margin-right:var(--assistant-panel-width)}.assistant-open solutions-searchsort-toolbar,.assistant-open solution-details-panel,.assistant-open solutions-deployed-shell,.assistant-open solutions-all-shell,.assistant-open calcite-tab-nav,.assistant-open solution-deployed-card-panel{margin-left:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));margin-right:0;width:auto;max-width:1440px}.builder-panel{position:fixed;top:65px;left:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));right:var(--assistant-panel-width);bottom:0;z-index:400;display:flex;flex-direction:column;transition:transform .3s cubic-bezier(.4,0,.2,1);transform:translate(0);pointer-events:auto}.builder-panel.display-none{display:flex!important;transform:translate(100%);pointer-events:none}.builder-panel.display-none:has(~.assistant-panel.display-none){display:none!important;transition:none}.assistant-panel{position:fixed;top:65px;right:0;bottom:0;width:var(--assistant-panel-width);min-width:var(--assistant-panel-min-width);z-index:400;display:flex;flex-direction:column}@media(max-width:800px){.builder-panel{display:none!important}.assistant-panel{width:100%;box-shadow:none}.main-content.assistant-open{margin-right:0}}.assistant-fab{position:fixed;bottom:var(--calcite-spacing-xxl);right:var(--calcite-spacing-xxl);z-index:500}calcite-tooltip{--calcite-tooltip-max-size-x: 16rem}`,R={solution:{title:"Bus Stop ADA Compliance Inspections",description:"Bus Stop ADA Compliance Inspections can be used to perform routine inspections of bus stops for ADA compliance and monitor inspection progress.",tags:["Bus Stop","ADA Compliance","Inspection","Field","Monitor","ArcGIS Solutions"],strings:[{key:"inspectionsByMonth",value:"Inspections by Month",description:"Descriptive title of dashboard chart displaying the number of inspections completed by month."},{key:"inspectionsCompleted",value:"Inspections Completed",description:"Descriptive title of dashboard indicator displaying the total number of inspections completed."},{key:"assetInventory",value:"Bus Stop Inventory",description:"Descriptive title of dashboard indicator displaying the total number of bus stops."}]},items:[{id:"b21885d38b3c4924922ce36c90112737",title:"Bus Stop ADA Inspection Dashboard",description:"An ArcGIS Dashboards app used to monitor bus stop ADA compliance inspections.",type:"Dashboard"},{id:"54f69b6af00b4f06b1c1eef05e80dc93",title:"Bus Stop ADA Inspection Map",description:"A map used by the Bus Stop ADA Inspection Dashboard app to monitor inspections.",type:"Web Map"},{id:"2fc93fa4e07e42508669d02acb837a75",title:"Bus Stop ADA Inspection Field Map",description:"A map used in ArcGIS Field Maps to inspect bus stops in the field for ADA compliance.",type:"Web Map"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f323",title:"BusStops_field",description:"A hosted feature layer view used to inspect bus stops for ADA compliance.",type:"Feature Layer (hosted, view)"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f324",title:"BusStops_dashboard",description:"A hosted feature layer view used to monitor bus stop ADA inspections.",type:"Feature Layer (hosted, view)"},{id:"36d0bdce3a74436f8314c88c9667003e",title:"BusStops",description:"A hosted feature layer used to store bus stop and ADA inspection details.",type:"Feature Layer (hosted)"}],featureLayer:{itemId:"36d0bdce3a74436f8314c88c9667003e",addLayers:!0,layers:[{id:"0",type:"Point",name:"BusStops",description:"Point layer containing bus stop locations and ADA compliance information.",customFields:[{name:"stop_id",type:"string",alias:"Stop ID",description:"Identifier for the bus stop.",choiceList:null,length:255},{name:"location_description",type:"string",alias:"Location Description",description:"Description of the bus stop location.",choiceList:null,length:255},{name:"shelter_present",type:"string",alias:"Shelter Present",description:"Indicates if a waiting shelter is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"bench_present",type:"string",alias:"Bench Present",description:"Indicates if a bench is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"ada_compliant",type:"string",alias:"ADA Compliant",description:"Indicates if the bus stop meets ADA compliance requirements.",choiceList:["Yes","No"],length:5},{name:"capacity",type:"integer",alias:"Seating Capacity",description:"Number of people that can be seated at the bus stop."},{name:"distance_from_curb",type:"double",alias:"Distance from Curb (ft)",description:"Distance in feet from the curb to the shelter."},{name:"last_inspection_date",type:"date",alias:"Last Inspection Date",description:"Date of the most recent inspection."},{name:"installation_date",type:"date",alias:"Installation Date",description:"Date when the bus stop was installed."}],requiredFields:[{name:"route_number",type:"string",alias:"Route Number",description:"Number of the bus route that uses this stop.",choiceList:null,length:50},{name:"average_daily_riders",type:"integer",alias:"Average Daily Riders",description:"Average number of riders using this stop per day."},{name:"inspection_priority",type:"string",alias:"Inspection Priority",description:"Priority level for scheduling inspections.",choiceList:["High","Medium","Low"],length:10}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"1",type:"Polyline",name:"Routes",description:"Polyline layer containing bus route paths.",customFields:[{name:"route_name",type:"string",alias:"Route Name",description:"Name of the bus route.",choiceList:null,length:100},{name:"route_type",type:"string",alias:"Route Type",description:"Type of bus route service.",choiceList:["Express","Local","Rapid"],length:20},{name:"frequency_minutes",type:"integer",alias:"Frequency (minutes)",description:"How often buses run on this route in minutes."},{name:"route_length_miles",type:"double",alias:"Route Length (miles)",description:"Total length of the route in miles."}],requiredFields:[{name:"route_id",type:"string",alias:"Route ID",description:"Unique identifier for the route.",choiceList:null,length:50},{name:"active",type:"string",alias:"Active Status",description:"Whether the route is currently active.",choiceList:["Yes","No"],length:3}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"2",type:"Polygon",name:"ServiceAreas",description:"Polygon layer defining bus service coverage areas.",customFields:[{name:"area_name",type:"string",alias:"Area Name",description:"Name of the service area.",choiceList:null,length:100},{name:"service_level",type:"string",alias:"Service Level",description:"Level of service provided in this area.",choiceList:["High Frequency","Standard","Limited"],length:20},{name:"population",type:"integer",alias:"Population",description:"Estimated population within the service area."},{name:"area_sq_miles",type:"double",alias:"Area (sq miles)",description:"Size of the service area in square miles."}],requiredFields:[{name:"district_id",type:"string",alias:"District ID",description:"Unique identifier for the service district.",choiceList:null,length:50}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"3",type:"Table",name:"Inspections",description:"Table containing inspection records and findings.",customFields:[{name:"inspection_id",type:"string",alias:"Inspection ID",description:"Unique identifier for the inspection.",choiceList:null,length:50},{name:"stop_id",type:"string",alias:"Bus Stop ID",description:"ID of the bus stop that was inspected.",choiceList:null,length:255},{name:"inspector_name",type:"string",alias:"Inspector Name",description:"Name of the person who performed the inspection.",choiceList:null,length:100},{name:"inspection_date",type:"date",alias:"Inspection Date",description:"Date when the inspection was performed."},{name:"overall_condition",type:"string",alias:"Overall Condition",description:"Overall condition assessment of the bus stop.",choiceList:["Excellent","Good","Fair","Poor","Critical"],length:20},{name:"issues_found",type:"integer",alias:"Issues Found",description:"Number of issues identified during inspection."},{name:"notes",type:"string",alias:"Inspection Notes",description:"Additional notes or comments about the inspection.",choiceList:null,length:1e3}],requiredFields:[{name:"inspection_status",type:"string",alias:"Inspection Status",description:"Current status of the inspection.",choiceList:["Scheduled","In Progress","Completed","Cancelled"],length:20}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]}]}},g=class extends f{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.loadExampleBuilderData=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._isAssistantOpen=!1,this._builderVisible=!1,this._hasActiveBuilderDesign=!1,this._showFabTooltip=!0,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._globalAlerts=[],this._translations=w({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${O}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=u({context:D}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._solutionBuilderPanel=o(),this._builderDesignContextProvider=u({context:A}),this._isMobileContextProvider=u({context:S}),this._mainContentRef=o(),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new y,this.deployAppTabSelected=d(),this.deployedCardFetchFailed=d(),this.detailsCardSelected=d(),this.deployedCardSelected=d(),this.metaTagStringsReady=d(),this.sessionRefreshed=d(),this.tabChanged=d(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this.listenOn(window,"showGlobalAlert",this._handleShowGlobalAlert),this.listenOn(window,"openAssistant",()=>{this._openAssistant()}),this.listenOn(window,"closeAssistant",()=>{this._isAssistantOpen=!1,this._builderVisible=!1}),this.listenOn(window,"toggleSolutionBuilder",()=>{this._builderVisible=!this._builderVisible}),this.listenOn(window,"arcgis-solution-design-update",this._solutionBuilderSelected),this._builderDesignContextProvider.value={design:this.loadExampleBuilderData?R:null,updateDesign:t=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:t}},isBuilderVisible:!1,setBuilderVisible:t=>{this._builderVisible=t,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:t}}},this.loadExampleBuilderData&&(this._hasActiveBuilderDesign=!0)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,loadExampleBuilderData:5,authentication:16,_isLoaded:16,isMobile:16,_isAssistantOpen:16,_builderVisible:16,_hasActiveBuilderDesign:16,_showFabTooltip:16,_activeTab:16,_showDeployedCardFetchFailed:16,_globalAlerts:16,_translations:16}}static{this.styles=M}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}_openAssistant(){this._telemetry?.logEvent({category:c.ASSISTANT,action:"Open"}),this._isAssistantOpen=!0}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let s;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(s=l,this.deployedCardSelected.emit({card:s}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let s=P(this._allCards,t.tabTitleOrId);s=s||k(this._allCards,t.tabTitleOrId),s?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(s)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._builderVisible=!1,this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}updated(t){this._fixTabpanelFocus(),t.has("_isAssistantOpen")&&this._setScrollbarGutters(this._isAssistantOpen?"stable":"stable both-edges"),!this._resizeObserver&&this._mainContentRef.value&&(this._resizeObserver=new ResizeObserver(e=>{for(let i of e){let s=i.contentRect.width<=800;this.isMobile!==s&&(this.isMobile=s,this._isMobileContextProvider.setValue(s))}}),this._resizeObserver.observe(this._mainContentRef.value))}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let s=i.shadowRoot.querySelector('[role="tabpanel"]');s&&(s.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=$)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return h`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .assistantOpen=${this._isAssistantOpen} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${a(this._deployAppNav)}></solutions-deploy-app-nav><div class=${`main-content${this._isAssistantOpen?" assistant-open":""}`} ${a(this._mainContentRef)}>${this._isSearchToolbarShowing()&&h`<div class="border"></div>`||""}<solutions-searchsort-toolbar ${a(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${p(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader>${this._renderGlobalAlerts()}<calcite-tabs class=${p(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${a(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${a(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${a(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${a(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${a(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${a(this._allTab)}><solutions-all-shell class="height-100" ${a(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${a(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._resourcesTab)}><solutions-resources-shell .assistantOpen=${this._isAssistantOpen} class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${a(this._detailsTab)}><solution-details-panel class="height-100" ${a(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" ${a(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></div>${!this._configContextProvider.value?.isEnterprise&&h`<div class=${`builder-panel${this._builderVisible?"":" display-none"}`}><solution-builder-assistant class="height-100" ${a(this._solutionBuilderPanel)}></solution-builder-assistant></div><div class=${`assistant-panel${this._isAssistantOpen?"":" display-none"}`}><arcgis-solutions-assistant class="height-100" .builderVisible=${this._builderVisible} .hasActiveBuilderDesign=${this._hasActiveBuilderDesign}></arcgis-solutions-assistant></div><calcite-fab aria-label=${this._translations.assistantFabTooltip??T} class=${`assistant-fab${this._isAssistantOpen?" display-none":""}`} icon=effects id=assistant-fab-button @click=${()=>{this._openAssistant(),this._showFabTooltip=!1}} scale=l></calcite-fab><calcite-tooltip class=${p(this._isAssistantOpen?"display-none":"")} .open=${this._showFabTooltip&&!this._isAssistantOpen} placement=leading reference-element=assistant-fab-button><span>${this._translations.assistantFabTooltip}</span></calcite-tooltip>`||""}</calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._tabpanelObserver?.disconnect()}_renderGlobalAlerts(){return L(this._globalAlerts,t=>t.id,t=>h`<calcite-alert .autoClose=${t.autoClose} .autoCloseDuration=${t.autoCloseDuration} .icon=${t.icon} .kind=${t.kind} .label=${t.title||""} @calciteAlertClose=${()=>this._removeGlobalAlert(t.id)} open>${t.title&&h`<div slot=title>${t.title}</div>`||""}<div slot=message>${t.message}</div></calcite-alert>`)}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=y.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new m(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new m(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}this._builderVisible=!1,e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=c.ALL_SOLUTIONS;break;case"deployments":i=c.DEPLOYMENTS;break;case"resources":i=c.RESOURCES;break;case"details":i=c.SOLUTION_DETAILS;break;case"deployed-card":i=c.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let s=[];if((t==="details"||t==="deployed-card")&&e){let n=e;s.push(n.title||""),s.push(n.deployCommonId||""),s.push(n.deployVersion||"")}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:s.length>0?s:void 0})}}_emitMetaTagStrings(t,e){let i="",s="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,s=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,s=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,s=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),s=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:s,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_solutionBuilderSelected(t){t?.detail&&(this._builderVisible=!0,this._hasActiveBuilderDesign=!0,this._builderDesignContextProvider.value={design:t.detail,updateDesign:e=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:e}},isBuilderVisible:!0,setBuilderVisible:e=>{this._builderVisible=e,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:e}}})}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}_handleShowGlobalAlert(t){let e=t.detail,i=e.id||`alert-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;this._globalAlerts=[...this._globalAlerts,{...e,id:i}]}_removeGlobalAlert(t){this._globalAlerts=this._globalAlerts.filter(e=>e.id!==t)}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let s=x(e);try{let l=await B(e,i,this._cardsFetcher,this._cardFetcherDeployed,F,"created","desc",!1,[],[],this._abortControllerDeployed.signal,s?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let n=l.message;n.indexOf("CONT_0001")>-1||n.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):n.indexOf("GWM_0003")>-1||n.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,s=t.industry==="AEC"?I.AEC:t.industry,l=t.offerType,n=t.searchTerm,E="",r=t.sortField,b=t.owner,_=t.filter;r==="suggested"&&!this.authentication?.IsSignedIn&&(r=this.sortType),e=i||s?{type:i?"domain":s?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),s&&(e=e?{...e,industry:s}:{industry:s}),n&&(e=e?{...e,searchTerm:n}:{searchTerm:n}),e&&(e={...e,displayValue:E}),r&&(e=e?{...e,sortType:r}:{sortType:r}),l&&(r=l.toLowerCase(),e=e?{...e,sortType:r}:{sortType:r}),b&&(e=e?{...e,owner:b}:{owner:b}),_&&(e=e?{...e,filter:_}:{filter:_})}return e}_setScrollbarGutters(t="stable both-edges"){[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(e=>{let i=e.value?.shadowRoot?.firstElementChild;i?.style&&(i.style.scrollbarGutter=t)})}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),s=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},s)}}};C("solutions-deploy-app",g);return g},"identity/IdentityManager","identity/OAuthInfo","portal/Portal","intl",b,c,e,g,i,j,k,l,m,n,q,r,s,t,x)
|
|
2
|
+
import x from"./5BU6XZAD.js";import t from"./ZGEMIOB5.js";import s from"./K6WLYYPH.js";import r from"./5OF3YOO7.js";import q from"./ELPH6EFW.js";import n from"./2ID55IJB.js";import m from"./NPOHA56R.js";import l from"./WVRKV5SS.js";import k from"./JC5EXPFH.js";import j from"./2VXTMCRJ.js";import i from"./DI7PQSFH.js";import"./QPNIPE5H.js";import"./ZYCAAXQF.js";import g from"./XAW6KPKL.js";import"./O3O4EPB6.js";import{a as L}from"./L33BENH7.js";import"./FVXS4LF5.js";import e from"./ZP6VPBP4.js";import c from"./XXT542UR.js";import b from"./X5EABWHE.js";import{a as S,b as D,c as A}from"./2B4SGB3I.js";import{a as u}from"./YKQDHR27.js";import"./J75MHJID.js";import{a as w}from"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as C}from"./KIUBUHVM.js";import{E as o,F as a,G as f,I as p,K as T,h as v,i as h,q as d}from"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,,,,{c:x,g:I,k:F,l:O,o:c},,{b:$},,,,{g:P,h:k},,,,,{a:m,b:B},{a:y}])=>{var M=v`.back-color-override{background-color:var(--calcite-color-surface-3);--calcite-tab-border-color: var(--calcite-color-surface-4)}:host{--panel-edge-adjustment: 2vw;--assistant-panel-min-width: 420px;--assistant-panel-width: max(var(--assistant-panel-min-width), calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment) - 15px))}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-2);flex:1;min-height:0}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-2);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}.main-content{container-type:inline-size;display:flex;flex-direction:column;height:100%;overflow:hidden}.main-content.assistant-open{margin-right:var(--assistant-panel-width)}.assistant-open solutions-searchsort-toolbar,.assistant-open solution-details-panel,.assistant-open solutions-deployed-shell,.assistant-open solutions-all-shell,.assistant-open calcite-tab-nav,.assistant-open solution-deployed-card-panel{margin-left:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));margin-right:0;width:auto;max-width:1440px}.builder-panel{position:fixed;top:65px;left:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));right:var(--assistant-panel-width);bottom:0;z-index:400;display:flex;flex-direction:column;transition:transform .3s cubic-bezier(.4,0,.2,1);transform:translate(0);pointer-events:auto}.builder-panel.display-none{display:flex!important;transform:translate(100%);pointer-events:none}.builder-panel.display-none:has(~.assistant-panel.display-none){display:none!important;transition:none}.assistant-panel{position:fixed;top:65px;right:0;bottom:0;width:var(--assistant-panel-width);min-width:var(--assistant-panel-min-width);z-index:400;display:flex;flex-direction:column}@media(max-width:800px){.builder-panel{display:none!important}.assistant-panel{width:100%;box-shadow:none}.main-content.assistant-open{margin-right:0}}.assistant-fab{position:fixed;bottom:var(--calcite-spacing-xxl);right:var(--calcite-spacing-xxl);z-index:500}calcite-tooltip{--calcite-tooltip-max-size-x: 16rem}`,R={solution:{title:"Bus Stop ADA Compliance Inspections",description:"Bus Stop ADA Compliance Inspections can be used to perform routine inspections of bus stops for ADA compliance and monitor inspection progress.",tags:["Bus Stop","ADA Compliance","Inspection","Field","Monitor","ArcGIS Solutions"],strings:[{key:"inspectionsByMonth",value:"Inspections by Month",description:"Descriptive title of dashboard chart displaying the number of inspections completed by month."},{key:"inspectionsCompleted",value:"Inspections Completed",description:"Descriptive title of dashboard indicator displaying the total number of inspections completed."},{key:"assetInventory",value:"Bus Stop Inventory",description:"Descriptive title of dashboard indicator displaying the total number of bus stops."}]},items:[{id:"b21885d38b3c4924922ce36c90112737",title:"Bus Stop ADA Inspection Dashboard",description:"An ArcGIS Dashboards app used to monitor bus stop ADA compliance inspections.",type:"Dashboard"},{id:"54f69b6af00b4f06b1c1eef05e80dc93",title:"Bus Stop ADA Inspection Map",description:"A map used by the Bus Stop ADA Inspection Dashboard app to monitor inspections.",type:"Web Map"},{id:"2fc93fa4e07e42508669d02acb837a75",title:"Bus Stop ADA Inspection Field Map",description:"A map used in ArcGIS Field Maps to inspect bus stops in the field for ADA compliance.",type:"Web Map"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f323",title:"BusStops_field",description:"A hosted feature layer view used to inspect bus stops for ADA compliance.",type:"Feature Layer (hosted, view)"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f324",title:"BusStops_dashboard",description:"A hosted feature layer view used to monitor bus stop ADA inspections.",type:"Feature Layer (hosted, view)"},{id:"36d0bdce3a74436f8314c88c9667003e",title:"BusStops",description:"A hosted feature layer used to store bus stop and ADA inspection details.",type:"Feature Layer (hosted)"}],featureLayer:{itemId:"36d0bdce3a74436f8314c88c9667003e",addLayers:!0,layers:[{id:"0",type:"Point",name:"BusStops",description:"Point layer containing bus stop locations and ADA compliance information.",customFields:[{name:"stop_id",type:"string",alias:"Stop ID",description:"Identifier for the bus stop.",choiceList:null,length:255},{name:"location_description",type:"string",alias:"Location Description",description:"Description of the bus stop location.",choiceList:null,length:255},{name:"shelter_present",type:"string",alias:"Shelter Present",description:"Indicates if a waiting shelter is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"bench_present",type:"string",alias:"Bench Present",description:"Indicates if a bench is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"ada_compliant",type:"string",alias:"ADA Compliant",description:"Indicates if the bus stop meets ADA compliance requirements.",choiceList:["Yes","No"],length:5},{name:"capacity",type:"integer",alias:"Seating Capacity",description:"Number of people that can be seated at the bus stop."},{name:"distance_from_curb",type:"double",alias:"Distance from Curb (ft)",description:"Distance in feet from the curb to the shelter."},{name:"last_inspection_date",type:"date",alias:"Last Inspection Date",description:"Date of the most recent inspection."},{name:"installation_date",type:"date",alias:"Installation Date",description:"Date when the bus stop was installed."}],requiredFields:[{name:"route_number",type:"string",alias:"Route Number",description:"Number of the bus route that uses this stop.",choiceList:null,length:50},{name:"average_daily_riders",type:"integer",alias:"Average Daily Riders",description:"Average number of riders using this stop per day."},{name:"inspection_priority",type:"string",alias:"Inspection Priority",description:"Priority level for scheduling inspections.",choiceList:["High","Medium","Low"],length:10}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"1",type:"Polyline",name:"Routes",description:"Polyline layer containing bus route paths.",customFields:[{name:"route_name",type:"string",alias:"Route Name",description:"Name of the bus route.",choiceList:null,length:100},{name:"route_type",type:"string",alias:"Route Type",description:"Type of bus route service.",choiceList:["Express","Local","Rapid"],length:20},{name:"frequency_minutes",type:"integer",alias:"Frequency (minutes)",description:"How often buses run on this route in minutes."},{name:"route_length_miles",type:"double",alias:"Route Length (miles)",description:"Total length of the route in miles."}],requiredFields:[{name:"route_id",type:"string",alias:"Route ID",description:"Unique identifier for the route.",choiceList:null,length:50},{name:"active",type:"string",alias:"Active Status",description:"Whether the route is currently active.",choiceList:["Yes","No"],length:3}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"2",type:"Polygon",name:"ServiceAreas",description:"Polygon layer defining bus service coverage areas.",customFields:[{name:"area_name",type:"string",alias:"Area Name",description:"Name of the service area.",choiceList:null,length:100},{name:"service_level",type:"string",alias:"Service Level",description:"Level of service provided in this area.",choiceList:["High Frequency","Standard","Limited"],length:20},{name:"population",type:"integer",alias:"Population",description:"Estimated population within the service area."},{name:"area_sq_miles",type:"double",alias:"Area (sq miles)",description:"Size of the service area in square miles."}],requiredFields:[{name:"district_id",type:"string",alias:"District ID",description:"Unique identifier for the service district.",choiceList:null,length:50}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"3",type:"Table",name:"Inspections",description:"Table containing inspection records and findings.",customFields:[{name:"inspection_id",type:"string",alias:"Inspection ID",description:"Unique identifier for the inspection.",choiceList:null,length:50},{name:"stop_id",type:"string",alias:"Bus Stop ID",description:"ID of the bus stop that was inspected.",choiceList:null,length:255},{name:"inspector_name",type:"string",alias:"Inspector Name",description:"Name of the person who performed the inspection.",choiceList:null,length:100},{name:"inspection_date",type:"date",alias:"Inspection Date",description:"Date when the inspection was performed."},{name:"overall_condition",type:"string",alias:"Overall Condition",description:"Overall condition assessment of the bus stop.",choiceList:["Excellent","Good","Fair","Poor","Critical"],length:20},{name:"issues_found",type:"integer",alias:"Issues Found",description:"Number of issues identified during inspection."},{name:"notes",type:"string",alias:"Inspection Notes",description:"Additional notes or comments about the inspection.",choiceList:null,length:1e3}],requiredFields:[{name:"inspection_status",type:"string",alias:"Inspection Status",description:"Current status of the inspection.",choiceList:["Scheduled","In Progress","Completed","Cancelled"],length:20}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]}]}},g=class extends f{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.loadExampleBuilderData=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._isAssistantOpen=!1,this._builderVisible=!1,this._hasActiveBuilderDesign=!1,this._showFabTooltip=!0,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._globalAlerts=[],this._translations=w({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${O}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=u({context:D}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._solutionBuilderPanel=o(),this._builderDesignContextProvider=u({context:A}),this._isMobileContextProvider=u({context:S}),this._mainContentRef=o(),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new y,this.deployAppTabSelected=d(),this.deployedCardFetchFailed=d(),this.detailsCardSelected=d(),this.deployedCardSelected=d(),this.metaTagStringsReady=d(),this.sessionRefreshed=d(),this.tabChanged=d(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this.listenOn(window,"showGlobalAlert",this._handleShowGlobalAlert),this.listenOn(window,"openAssistant",()=>{this._openAssistant()}),this.listenOn(window,"closeAssistant",()=>{this._isAssistantOpen=!1,this._builderVisible=!1}),this.listenOn(window,"toggleSolutionBuilder",()=>{this._builderVisible=!this._builderVisible}),this.listenOn(window,"arcgis-solution-design-update",this._solutionBuilderSelected),this._builderDesignContextProvider.value={design:this.loadExampleBuilderData?R:null,updateDesign:t=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:t}},isBuilderVisible:!1,setBuilderVisible:t=>{this._builderVisible=t,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:t}}},this.loadExampleBuilderData&&(this._hasActiveBuilderDesign=!0)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,loadExampleBuilderData:5,authentication:16,_isLoaded:16,isMobile:16,_isAssistantOpen:16,_builderVisible:16,_hasActiveBuilderDesign:16,_showFabTooltip:16,_activeTab:16,_showDeployedCardFetchFailed:16,_globalAlerts:16,_translations:16}}static{this.styles=M}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}_openAssistant(){this._telemetry?.logEvent({category:c.ASSISTANT,action:"Open"}),this._isAssistantOpen=!0}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let s;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(s=l,this.deployedCardSelected.emit({card:s}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let s=P(this._allCards,t.tabTitleOrId);s=s||k(this._allCards,t.tabTitleOrId),s?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(s)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._builderVisible=!1,this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}updated(t){this._fixTabpanelFocus(),t.has("_isAssistantOpen")&&this._setScrollbarGutters(this._isAssistantOpen?"stable":"stable both-edges"),!this._resizeObserver&&this._mainContentRef.value&&(this._resizeObserver=new ResizeObserver(e=>{for(let i of e){let s=i.contentRect.width<=800;this.isMobile!==s&&(this.isMobile=s,this._isMobileContextProvider.setValue(s))}}),this._resizeObserver.observe(this._mainContentRef.value))}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let s=i.shadowRoot.querySelector('[role="tabpanel"]');s&&(s.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=$)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return h`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .assistantOpen=${this._isAssistantOpen} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${a(this._deployAppNav)}></solutions-deploy-app-nav><div class=${`main-content${this._isAssistantOpen?" assistant-open":""}`} ${a(this._mainContentRef)}>${this._isSearchToolbarShowing()&&h`<div class="border"></div>`||""}<solutions-searchsort-toolbar ${a(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${p(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader>${this._renderGlobalAlerts()}<calcite-tabs class=${p(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${a(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${a(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${a(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${a(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${a(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${a(this._allTab)}><solutions-all-shell class="height-100" ${a(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${a(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._resourcesTab)}><solutions-resources-shell .assistantOpen=${this._isAssistantOpen} class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${a(this._detailsTab)}><solution-details-panel class="height-100" ${a(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" ${a(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></div>${!this._configContextProvider.value?.isEnterprise&&h`<div class=${`builder-panel${this._builderVisible?"":" display-none"}`}><solution-builder-assistant class="height-100" ${a(this._solutionBuilderPanel)}></solution-builder-assistant></div><div class=${`assistant-panel${this._isAssistantOpen?"":" display-none"}`}><arcgis-solutions-assistant class="height-100" .builderVisible=${this._builderVisible} .hasActiveBuilderDesign=${this._hasActiveBuilderDesign}></arcgis-solutions-assistant></div><calcite-fab aria-label=${this._translations.assistantFabTooltip??T} class=${`assistant-fab${this._isAssistantOpen?" display-none":""}`} icon=effects id=assistant-fab-button @click=${()=>{this._openAssistant(),this._showFabTooltip=!1}} scale=l></calcite-fab><calcite-tooltip class=${p(this._isAssistantOpen?"display-none":"")} .open=${this._showFabTooltip&&!this._isAssistantOpen} placement=leading reference-element=assistant-fab-button><span>${this._translations.assistantFabTooltip}</span></calcite-tooltip>`||""}</calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._tabpanelObserver?.disconnect()}_renderGlobalAlerts(){return L(this._globalAlerts,t=>t.id,t=>h`<calcite-alert .autoClose=${t.autoClose} .autoCloseDuration=${t.autoCloseDuration} .icon=${t.icon} .kind=${t.kind} .label=${t.title||""} @calciteAlertClose=${()=>this._removeGlobalAlert(t.id)} open>${t.title&&h`<div slot=title>${t.title}</div>`||""}<div slot=message>${t.message}</div></calcite-alert>`)}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=y.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new m(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new m(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}this._builderVisible=!1,e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=c.ALL_SOLUTIONS;break;case"deployments":i=c.DEPLOYMENTS;break;case"resources":i=c.RESOURCES;break;case"details":i=c.SOLUTION_DETAILS;break;case"deployed-card":i=c.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let s=[];if((t==="details"||t==="deployed-card")&&e){let n=e;s.push(n.title||""),s.push(n.deployCommonId||""),s.push(n.deployVersion||"")}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:s.length>0?s:void 0})}}_emitMetaTagStrings(t,e){let i="",s="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,s=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,s=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,s=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),s=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:s,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_solutionBuilderSelected(t){t?.detail&&(this._builderVisible=!0,this._hasActiveBuilderDesign=!0,this._builderDesignContextProvider.value={design:t.detail,updateDesign:e=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:e}},isBuilderVisible:!0,setBuilderVisible:e=>{this._builderVisible=e,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:e}}})}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}_handleShowGlobalAlert(t){let e=t.detail,i=e.id||`alert-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;this._globalAlerts=[...this._globalAlerts,{...e,id:i}]}_removeGlobalAlert(t){this._globalAlerts=this._globalAlerts.filter(e=>e.id!==t)}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let s=x(e);try{let l=await B(e,i,this._cardsFetcher,this._cardFetcherDeployed,F,"created","desc",!1,[],[],this._abortControllerDeployed.signal,s?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let n=l.message;n.indexOf("CONT_0001")>-1||n.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):n.indexOf("GWM_0003")>-1||n.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,s=t.industry==="AEC"?I.AEC:t.industry,l=t.offerType,n=t.searchTerm,E="",r=t.sortField,b=t.owner,_=t.filter;r==="suggested"&&!this.authentication?.IsSignedIn&&(r=this.sortType),e=i||s?{type:i?"domain":s?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),s&&(e=e?{...e,industry:s}:{industry:s}),n&&(e=e?{...e,searchTerm:n}:{searchTerm:n}),e&&(e={...e,displayValue:E}),r&&(e=e?{...e,sortType:r}:{sortType:r}),l&&(r=l.toLowerCase(),e=e?{...e,sortType:r}:{sortType:r}),b&&(e=e?{...e,owner:b}:{owner:b}),_&&(e=e?{...e,filter:_}:{filter:_})}return e}_setScrollbarGutters(t="stable both-edges"){[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(e=>{let i=e.value?.shadowRoot?.firstElementChild;i?.style&&(i.style.scrollbarGutter=t)})}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),s=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},s)}}};C("solutions-deploy-app",g);return g},"identity/IdentityManager","identity/OAuthInfo","portal/Portal","intl",b,c,e,g,i,j,k,l,m,n,q,r,s,t,x)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import i from"./XAW6KPKL.js";import"./R4VHCXKS.js";import h from"./ZP6VPBP4.js";import e from"./XXT542UR.js";import b from"./X5EABWHE.js";import{b as I}from"./2B4SGB3I.js";import{b as D}from"./YKQDHR27.js";import{_b as y}from"./J75MHJID.js";import{a as f}from"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as _}from"./KIUBUHVM.js";import{E as u,F as d,G as g,I as r,h as m,i as a,l as p,q as c}from"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([,{a:b},{c:w,o:$},{a:C,b:v}])=>{var P=m`*[tabindex]:focus-visible{outline-style:solid!important;outline-width:2px!important;outline-color:var(--calcite-color-brand)!important;outline-offset:2px!important}.deletion-note-text{display:inline-block}.deletion-note-container{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size-0);margin-bottom:var(--calcite-spacing-md)}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-surface-2);--calcite-panel-background-color: var(--calcite-color-surface-2)}.display-none{display:none}calcite-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.loader-text{margin-top:var(--calcite-spacing-md);margin-bottom:var(--calcite-spacing-xl);text-align:center;font-size:var(--calcite-font-size-relative-base);color:var(--calcite-color-text-1)}.padding-around{padding:12px 2rem 2rem}`,h=class extends g{constructor(){super(),this.open=!1,this.source="Card Dropdown",this._deletePercentage=0,this._fetchingTemplates=!1,this._isDeleteInProgress=!1,this._nonSolutionDependencyItems=[],this._showDeleteError=!1,this._showUndeletableItems=!1,this._templateInfos=[],this._translations=f({name:"solution-delete-dialog",blocking:!0}),this._accordion=u(),this._configContextConsumer=D({context:I,subscribe:!0}),this.solutionDeleteDialogOpen=c(),this.solutionDeleted=c(),this.solutionDeleteDialogBeforeClose=c(),this.listenOn(window,"beforeunload",t=>{this._isDeleteInProgress&&(t.preventDefault(),t.returnValue=!0)})}static{this.properties={card:0,open:5,source:1,_deletePercentage:16,_fetchingTemplates:16,_isDeleteInProgress:16,_nonSolutionDependencyItems:16,_showDeleteError:16,_showUndeletableItems:16,_templateInfos:16,_translations:16}}static{this.styles=P}get _hasAdminDeletePermission(){return this._configContextConsumer.value?.authentication?w(this._configContextConsumer.value?.authentication):!1}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}close(){this._showUndeletableItems&&this.solutionDeleted.emit({showAlert:!1,refreshSolutionsTimeout:!0,solutionTitle:this.card?.title}),this._showDeleteError=!1,this._showUndeletableItems=!1,this._isDeleteInProgress=!1,this.open=!1,this.solutionDeleteDialogOpen.emit(!1)}delete(){if(this._telemetry?.logEvent({category:$.DEPLOYMENTS,action:"Delete Solution",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",this.source]}),this._isDeleteInProgress=!0,this.card){let t=[{itemName:this.card.title,itemType:"Solution",owner:this.card.owner,modified:this.card.modified}],s={progressCallback:n=>{this._deletePercentage=Math.round(n)},solutionOwner:this.card.owner};y(this.card.id,this._configContextConsumer.value.userSession,s).then(n=>{let o=n[1],l;if(o?l=o.items.map(e=>({itemName:e.title,itemType:e.type,owner:e.owner,modified:e.modified})):l=t,l.length===0)this.solutionDeleted.emit({showAlert:!0,refreshSolutionsTimeout:!0,solutionTitle:this.card?.title}),this._isDeleteInProgress=!1,this.open=!1;else if(l.some(e=>e.itemType==="Solution"))this.card?v(this.card,this._configContextConsumer.value.userSession).then(e=>{this._templateInfos=e,this._showDeleteError=!0,this._showUndeletableItems=!0,this._isDeleteInProgress=!1}):(this._showDeleteError=!0,this._isDeleteInProgress=!1);else if(this.card){let e=[];e=o.items.map(i=>({id:i.id,title:i.title,type:i.type,owner:i.owner,modified:i.modified,typeKeywords:[],snippet:"",dependencies:[],url:b(i.id,this._configContextConsumer.value.authentication)})),this._templateInfos=e,this._showDeleteError=!1,this._showUndeletableItems=!0,this._isDeleteInProgress=!1}else this.solutionDeleted.emit({showAlert:!0,refreshSolutionsTimeout:!0}),this._isDeleteInProgress=!1,this.open=!1})}}willUpdate(t){if(t.has("open")){let s=t.get("open");this.open&&!s&&(this._fetchingTemplates=!0,C(this._configContextConsumer.value.userSession,this.card).then(n=>{this._templateInfos=n.templateInfos,this._nonSolutionDependencyItems=n._nonSolutionDependencyItems,this._fetchingTemplates=!1}))}}render(){let t=this._fetchingTemplates?"":"display-none",s=this._fetchingTemplates?"display-none":"",n=new Set(this._nonSolutionDependencyItems.filter(i=>i.dependencyItemId!==this.card.id).map(i=>`${i.controlItemId}|${i.dependencyItemId}`)),o=Array.from(n).map(i=>{let[x,S]=i.split("|");return{controlItemId:x,dependencyItemId:S}}),l=this._templateInfos.length-this._getDependencyCount()-this._getNonOwnerCount(),e=this._translations.deletionCount.replace("{{deleteableCount}}",l.toString()).replace("{{totalCount}}",this._templateInfos.length.toString());return a`<calcite-dialog class="panel-bg-color" .closeDisabled=${this._isDeleteInProgress} .escapeDisabled=${this._isDeleteInProgress} .heading=${this._translations.title.replace("{{solution}}",this.card?.title??"")} id=${this._translations.title.replace("{{solution}}",this.card?.title??"")??p} modal kind=danger .open=${this.open} width=l outside-close-disabled @calciteDialogBeforeClose=${()=>{this.solutionDeleteDialogBeforeClose.emit()}} @calciteDialogClose=${()=>{this.open=!1,this.solutionDeleteDialogOpen.emit(!1)}}>${this._isDeleteInProgress?a`<calcite-loader .label=${this._translations.deleteInProgress} scale=l type=determinate-value .value=${this._deletePercentage}></calcite-loader><div class="loader-text" tabindex=0>${this._translations.deleteInProgress}</div>`:this._showUndeletableItems?a`<calcite-label class=${r(s)} layout=inline><span tabindex=0>${this._translations.failedToDeleteItems}</span></calcite-label><solution-item-accordion class=${r(s)} .itemRelationshipDependencies=${[]} link-type=item list-selection-mode=multiple .reuseWarning=${this._translations.itemDependencyReusewarning} .templateInfos=${this._templateInfos} .typeKeywords=${this.card?.typeKeywords} usage-context=delete ${d(this._accordion)}></solution-item-accordion><calcite-button appearance=outline @click=${this.close} slot=footer-end>${this._translations.buttonClose}</calcite-button>`:a`<div class="padding-around"><div class=${`deletion-note-container ${s}`}><span class="deletion-note-text" tabindex=0>${this._translations.deletionNote}</span><calcite-chip .label=${e} scale=m icon=information>${e}</calcite-chip></div><calcite-loader class=${r(t)} label></calcite-loader><solution-item-accordion class=${r(s)} .itemRelationshipDependencies=${o} link-type=item list-selection-mode=multiple .reuseWarning=${this._translations.itemDependencyReusewarning} .templateInfos=${this._templateInfos} .typeKeywords=${this.card?.typeKeywords} usage-context=delete ${d(this._accordion)}></solution-item-accordion></div><calcite-button appearance=outline @click=${this.close} slot=footer-end>${this._translations.buttonCancel}</calcite-button><calcite-button @click=${()=>{this.delete()}} slot=footer-end kind=danger>${this._translations.buttonDelete}</calcite-button>${this._showDeleteError&&a`<calcite-alert icon=exclamation-mark-triangle kind=danger .label=${this._translations.failedToDelete} @calciteAlertClose=${()=>{this._showDeleteError=!1}} open><div slot=message>${this._translations.failedToDelete}</div></calcite-alert>`||""}`}</calcite-dialog>`}_getDependencyCount(){let t=this._nonSolutionDependencyItems.map(s=>s.controlItemId);return new Set(t).size}_getNonOwnerCount(){if(this._templateInfos.length===0||this._hasAdminDeletePermission)return 0;let t=this._nonSolutionDependencyItems.map(o=>o.controlItemId),s=new Set(t),n=this._configContextConsumer.value.userSession.username;return this._templateInfos.filter(o=>!s.has(o.id)).filter(o=>o.owner!==n).length}};_("solution-delete-dialog",h);return h},b,e,h,i)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a}from"./R4VHCXKS.js";import"./2B4SGB3I.js";import"./YKQDHR27.js";import"./J75MHJID.js";import"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import"./KIUBUHVM.js";import"./H5E6ISYP.js";import"./QPIMTXPL.js";export{a as SolutionItemAccordion};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import h from"./ZGEMIOB5.js";import g from"./NPOHA56R.js";import e from"./ZP6VPBP4.js";import d from"./XXT542UR.js";import b from"./X5EABWHE.js";import{b as w}from"./2B4SGB3I.js";import{b as f}from"./YKQDHR27.js";import"./J75MHJID.js";import{a as v}from"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as S}from"./KIUBUHVM.js";import{G as C,h as m,i as a,j as y,q as c}from"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([{n:x,q:T},,{g:b,h:A,k:D,l:h,o:u},{c:E},{a:_,b:I}])=>{var O=m`calcite-panel{width:100%;height:100%;--calcite-panel-background-color: var(--calcite-color-surface-3)}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-md) var(--calcite-spacing-md)}solution-details-card{width:calc(25% - .6rem)}@container (max-width: 1234px){solution-details-card{width:calc(33.333% - .6rem)}}@container (max-width: 1010px){solution-details-card{width:calc(50% - .6rem)}}@container (max-width: 800px){.card-group{padding-left:0;padding-right:0}solution-details-card{width:calc(33.33% - .6rem)}}@container (max-width: 680px){solution-details-card{width:calc(50% - .6rem)}}@container (max-width: 440px){solution-details-card{width:calc(100% - .75rem)}}.text-center{text-align:center}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.no-solutions{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(100vh - 190px)}.margin-top-half{margin-top:.5rem}.margin-top-1{margin-top:1rem}.no-solutions-prompt{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}`,L=5,g=class extends C{constructor(){super(),this.sortType="relevance",this._cards=[],this._isLoading=!0,this._modifiedCheckTry=0,this._translations=v({name:"solutions-all-panel",blocking:!0}),this._agoTerms=`${h}`,this._allCards=[],this._baseAgoTerms=h,this._categories=[],this._configContextConsumer=f({context:w,subscribe:!0,callback:async t=>{t&&(this._isDisconnectedEnvironment?this._isLoading=!1:await this._loadUpdateProcedures())}}),this._delay=!1,this._getSuggested=!1,this._relatedSolutions=new Set,this._sortField="relevance",this._sortOrder="desc",this.cardsFetched=c(),this.allCardsFetched=c(),this.searchTermSet=c(),this.sortTypeSet=c(),this.detailsCardSelected=c(),this._handleOpenAssistant=()=>{this._telemetry?.logEvent({category:u.ASSISTANT,action:"Open"}),window.dispatchEvent(new CustomEvent("openAssistant"))},this.listenOn(window,"deployProgressEnd",()=>{this._modifiedCheckTry=L,this._loadUpdateProcedures()}),this.listenOn(window,"solutionDeleted",()=>{this._modifiedCheckTry=L,this._loadUpdateProcedures()}),this.listenOn(window,"sortTypeChanged",t=>{t.detail&&t.detail.scope==="all-solutions"&&(this.sortType=t.detail.sortType,this._telemetry?.logEvent({category:u.ALL_SOLUTIONS,action:"Sort",dimensions:[x(t.detail.sortType)]}),this.sortType==="suggested"&&this._deployedSolutions?.cards.length===0?this._getDeployedSolutions().then(()=>{this.searchSolutions(t.detail)}):this.searchSolutions(t.detail))}),this.listenOn(window,"solutionIDFromAssistant",t=>{this._lookupSolutionById(t.detail)})}static{this.properties={sortType:1,_cards:16,_isLoading:16,_modifiedCheckTry:16,_translations:16}}static{this.styles=O}get _isEnterprise(){return this._configContextConsumer.value?.isEnterprise}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextConsumer.value?.isEnterprise===!0&&this._configContextConsumer.value?.authentication?.CanSearchArcGISOnline===!1}async searchSolutions(t){this._isDisconnectedEnvironment||(t?"searchTerm"in t?this._textSearch(t.searchTerm):"sortType"in t?this._sortCards(t):Array.isArray(t)&&this._filterCards(t):(this._agoTerms=this._baseAgoTerms,this._clearFilterCategories()),this._cards=await this._getSolutions())}async setSearchOptions(t){t&&("searchTerm"in t&&(this._textSearch(t.searchTerm),this.searchTermSet.emit({searchTerm:t.searchTerm,scope:"all-solutions"})),"sortType"in t&&(this._sortCards(t),this.sortTypeSet.emit({sortType:t.sortType,scope:"all-solutions"})))}render(){let t=this._configContextConsumer.value?.authentication?.IsSignedIn&&this._configContextConsumer.value?.authentication?.CanUseAI;return this._isDisconnectedEnvironment?a`<div class="no-solutions">${this._getMeridianSearch()}<div class="no-solutions-prompt"><div class="text-center leader-1 warning-text trailer-1"><div>${this._translations.disconnectedEnvironment}</div></div></div></div>`:this._isLoading||this._cards.length?a`<calcite-panel>${this._isLoading?a`<calcite-loader id=solutions-all-panel-loader .label=${this._translations.fetchingSolutions}></calcite-loader>`:a`<calcite-card-group class="card-group" .label=${this._translations.allSolutionCards}>${this._renderCards()}</calcite-card-group>`}</calcite-panel>`:a`<div class="no-solutions">${this._getMeridianSearch()}<div class="no-solutions-prompt"><div class="text-center leader-1 warning-text trailer-1"><div>${this._translations.noSolutionsFound}</div><div class="margin-top-half">${!this._isEnterprise&&t?this._translations.assistantHelp:this._translations.changeSearchTerm}</div></div>${!this._isEnterprise&&t&&a`<calcite-button appearance=outline icon-start=speech-bubbles @click=${this._handleOpenAssistant} @keydown=${e=>T(e,()=>this._handleOpenAssistant())} scale=l>${this._translations.askAssistant}</calcite-button>`||""}</div></div>`}_renderCards(){return this._cards.map(t=>a`<solution-details-card .card=${t}></solution-details-card>`)}async _getSolutions(){if(this._isDisconnectedEnvironment)return this._isLoading=!1,[];if(this._configContextConsumer.value){this._isLoading=!0,this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let t=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},this._configContextConsumer.value?.primarySolutionsGroupId,this._configContextConsumer.value?.agoBasedEnterpriseSolutionsGroupId,this._configContextConsumer.value?.userSession,this._configContextConsumer.value?.isEnterprise,this._abortController.signal,{num:1e3});this._abortController=void 0;let e=t?.cards.length?t.cards:[];if(this.sortType==="new"||this.sortType==="updated"){let s="/Categories/New Release";this.sortType==="updated"&&(s="/Categories/Updated"),e.sort((l,d)=>l.categories.includes(s)&&!d.categories.includes(s)?-1:!l.categories.includes(s)&&d.categories.includes(s)?1:l.categories.includes(s)&&d.categories.includes(s)?l.categories.length-d.categories.length:0)}else if(this.sortType==="suggested"&&this._relatedSolutions.size>0&&this._deployedSolutions?.cards?.length){let s=new Map;for(let i of e){let r=s.get(i.deployCommonId),n=Number(i.deployVersion);(!r||n>r)&&s.set(i.deployCommonId,n)}let l=this._deployedSolutions.cards.filter(i=>{let r=s.get(i.deployCommonId);return r!==void 0&&Number(i.deployVersion)>=r}),d=new Set(l.map(i=>i.deployCommonId));this._relatedSolutions=new Set([...this._relatedSolutions].filter(i=>!d.has(i))),e.sort((i,r)=>{let n=this._relatedSolutions.has(i.deployCommonId),p=this._relatedSolutions.has(r.deployCommonId);return n&&!p?-1:!n&&p?1:0})}let o=e.map(s=>{let l=s.categories.indexOf("/Categories/New Release")>-1,d=s.categories.indexOf("/Categories/Updated")>-1,i=!1,r=!0;this._deployedSolutions&&(i=this._isSolutionDeployed(s.deployCommonId),r=this._isLatestVersion(s));let n=[];return l?n.push("new"):d&&n.push("updated"),i&&r&&n.push("deployed"),s.chips=n.length>0?n:void 0,s.supportReuse=i?!!(i&&!r):!0,s});return this._allCards.length===0&&t?.cards&&(this._allCards=t?.cards,this._deployedSolutions&&(this._relatedSolutions=E(this._deployedSolutions.cards,this._allCards))),this.cardsFetched.emit(o.length),this._isLoading=!1,o}else return this._isLoading=!1,[]}async _loadUpdateProcedures(){if(this._isDisconnectedEnvironment){this._isLoading=!1;return}this._isLoading=!0;let t=this._configContextConsumer.value;this._cardsFetcher=new _(t.locale,t.orgUrl,t.portalURL),this._cardsFetcherDeployed=new _(t.locale,t.orgUrl,t.portalURL),await this._getDeployedSolutions(),this._cards=await this._getSolutions(),this.allCardsFetched.emit(this._cards),this._isLoading=!1}async _getDeployedSolutions(){let t=this._configContextConsumer.value.authentication,e=this._configContextConsumer.value.userSession;if(t&&e&&t.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let o=await I(t,e,this._cardsFetcher,this._cardsFetcherDeployed,D,"created",this._sortOrder,void 0,this._categories,void 0,this._abortControllerDeployed.signal);if(this._abortControllerDeployed=void 0,o){if(this._modifiedCheckTry>0){if(this._deployedSolutions?.cards.length===o?.cards.length)return this._modifiedCheckTry--,await this._getDeployedSolutions();this._modifiedCheckTry=0}this._deployedSolutions=o}}}_getMeridianSearch(){return a`<div><svg viewBox="0 0 64 64" width=140 height=140 xmlns=http://www.w3.org/2000/svg fill=var(--calcite-color-text-3)>${y`<path d="M60.217 54.937l-15.77-15.77-1.414 1.415-3.801-3.8a19.94 19.94 0 1 0-2.451 2.45l3.802 3.802-1.413 1.415 15.767 15.767a1.739 1.739 0 0 0 2.459 0l2.82-2.821a1.742 1.742 0 0 0 0-2.458zM4.9 24A19.1 19.1 0 1 1 24 43.1 19.121 19.121 0 0 1 4.9 24zm32.474 14.693q.69-.63 1.32-1.32l3.774 3.775-1.32 1.32zM59.65 56.83l-2.82 2.82a.97.97 0 0 1-1.327 0L40.3 44.45l4.145-4.15L59.65 55.501a.939.939 0 0 1 0 1.328zM22.343 9.62l.097.795q-.31.038-.619.086a13.635 13.635 0 0 0-11.353 11.775l-.026.217-.795-.084.026-.228a14.44 14.44 0 0 1 12.022-12.47c.215-.034.431-.064.648-.09z" />`}</svg></div>`}_textSearch(t){this._agoTerms=this._baseAgoTerms+` ${t}`}_sortCards(t){let e=t.sortType;this._getSuggested=!1,this._sortOrder="desc",e==="suggested"?this._getSuggested=!0:e==="new"?this._sortField="relevance":e==="relevance"||e==="title"?(e==="title"&&(this._sortOrder="asc"),this._sortField=e):e==="updated"&&(this._sortField="relevance"),this.sortType=e}_filterCards(t){this._categories=[],t.forEach(e=>{if(e.industry){let o=this._getIndustryValue(e.industry);if(e.domain){let s=this._getDomainValue(e.domain);this._categories.push(`/Categories/${o}/${s}`)}else this._categories.push(`/Categories/${o}`)}})}_getDomainValue(t){return A[t]}_getIndustryValue(t){return t==="AEC"?"AEC":b[t]}_clearFilterCategories(){this._categories=[]}_isSolutionDeployed(t){return!!this._deployedSolutions?.cards?.some(e=>e?.typeKeywords?.some(o=>o.includes("solutionid")&&o.includes(t)))}_isLatestVersion(t){let e=this._deployedSolutions?.cards?.filter(o=>o?.typeKeywords?.some(s=>s.includes("solutionid")&&s.includes(t.deployCommonId)));return!(e&&e.length>0&&e[0].deployVersion!==t.deployVersion)}_lookupSolutionById(t){let e=this._allCards.filter(o=>o.deployCommonId===t);e.length>0&&this.detailsCardSelected.emit(e[0])}};S("solutions-all-panel",g);return g},b,d,e,g,h)
|
|
2
|
+
import h from"./ZGEMIOB5.js";import g from"./NPOHA56R.js";import e from"./ZP6VPBP4.js";import d from"./XXT542UR.js";import b from"./X5EABWHE.js";import{b as w}from"./2B4SGB3I.js";import{b as f}from"./YKQDHR27.js";import"./J75MHJID.js";import{a as v}from"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as S}from"./KIUBUHVM.js";import{G as C,h as m,i as a,j as y,q as c}from"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([{n:x,q:T},,{g:b,h:A,k:D,l:h,o:u},{c:E},{a:_,b:I}])=>{var O=m`calcite-panel{width:100%;height:100%;--calcite-panel-background-color: var(--calcite-color-surface-3)}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-md) var(--calcite-spacing-md)}solution-details-card{width:calc(25% - .6rem)}@container (max-width: 1234px){solution-details-card{width:calc(33.333% - .6rem)}}@container (max-width: 1010px){solution-details-card{width:calc(50% - .6rem)}}@container (max-width: 800px){.card-group{padding-left:0;padding-right:0}solution-details-card{width:calc(33.33% - .6rem)}}@container (max-width: 680px){solution-details-card{width:calc(50% - .6rem)}}@container (max-width: 440px){solution-details-card{width:calc(100% - .75rem)}}.text-center{text-align:center}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.no-solutions{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(100vh - 190px)}.margin-top-half{margin-top:.5rem}.margin-top-1{margin-top:1rem}.no-solutions-prompt{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}`,L=5,g=class extends C{constructor(){super(),this.sortType="relevance",this._cards=[],this._isLoading=!0,this._modifiedCheckTry=0,this._translations=v({name:"solutions-all-panel",blocking:!0}),this._agoTerms=`${h}`,this._allCards=[],this._baseAgoTerms=h,this._categories=[],this._configContextConsumer=f({context:w,subscribe:!0,callback:async t=>{t&&(this._isDisconnectedEnvironment?this._isLoading=!1:await this._loadUpdateProcedures())}}),this._delay=!1,this._getSuggested=!1,this._relatedSolutions=new Set,this._sortField="relevance",this._sortOrder="desc",this.cardsFetched=c(),this.allCardsFetched=c(),this.searchTermSet=c(),this.sortTypeSet=c(),this.detailsCardSelected=c(),this._handleOpenAssistant=()=>{this._telemetry?.logEvent({category:u.ASSISTANT,action:"Open"}),window.dispatchEvent(new CustomEvent("openAssistant"))},this.listenOn(window,"deployProgressEnd",()=>{this._modifiedCheckTry=L,this._loadUpdateProcedures()}),this.listenOn(window,"solutionDeleted",()=>{this._modifiedCheckTry=L,this._loadUpdateProcedures()}),this.listenOn(window,"sortTypeChanged",t=>{t.detail&&t.detail.scope==="all-solutions"&&(this.sortType=t.detail.sortType,this._telemetry?.logEvent({category:u.ALL_SOLUTIONS,action:"Sort",dimensions:[x(t.detail.sortType)]}),this.sortType==="suggested"&&this._deployedSolutions?.cards.length===0?this._getDeployedSolutions().then(()=>{this.searchSolutions(t.detail)}):this.searchSolutions(t.detail))}),this.listenOn(window,"solutionIDFromAssistant",t=>{this._lookupSolutionById(t.detail)})}static{this.properties={sortType:1,_cards:16,_isLoading:16,_modifiedCheckTry:16,_translations:16}}static{this.styles=O}get _isEnterprise(){return this._configContextConsumer.value?.isEnterprise}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextConsumer.value?.isEnterprise===!0&&this._configContextConsumer.value?.authentication?.CanSearchArcGISOnline===!1}async searchSolutions(t){this._isDisconnectedEnvironment||(t?"searchTerm"in t?this._textSearch(t.searchTerm):"sortType"in t?this._sortCards(t):Array.isArray(t)&&this._filterCards(t):(this._agoTerms=this._baseAgoTerms,this._clearFilterCategories()),this._cards=await this._getSolutions())}async setSearchOptions(t){t&&("searchTerm"in t&&(this._textSearch(t.searchTerm),this.searchTermSet.emit({searchTerm:t.searchTerm,scope:"all-solutions"})),"sortType"in t&&(this._sortCards(t),this.sortTypeSet.emit({sortType:t.sortType,scope:"all-solutions"})))}render(){let t=this._configContextConsumer.value?.authentication?.IsSignedIn&&this._configContextConsumer.value?.authentication?.CanUseAI;return this._isDisconnectedEnvironment?a`<div class="no-solutions">${this._getMeridianSearch()}<div class="no-solutions-prompt"><div class="text-center leader-1 warning-text trailer-1"><div>${this._translations.disconnectedEnvironment}</div></div></div></div>`:this._isLoading||this._cards.length?a`<calcite-panel>${this._isLoading?a`<calcite-loader id=solutions-all-panel-loader .label=${this._translations.fetchingSolutions}></calcite-loader>`:a`<calcite-card-group class="card-group" .label=${this._translations.allSolutionCards}>${this._renderCards()}</calcite-card-group>`}</calcite-panel>`:a`<div class="no-solutions">${this._getMeridianSearch()}<div class="no-solutions-prompt"><div class="text-center leader-1 warning-text trailer-1"><div>${this._translations.noSolutionsFound}</div><div class="margin-top-half">${!this._isEnterprise&&t?this._translations.assistantHelp:this._translations.changeSearchTerm}</div></div>${!this._isEnterprise&&t&&a`<calcite-button appearance=outline icon-start=speech-bubbles @click=${this._handleOpenAssistant} @keydown=${e=>T(e,()=>this._handleOpenAssistant())} scale=l>${this._translations.askAssistant}</calcite-button>`||""}</div></div>`}_renderCards(){return this._cards.map(t=>a`<solution-details-card .card=${t}></solution-details-card>`)}async _getSolutions(){if(this._isDisconnectedEnvironment)return this._isLoading=!1,[];if(this._configContextConsumer.value){this._isLoading=!0,this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let t=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},this._configContextConsumer.value?.primarySolutionsGroupId,this._configContextConsumer.value?.agoBasedEnterpriseSolutionsGroupId,this._configContextConsumer.value?.userSession,this._configContextConsumer.value?.isEnterprise,this._abortController.signal,{num:1e3});this._abortController=void 0;let e=t?.cards.length?t.cards:[];if(this.sortType==="new"||this.sortType==="updated"){let s="/Categories/New Release";this.sortType==="updated"&&(s="/Categories/Updated"),e.sort((l,d)=>l.categories.includes(s)&&!d.categories.includes(s)?-1:!l.categories.includes(s)&&d.categories.includes(s)?1:l.categories.includes(s)&&d.categories.includes(s)?l.categories.length-d.categories.length:0)}else if(this.sortType==="suggested"&&this._relatedSolutions.size>0&&this._deployedSolutions?.cards?.length){let s=new Map;for(let i of e){let n=s.get(i.deployCommonId),r=Number(i.deployVersion);(!n||r>n)&&s.set(i.deployCommonId,r)}let l=this._deployedSolutions.cards.filter(i=>{let n=s.get(i.deployCommonId);return n!==void 0&&Number(i.deployVersion)>=n}),d=new Set(l.map(i=>i.deployCommonId));this._relatedSolutions=new Set([...this._relatedSolutions].filter(i=>!d.has(i))),e.sort((i,n)=>{let r=this._relatedSolutions.has(i.deployCommonId),p=this._relatedSolutions.has(n.deployCommonId);return r&&!p?-1:!r&&p?1:0})}let o=e.map(s=>{let l=s.categories.indexOf("/Categories/New Release")>-1,d=s.categories.indexOf("/Categories/Updated")>-1,i=!1,n=!0;this._deployedSolutions&&(i=this._isSolutionDeployed(s.deployCommonId),n=this._isLatestVersion(s));let r=[];return l?r.push("new"):d&&r.push("updated"),i&&(n?r.push("deployed"):r.push("deployedOlderVersion")),s.chips=r.length>0?r:void 0,s.supportReuse=i?!!(i&&!n):!0,s});return this._allCards.length===0&&t?.cards&&(this._allCards=t?.cards,this._deployedSolutions&&(this._relatedSolutions=E(this._deployedSolutions.cards,this._allCards))),this.cardsFetched.emit(o.length),this._isLoading=!1,o}else return this._isLoading=!1,[]}async _loadUpdateProcedures(){if(this._isDisconnectedEnvironment){this._isLoading=!1;return}this._isLoading=!0;let t=this._configContextConsumer.value;this._cardsFetcher=new _(t.locale,t.orgUrl,t.portalURL),this._cardsFetcherDeployed=new _(t.locale,t.orgUrl,t.portalURL),await this._getDeployedSolutions(),this._cards=await this._getSolutions(),this.allCardsFetched.emit(this._cards),this._isLoading=!1}async _getDeployedSolutions(){let t=this._configContextConsumer.value.authentication,e=this._configContextConsumer.value.userSession;if(t&&e&&t.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let o=await I(t,e,this._cardsFetcher,this._cardsFetcherDeployed,D,"created",this._sortOrder,void 0,this._categories,void 0,this._abortControllerDeployed.signal);if(this._abortControllerDeployed=void 0,o){if(this._modifiedCheckTry>0){if(this._deployedSolutions?.cards.length===o?.cards.length)return this._modifiedCheckTry--,await this._getDeployedSolutions();this._modifiedCheckTry=0}this._deployedSolutions=o}}}_getMeridianSearch(){return a`<div><svg viewBox="0 0 64 64" width=140 height=140 xmlns=http://www.w3.org/2000/svg fill=var(--calcite-color-text-3)>${y`<path d="M60.217 54.937l-15.77-15.77-1.414 1.415-3.801-3.8a19.94 19.94 0 1 0-2.451 2.45l3.802 3.802-1.413 1.415 15.767 15.767a1.739 1.739 0 0 0 2.459 0l2.82-2.821a1.742 1.742 0 0 0 0-2.458zM4.9 24A19.1 19.1 0 1 1 24 43.1 19.121 19.121 0 0 1 4.9 24zm32.474 14.693q.69-.63 1.32-1.32l3.774 3.775-1.32 1.32zM59.65 56.83l-2.82 2.82a.97.97 0 0 1-1.327 0L40.3 44.45l4.145-4.15L59.65 55.501a.939.939 0 0 1 0 1.328zM22.343 9.62l.097.795q-.31.038-.619.086a13.635 13.635 0 0 0-11.353 11.775l-.026.217-.795-.084.026-.228a14.44 14.44 0 0 1 12.022-12.47c.215-.034.431-.064.648-.09z" />`}</svg></div>`}_textSearch(t){this._agoTerms=this._baseAgoTerms+` ${t}`}_sortCards(t){let e=t.sortType;this._getSuggested=!1,this._sortOrder="desc",e==="suggested"?this._getSuggested=!0:e==="new"?this._sortField="relevance":e==="relevance"||e==="title"?(e==="title"&&(this._sortOrder="asc"),this._sortField=e):e==="updated"&&(this._sortField="relevance"),this.sortType=e}_filterCards(t){this._categories=[],t.forEach(e=>{if(e.industry){let o=this._getIndustryValue(e.industry);if(e.domain){let s=this._getDomainValue(e.domain);this._categories.push(`/Categories/${o}/${s}`)}else this._categories.push(`/Categories/${o}`)}})}_getDomainValue(t){return A[t]}_getIndustryValue(t){return t==="AEC"?"AEC":b[t]}_clearFilterCategories(){this._categories=[]}_isSolutionDeployed(t){return!!this._deployedSolutions?.cards?.some(e=>e?.typeKeywords?.some(o=>o.includes("solutionid")&&o.includes(t)))}_isLatestVersion(t){let e=this._deployedSolutions?.cards?.filter(o=>o?.typeKeywords?.some(s=>s.includes("solutionid")&&s.includes(t.deployCommonId)));return!(e&&e.length>0&&e[0].deployVersion!==t.deployVersion)}_lookupSolutionById(t){let e=this._allCards.filter(o=>o.deployCommonId===t);e.length>0&&this.detailsCardSelected.emit(e[0])}};S("solutions-all-panel",g);return g},b,d,e,g,h)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as S3,b as f3}from"./ZYCAAXQF.js";import{a as r3}from"./2WHAF4H7.js";import a from"./X5EABWHE.js";import{b as w2}from"./2B4SGB3I.js";import{b as k2}from"./YKQDHR27.js";import{$ as Y1,$a as E7,$b as Z9,A as M2,Aa as J2,Ab as p7,B as F2,Ba as $2,Bb as g7,C as E1,Ca as q2,Cb as h7,D as Z,Da as F9,E as R2,Ea as R9,Eb as T7,F as $1,Fa as Y2,G as I1,Ga as X2,Gb as Z7,H as A,Ha as w1,Hb as U7,I as I9,Ia as p9,Ib as W7,J as p2,Ja as Q2,Jb as O7,K as u,Ka as e7,Kb as n1,L as g2,La as a7,Lb as K7,Ma as x7,Mb as H7,N as c1,Na as t7,Nb as v7,O as D,Oa as n7,Ob as B7,P as C1,Pa as m7,Pb as L7,Q as h2,Qa as i7,Qb as j7,R as c9,Ra as l7,Rb as _7,S as C9,Sa as d7,Sb as V7,T as q1,Ta as y7,Tb as z7,U as J,Ua as o7,Ub as J7,V as T2,Va as u7,Vb as $7,W as Z2,Wa as r7,Wb as q7,X as U2,Xa as g9,Xb as Y7,Y as v,Ya as a9,Yb as X7,Z as W2,Za as S7,Zb as Q7,_ as j,_a as f7,_b as e3,a as K1,aa as O2,ab as t1,ac as t9,ba as G9,bb as k7,bc as U9,c as O,ca as x1,cb as w7,cc as M1,da as N,db as b7,dc as n9,e as e1,ea as c,eb as s7,ec as a3,f as P2,fa as X,fb as N7,fc as x3,g as d1,ga as X1,gb as A7,gc as t3,h as S,ha as K2,hb as P7,hc as n3,i as P9,ia as H2,ib as D7,ic as m3,j as u1,ja as M9,jb as I7,jc as i3,k as L1,ka as v2,kb as c7,kc as l3,l as S1,lb as G1,lc as F1,m as j1,ma as B2,mb as M,mc as m9,n as _1,na as L2,nb as x9,nc as i9,o as D9,oa as j2,oc as d3,p as I2,pa as _2,pc as l9,qa as V2,qb as C7,qc as y3,r as V1,ra as g,rb as G7,s as c2,sa as k1,sb as B,t as z1,ta as $,tb as M7,u as J1,ub as b1,v as a1,va as Q1,vb as q,w as C2,wa as e9,wb as F7,x as f1,xa as z2,xb as h9,y as G2,yb as R7,z as k,zb as T9}from"./J75MHJID.js";import{a as E2}from"./R67EKKSL.js";import{a as r1,g as D1}from"./ALSK2SPM.js";import{a as K}from"./ZCU2WWVN.js";import{a as z,b as H1,c as v1,d as B1}from"./KOIDWEP3.js";import{e as V,f as N2,j as U1,l as W1,o as A2,s as O1}from"./XQQ52NKX.js";import{a as b2,g as s2}from"./JUUVYK2H.js";import{a as D2}from"./4HFHJOS3.js";import{a as H}from"./45M33Q5G.js";import{b as f2}from"./KIUBUHVM.js";import{E as T1,F as Z1,G as r2,K as S2,h as u2,i as _,q as o1}from"./H5E6ISYP.js";import{c as W}from"./QPIMTXPL.js";export default $arcgis.t(([{g:o3,h:u3}])=>{function s1(e,a="application/octet-stream"){if(typeof Blob<"u"){let x=[];for(let n=0;n<e.length;n++)x[n]=e.charCodeAt(n);let t=new Uint8Array(x);return new Blob([t],{type:a})}else throw new Error("stringToBlob is not currently supported on Node")}function E3(e){if(typeof Blob<"u")return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")}var d9={};W(d9,{_mostRecentlyEditedLayer:()=>W9,convertItemToTemplate:()=>x0,createItemFromTemplate:()=>t0,postProcess:()=>n0});function x0(e,a,x,t){return new Promise((n,m)=>{let i=j(e);I7(e.groupDesignations)?a7(i,x).then(d=>n(d),d=>m(A(d))):(i.estimatedDeploymentCostFactor=10,$(i.item.id,x).then(d=>{i.data=d,A7(i,x).then(y=>{y.item.modified=Math.max(y.item.modified,W9(i.properties.layers),W9(i.properties.tables)),b7(y,x).then(o=>{y.dependencies=o.map(r=>r.id),n(Y2(y,o,!1,t))},o=>m(A(o)))},y=>m(A(y)))}))})}function t0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),delete m.item.thumbnail,$1(m,"properties.service.size");let i=X2(m.data);E7(m,x,a).then(l=>{l.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?(m=p9(m,a,l),n7(m,a,i,x).then(()=>{m=p9(m,a,l),b1({...m.item,url:void 0},m.data,x,e.item.thumbnail,void 0,a).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?g(m.itemId,x).then(d=>{m.item=d,u(m,"item.url")&&!m.item.url.endsWith("/")&&(m.item.url+="/"),n({item:m,id:l.serviceItemId,type:m.type,postProcess:x1({item:m.item,data:m.data})||g9(m)})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function n0(e,a,x,t,n,m,i){return new Promise((l,d)=>{q(e,m,i).then(y=>{g9(t)?(t=N(t,m),a9(t,i,t.item.url,m).then(l,d)):l(y)},d)})}function W9(e){let a=0;return e.forEach(x=>{a=x.editingInfo?.lastEditDate?Math.max(a,x.editingInfo.lastEditDate):a}),a}var f={};W(f,{convertItemToTemplate:()=>m0,createItemFromTemplate:()=>i0});function m0(e,a,x){return new Promise(t=>{let n=j(e);n.item.id=c(n.item.id,n.item.id,".itemId");let m=new Promise(l=>{k1(n.itemId,n.item.name,x).then(d=>{!d||d.size===0?l(null):l(d)})}),i=Promise.resolve({});Promise.all([m,i]).then(l=>{let[d]=l;if(d){let y=a3(d,n.item.name);n.properties[y.filename]=y.mimeType;let o=n9(n.itemId,y.blob.name,1,y.blob.name===y.filename?M1.data:M1.fakezip),r={itemId:n.itemId,file:y.blob,folder:o.folder,filename:o.filename};n.dataFile=r,n.resources.push(o.folder+"/"+o.filename),t(n)}else t(n)})})}function i0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),t1(m.item,m.data,x,a.folderId).then(i=>{t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,i.id)?(m.itemId=i.id,a[e.itemId]={itemId:i.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,i.id),n({item:m,id:i.id,type:m.type,postProcess:!1})):(t(e.itemId,S.Cancelled,0),M(i.id,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}var Q9={};W(Q9,{_getFormDataFilename:()=>Q3,_replaceFeatureServiceURLs:()=>V3,_replaceItemIds:()=>z3,_replacePortalBaseUrls:()=>J3,_replaceWorkflowManagerBaseUrls:()=>$3,_updateZipObjectTextContent:()=>q3,convertItemToTemplate:()=>B0,createItemFromTemplate:()=>L0,postProcess:()=>X3,postProcessFormItems:()=>_0,swizzleFormObject:()=>Y9,templatizeFormData:()=>X9});function b3(e,a){return l0(e,a)}function l0(e,a){return["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"].forEach(t=>{let n=u(e,t);Array.isArray(n)&&n.forEach(m=>{m.type==="mapWidget"&&(e.dependencies.indexOf(m.itemId)<0&&e.dependencies.push(m.itemId),m.itemId=c(m.itemId,m.itemId,".itemId")),Array.isArray(m.datasets)&&d0(m,e,a)})}),e}function d0(e,a,x){e.datasets.forEach(t=>{if(u(t,"dataSource.type")!=="arcadeDataSource"){let m=u(t,"dataSource.itemId");if(m){a.dependencies.indexOf(m)<0&&a.dependencies.push(m);let i=u(t,"dataSource.layerId");w1(i?.toString(),m,"",x),t.dataSource.itemId=c(m,m,".itemId")}}})}function s3(e,a){let x=["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"];return x.forEach(t=>{let n=u(e,t);y0(n,a)}),x.forEach(t=>{o0(e,t,a)}),e}function y0(e,a){e&&Array.isArray(e)&&e.forEach(x=>{Array.isArray(x.datasets)&&x.datasets.forEach(t=>{let n=c9(u(t,"dataSource.itemId"));if(n){let m=C9(u(t,"dataSource.layerId"));a.some(i=>i.itemId===n&&i.layerId===m?(w3(i,x.id),!0):!1)}else{let m=u(t,"dataSource.id");if(m){let i=m.split("#")[1];a.some(l=>l.ids.indexOf(i)>-1?(w3(l,x.id),!0):!1)}}})})}function o0(e,a,x){let t=u(e,a);t&&D(e,a,u0(t,x))}function u0(e,a){return Array.isArray(e)?e.map(x=>{let t=x;return Array.isArray(t.events)&&(t.events=t.events.map(n=>{let m=n;return Array.isArray(m.actions)&&(m.actions=m.actions.map(i=>{let l=i;if(l.fieldMap&&l.targetId&&l.targetId.indexOf("#")>-1){let d=k3(l,a);if(d){let y=u(d,"fields"),o=u(d,"basePath");Array.isArray(y)&&o&&(l.fieldMap=l.fieldMap.map(r=>{let E=r;return E.targetName=X(E.targetName,y,o),E}))}}return l})),m})),Array.isArray(t.datasets)&&(t.datasets=t.datasets.map(n=>{let m=n;if(m.type==="serviceDataset"){let i=k3(n,a);if(i){let l=u(i,"fields"),d=u(i,"basePath");Array.isArray(l)&&d&&(t=X(t,l,d),m=X(m,l,d))}}return m})),t}):e}function k3(e,a){let x,t=u(e,"dataSource.id")||u(e,"targetId");if(t){let n=t.split("#")[1];if(!a.some(m=>(x=m.ids.indexOf(n)>-1?m:x,m.ids.indexOf(n)>-1))){let m=t.split("#")[0];a.some(i=>{let d=(i.references||[]).indexOf(m)>-1;return x=d?i:x,d})}}else{let n=c9(u(e,"dataSource.itemId")),m=C9(u(e,"dataSource.layerId"));n&&a.some(i=>{let l=n===i.itemId&&m===i.layerId;return x=l?i:x,l})}return x}function w3(e,a){e.references=Array.isArray(e.references)?e.references:[],e.references.indexOf(a)<0&&e.references.push(a)}var N1={};W(N1,{convertItemToTemplate:()=>A0,convertNotebookToTemplate:()=>z9,createItemFromTemplate:()=>P0,deleteProps:()=>R3,fineTuneCreatedItem:()=>V9,postProcess:()=>I0,postProcessNotebookTemplates:()=>D0});function P3(e,a,x,t){return new Promise((n,m)=>{let i="";if(e.item.url){let l=e.item.url,d=l.indexOf("//");e.item.url=v(J)+l.substring(l.indexOf("/",d+2),l.lastIndexOf("=")+1)+e.item.id,i=l.replace(l.substring(l.indexOf("/",d+2)),"")}e.dependencies=f0(e),D(e,"data.folderId","{{folderId}}"),w0(e,["data.map.itemId","data.map.appProxy.mapItemId","data.values.webmap","data.values.group"]),I3(e,"data.appItemId",e.itemId),j9(e,["data.logo","data.map.portalUrl","data.portalUrl","data.httpProxy.url"],v(J)),D(e,"data.geometryService",v(T2)),r0(e,x,i,t).then(()=>{A3(e,x,i,"data.widgetPool.widgets").then(l=>{A3(l,x,i,"data.widgetOnScreen.widgets",!0).then(d=>{S0(d,x,i,"data.values").then(y=>{n(y)},y=>m(A(y)))},d=>m(A(d)))},l=>m(A(l)))},l=>m(A(l)))})}function r0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,"data.dataSource.dataSources");if(i&&Object.keys(i).length>0){let l=new Array;Object.keys(i).forEach(d=>{let y=i[d];D(y,"portalUrl",v(J));let o=u(y,"itemId");if(u(y,"url")){if(o){let E=y.url.substr(y.url.lastIndexOf("/")+1);w1(E.toString(),o,y.url,t),y.itemId=c(o,o,".layer"+E+".itemId")}let r=L9(y.url,x,[],[],a);l.push(new Promise((E,w)=>{B9(r.serviceRequests,r.requestUrls,r.testString).then(s=>{y.url=s,E()},s=>w(A(s)))}))}else o&&(y.itemId=c(o,o,".itemId"))}),Promise.all(l).then(()=>n(e),d=>m(A(d)))}else n(e)})}function A3(e,a,x,t,n=!1){return new Promise((m,i)=>{let l=u(e,t)||[],d=[],y=[];if(l.forEach(o=>{!n&&u(o,"icon")&&j9(o,["icon"],v(J));let r=o.config;if(r){let E=JSON.stringify(r),w=L9(E,x,y,d,a);o.config=JSON.parse(w.testString),d=w.serviceRequests,y=w.requestUrls}}),d.length>0){let o=JSON.stringify(l);B9(d,y,o).then(r=>{D(e,t,JSON.parse(r)),m(e)},r=>i(A(r)))}else m(e)})}function S0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,t),l=[],d=[];if(i){u(i,"icon")&&j9(i,["icon"],v(J));let y=JSON.stringify(i),o=L9(y,x,d,l,a);i=JSON.parse(o.testString),l=o.serviceRequests,d=o.requestUrls}if(l.length>0){let y=JSON.stringify(i);B9(l,d,y).then(o=>{D(e,t,JSON.parse(o)),n(e)},o=>m(A(o)))}else n(e)})}function B9(e,a,x){return new Promise((t,n)=>{if(e&&e.length>0){let m=0;Promise.all(e).then(i=>{i.forEach(l=>{if(u(l,"serviceItemId")){let d="{{"+l.serviceItemId+(l.hasOwnProperty("id")?".layer"+l.id:"")+".url}}";x=y9(x,a[m],d,!0)}m++}),t(x)},i=>n(A(i)))}else t(x)})}function L9(e,a,x,t,n){let m={f:"json",authentication:n},i=e.match(/(\bhttps?:\/\/[-A-Z0-9/._]*)/gim);return i&&i.length&&i.forEach(l=>{l.indexOf("NAServer")>-1?e=y9(e,l,v(U2)):l.indexOf("GeocodeServer")>-1?e=y9(e,l,v(Z2)):a&&l.indexOf(a)>-1?e=y9(e,a,v(J)):l.indexOf("FeatureServer")>-1&&x.indexOf(l)===-1&&(x.push(l),t.push(O(l,m)))}),{testString:e,requestUrls:x,serviceRequests:t}}function y9(e,a,x,t=!1){let n=t&&e.indexOf('"')>-1,m=new RegExp(n?'"'+a+'"':a,"gmi");return e.replace(m,n?'"'+x+'"':x)}function j9(e,a,x){a.forEach(t=>{let n=u(e,t);if(n){let m=n.substring(n.indexOf("/",n.indexOf("//")+2));D(e,t,m!==n?x+m:x)}})}function D3(e,a,x,t){return new Promise(n=>{if(C1(e,["WAB2D","WAB3D","Web AppBuilder"])){let m={id:a.itemId,url:a.item.url,data:a.data},i=B(m,t),l={tags:e.item.tags,title:e.item.title,type:"Code Attachment",typeKeywords:["Code","Javascript","Web Mapping Application"],relationshipType:"WMA2Code",originItemId:a.itemId,url:J1(N(v(J),x))+"sharing/rest/content/items/"+a.itemId+"/package"},d=t1(l,{},t,x.folderId);Promise.all([i,d]).then(()=>n(null),()=>n(null))}else n(null)})}function f0(e){let a=E0;return C1(e,["WAB2D","WAB3D","Web AppBuilder"])&&(a=k0),a(e)}function E0(e){return g2(e,["data.values.webmap","data.values.group"])}function k0(e){let a=[],x=u(e,"data.map.itemId");x&&a.push(x);let t=u(e,"data.dataSource.dataSources");return t&&Object.keys(t).forEach(n=>{let m=t[n];m.itemId&&a.push(m.itemId)}),a}function w0(e,a){a.forEach(x=>{let t=u(e,x);I3(e,x,t)})}function I3(e,a,x){D(e,a,c(x,x,".itemId"))}function c3(e,a){let x=u(e,"data.dataSource.dataSources");x&&Object.keys(x).length>0&&(Object.keys(x).forEach(m=>{let i=x[m];x[m]=H9(i,a)}),D(e,"data.dataSource.dataSources",x)),["data.widgetPool.widgets","data.widgetOnScreen.widgets"].forEach(m=>{let i=u(e,m);i&&D(e,m,b0(i,a))});let n=u(e,"data.values");return n&&D(e,"data.values",H9(n,a)),e}function H9(e,a,x=!1){return e=N0(e,a,x),s0(e,a).forEach(n=>{e=X(e,n.fields,n.basePath,x)}),e}function b0(e,a){let x=["SmartEditor","Screening"];return e.map(t=>{if(t.config){let n=x.indexOf(t.name)>-1;t.config=H9(t.config,a,n)}return t})}function s0(e,a){let x=JSON.stringify(e);return a.filter(n=>K9(n,x)<4).sort((n,m)=>K9(n,x)-K9(m,x))}function K9(e,a){let x=e.url,t=e.itemId,n=e.layerId,m;return x&&!isNaN(n)&&(m=new RegExp(x.replace(/[.]/,".layer"+n+"."),"gm")),m&&m.test(a)||e.ids.length>0&&e.ids.some(i=>new RegExp(i,"gm").test(a))?1:x&&new RegExp(x,"gm").test(a)?2:t&&new RegExp(t,"gm").test(a)?3:4}function N0(e,a,x){let t=JSON.stringify(e),n=a.filter(m=>{let i;m.url&&!isNaN(m.layerId)&&(i=new RegExp(m.url.replace(/[.]/,".layer"+m.layerId+"."),"gm"));let l=!1;if(m.ids.length>0&&(l=m.ids.some(d=>new RegExp(d,"gm").test(t))),l||i&&i.test(t))return m});return n.length>0&&n.forEach(m=>{e=v9(e,m,x),m.ids.length>0&&m.ids.forEach(i=>{e=o9(e,m,i,x)})}),e}function v9(e,a,x){let t={},n=a.url,m=a.layerId,i;if(n&&!isNaN(m)&&(i=new RegExp(n.replace(/[.]/,".layer"+m+"."),"gm")),Array.isArray(e))t=e.map(l=>v9(l,a,x));else if(typeof e=="object")for(let l in e)e[l]!=null&&typeof e[l]=="object"?t[l]=v9(e[l],a,x):(i&&i.test(e[l])&&(e=X(e,a.fields,a.basePath,x)),t[l]=e[l]);else t=e;return t}function o9(e,a,x,t){let n={},m=new RegExp(x,"gm");if(Array.isArray(e))n=e.map(i=>o9(i,a,x,t));else if(typeof e=="object")for(let i in e)if(e[i]!==null){let l;try{l=JSON.parse(e[i])}catch{l=void 0}l&&typeof l=="object"?n[i]=JSON.stringify(o9(l,a,x,t)):typeof e[i]=="object"?(m.test(i)&&t&&(e[i]=X(e[i],a.fields,a.basePath,t)),n[i]=o9(e[i],a,x,t)):(m.test(e[i])&&(e=X(e,a.fields,a.basePath,t)),n[i]=e[i])}else n[i]=e[i];else n=e;return n}function C3(e,a,x,t){return r7(e,x,t)}function G3(e,a,x){return a9(e,a,"",x)}function Y(e,a,x,t,n){return new Promise((m,i)=>{function l(){n&&n.signal.aborted&&i(new Error("Operation was cancelled"))}if(l(),!t(e.itemId,S.Started,0))t(e.itemId,S.Ignored,0),m(k(e.type));else{let d=Z(e);d=N(d,a);let y;e.type==="Web Mapping Application"&&e.data?d=JSON.parse(N(JSON.stringify(d),a)):e.type==="QuickCapture Project"&&e.data&&(y=JSON.stringify(d.data.application),delete d.data),e.item.thumbnail&&(d.item.thumbnail=e.item.thumbnail),t1(d.item,d.data,x,a.folderId).then(o=>{if(l(),!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,o.id))t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type)));else{a[e.itemId]={itemId:o.id,itemUrl:a.portalBaseUrl+"/sharing/rest/content/items/"+o.id},d.itemId=o.id,d.type==="Web Mapping Application"&&e.data&&D(d,"data.appItemId",o.id);let r=x1(d.data),E=d.item.url;d=N(d,a),l();let w=Promise.resolve([]);if(d.relatedItems){let P=N(X1(d.relatedItems),a);w=S7(d.itemId,P,x)}l();let s;if(e.type==="Web Mapping Application"&&e.data&&C1(e,["WAB2D","WAB3D","Web AppBuilder"]))s=D3(e,d,a,x);else if(e.type==="Workforce Project")s=G3(d,x,a);else if(e.type==="QuickCapture Project"){if(y){let P=E1(N(JSON.parse(y),a),"qc.project.json");s=l3(P,d.itemId,"",P.name,x)}}else e.type==="Notebook"?s=V9(e,d,a,x):E!==d.item.url?(l(),s=new Promise((P,b)=>{F7(o.id,d.item.url,x).then(()=>P(),b)})):s=Promise.resolve(null);l(),Promise.all([w,s]).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,o.id)?m({item:d,id:o.id,type:d.type,postProcess:r}):(t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type))))},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}})}function A0(e,a,x,t){return Q(e,a,x,t)}function P0(e,a,x,t){return Y(e,a,x,t)}function z9(e){return new Promise(a=>{R3(e.data),a(e)})}function D0(e,a){if(e.some(t=>t.type==="Notebook")){let t=Object.keys(a).filter(m=>m.indexOf("FeatureServer")>-1).sort().reverse(),n=e.reduce((m,i)=>(m=[...new Set([...m,...i.dependencies,i.itemId])],m),[]);e=e.map(m=>{if(m.type==="Notebook"){let i=m.data&&JSON.stringify(m.data);return n.forEach(l=>{new RegExp(l,"gim").test(i)&&(i=i.replace(l,"{{"+l+".itemId}}"),m.dependencies.indexOf(l)<0&&m.dependencies.push(l))}),t.forEach(l=>{let d=new RegExp(l,"gim");if(d.test(i)){let y=a[l];i=i.replace(d,y);let o=/[0-9A-F]{32}/gim,r=y.match(o)[0];m.dependencies.indexOf(r)<0&&m.dependencies.push(r)}}),m.data=JSON.parse(i),m}})}return e}function R3(e){if(e){let a=["metadata.interpreter","metadata.papermill"];I1(e,a),(e.cells||[]).forEach(x=>{I1(x,a)})}}function V9(e,a,x,t){return new Promise((n,m)=>{let i={id:a.itemId,url:a.item.url,data:E1(a.data,a.itemId+".ipynb")};B(i,t).then(()=>n(null),m)})}function I0(e,a,x,t,n,m,i){return q(e,m,i)}function g3(e,a,x){return new Promise((t,n)=>{c0(e,x).then(m=>{e.dependencies=m.dependencies,e.data?.properties&&(e.data.properties.ServiceURL=p3(e.data.properties.ServiceURL,m.urlHash),e.data.properties.OverviewURL=p3(e.data.properties.OverviewURL,m.urlHash)),t(e)},m=>n(A(m)))})}function c0(e,a){return new Promise((x,t)=>{let n=[];if(e.data?.properties){let m=[];e.data.properties.ServiceURL&&m.push(e.data.properties.ServiceURL),e.data.properties.OverviewURL&&e.data.properties.OverviewURL!==e.data.properties.ServiceURL&&m.push(e.data.properties.OverviewURL),C0(m,n,a).then(i=>{x(i)},i=>t(A(i)))}else x({dependencies:n,urlHash:{}})})}function C0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o){let r=/.+FeatureServer/g.exec(o),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E]]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function p3(e,a){let x=e;if(e){let t=a[e];if(t){let n=e.substr(e.lastIndexOf("/")+1);x=c(t,t,".layer"+n+".url")}x=X1(x.replace(/.+?(?=\/home)/,"{{portalBaseUrl}}"))}return x}var R1={};W(R1,{_templatizeAdminEmail:()=>Z3,_templatizeApplication:()=>T3,_templatizeId:()=>J9,_templatizeUrl:()=>W3,_updateDependencies:()=>U3,convertItemToTemplate:()=>M0,convertQuickCaptureToTemplate:()=>$9,createItemFromTemplate:()=>F0});function M0(e,a,x,t){return Q(e,a,x,t)}function $9(e){return D(e,"data.application",T3(e.data.application,e)),e}function T3(e,a){J9(e,"itemId"),Z3(e);let x=e?.dataSources;return x&&Array.isArray(x)&&x.forEach(t=>{let n=t.featureServiceItemId;n&&(U3(n,a),W3(t,"featureServiceItemId","url"),J9(t,"featureServiceItemId"))}),e}function Z3(e){u(e,"preferences.adminEmail")&&D(e,"preferences.adminEmail","{{user.email}}")}function U3(e,a){a.dependencies.indexOf(e)===-1&&a.dependencies.push(e)}function W3(e,a,x){let t=u(e,a),n=u(e,x);if(n){let m=n.substr(n.lastIndexOf("/")+1);D(e,x,c(t,t,".layer"+m+".url"))}}function J9(e,a){let x=u(e,a);x&&D(e,a,c(x,x,".itemId"))}function F0(e,a,x,t){return Y(e,a,x,t)}var R0="home/webmap/viewer.html?webmap=";function O3(e,a,x,t){return new Promise((n,m)=>{e.type!=="Vector Tile Service"&&(e.item.url=e.item.url?J1(v(J))+R0+e.item.id:e.item.url),p0(e,x).then(i=>{e.dependencies=i.dependencies,e.data&&(e.data.baseMap?.baseMapLayers&&q9(e.data.baseMap.baseMapLayers,i.urlHash,t),e.data.operationalLayers&&q9(e.data.operationalLayers,i.urlHash,t),q9(e.data.tables,i.urlHash,t),g0(e.data)),n(e)},i=>m(A(i)))})}function p0(e,a){return new Promise((x,t)=>{let n=[];if(e.data){let m=e.data.baseMap?.baseMapLayers||[],i=e.data.operationalLayers||[],l=e.data.tables||[],d=m.concat(i).concat(l);h0(d,n,a).then(y=>{x(y)},y=>t(A(y)))}else x({dependencies:n,urlHash:{}})})}function g0(e){$1(e,"initialState")}function h0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o.itemId&&o.layerType==="VectorTileLayer")return l.push(g(o.itemId,x)),!0;if(o.url&&o.url.indexOf("{{velocityUrl}}")<0){let r=/.+FeatureServer/g.exec(o.url),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o.url,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(y[E].layerType==="VectorTileLayer"){let w=u(r,"typeKeywords");if(w&&w.includes("Vector Tile Style Editor")){a.indexOf(r.id)<0&&a.push(r.id),y[E].templatizeId=!0;let s=y[E].styleUrl.indexOf(r.id)+r.id.length;y[E].styleUrl=c(y[E].styleUrl.replace(y[E].styleUrl.substring(0,s),r.id),r.id,".itemUrl")}}else if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E].url]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function q9(e=[],a,x){e.forEach(t=>{if(t.itemId&&t.layerType==="VectorTileLayer")t.templatizeId&&(t.itemId=c(t.itemId,t.itemId,".itemId"),delete t.templatizeId);else if(t.url){let n=t.url.substr(t.url.lastIndexOf("/")+1),m=Object.keys(a).indexOf(t.url)>-1?a[t.url]:void 0;m&&(w1(n,m,t.url,x),t.url=c(m,m,".layer"+n+".url"),t.itemId=c(m,m,".layer"+n+".itemId"))}})}function K3(e,a){return["data.operationalLayers","data.tables","data.applicationProperties.viewing.search.layers"].forEach(t=>T0(e,a,t)),e}function T0(e,a,x){let t=u(e,x);t&&D(e,x,Z0(t,a))}function Z0(e,a){return e.forEach(x=>{let t=U0(x,a);if(t){let n=t.fields.map(i=>i.name);l7(x,t,t.basePath,t.itemId,n),y7(x,t.basePath,n),x.layerDefinition&&(u7(x.layerDefinition,t.basePath,n),o7(x.layerDefinition,t.basePath,n));let m=u(x,"field.name");m&&D(x,"field.name",d7(m,x,t.itemId,t.basePath))}}),e}function U0(e,a){let x;return a.some(t=>t.ids.indexOf(e.id)>-1?(x=t,!0):!1),x}function Q(e,a,x,t){return new Promise((n,m)=>{let i=j(e);i.item.id=c(i.item.id,i.item.id,".itemId");let l=Q1(i.itemId,"forward",x),d=Promise.resolve({}),y=Promise.resolve([]);switch(e.type){case"Dashboard":case"Data Pipeline":case"Feature Collection":case"Feature Service":case"Hub Initiative":case"Hub Page":case"Hub Site Application":case"Insights Model":case"Oriented Imagery Catalog":case"Project Package":case"Style":case"Workforce Project":case"Web Map":case"Web Mapping Application":case"Web Scene":case"Notebook":d=new Promise(o=>{$(i.itemId,x).then(r=>o(r))});break;case"Form":d=k1(i.itemId,i.item.name,x);break;case"QuickCapture Project":y=e9(i.itemId,x);break}Promise.all([d,l,y]).then(o=>{let[r,E,w]=o;y3(i,t),i.data=l9(r,e.type,t);let s=E;i.dependencies=[],i.relatedItems=[],s.forEach(b=>{b.relationshipType!=="WMA2Code"&&(i.relatedItems.push(b),b.relatedItemIds.forEach(C=>{i.dependencies.indexOf(C)<0&&i.dependencies.push(C)}))}),e.type==="Data Pipeline"&&(i.dependencies=i.dependencies.concat(W0(r)));let P=Promise.resolve(i);switch(e.type){case"Dashboard":b3(i,t);break;case"Notebook":P=z9(i);break;case"Oriented Imagery Catalog":P=g3(i,a,x);break;case"QuickCapture Project":i.resources=w,P=new Promise(async b=>{let C=null,I=-1;w&&(w.some((y1,m1)=>{let i1=y1.name==="qc.project.json";return i1&&(C=y1,I=m1),i1}),I>=0&&w.splice(I,1)),C&&(i.data={application:{...await z1(C)},name:"qc.project.json"}),i.data.application?.basemap?.type==="Web Map"&&i.dependencies.push(i.data.application.basemap.itemId);let L=$9(i);b(L)});break;case"Vector Tile Service":case"Web Map":case"Web Scene":P=O3(i,a,x,t);break;case"Web Mapping Application":r&&(P=P3(i,a,x,t));break;case"Workforce Project":P=C3(i,a,x,t);break}P.then(n,b=>m(A(b)))})})}function W0(e){let a=[];return(e?.inputs??[]).concat(e?.outputs??[]).forEach(t=>{if(t.type==="FeatureServiceSource"||t.type==="FeatureServiceSink"){let n=u(t,"parameters.layer.value.itemId");n&&a.push(n)}}),a}var R={};W(R,{convertItemToTemplate:()=>O0,createItemFromTemplate:()=>K0,postProcess:()=>v0,postProcessFieldReferences:()=>H0});function O0(e,a,x,t){return Q(e,a,x,t)}function K0(e,a,x,t,n){return n?Y(e,a,x,t,n):Y(e,a,x,t)}function H0(e,a,x){switch(x){case"Web Mapping Application":c3(e,a);break;case"Dashboard":s3(e,a);break;case"Web Map":K3(e,a);break}return e}async function v0(e,a,x,t,n,m,i){if(a==="Web Map"&&t.resources.some(l=>l.indexOf(d1)>-1)){let l=t3(`${m.portalBaseUrl}/sharing/rest`,t.itemId,d1),d={httpMethod:"GET",authentication:i,params:{f:"json"},headers:{Accept:"application/json",Authorization:`Bearer ${i.token}`,"Content-Type":"application/json","X-Esri-Authorization":`Bearer ${i.token}`}};await O(l,d).then(async y=>{let o=JSON.stringify(y),r=N(o,m);if(o!==r){let E=JSON.parse(r),w={id:e,resource:E1(E,d1),name:d1,authentication:i,params:{}};await P2(w)}})}return q(e,m,i)}function B0(e,a,x,t){return R.convertItemToTemplate(e,a,x,t)}function u9(e){return!!u(e,"properties.services")}function B3(e,a="https://survey123.arcgis.com"){let x=`${a}/api/survey/create`,t={credentials:"same-origin",method:"POST",body:b2({f:"json",...e},!0)};return fetch(x,t).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(`Failed to create survey: ${n.error.message}`);return{formId:n.id,featureServiceId:n.featureService.source.itemId,folderId:n.formItemInfo.ownerFolder}})}var L3=function(a){let x=Z(a),t=[["header","content"],["subHeader","content"],["footer","content"],["settings","thankYouScreenContent"]],n=(i,l)=>(i&&i[l]&&(i[l]=encodeURIComponent(i[l])),i);t.forEach(([i,l])=>n(x[i],l));let m=i=>n(i,"description");return x.questions=(x.questions||[]).map(i=>i.questions?{...i,questions:i.questions.map(m)}:m(i)),x};function j3(e,a,x){let{item:{title:t,description:n,tags:m,typeKeywords:i},properties:{form:l}}=e,{user:{username:d},portalBaseUrl:y,organization:{basemapGalleryGroupQuery:o,defaultBasemap:{title:r}}}=a,{token:E}=x.toCredential();return J2(o,r,x).then(w=>{let s="Survey-",P=h2(`${s}${t}`,a,"user.folders").replace(s,"");if(l.questions){let C=I=>(I.maps&&(I.maps=I.maps.map(L=>({...L,itemId:w.id}))),I);l.questions=l.questions.map(I=>I.questions?{...I,questions:I.questions.map(C)}:C(I))}let b=L3(l);return{description:n,form:b,portalUrl:y,tags:m,title:P,token:E,typeKeywords:i,username:d}})}function _3(e,a,x,t){let n=N(e,a),{survey123Url:m}=a;return j3(n,a,x).then(i=>B3(i,m)).then(i=>{let{formId:l,featureServiceId:d}=i,y=Promise.resolve(null);return e.item.thumbnail&&(y=b1({id:l},null,x,e.item.thumbnail)),y.then(()=>g(l,x)).then(o=>(a[n.itemId]={itemId:l},a[n.properties.info.serviceInfo.itemId]={itemId:d},t(n.itemId,S.Finished,n.estimatedDeploymentCostFactor,l),{item:{...e,item:o,itemId:l},id:l,type:"Form",postProcess:!0}))}).catch(i=>{throw t(n.itemId,S.Failed,0),i})}function L0(e,a,x,t){return u9(e)?_3(e,a,x,t):R.createItemFromTemplate(e,a,x,t)}async function Y9(e,a){let x=await T9(e),t=new Date;return t=new Date(t.valueOf()-864e5-t.getTimezoneOffset()*1e3*60),x.forEach(n=>{if(typeof n.content=="string"){let m=q3(n,a);e.file(n.file,m,{date:t})}else n.file.endsWith(".xlsx")&&e.file(n.file,n.content,{date:t})}),Promise.resolve(e)}async function X9(e,a){return(await T9(e)).forEach(t=>{if(t.file.endsWith(".info")||t.file.endsWith(".itemInfo")||t.file.endsWith(".json")||t.file.endsWith(".webform")||t.file.endsWith(".xml")){let n=t.content,m=/\b([0-9A-Fa-f]){32}_type/g;n=z3(n,a,m),n=V3(n,a,m),n=J3(n,a),n=$3(n,a),e.file(t.file,n)}}),Promise.resolve(e)}function V3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type==="Feature Service").forEach(m=>{let i=a[m].url,l=a[i];l&&(t=t.replace(new RegExp(i,"g"),l))}),t}function z3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type!=="Feature Service").map(m=>m.replace("_type","")).forEach(m=>{t=t.replace(new RegExp(m,"g"),`{{${m}.itemId}}`)}),t}function J3(e,a){let x=e;return a.portalBaseUrl&&(x=x.replace(new RegExp(a.portalBaseUrl,"g"),"{{portalBaseUrl}}")),x}function $3(e,a){let x=e;return a.workflowBaseUrl&&(x=x.replace(new RegExp(a.workflowBaseUrl,"g"),"{{workflowBaseUrl}}")),x}function q3(e,a){let x=M2(),t=e.content;return t=N(e.content,a),f1(t.match(x)??[]).forEach(m=>{let i=a[m];typeof i?.itemId=="string"&&(t=t.replace(new RegExp(m,"g"),`${i.itemId}`))}),t}function Y3(e,a,x,t,n,m,i){let l=t.properties.info.serviceInfo.itemId,{itemId:d}=m[l],y=N(t,m);return g(d,i).then(o=>{let r=[{id:e,title:y.item.title,snippet:y.item.snippet,extent:y.item.extent,culture:y.item.culture},{id:d,extent:y.item.extent,typeKeywords:[`source-${l}`].concat(o.typeKeywords)}],E=s=>B(s,i),w=r.map(E);return Promise.all(w).then(()=>{let s=[e,d],P=C=>V({itemId:C,folderId:m.folderId,authentication:i}),b=s.map(P);return Promise.all(b)}).then(()=>c7(o.ownerFolder,i)).then(()=>{let s=j(o);return n.push(s),t.dependencies.push(o.id),!0})})}async function X3(e,a,x,t,n,m,i){let l=await k1(e,"Form",i);if(l){let d=await h9(l),y=await Y9(d,m);t9(y,e,i)}else return await G2(5e3),X3(e,a,x,t,n,m,i);return u9(t)?Y3(e,a,x,t,n,m,i):q(e,m,i)}async function _0(e,a){for(let x of e)if(x.type==="Form"){let t=x.data;if(x.data=null,t){let n=await h9(t);n=await X9(n,a),x.item.name=Q3(x.item.name,t.name,`${x.itemId}.zip`);let m=await p7(n,x.item.name),i=n9(x.itemId,x.item.name,1,M1.data),l={itemId:x.itemId,file:m,folder:i.folder,filename:x.item.name};x.dataFile=l,x.resources.push(i.folder+"/"+i.filename)}}return Promise.resolve(e)}function Q3(e,a,x){let t=e||a;return t&&t!=="undefined"?t:x}var e2={};W(e2,{_initializeNewGroup:()=>e6,convertItemToTemplate:()=>V0,createItemFromTemplate:()=>z0,postProcess:()=>J0});function V0(e,a,x){return new Promise(t=>{let n=W2(e);n.item.id=c(n.item.id,n.item.id,".itemId"),V2(e.id,x).then(m=>{n.type="Group",_2(e.id,x).then(i=>{i.id=n.item.id,n.item={...i,type:"Group"},n.dependencies=m.concat(p2(i.tags)),t(n)},()=>t(n))},()=>t(n))})}function z0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),m.item.thumbnail=e.item.thumbnail;let i=e6(m.item);w7(i.title,i,a,x,R9(m)?a.locationTracking.owner:void 0).then(l=>{if(l.success)if(!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(m.itemId=l.group.id,a[e.itemId]={itemId:l.group.id},m=N(m,a),a[e.itemId].itemId=l.group.id,!t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(R9(m)){let d=a.locationTracking.owner;C7(l.group.id,d,x).then(y=>{y.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?G7(l.group.id,[x.username],x).then(o=>{Array.isArray(o.notRemoved)&&o.notRemoved.length===0?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)}):(t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))})}else n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)});else t(e.itemId,S.Failed,0),n(k(e.type))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function J0(e,a,x,t,n,m,i){let l=Promise.resolve({success:!0});return x.some(d=>{if(d.id===e){let y=d.item.item;return x1(y)&&(y=N(y,m),l=M7(y,i)),!0}}),l}function e6(e){let a={access:"private",description:e.description,owner:e.owner,snippet:e.snippet,tags:e.tags,thumbnail:e.thumbnail,title:e.title||"",typeKeywords:e.typeKeywords};return["autoJoin","displaySettings","isInvitationOnly","isOpenData","isViewOnly","membershipAccess","properties","sortField","sortOrder"].forEach(t=>{e.hasOwnProperty(t)&&(a[t]=e[t])}),a}var p1={};W(p1,{convertItemToTemplate:()=>$0,createItemFromTemplate:()=>q0,isAPage:()=>X0,postProcess:()=>Y0});function a6(e,a,x,t){return e=S1(e,x,{}),B7(e,{...t,allowList:[]}).then(()=>!0)}function r9(e){let a=z(e);return(e.dependencies||[]).forEach(t=>{let n=new RegExp(t,"g"),m=`{{${t}.itemId}}`;a.item=u1(a.item,n,m),a.data=u1(a.data,n,m),e.properties&&(a.properties=u1(a.properties,n,m))}),a}function S9(e,a,x){let t=K(V,{success:!0}),n=[t({itemId:e.item.id,folderId:a,authentication:x})];return H(e,"item.properties.parentInitiativeId")&&n.push(t({itemId:e.item.properties.parentInitiativeId,folderId:a,authentication:x})),Promise.all(n)}function $0(e,a,x=null){let t=0,n=0;return Promise.all([D1(e.id,{authentication:a}),n1(a)]).then(([m,i])=>(t=m.item.created,n=m.item.modified,j7(m,i))).then(m=>(m.item.created=t,m.item.modified=n,m.item.typeKeywords=H1(m.item.typeKeywords,"doNotDelete"),m.groups=[],m.estimatedDeploymentCostFactor=2,m.resources=[],H(m,"properties")||(m.properties={}),m=r9(m),m))}function q0(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));if(e.assets&&e.resources&&delete e.assets,a.solutionItemExtent){let y=a.solutionItemExtent.split(",");a.organization.defaultExtentBBox=[[y[0],y[1]],[y[2],y[3]]]}let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,_7(e,a,m,l))).then(y=>{let o=y,r={assets:o.assets||[]};return L7(o,r,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(v7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function Y0(e,a,x,t,n,m,i){let l;return n1(i).then(d=>(l=d,D1(e,{authentication:i}))).then(d=>a6(d,x,m,l))}function X0(e){let a=!1;return(e==="Hub Page"||e==="Site Page")&&(a=!0),a}var g1={};W(g1,{convertItemToTemplate:()=>Q0,createItemFromTemplate:()=>e5,isASite:()=>x5,postProcess:()=>a5});function x6(e,a,x){let t=a.filter(n=>n.type.indexOf("Page")>-1).map(n=>n.id);return Promise.all(t.map(n=>D1(n,x))).then(n=>Q7(e,n,x))}function t6(e,a,x,t){let n=a.filter(d=>d.id!==e.item.id),m=n.map(d=>({item:{id:d.id,type:d.type}})),i=[];i=i.concat(X7(e,m,t)),i=i.concat(x6(e,n,t));let l=n.map(d=>d.id);return e.item.properties.children=l,e=$7(e,x,{}),i.push(V7(e,{...t,allowList:void 0})),Promise.all(i).then(()=>!0)}function Q0(e,a,x=null){let t=0,n=0,m,i,l;return n1(a).then(d=>(l=d,D9(e.id,l))).then(d=>(t=d.item.created,n=d.item.modified,m=d.item.title,i=d.data.values.title,Y7(d,l))).then(d=>(d.item.created=t,d.item.modified=n,d.item.title=m,d.item.typeKeywords=H1(d.item.typeKeywords,"doNotDelete"),d.data.values.title=i,d.groups=[],d.estimatedDeploymentCostFactor=2,d.resources=[],u(d,"properties")||(d.properties={}),d.dependencies=f1(d.dependencies),d=r9(d),d))}function e5(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));e.assets&&e.resources&&delete e.assets,a.solution||(a.solution={}),a.solution.title=a.title;let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,q7(e,a,m,l))).then(y=>{let o={assets:y.assets||[]};return J7(y,o,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(z7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function a5(e,a,x,t,n,m,i){let l;return n1(i,m).then(d=>(l=d,D9(e,l))).then(d=>t6(d,x,m,l)).then(()=>Promise.resolve(!0))}function x5(e){let a=!1;return(e==="Hub Site Application"||e==="Site Application")&&(a=!0),a}var E9={};W(E9,{convertItemToTemplate:()=>m5,createItemFromTemplate:()=>i5,isAStoryMap:()=>l5});function n6(e={}){let a=0;return Object.keys(e).reduce((x,t)=>(H(e,`${t}.type`)==="webmap"&&t!==`webmap${a}`&&(x.push({original:t,updated:`webmap${a}`}),a++),x),[])}function m6(e){let a=H(e,"data.resources")||{};return Object.keys(a).reduce((x,t)=>(H(a,`${t}.type`)==="webmap"&&x.push(H(a,`${t}.data.itemId`)),x),[])}function l6(e){let a=Y1(e.item.id,e.item.type);a.key=`${L1(e.item.title)}_${v1("i")}`;let x=z(e);a.data=x.data;let t=x.item.created,n=x.item.modified;return a.item=_1(x.item),a.item.created=t,a.item.modified=n,a.item.url="{{storyMapTemplateUrl}}",n6(a.data.resources).forEach(l=>{a.data.resources[l.updated]=z(a.data.resources[l.original]),delete a.data.resources[l.original],a.data.nodes=u1(a.data.nodes,l.original,l.updated)}),a.item.typeKeywords.indexOf(i6)!==-1&&(a.item.typeKeywords=[t5].concat(a.item.typeKeywords.filter(l=>l!==i6))),a.properties={},a.properties.draftFileName="draft_{{timestamp}}.json",Object.assign(a.properties,n5),a.dependencies=m6(e),Promise.resolve(a)}var i6="smstatusunpublishedchanges",t5="smstatuspublished",n5={oembed:{version:"1.0",type:"rich",title:"Example StoryMap",url:"{{storyMapTemplateUrl}}",provider_name:"ArcGIS StoryMaps",provider_url:"{{storyMapBaseUrl}}",width:800,height:600,thumbnail_url:"{{storyMapThumbnailUrl}}",thumbnail_height:"100.5",thumbnail_width:"400",html:'<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',cache_age:86400},oembedXML:`<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
|
2
|
+
import{a as S3,b as f3}from"./ZYCAAXQF.js";import{a as r3}from"./FVXS4LF5.js";import a from"./X5EABWHE.js";import{b as w2}from"./2B4SGB3I.js";import{b as k2}from"./YKQDHR27.js";import{$ as Y1,$a as E7,$b as Z9,A as M2,Aa as J2,Ab as p7,B as F2,Ba as $2,Bb as g7,C as E1,Ca as q2,Cb as h7,D as Z,Da as F9,E as R2,Ea as R9,Eb as T7,F as $1,Fa as Y2,G as I1,Ga as X2,Gb as Z7,H as A,Ha as w1,Hb as U7,I as I9,Ia as p9,Ib as W7,J as p2,Ja as Q2,Jb as O7,K as u,Ka as e7,Kb as n1,L as g2,La as a7,Lb as K7,Ma as x7,Mb as H7,N as c1,Na as t7,Nb as v7,O as D,Oa as n7,Ob as B7,P as C1,Pa as m7,Pb as L7,Q as h2,Qa as i7,Qb as j7,R as c9,Ra as l7,Rb as _7,S as C9,Sa as d7,Sb as V7,T as q1,Ta as y7,Tb as z7,U as J,Ua as o7,Ub as J7,V as T2,Va as u7,Vb as $7,W as Z2,Wa as r7,Wb as q7,X as U2,Xa as g9,Xb as Y7,Y as v,Ya as a9,Yb as X7,Z as W2,Za as S7,Zb as Q7,_ as j,_a as f7,_b as e3,a as K1,aa as O2,ab as t1,ac as t9,ba as G9,bb as k7,bc as U9,c as O,ca as x1,cb as w7,cc as M1,da as N,db as b7,dc as n9,e as e1,ea as c,eb as s7,ec as a3,f as P2,fa as X,fb as N7,fc as x3,g as d1,ga as X1,gb as A7,gc as t3,h as S,ha as K2,hb as P7,hc as n3,i as P9,ia as H2,ib as D7,ic as m3,j as u1,ja as M9,jb as I7,jc as i3,k as L1,ka as v2,kb as c7,kc as l3,l as S1,lb as G1,lc as F1,m as j1,ma as B2,mb as M,mc as m9,n as _1,na as L2,nb as x9,nc as i9,o as D9,oa as j2,oc as d3,p as I2,pa as _2,pc as l9,qa as V2,qb as C7,qc as y3,r as V1,ra as g,rb as G7,s as c2,sa as k1,sb as B,t as z1,ta as $,tb as M7,u as J1,ub as b1,v as a1,va as Q1,vb as q,w as C2,wa as e9,wb as F7,x as f1,xa as z2,xb as h9,y as G2,yb as R7,z as k,zb as T9}from"./J75MHJID.js";import{a as E2}from"./R67EKKSL.js";import{a as r1,g as D1}from"./ALSK2SPM.js";import{a as K}from"./ZCU2WWVN.js";import{a as z,b as H1,c as v1,d as B1}from"./KOIDWEP3.js";import{e as V,f as N2,j as U1,l as W1,o as A2,s as O1}from"./XQQ52NKX.js";import{a as b2,g as s2}from"./JUUVYK2H.js";import{a as D2}from"./4HFHJOS3.js";import{a as H}from"./45M33Q5G.js";import{b as f2}from"./KIUBUHVM.js";import{E as T1,F as Z1,G as r2,K as S2,h as u2,i as _,q as o1}from"./H5E6ISYP.js";import{c as W}from"./QPIMTXPL.js";export default $arcgis.t(([{g:o3,h:u3}])=>{function s1(e,a="application/octet-stream"){if(typeof Blob<"u"){let x=[];for(let n=0;n<e.length;n++)x[n]=e.charCodeAt(n);let t=new Uint8Array(x);return new Blob([t],{type:a})}else throw new Error("stringToBlob is not currently supported on Node")}function E3(e){if(typeof Blob<"u")return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")}var d9={};W(d9,{_mostRecentlyEditedLayer:()=>W9,convertItemToTemplate:()=>x0,createItemFromTemplate:()=>t0,postProcess:()=>n0});function x0(e,a,x,t){return new Promise((n,m)=>{let i=j(e);I7(e.groupDesignations)?a7(i,x).then(d=>n(d),d=>m(A(d))):(i.estimatedDeploymentCostFactor=10,$(i.item.id,x).then(d=>{i.data=d,A7(i,x).then(y=>{y.item.modified=Math.max(y.item.modified,W9(i.properties.layers),W9(i.properties.tables)),b7(y,x).then(o=>{y.dependencies=o.map(r=>r.id),n(Y2(y,o,!1,t))},o=>m(A(o)))},y=>m(A(y)))}))})}function t0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),delete m.item.thumbnail,$1(m,"properties.service.size");let i=X2(m.data);E7(m,x,a).then(l=>{l.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?(m=p9(m,a,l),n7(m,a,i,x).then(()=>{m=p9(m,a,l),b1({...m.item,url:void 0},m.data,x,e.item.thumbnail,void 0,a).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?g(m.itemId,x).then(d=>{m.item=d,u(m,"item.url")&&!m.item.url.endsWith("/")&&(m.item.url+="/"),n({item:m,id:l.serviceItemId,type:m.type,postProcess:x1({item:m.item,data:m.data})||g9(m)})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function n0(e,a,x,t,n,m,i){return new Promise((l,d)=>{q(e,m,i).then(y=>{g9(t)?(t=N(t,m),a9(t,i,t.item.url,m).then(l,d)):l(y)},d)})}function W9(e){let a=0;return e.forEach(x=>{a=x.editingInfo?.lastEditDate?Math.max(a,x.editingInfo.lastEditDate):a}),a}var f={};W(f,{convertItemToTemplate:()=>m0,createItemFromTemplate:()=>i0});function m0(e,a,x){return new Promise(t=>{let n=j(e);n.item.id=c(n.item.id,n.item.id,".itemId");let m=new Promise(l=>{k1(n.itemId,n.item.name,x).then(d=>{!d||d.size===0?l(null):l(d)})}),i=Promise.resolve({});Promise.all([m,i]).then(l=>{let[d]=l;if(d){let y=a3(d,n.item.name);n.properties[y.filename]=y.mimeType;let o=n9(n.itemId,y.blob.name,1,y.blob.name===y.filename?M1.data:M1.fakezip),r={itemId:n.itemId,file:y.blob,folder:o.folder,filename:o.filename};n.dataFile=r,n.resources.push(o.folder+"/"+o.filename),t(n)}else t(n)})})}function i0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),t1(m.item,m.data,x,a.folderId).then(i=>{t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,i.id)?(m.itemId=i.id,a[e.itemId]={itemId:i.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,i.id),n({item:m,id:i.id,type:m.type,postProcess:!1})):(t(e.itemId,S.Cancelled,0),M(i.id,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}var Q9={};W(Q9,{_getFormDataFilename:()=>Q3,_replaceFeatureServiceURLs:()=>V3,_replaceItemIds:()=>z3,_replacePortalBaseUrls:()=>J3,_replaceWorkflowManagerBaseUrls:()=>$3,_updateZipObjectTextContent:()=>q3,convertItemToTemplate:()=>B0,createItemFromTemplate:()=>L0,postProcess:()=>X3,postProcessFormItems:()=>_0,swizzleFormObject:()=>Y9,templatizeFormData:()=>X9});function b3(e,a){return l0(e,a)}function l0(e,a){return["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"].forEach(t=>{let n=u(e,t);Array.isArray(n)&&n.forEach(m=>{m.type==="mapWidget"&&(e.dependencies.indexOf(m.itemId)<0&&e.dependencies.push(m.itemId),m.itemId=c(m.itemId,m.itemId,".itemId")),Array.isArray(m.datasets)&&d0(m,e,a)})}),e}function d0(e,a,x){e.datasets.forEach(t=>{if(u(t,"dataSource.type")!=="arcadeDataSource"){let m=u(t,"dataSource.itemId");if(m){a.dependencies.indexOf(m)<0&&a.dependencies.push(m);let i=u(t,"dataSource.layerId");w1(i?.toString(),m,"",x),t.dataSource.itemId=c(m,m,".itemId")}}})}function s3(e,a){let x=["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"];return x.forEach(t=>{let n=u(e,t);y0(n,a)}),x.forEach(t=>{o0(e,t,a)}),e}function y0(e,a){e&&Array.isArray(e)&&e.forEach(x=>{Array.isArray(x.datasets)&&x.datasets.forEach(t=>{let n=c9(u(t,"dataSource.itemId"));if(n){let m=C9(u(t,"dataSource.layerId"));a.some(i=>i.itemId===n&&i.layerId===m?(w3(i,x.id),!0):!1)}else{let m=u(t,"dataSource.id");if(m){let i=m.split("#")[1];a.some(l=>l.ids.indexOf(i)>-1?(w3(l,x.id),!0):!1)}}})})}function o0(e,a,x){let t=u(e,a);t&&D(e,a,u0(t,x))}function u0(e,a){return Array.isArray(e)?e.map(x=>{let t=x;return Array.isArray(t.events)&&(t.events=t.events.map(n=>{let m=n;return Array.isArray(m.actions)&&(m.actions=m.actions.map(i=>{let l=i;if(l.fieldMap&&l.targetId&&l.targetId.indexOf("#")>-1){let d=k3(l,a);if(d){let y=u(d,"fields"),o=u(d,"basePath");Array.isArray(y)&&o&&(l.fieldMap=l.fieldMap.map(r=>{let E=r;return E.targetName=X(E.targetName,y,o),E}))}}return l})),m})),Array.isArray(t.datasets)&&(t.datasets=t.datasets.map(n=>{let m=n;if(m.type==="serviceDataset"){let i=k3(n,a);if(i){let l=u(i,"fields"),d=u(i,"basePath");Array.isArray(l)&&d&&(t=X(t,l,d),m=X(m,l,d))}}return m})),t}):e}function k3(e,a){let x,t=u(e,"dataSource.id")||u(e,"targetId");if(t){let n=t.split("#")[1];if(!a.some(m=>(x=m.ids.indexOf(n)>-1?m:x,m.ids.indexOf(n)>-1))){let m=t.split("#")[0];a.some(i=>{let d=(i.references||[]).indexOf(m)>-1;return x=d?i:x,d})}}else{let n=c9(u(e,"dataSource.itemId")),m=C9(u(e,"dataSource.layerId"));n&&a.some(i=>{let l=n===i.itemId&&m===i.layerId;return x=l?i:x,l})}return x}function w3(e,a){e.references=Array.isArray(e.references)?e.references:[],e.references.indexOf(a)<0&&e.references.push(a)}var N1={};W(N1,{convertItemToTemplate:()=>A0,convertNotebookToTemplate:()=>z9,createItemFromTemplate:()=>P0,deleteProps:()=>R3,fineTuneCreatedItem:()=>V9,postProcess:()=>I0,postProcessNotebookTemplates:()=>D0});function P3(e,a,x,t){return new Promise((n,m)=>{let i="";if(e.item.url){let l=e.item.url,d=l.indexOf("//");e.item.url=v(J)+l.substring(l.indexOf("/",d+2),l.lastIndexOf("=")+1)+e.item.id,i=l.replace(l.substring(l.indexOf("/",d+2)),"")}e.dependencies=f0(e),D(e,"data.folderId","{{folderId}}"),w0(e,["data.map.itemId","data.map.appProxy.mapItemId","data.values.webmap","data.values.group"]),I3(e,"data.appItemId",e.itemId),j9(e,["data.logo","data.map.portalUrl","data.portalUrl","data.httpProxy.url"],v(J)),D(e,"data.geometryService",v(T2)),r0(e,x,i,t).then(()=>{A3(e,x,i,"data.widgetPool.widgets").then(l=>{A3(l,x,i,"data.widgetOnScreen.widgets",!0).then(d=>{S0(d,x,i,"data.values").then(y=>{n(y)},y=>m(A(y)))},d=>m(A(d)))},l=>m(A(l)))},l=>m(A(l)))})}function r0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,"data.dataSource.dataSources");if(i&&Object.keys(i).length>0){let l=new Array;Object.keys(i).forEach(d=>{let y=i[d];D(y,"portalUrl",v(J));let o=u(y,"itemId");if(u(y,"url")){if(o){let E=y.url.substr(y.url.lastIndexOf("/")+1);w1(E.toString(),o,y.url,t),y.itemId=c(o,o,".layer"+E+".itemId")}let r=L9(y.url,x,[],[],a);l.push(new Promise((E,w)=>{B9(r.serviceRequests,r.requestUrls,r.testString).then(s=>{y.url=s,E()},s=>w(A(s)))}))}else o&&(y.itemId=c(o,o,".itemId"))}),Promise.all(l).then(()=>n(e),d=>m(A(d)))}else n(e)})}function A3(e,a,x,t,n=!1){return new Promise((m,i)=>{let l=u(e,t)||[],d=[],y=[];if(l.forEach(o=>{!n&&u(o,"icon")&&j9(o,["icon"],v(J));let r=o.config;if(r){let E=JSON.stringify(r),w=L9(E,x,y,d,a);o.config=JSON.parse(w.testString),d=w.serviceRequests,y=w.requestUrls}}),d.length>0){let o=JSON.stringify(l);B9(d,y,o).then(r=>{D(e,t,JSON.parse(r)),m(e)},r=>i(A(r)))}else m(e)})}function S0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,t),l=[],d=[];if(i){u(i,"icon")&&j9(i,["icon"],v(J));let y=JSON.stringify(i),o=L9(y,x,d,l,a);i=JSON.parse(o.testString),l=o.serviceRequests,d=o.requestUrls}if(l.length>0){let y=JSON.stringify(i);B9(l,d,y).then(o=>{D(e,t,JSON.parse(o)),n(e)},o=>m(A(o)))}else n(e)})}function B9(e,a,x){return new Promise((t,n)=>{if(e&&e.length>0){let m=0;Promise.all(e).then(i=>{i.forEach(l=>{if(u(l,"serviceItemId")){let d="{{"+l.serviceItemId+(l.hasOwnProperty("id")?".layer"+l.id:"")+".url}}";x=y9(x,a[m],d,!0)}m++}),t(x)},i=>n(A(i)))}else t(x)})}function L9(e,a,x,t,n){let m={f:"json",authentication:n},i=e.match(/(\bhttps?:\/\/[-A-Z0-9/._]*)/gim);return i&&i.length&&i.forEach(l=>{l.indexOf("NAServer")>-1?e=y9(e,l,v(U2)):l.indexOf("GeocodeServer")>-1?e=y9(e,l,v(Z2)):a&&l.indexOf(a)>-1?e=y9(e,a,v(J)):l.indexOf("FeatureServer")>-1&&x.indexOf(l)===-1&&(x.push(l),t.push(O(l,m)))}),{testString:e,requestUrls:x,serviceRequests:t}}function y9(e,a,x,t=!1){let n=t&&e.indexOf('"')>-1,m=new RegExp(n?'"'+a+'"':a,"gmi");return e.replace(m,n?'"'+x+'"':x)}function j9(e,a,x){a.forEach(t=>{let n=u(e,t);if(n){let m=n.substring(n.indexOf("/",n.indexOf("//")+2));D(e,t,m!==n?x+m:x)}})}function D3(e,a,x,t){return new Promise(n=>{if(C1(e,["WAB2D","WAB3D","Web AppBuilder"])){let m={id:a.itemId,url:a.item.url,data:a.data},i=B(m,t),l={tags:e.item.tags,title:e.item.title,type:"Code Attachment",typeKeywords:["Code","Javascript","Web Mapping Application"],relationshipType:"WMA2Code",originItemId:a.itemId,url:J1(N(v(J),x))+"sharing/rest/content/items/"+a.itemId+"/package"},d=t1(l,{},t,x.folderId);Promise.all([i,d]).then(()=>n(null),()=>n(null))}else n(null)})}function f0(e){let a=E0;return C1(e,["WAB2D","WAB3D","Web AppBuilder"])&&(a=k0),a(e)}function E0(e){return g2(e,["data.values.webmap","data.values.group"])}function k0(e){let a=[],x=u(e,"data.map.itemId");x&&a.push(x);let t=u(e,"data.dataSource.dataSources");return t&&Object.keys(t).forEach(n=>{let m=t[n];m.itemId&&a.push(m.itemId)}),a}function w0(e,a){a.forEach(x=>{let t=u(e,x);I3(e,x,t)})}function I3(e,a,x){D(e,a,c(x,x,".itemId"))}function c3(e,a){let x=u(e,"data.dataSource.dataSources");x&&Object.keys(x).length>0&&(Object.keys(x).forEach(m=>{let i=x[m];x[m]=H9(i,a)}),D(e,"data.dataSource.dataSources",x)),["data.widgetPool.widgets","data.widgetOnScreen.widgets"].forEach(m=>{let i=u(e,m);i&&D(e,m,b0(i,a))});let n=u(e,"data.values");return n&&D(e,"data.values",H9(n,a)),e}function H9(e,a,x=!1){return e=N0(e,a,x),s0(e,a).forEach(n=>{e=X(e,n.fields,n.basePath,x)}),e}function b0(e,a){let x=["SmartEditor","Screening"];return e.map(t=>{if(t.config){let n=x.indexOf(t.name)>-1;t.config=H9(t.config,a,n)}return t})}function s0(e,a){let x=JSON.stringify(e);return a.filter(n=>K9(n,x)<4).sort((n,m)=>K9(n,x)-K9(m,x))}function K9(e,a){let x=e.url,t=e.itemId,n=e.layerId,m;return x&&!isNaN(n)&&(m=new RegExp(x.replace(/[.]/,".layer"+n+"."),"gm")),m&&m.test(a)||e.ids.length>0&&e.ids.some(i=>new RegExp(i,"gm").test(a))?1:x&&new RegExp(x,"gm").test(a)?2:t&&new RegExp(t,"gm").test(a)?3:4}function N0(e,a,x){let t=JSON.stringify(e),n=a.filter(m=>{let i;m.url&&!isNaN(m.layerId)&&(i=new RegExp(m.url.replace(/[.]/,".layer"+m.layerId+"."),"gm"));let l=!1;if(m.ids.length>0&&(l=m.ids.some(d=>new RegExp(d,"gm").test(t))),l||i&&i.test(t))return m});return n.length>0&&n.forEach(m=>{e=v9(e,m,x),m.ids.length>0&&m.ids.forEach(i=>{e=o9(e,m,i,x)})}),e}function v9(e,a,x){let t={},n=a.url,m=a.layerId,i;if(n&&!isNaN(m)&&(i=new RegExp(n.replace(/[.]/,".layer"+m+"."),"gm")),Array.isArray(e))t=e.map(l=>v9(l,a,x));else if(typeof e=="object")for(let l in e)e[l]!=null&&typeof e[l]=="object"?t[l]=v9(e[l],a,x):(i&&i.test(e[l])&&(e=X(e,a.fields,a.basePath,x)),t[l]=e[l]);else t=e;return t}function o9(e,a,x,t){let n={},m=new RegExp(x,"gm");if(Array.isArray(e))n=e.map(i=>o9(i,a,x,t));else if(typeof e=="object")for(let i in e)if(e[i]!==null){let l;try{l=JSON.parse(e[i])}catch{l=void 0}l&&typeof l=="object"?n[i]=JSON.stringify(o9(l,a,x,t)):typeof e[i]=="object"?(m.test(i)&&t&&(e[i]=X(e[i],a.fields,a.basePath,t)),n[i]=o9(e[i],a,x,t)):(m.test(e[i])&&(e=X(e,a.fields,a.basePath,t)),n[i]=e[i])}else n[i]=e[i];else n=e;return n}function C3(e,a,x,t){return r7(e,x,t)}function G3(e,a,x){return a9(e,a,"",x)}function Y(e,a,x,t,n){return new Promise((m,i)=>{function l(){n&&n.signal.aborted&&i(new Error("Operation was cancelled"))}if(l(),!t(e.itemId,S.Started,0))t(e.itemId,S.Ignored,0),m(k(e.type));else{let d=Z(e);d=N(d,a);let y;e.type==="Web Mapping Application"&&e.data?d=JSON.parse(N(JSON.stringify(d),a)):e.type==="QuickCapture Project"&&e.data&&(y=JSON.stringify(d.data.application),delete d.data),e.item.thumbnail&&(d.item.thumbnail=e.item.thumbnail),t1(d.item,d.data,x,a.folderId).then(o=>{if(l(),!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,o.id))t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type)));else{a[e.itemId]={itemId:o.id,itemUrl:a.portalBaseUrl+"/sharing/rest/content/items/"+o.id},d.itemId=o.id,d.type==="Web Mapping Application"&&e.data&&D(d,"data.appItemId",o.id);let r=x1(d.data),E=d.item.url;d=N(d,a),l();let w=Promise.resolve([]);if(d.relatedItems){let P=N(X1(d.relatedItems),a);w=S7(d.itemId,P,x)}l();let s;if(e.type==="Web Mapping Application"&&e.data&&C1(e,["WAB2D","WAB3D","Web AppBuilder"]))s=D3(e,d,a,x);else if(e.type==="Workforce Project")s=G3(d,x,a);else if(e.type==="QuickCapture Project"){if(y){let P=E1(N(JSON.parse(y),a),"qc.project.json");s=l3(P,d.itemId,"",P.name,x)}}else e.type==="Notebook"?s=V9(e,d,a,x):E!==d.item.url?(l(),s=new Promise((P,b)=>{F7(o.id,d.item.url,x).then(()=>P(),b)})):s=Promise.resolve(null);l(),Promise.all([w,s]).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,o.id)?m({item:d,id:o.id,type:d.type,postProcess:r}):(t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type))))},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}})}function A0(e,a,x,t){return Q(e,a,x,t)}function P0(e,a,x,t){return Y(e,a,x,t)}function z9(e){return new Promise(a=>{R3(e.data),a(e)})}function D0(e,a){if(e.some(t=>t.type==="Notebook")){let t=Object.keys(a).filter(m=>m.indexOf("FeatureServer")>-1).sort().reverse(),n=e.reduce((m,i)=>(m=[...new Set([...m,...i.dependencies,i.itemId])],m),[]);e=e.map(m=>{if(m.type==="Notebook"){let i=m.data&&JSON.stringify(m.data);return n.forEach(l=>{new RegExp(l,"gim").test(i)&&(i=i.replace(l,"{{"+l+".itemId}}"),m.dependencies.indexOf(l)<0&&m.dependencies.push(l))}),t.forEach(l=>{let d=new RegExp(l,"gim");if(d.test(i)){let y=a[l];i=i.replace(d,y);let o=/[0-9A-F]{32}/gim,r=y.match(o)[0];m.dependencies.indexOf(r)<0&&m.dependencies.push(r)}}),m.data=JSON.parse(i),m}})}return e}function R3(e){if(e){let a=["metadata.interpreter","metadata.papermill"];I1(e,a),(e.cells||[]).forEach(x=>{I1(x,a)})}}function V9(e,a,x,t){return new Promise((n,m)=>{let i={id:a.itemId,url:a.item.url,data:E1(a.data,a.itemId+".ipynb")};B(i,t).then(()=>n(null),m)})}function I0(e,a,x,t,n,m,i){return q(e,m,i)}function g3(e,a,x){return new Promise((t,n)=>{c0(e,x).then(m=>{e.dependencies=m.dependencies,e.data?.properties&&(e.data.properties.ServiceURL=p3(e.data.properties.ServiceURL,m.urlHash),e.data.properties.OverviewURL=p3(e.data.properties.OverviewURL,m.urlHash)),t(e)},m=>n(A(m)))})}function c0(e,a){return new Promise((x,t)=>{let n=[];if(e.data?.properties){let m=[];e.data.properties.ServiceURL&&m.push(e.data.properties.ServiceURL),e.data.properties.OverviewURL&&e.data.properties.OverviewURL!==e.data.properties.ServiceURL&&m.push(e.data.properties.OverviewURL),C0(m,n,a).then(i=>{x(i)},i=>t(A(i)))}else x({dependencies:n,urlHash:{}})})}function C0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o){let r=/.+FeatureServer/g.exec(o),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E]]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function p3(e,a){let x=e;if(e){let t=a[e];if(t){let n=e.substr(e.lastIndexOf("/")+1);x=c(t,t,".layer"+n+".url")}x=X1(x.replace(/.+?(?=\/home)/,"{{portalBaseUrl}}"))}return x}var R1={};W(R1,{_templatizeAdminEmail:()=>Z3,_templatizeApplication:()=>T3,_templatizeId:()=>J9,_templatizeUrl:()=>W3,_updateDependencies:()=>U3,convertItemToTemplate:()=>M0,convertQuickCaptureToTemplate:()=>$9,createItemFromTemplate:()=>F0});function M0(e,a,x,t){return Q(e,a,x,t)}function $9(e){return D(e,"data.application",T3(e.data.application,e)),e}function T3(e,a){J9(e,"itemId"),Z3(e);let x=e?.dataSources;return x&&Array.isArray(x)&&x.forEach(t=>{let n=t.featureServiceItemId;n&&(U3(n,a),W3(t,"featureServiceItemId","url"),J9(t,"featureServiceItemId"))}),e}function Z3(e){u(e,"preferences.adminEmail")&&D(e,"preferences.adminEmail","{{user.email}}")}function U3(e,a){a.dependencies.indexOf(e)===-1&&a.dependencies.push(e)}function W3(e,a,x){let t=u(e,a),n=u(e,x);if(n){let m=n.substr(n.lastIndexOf("/")+1);D(e,x,c(t,t,".layer"+m+".url"))}}function J9(e,a){let x=u(e,a);x&&D(e,a,c(x,x,".itemId"))}function F0(e,a,x,t){return Y(e,a,x,t)}var R0="home/webmap/viewer.html?webmap=";function O3(e,a,x,t){return new Promise((n,m)=>{e.type!=="Vector Tile Service"&&(e.item.url=e.item.url?J1(v(J))+R0+e.item.id:e.item.url),p0(e,x).then(i=>{e.dependencies=i.dependencies,e.data&&(e.data.baseMap?.baseMapLayers&&q9(e.data.baseMap.baseMapLayers,i.urlHash,t),e.data.operationalLayers&&q9(e.data.operationalLayers,i.urlHash,t),q9(e.data.tables,i.urlHash,t),g0(e.data)),n(e)},i=>m(A(i)))})}function p0(e,a){return new Promise((x,t)=>{let n=[];if(e.data){let m=e.data.baseMap?.baseMapLayers||[],i=e.data.operationalLayers||[],l=e.data.tables||[],d=m.concat(i).concat(l);h0(d,n,a).then(y=>{x(y)},y=>t(A(y)))}else x({dependencies:n,urlHash:{}})})}function g0(e){$1(e,"initialState")}function h0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o.itemId&&o.layerType==="VectorTileLayer")return l.push(g(o.itemId,x)),!0;if(o.url&&o.url.indexOf("{{velocityUrl}}")<0){let r=/.+FeatureServer/g.exec(o.url),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o.url,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(y[E].layerType==="VectorTileLayer"){let w=u(r,"typeKeywords");if(w&&w.includes("Vector Tile Style Editor")){a.indexOf(r.id)<0&&a.push(r.id),y[E].templatizeId=!0;let s=y[E].styleUrl.indexOf(r.id)+r.id.length;y[E].styleUrl=c(y[E].styleUrl.replace(y[E].styleUrl.substring(0,s),r.id),r.id,".itemUrl")}}else if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E].url]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function q9(e=[],a,x){e.forEach(t=>{if(t.itemId&&t.layerType==="VectorTileLayer")t.templatizeId&&(t.itemId=c(t.itemId,t.itemId,".itemId"),delete t.templatizeId);else if(t.url){let n=t.url.substr(t.url.lastIndexOf("/")+1),m=Object.keys(a).indexOf(t.url)>-1?a[t.url]:void 0;m&&(w1(n,m,t.url,x),t.url=c(m,m,".layer"+n+".url"),t.itemId=c(m,m,".layer"+n+".itemId"))}})}function K3(e,a){return["data.operationalLayers","data.tables","data.applicationProperties.viewing.search.layers"].forEach(t=>T0(e,a,t)),e}function T0(e,a,x){let t=u(e,x);t&&D(e,x,Z0(t,a))}function Z0(e,a){return e.forEach(x=>{let t=U0(x,a);if(t){let n=t.fields.map(i=>i.name);l7(x,t,t.basePath,t.itemId,n),y7(x,t.basePath,n),x.layerDefinition&&(u7(x.layerDefinition,t.basePath,n),o7(x.layerDefinition,t.basePath,n));let m=u(x,"field.name");m&&D(x,"field.name",d7(m,x,t.itemId,t.basePath))}}),e}function U0(e,a){let x;return a.some(t=>t.ids.indexOf(e.id)>-1?(x=t,!0):!1),x}function Q(e,a,x,t){return new Promise((n,m)=>{let i=j(e);i.item.id=c(i.item.id,i.item.id,".itemId");let l=Q1(i.itemId,"forward",x),d=Promise.resolve({}),y=Promise.resolve([]);switch(e.type){case"Dashboard":case"Data Pipeline":case"Feature Collection":case"Feature Service":case"Hub Initiative":case"Hub Page":case"Hub Site Application":case"Insights Model":case"Oriented Imagery Catalog":case"Project Package":case"Style":case"Workforce Project":case"Web Map":case"Web Mapping Application":case"Web Scene":case"Notebook":d=new Promise(o=>{$(i.itemId,x).then(r=>o(r))});break;case"Form":d=k1(i.itemId,i.item.name,x);break;case"QuickCapture Project":y=e9(i.itemId,x);break}Promise.all([d,l,y]).then(o=>{let[r,E,w]=o;y3(i,t),i.data=l9(r,e.type,t);let s=E;i.dependencies=[],i.relatedItems=[],s.forEach(b=>{b.relationshipType!=="WMA2Code"&&(i.relatedItems.push(b),b.relatedItemIds.forEach(C=>{i.dependencies.indexOf(C)<0&&i.dependencies.push(C)}))}),e.type==="Data Pipeline"&&(i.dependencies=i.dependencies.concat(W0(r)));let P=Promise.resolve(i);switch(e.type){case"Dashboard":b3(i,t);break;case"Notebook":P=z9(i);break;case"Oriented Imagery Catalog":P=g3(i,a,x);break;case"QuickCapture Project":i.resources=w,P=new Promise(async b=>{let C=null,I=-1;w&&(w.some((y1,m1)=>{let i1=y1.name==="qc.project.json";return i1&&(C=y1,I=m1),i1}),I>=0&&w.splice(I,1)),C&&(i.data={application:{...await z1(C)},name:"qc.project.json"}),i.data.application?.basemap?.type==="Web Map"&&i.dependencies.push(i.data.application.basemap.itemId);let L=$9(i);b(L)});break;case"Vector Tile Service":case"Web Map":case"Web Scene":P=O3(i,a,x,t);break;case"Web Mapping Application":r&&(P=P3(i,a,x,t));break;case"Workforce Project":P=C3(i,a,x,t);break}P.then(n,b=>m(A(b)))})})}function W0(e){let a=[];return(e?.inputs??[]).concat(e?.outputs??[]).forEach(t=>{if(t.type==="FeatureServiceSource"||t.type==="FeatureServiceSink"){let n=u(t,"parameters.layer.value.itemId");n&&a.push(n)}}),a}var R={};W(R,{convertItemToTemplate:()=>O0,createItemFromTemplate:()=>K0,postProcess:()=>v0,postProcessFieldReferences:()=>H0});function O0(e,a,x,t){return Q(e,a,x,t)}function K0(e,a,x,t,n){return n?Y(e,a,x,t,n):Y(e,a,x,t)}function H0(e,a,x){switch(x){case"Web Mapping Application":c3(e,a);break;case"Dashboard":s3(e,a);break;case"Web Map":K3(e,a);break}return e}async function v0(e,a,x,t,n,m,i){if(a==="Web Map"&&t.resources.some(l=>l.indexOf(d1)>-1)){let l=t3(`${m.portalBaseUrl}/sharing/rest`,t.itemId,d1),d={httpMethod:"GET",authentication:i,params:{f:"json"},headers:{Accept:"application/json",Authorization:`Bearer ${i.token}`,"Content-Type":"application/json","X-Esri-Authorization":`Bearer ${i.token}`}};await O(l,d).then(async y=>{let o=JSON.stringify(y),r=N(o,m);if(o!==r){let E=JSON.parse(r),w={id:e,resource:E1(E,d1),name:d1,authentication:i,params:{}};await P2(w)}})}return q(e,m,i)}function B0(e,a,x,t){return R.convertItemToTemplate(e,a,x,t)}function u9(e){return!!u(e,"properties.services")}function B3(e,a="https://survey123.arcgis.com"){let x=`${a}/api/survey/create`,t={credentials:"same-origin",method:"POST",body:b2({f:"json",...e},!0)};return fetch(x,t).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(`Failed to create survey: ${n.error.message}`);return{formId:n.id,featureServiceId:n.featureService.source.itemId,folderId:n.formItemInfo.ownerFolder}})}var L3=function(a){let x=Z(a),t=[["header","content"],["subHeader","content"],["footer","content"],["settings","thankYouScreenContent"]],n=(i,l)=>(i&&i[l]&&(i[l]=encodeURIComponent(i[l])),i);t.forEach(([i,l])=>n(x[i],l));let m=i=>n(i,"description");return x.questions=(x.questions||[]).map(i=>i.questions?{...i,questions:i.questions.map(m)}:m(i)),x};function j3(e,a,x){let{item:{title:t,description:n,tags:m,typeKeywords:i},properties:{form:l}}=e,{user:{username:d},portalBaseUrl:y,organization:{basemapGalleryGroupQuery:o,defaultBasemap:{title:r}}}=a,{token:E}=x.toCredential();return J2(o,r,x).then(w=>{let s="Survey-",P=h2(`${s}${t}`,a,"user.folders").replace(s,"");if(l.questions){let C=I=>(I.maps&&(I.maps=I.maps.map(L=>({...L,itemId:w.id}))),I);l.questions=l.questions.map(I=>I.questions?{...I,questions:I.questions.map(C)}:C(I))}let b=L3(l);return{description:n,form:b,portalUrl:y,tags:m,title:P,token:E,typeKeywords:i,username:d}})}function _3(e,a,x,t){let n=N(e,a),{survey123Url:m}=a;return j3(n,a,x).then(i=>B3(i,m)).then(i=>{let{formId:l,featureServiceId:d}=i,y=Promise.resolve(null);return e.item.thumbnail&&(y=b1({id:l},null,x,e.item.thumbnail)),y.then(()=>g(l,x)).then(o=>(a[n.itemId]={itemId:l},a[n.properties.info.serviceInfo.itemId]={itemId:d},t(n.itemId,S.Finished,n.estimatedDeploymentCostFactor,l),{item:{...e,item:o,itemId:l},id:l,type:"Form",postProcess:!0}))}).catch(i=>{throw t(n.itemId,S.Failed,0),i})}function L0(e,a,x,t){return u9(e)?_3(e,a,x,t):R.createItemFromTemplate(e,a,x,t)}async function Y9(e,a){let x=await T9(e),t=new Date;return t=new Date(t.valueOf()-864e5-t.getTimezoneOffset()*1e3*60),x.forEach(n=>{if(typeof n.content=="string"){let m=q3(n,a);e.file(n.file,m,{date:t})}else n.file.endsWith(".xlsx")&&e.file(n.file,n.content,{date:t})}),Promise.resolve(e)}async function X9(e,a){return(await T9(e)).forEach(t=>{if(t.file.endsWith(".info")||t.file.endsWith(".itemInfo")||t.file.endsWith(".json")||t.file.endsWith(".webform")||t.file.endsWith(".xml")){let n=t.content,m=/\b([0-9A-Fa-f]){32}_type/g;n=z3(n,a,m),n=V3(n,a,m),n=J3(n,a),n=$3(n,a),e.file(t.file,n)}}),Promise.resolve(e)}function V3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type==="Feature Service").forEach(m=>{let i=a[m].url,l=a[i];l&&(t=t.replace(new RegExp(i,"g"),l))}),t}function z3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type!=="Feature Service").map(m=>m.replace("_type","")).forEach(m=>{t=t.replace(new RegExp(m,"g"),`{{${m}.itemId}}`)}),t}function J3(e,a){let x=e;return a.portalBaseUrl&&(x=x.replace(new RegExp(a.portalBaseUrl,"g"),"{{portalBaseUrl}}")),x}function $3(e,a){let x=e;return a.workflowBaseUrl&&(x=x.replace(new RegExp(a.workflowBaseUrl,"g"),"{{workflowBaseUrl}}")),x}function q3(e,a){let x=M2(),t=e.content;return t=N(e.content,a),f1(t.match(x)??[]).forEach(m=>{let i=a[m];typeof i?.itemId=="string"&&(t=t.replace(new RegExp(m,"g"),`${i.itemId}`))}),t}function Y3(e,a,x,t,n,m,i){let l=t.properties.info.serviceInfo.itemId,{itemId:d}=m[l],y=N(t,m);return g(d,i).then(o=>{let r=[{id:e,title:y.item.title,snippet:y.item.snippet,extent:y.item.extent,culture:y.item.culture},{id:d,extent:y.item.extent,typeKeywords:[`source-${l}`].concat(o.typeKeywords)}],E=s=>B(s,i),w=r.map(E);return Promise.all(w).then(()=>{let s=[e,d],P=C=>V({itemId:C,folderId:m.folderId,authentication:i}),b=s.map(P);return Promise.all(b)}).then(()=>c7(o.ownerFolder,i)).then(()=>{let s=j(o);return n.push(s),t.dependencies.push(o.id),!0})})}async function X3(e,a,x,t,n,m,i){let l=await k1(e,"Form",i);if(l){let d=await h9(l),y=await Y9(d,m);t9(y,e,i)}else return await G2(5e3),X3(e,a,x,t,n,m,i);return u9(t)?Y3(e,a,x,t,n,m,i):q(e,m,i)}async function _0(e,a){for(let x of e)if(x.type==="Form"){let t=x.data;if(x.data=null,t){let n=await h9(t);n=await X9(n,a),x.item.name=Q3(x.item.name,t.name,`${x.itemId}.zip`);let m=await p7(n,x.item.name),i=n9(x.itemId,x.item.name,1,M1.data),l={itemId:x.itemId,file:m,folder:i.folder,filename:x.item.name};x.dataFile=l,x.resources.push(i.folder+"/"+i.filename)}}return Promise.resolve(e)}function Q3(e,a,x){let t=e||a;return t&&t!=="undefined"?t:x}var e2={};W(e2,{_initializeNewGroup:()=>e6,convertItemToTemplate:()=>V0,createItemFromTemplate:()=>z0,postProcess:()=>J0});function V0(e,a,x){return new Promise(t=>{let n=W2(e);n.item.id=c(n.item.id,n.item.id,".itemId"),V2(e.id,x).then(m=>{n.type="Group",_2(e.id,x).then(i=>{i.id=n.item.id,n.item={...i,type:"Group"},n.dependencies=m.concat(p2(i.tags)),t(n)},()=>t(n))},()=>t(n))})}function z0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),m.item.thumbnail=e.item.thumbnail;let i=e6(m.item);w7(i.title,i,a,x,R9(m)?a.locationTracking.owner:void 0).then(l=>{if(l.success)if(!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(m.itemId=l.group.id,a[e.itemId]={itemId:l.group.id},m=N(m,a),a[e.itemId].itemId=l.group.id,!t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(R9(m)){let d=a.locationTracking.owner;C7(l.group.id,d,x).then(y=>{y.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?G7(l.group.id,[x.username],x).then(o=>{Array.isArray(o.notRemoved)&&o.notRemoved.length===0?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)}):(t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),G1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))})}else n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)});else t(e.itemId,S.Failed,0),n(k(e.type))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function J0(e,a,x,t,n,m,i){let l=Promise.resolve({success:!0});return x.some(d=>{if(d.id===e){let y=d.item.item;return x1(y)&&(y=N(y,m),l=M7(y,i)),!0}}),l}function e6(e){let a={access:"private",description:e.description,owner:e.owner,snippet:e.snippet,tags:e.tags,thumbnail:e.thumbnail,title:e.title||"",typeKeywords:e.typeKeywords};return["autoJoin","displaySettings","isInvitationOnly","isOpenData","isViewOnly","membershipAccess","properties","sortField","sortOrder"].forEach(t=>{e.hasOwnProperty(t)&&(a[t]=e[t])}),a}var p1={};W(p1,{convertItemToTemplate:()=>$0,createItemFromTemplate:()=>q0,isAPage:()=>X0,postProcess:()=>Y0});function a6(e,a,x,t){return e=S1(e,x,{}),B7(e,{...t,allowList:[]}).then(()=>!0)}function r9(e){let a=z(e);return(e.dependencies||[]).forEach(t=>{let n=new RegExp(t,"g"),m=`{{${t}.itemId}}`;a.item=u1(a.item,n,m),a.data=u1(a.data,n,m),e.properties&&(a.properties=u1(a.properties,n,m))}),a}function S9(e,a,x){let t=K(V,{success:!0}),n=[t({itemId:e.item.id,folderId:a,authentication:x})];return H(e,"item.properties.parentInitiativeId")&&n.push(t({itemId:e.item.properties.parentInitiativeId,folderId:a,authentication:x})),Promise.all(n)}function $0(e,a,x=null){let t=0,n=0;return Promise.all([D1(e.id,{authentication:a}),n1(a)]).then(([m,i])=>(t=m.item.created,n=m.item.modified,j7(m,i))).then(m=>(m.item.created=t,m.item.modified=n,m.item.typeKeywords=H1(m.item.typeKeywords,"doNotDelete"),m.groups=[],m.estimatedDeploymentCostFactor=2,m.resources=[],H(m,"properties")||(m.properties={}),m=r9(m),m))}function q0(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));if(e.assets&&e.resources&&delete e.assets,a.solutionItemExtent){let y=a.solutionItemExtent.split(",");a.organization.defaultExtentBBox=[[y[0],y[1]],[y[2],y[3]]]}let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,_7(e,a,m,l))).then(y=>{let o=y,r={assets:o.assets||[]};return L7(o,r,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(v7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function Y0(e,a,x,t,n,m,i){let l;return n1(i).then(d=>(l=d,D1(e,{authentication:i}))).then(d=>a6(d,x,m,l))}function X0(e){let a=!1;return(e==="Hub Page"||e==="Site Page")&&(a=!0),a}var g1={};W(g1,{convertItemToTemplate:()=>Q0,createItemFromTemplate:()=>e5,isASite:()=>x5,postProcess:()=>a5});function x6(e,a,x){let t=a.filter(n=>n.type.indexOf("Page")>-1).map(n=>n.id);return Promise.all(t.map(n=>D1(n,x))).then(n=>Q7(e,n,x))}function t6(e,a,x,t){let n=a.filter(d=>d.id!==e.item.id),m=n.map(d=>({item:{id:d.id,type:d.type}})),i=[];i=i.concat(X7(e,m,t)),i=i.concat(x6(e,n,t));let l=n.map(d=>d.id);return e.item.properties.children=l,e=$7(e,x,{}),i.push(V7(e,{...t,allowList:void 0})),Promise.all(i).then(()=>!0)}function Q0(e,a,x=null){let t=0,n=0,m,i,l;return n1(a).then(d=>(l=d,D9(e.id,l))).then(d=>(t=d.item.created,n=d.item.modified,m=d.item.title,i=d.data.values.title,Y7(d,l))).then(d=>(d.item.created=t,d.item.modified=n,d.item.title=m,d.item.typeKeywords=H1(d.item.typeKeywords,"doNotDelete"),d.data.values.title=i,d.groups=[],d.estimatedDeploymentCostFactor=2,d.resources=[],u(d,"properties")||(d.properties={}),d.dependencies=f1(d.dependencies),d=r9(d),d))}function e5(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));e.assets&&e.resources&&delete e.assets,a.solution||(a.solution={}),a.solution.title=a.title;let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,q7(e,a,m,l))).then(y=>{let o={assets:y.assets||[]};return J7(y,o,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(z7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function a5(e,a,x,t,n,m,i){let l;return n1(i,m).then(d=>(l=d,D9(e,l))).then(d=>t6(d,x,m,l)).then(()=>Promise.resolve(!0))}function x5(e){let a=!1;return(e==="Hub Site Application"||e==="Site Application")&&(a=!0),a}var E9={};W(E9,{convertItemToTemplate:()=>m5,createItemFromTemplate:()=>i5,isAStoryMap:()=>l5});function n6(e={}){let a=0;return Object.keys(e).reduce((x,t)=>(H(e,`${t}.type`)==="webmap"&&t!==`webmap${a}`&&(x.push({original:t,updated:`webmap${a}`}),a++),x),[])}function m6(e){let a=H(e,"data.resources")||{};return Object.keys(a).reduce((x,t)=>(H(a,`${t}.type`)==="webmap"&&x.push(H(a,`${t}.data.itemId`)),x),[])}function l6(e){let a=Y1(e.item.id,e.item.type);a.key=`${L1(e.item.title)}_${v1("i")}`;let x=z(e);a.data=x.data;let t=x.item.created,n=x.item.modified;return a.item=_1(x.item),a.item.created=t,a.item.modified=n,a.item.url="{{storyMapTemplateUrl}}",n6(a.data.resources).forEach(l=>{a.data.resources[l.updated]=z(a.data.resources[l.original]),delete a.data.resources[l.original],a.data.nodes=u1(a.data.nodes,l.original,l.updated)}),a.item.typeKeywords.indexOf(i6)!==-1&&(a.item.typeKeywords=[t5].concat(a.item.typeKeywords.filter(l=>l!==i6))),a.properties={},a.properties.draftFileName="draft_{{timestamp}}.json",Object.assign(a.properties,n5),a.dependencies=m6(e),Promise.resolve(a)}var i6="smstatusunpublishedchanges",t5="smstatuspublished",n5={oembed:{version:"1.0",type:"rich",title:"Example StoryMap",url:"{{storyMapTemplateUrl}}",provider_name:"ArcGIS StoryMaps",provider_url:"{{storyMapBaseUrl}}",width:800,height:600,thumbnail_url:"{{storyMapThumbnailUrl}}",thumbnail_height:"100.5",thumbnail_width:"400",html:'<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',cache_age:86400},oembedXML:`<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
|
3
3
|
<oembed>
|
|
4
4
|
<version>1.0</version>
|
|
5
5
|
<type>rich</type>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
function u(){return{renderer:{type:"simple",symbol:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-12.600000000000001},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:7.2,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[242,242,242,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:360},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-9},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:18,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[39,17,17,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:360}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:360}}}}}function m(){return{renderer:{type:"simple",symbol:{type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],size:10,angle:0,xoffset:0,yoffset:0,outline:{color:[0,0,0,255],width:0}}}}}var _=class a{constructor(e){this.llm_fs_lookup={},this.structure=e,this._s=this.structure?.buildSolution}static{this.TYPE_LOOKUP={point:"esriGeometryPoint",polyline:"esriGeometryPolyline",polygon:"esriGeometryPolygon"}}static{this.DRAWING_TOOL_LOOKUP={esriGeometryPoint:"esriFeatureEditToolPoint",esriGeometryPolyline:"esriFeatureEditToolLine",esriGeometryPolygon:"esriFeatureEditToolPolygon",Table:"esriFeatureEditToolNone"}}static{this.FIELD_TYPE_TO_ESRI={string:"esriFieldTypeString",integer:"esriFieldTypeInteger",double:"esriFieldTypeDouble",date:"esriFieldTypeDate",guid:"esriFieldTypeGUID",globalid:"esriFieldTypeGlobalID",oid:"esriFieldTypeOID"}}static{this.FIELD_TYPE_TO_SIMPLE=Object.fromEntries(Object.entries(a.FIELD_TYPE_TO_ESRI).map(([e,t])=>[t,e]))}dump_to_llm_template(){let e=this.structure?.buildSolution?.solution,t=Object.entries(e?.strings||{}).map(([s,r])=>({key:s,value:r.value,description:r.description})),i={title:e?.title,description:e?.description,tags:e?.tags,strings:t},o=this.structure?.buildSolution?.items,l=Object.entries(o||{}).map(([s,r])=>({id:s,title:r.title,description:r.description,type:r.type})),n=null;for(let[s,r]of Object.entries(o||{})){if(r.type!=="Feature Layer (hosted)")continue;let d=[];for(let p of r.service?.layers||[]){let c=this._get_fields(p);d.push({id:p.id,type:"",name:p.name,customFields:[],requiredFields:c,systemFields:[]})}for(let p of r.service?.tables||[]){let c=this._get_fields(p);d.push({id:p.id,type:"Table",name:p.name,customFields:[],requiredFields:c,systemFields:[]})}n={itemId:s,addLayers:r.addLayers,layers:d};break}return{solution:i,items:l,featureLayer:n??{itemId:"",addLayers:!1,layers:[]}}}_get_fields(e){let t=[];for(let i of e.fields||[])t.push({name:i.name,type:a.FIELD_TYPE_TO_SIMPLE[i.type]||i.type,alias:i.alias,description:a._get_field_description(i.description),choiceList:a._get_field_domain(i.domain),length:i.length});return t}static _get_field_description(e){if(e)try{return JSON.parse(e).value||e}catch{return e}}static _get_field_domain(e){if(e)return e.codedValues?.map(t=>t.code)}apply_llm_template(e){let t=this._s.solution;if(this.llm_fs_lookup={},e.featureLayer?.itemId){this.llm_fs_lookup[e.featureLayer.itemId]={};for(let s of e.featureLayer.layers)this.llm_fs_lookup[e.featureLayer.itemId][s.id]=s}for(let[s,r]of Object.entries(this._s.items))r.type==="Feature Layer (hosted, view)"&&(this.llm_fs_lookup[s]={...this.llm_fs_lookup[r.source]});t.title=e.solution.title,t.description=e.solution.description,t.tags=e.solution.tags;let i=t.strings;for(let s of e.solution.strings)i[s.key]&&(i[s.key].value=s.value);let o={},l=new Set,n=this._s.items;for(let s of e.items){let r=n[s.id];if(r)if(r.title=s.title,r.description=s.description,r.type==="Web Map")this._apply_web_map(r);else if(r.type==="Feature Layer (hosted)"){this._apply_feature_service(r,s.id,!1);let d=new y(r).generate_data();r.data=d,o[s.id]=d}else r.type==="Feature Layer (hosted, view)"&&(this._apply_feature_service(r,s.id,!0),l.add(s.id))}for(let s of l){let r=n[s];r.data=o[r.source]}return this.structure}_apply_web_map(e){if(e.layerSources)for(let t of[...e.layers||[],...e.tables||[]]){let[i,o]=this._extract_id_and_layid(t.url),l=this.llm_fs_lookup[i]?.[o];l&&(t.title=l.name)}}_extract_id_and_layid(e){let t=e.replace(/[{}]/g,"").split("."),i=t[0],o=parseInt(t[1].replace("layer",""));return[i,o]}_apply_feature_service(e,t,i=!1){let o=e.source||t,l=this.llm_fs_lookup[o];for(let n of[...e.service.layers,...e.service.tables])this._apply_layer(n,l,i)}_apply_layer(e,t,i=!1){let o=t[e.id];if(!o||(e.name=o.name,i))return;let l=a.TYPE_LOOKUP[o.type.toLowerCase()]||o.type;l.toLowerCase()==="table"?e.type=l:e.geometryType=l,e.editFieldsInfo=this._edit_fields_info(),e.globalIdField="globalid",e.objectIdField="objectid",e.uniqueIdField={name:"objectid",isSystemMaintained:!0},e.hasAttachments=!0,this._update_relationships(e,t),this._update_fields(e,o),this._update_templates(e),this._update_drawing_info(e)}_update_relationships(e,t){let i=e.relationships||[];for(let o of i){let l=t[o.relatedTableId];l&&(o.name=l.name)}}_update_fields(e,t){let i=[],o=[[!1,t.customFields],[!0,t.requiredFields],[!0,t.systemFields]];for(let[l,n]of o)if(Array.isArray(n))for(let s of n){let r={name:s.name,alias:s.alias,type:a.FIELD_TYPE_TO_ESRI[s.type]||s.type,description:JSON.stringify({value:s.description,fieldValueType:""},null,0),domain:this._create_domain(s.choiceList,s.name),required:l};s.type?.toLowerCase()==="string"&&(r.length=s.length??256),(s.type==="oid"||s.type==="globalid")&&(r.editable=!1,r.nullable=!1),i.push(r)}e.fields=i}_update_templates(e){let t=a.DRAWING_TOOL_LOOKUP[e.geometryType||e.type];e.templates=[{name:e.name,description:"",drawingTool:t,prototype:{attributes:{}}}]}_update_drawing_info(e){if(e.drawingTool==="esriGeometryPoint")e.drawingInfo=m();else return}_create_domain(e,t){return e?{type:"codedValue",name:`${t}_${crypto.randomUUID().replace(/-/g,"")}`,codedValues:e.map(i=>({name:i,code:i}))}:null}_edit_fields_info(){return{creationDateField:"created_date",creatorField:"created_user",editDateField:"last_edited_date",editorField:"last_edited_user"}}},y=class{constructor(e){this.item_def=e,this.source_service_props=this.item_def.service}generate_data(){let e={layers:[],tables:[]};for(let t of this.source_service_props.layers||[]){let i={id:t.id};i.formInfo=this._generate_form_info(t),i.popupInfo=this._generate_popup_info(t),i.layerDefinition=this._generate_drawing_info(t),e.layers.push(i)}for(let t of this.source_service_props.tables||[]){let i={id:t.id};i.formInfo=this._generate_form_info(t),i.popupInfo=this._generate_popup_info(t),e.tables.push(i)}return e}_generate_form_info(e){let t=[];for(let o of e.fields){if(o.required)continue;let l={label:o.alias,type:"field",editableExpression:"expr/system/true",fieldName:o.name,inputType:this._get_input_type(o.type,o.domain,o.length)};t.push(l)}let i=e.relationships||[];for(let o of i)t.push({description:"",label:o.name,type:"relationship",displayCount:3,displayType:"list",editableExpression:"expr/system/true",orderByFields:[{field:"created_date",order:"asc"}],relationshipId:o.id});return{formElements:t,expressionInfos:[{expression:"false",name:"expr/system/false",returnType:"boolean",title:"False"},{expression:"true",name:"expr/system/true",returnType:"boolean",title:"True"}],title:e.name}}_generate_popup_info(e){let t=[],i=[];for(let l of e.fields)l.required||i.push({fieldName:l.name,isEditable:!0,label:l.alias,visible:!0});t.push({type:"fields",description:"",fieldInfos:i});let o=e.relationships||[];if(o.length&&e.type!=="Table")for(let l of o)t.push({type:"relationship",description:"",displayCount:3,displayType:"list",orderByFields:[{field:"created_date",order:"asc"}],relationshipId:l.id});return t.push({type:"attachments",description:"",displayType:"auto",title:""}),{popupElements:t,showLastEditInfo:!1,title:""}}_generate_drawing_info(e){return e.geometryType==="esriGeometryPoint"?{drawingInfo:u()}:{drawingInfo:{}}}_get_input_type(e,t,i){return e==="esriFieldTypeString"&&!t?{type:"text-box",maxLength:i||255,minLength:0}:e==="esriFieldTypeString"&&t?{type:"combo-box",noValueOptionLabel:"No value",showNoValueOption:!0}:["esriFieldTypeInteger","esriFieldTypeDouble"].includes(e)?{type:"text-box",minLength:0}:e==="esriFieldTypeDate"?{type:"datetime-picker",includeTime:!1}:{type:"text-box",maxLength:i||255,minLength:0}}};export{_ as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
function Q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function v(t,e){var s={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(s[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(s[n[a]]=t[n[a]]);return s}function j(t){return Object.keys(t).some(e=>{let s=t[e];if(!s)return!1;switch(s&&s.toParam&&(s=s.toParam()),s.constructor.name){case"Array":return!1;case"Object":return!1;case"Date":return!1;case"Function":return!1;case"Boolean":return!1;case"String":return!1;case"Number":return!1;default:return!0}})}function A(t){let e={};return Object.keys(t).forEach(s=>{var n,a;let r=t[s];if(r&&r.toParam&&(r=r.toParam()),!r&&r!==0&&typeof r!="boolean"&&typeof r!="string")return;let o=r.constructor.name,c;switch(o){case"Array":let u=(a=(n=r[0])===null||n===void 0?void 0:n.constructor)===null||a===void 0?void 0:a.name;c=u==="Array"?r:u==="Object"?JSON.stringify(r):r.join(",");break;case"Object":c=JSON.stringify(r);break;case"Date":c=r.valueOf();break;case"Function":c=null;break;case"Boolean":c=r+"";break;default:c=r;break}(c||c===0||typeof c=="string"||Array.isArray(c))&&(e[s]=c)}),e}function C(t,e){return Array.isArray(e)&&e[0]&&Array.isArray(e[0])?e.map(s=>C(t,s)).join("&"):encodeURIComponent(t)+"="+encodeURIComponent(e)}function E(t){let e=A(t);return Object.keys(e).map(s=>C(s,e[s])).join("&")}var x=globalThis.FormData;function $(t,e){let s=j(t)||e,n=A(t);if(s){let a=new x;return Object.keys(n).forEach(r=>{if(typeof Blob<"u"&&n[r]instanceof Blob){let o=n.fileName||n[r].name||r;a.append(r,n[r],o)}else a.append(r,n[r])}),a}else return E(t)}var g=class extends Error{constructor(e,s,n,a,r){super(e);let o=new.target.prototype;Object.setPrototypeOf(this,o),e=e||"UNKNOWN_ERROR",s=s||"UNKNOWN_ERROR_CODE",this.name="ArcGISRequestError",this.message=s==="UNKNOWN_ERROR_CODE"?e:`${s}: ${e}`,this.originalMessage=e,this.code=s,this.response=n,this.url=a,this.options=r}},G={noCorsDomains:[],crossOriginNoCorsDomains:{},pendingNoCorsRequests:{}},b="ARCGIS_REST_JS_NO_CORS";globalThis[b]||(globalThis[b]=Object.assign({},G));var h=globalThis[b];function q(t){let e=new URL(t);t=e.origin+e.pathname,e.search.includes("f=json")&&(t+="?f=json");let s=e.origin;return h.pendingNoCorsRequests[s]||(h.pendingNoCorsRequests[s]=fetch(t,{mode:"no-cors",credentials:"include",cache:"no-store"}).then(n=>{h.noCorsDomains.indexOf(s)===-1&&h.noCorsDomains.push(s),h.crossOriginNoCorsDomains[s.toLowerCase()]=Date.now(),delete h.pendingNoCorsRequests[s]}).catch(n=>(delete h.pendingNoCorsRequests[s],Promise.reject(new Error(`no-cors request to ${s} failed`))))),h.pendingNoCorsRequests[s]}function L(t){t.forEach(e=>{e=e.toLowerCase(),/^https?:\/\//.test(e)?w(e):(w("http://"+e),w("https://"+e))})}function w(t){let e=new URL(t).origin;h.noCorsDomains.indexOf(e)===-1&&h.noCorsDomains.push(e)}function N(t){let e=!1;if(h.noCorsDomains.length){let s=new URL(t).origin.toLowerCase();e=h.noCorsDomains.some(n=>s.includes(n))}return e}function W(t){let e=!1;if(N(t)){let s=new URL(t).origin.toLowerCase(),n=h.crossOriginNoCorsDomains[s]||0;Date.now()-60*6e4>n&&(e=!0)}return e}function M(t){console&&console.warn&&console.warn.apply(console,[t])}function J(){return Promise.resolve({fetch:globalThis.fetch,Headers:globalThis.Headers,Response:globalThis.Response,Request:globalThis.Request})}function K(t,e){var s;if(!e&&!window||!t)return!1;{e=e||window;let n=(s=e.location)===null||s===void 0?void 0:s.origin;return t.startsWith(n)}}var H="@esri/arcgis-rest-js";function B(){return globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS||{httpMethod:"POST",params:{f:"json"}}}var O=class extends g{constructor(e="AUTHENTICATION_ERROR",s="AUTHENTICATION_ERROR_CODE",n,a,r){super(e,s,n,a,r),this.name="ArcGISAuthError",this.message=s==="AUTHENTICATION_ERROR_CODE"?e:`${s}: ${e}`;let o=new.target.prototype;Object.setPrototypeOf(this,o)}retry(e,s=1){let n=0,a=(r,o)=>{n=n+1,e(this.url,this.options).then(c=>{let u=Object.assign(Object.assign({},this.options),{authentication:c});return S(this.url,u)}).then(c=>{r(c)}).catch(c=>{c.name==="ArcGISAuthError"&&n<s?a(r,o):c.name===this.name&&c.message===this.message&&n>=s?o(this):o(c)})};return new Promise((r,o)=>{a(r,o)})}};function z(t,e,s,n,a){if(t.code>=400){let{message:r,code:o}=t;throw new g(r,o,t,e,n)}if(t.error){let{message:r,code:o,messageCode:c}=t.error,u=c||o||"UNKNOWN_ERROR_CODE";throw o===498||o===499?a||new O(r,u,t,e,n):new g(r,u,t,e,n)}if(t.status==="failed"||t.status==="failure"){let r,o="UNKNOWN_ERROR_CODE";try{r=JSON.parse(t.statusMessage).message,o=JSON.parse(t.statusMessage).code}catch{r=t.statusMessage||t.message}throw new g(r,o,t,e,n)}return t}function S(t,e){let s=B(),n=Object.assign(Object.assign(Object.assign({httpMethod:"POST"},s),e),{params:Object.assign(Object.assign({},s.params),e.params),headers:Object.assign(Object.assign({},s.headers),e.headers)}),{httpMethod:a,rawResponse:r}=n,o=Object.assign({f:"json"},n.params),c=null,u={method:a,signal:n.signal,credentials:n.credentials||"same-origin"};N(t)&&(u.credentials="include"),n.headers&&n.headers["X-Esri-Auth-Client-Id"]&&t.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let p;if(typeof n.authentication=="string"){let i=n.authentication;p={portal:"https://www.arcgis.com/sharing/rest",getToken:()=>Promise.resolve(i)},!n.authentication.startsWith("AAPK")&&!n.authentication.startsWith("AAPT")&&!n.authentication.startsWith("AATK")&&!n.authentication.startsWith("AAST")&&!n.suppressWarnings&&!globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING&&(M("Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information."),globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING=!0)}else p=n.authentication;let k=t,y=!1;typeof window<"u"&&(y=K(t));let U=!y&&W(t);n.headers&&n.headers["X-Esri-Auth-Client-Id"]&&t.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let R=Promise.resolve();return U&&(u.credentials="include",R=q(t)),R.then(()=>p?p.getToken(t).catch(i=>(i.url=t,i.options=n,c=i,Promise.resolve(""))):Promise.resolve("")).then(i=>{i.length&&(o.token=i),p&&p.getDomainCredentials&&(u.credentials=p.getDomainCredentials(t));let l={};if(u.method==="GET"){o.token&&n.hideToken&&typeof window>"u"&&(l["X-Esri-Authorization"]=`Bearer ${o.token}`,delete o.token);let f=E(o),m=f===""?t:`${t}?${f}`;n.maxUrlLength&&m.length>n.maxUrlLength||!n.maxUrlLength&&m.length>2e3||o.token&&n.hideToken?(u.method="POST",i.length&&n.hideToken&&(o.token=i,delete l["X-Esri-Authorization"])):t=m}let d=new RegExp("/items/.+/updateResources").test(t);return u.method==="POST"&&(u.body=$(o,d)),u.headers=Object.assign(Object.assign({},l),n.headers),(typeof window>"u"||window&&typeof window.document>"u")&&!u.headers.referer&&(u.headers.referer=H),!j(o)&&!d&&(u.headers["Content-Type"]="application/x-www-form-urlencoded"),globalThis.fetch?globalThis.fetch(t,u):J().then(({fetch:f})=>f(t,u))}).then(i=>{if(!i.ok)return i.json().then(l=>{let{status:d,statusText:f}=i,{message:m,details:T}=l.error,I=`${m}. ${T?T.join(" "):""}`.trim();throw new g(I,`HTTP ${d} ${f}`,l,t,n)}).catch(l=>{if(l.name==="ArcGISRequestError")throw l;let{status:d,statusText:f}=i;throw new g(f,`HTTP ${d}`,i,t,n)});if(r)return console.warn("rawResponse option is deprecated and will be removed in ArcGIS REST JS v5.0."),i;switch(o.f){case"json":return i.json();case"geojson":return i.json();case"html":return i.text();case"text":return i.text();default:return i.blob()}}).then(i=>{if((o.f==="json"||o.f==="geojson")&&!r){let l=z(i,k,o,n,c);if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(t)&&Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&L(i.authorizedCrossOriginNoCorsDomains),c){let d=t.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0];n.authentication.federatedServers[d]={token:[],expires:new Date(Date.now()+86400*1e3)},c=null}return l}else return i})}function P(t,e={params:{f:"json"}}){let{request:s}=e,n=v(e,["request"]);return s?s(t,n):S(t,n).catch(a=>a instanceof O&&e.authentication&&typeof e.authentication!="string"&&e.authentication.canRefresh&&e.authentication.refreshCredentials?a.retry(()=>e.authentication.refreshCredentials(),1):Promise.reject(a))}function F(t){return typeof t!="string"||(t=t.trim(),t[t.length-1]==="/"&&(t=t.slice(0,-1))),t}function _(t={}){return t.portal?F(t.portal):t.authentication&&typeof t.authentication!="string"?t.authentication.portal:"https://www.arcgis.com/sharing/rest"}function V(t){return t.owner?Promise.resolve(t.owner):t.item&&t.item.owner?Promise.resolve(t.item.owner):t.authentication&&t.authentication.getUsername?t.authentication.getUsername():Promise.reject(new Error("Could not determine the owner of this item. Pass the `owner`, `item.owner`, or `authentication` option."))}function Y(t){return Array.isArray(t)&&Array.isArray(t[0])&&Array.isArray(t[1])}function Z(t){return t.join(",")}function X(t,e,s){if(!t)return t;let n=null;return typeof t.thumbnail=="string"&&(n=`${e}/content/items/${t.id}/info/${t.thumbnail}`,n&&t.access!=="public"&&s&&(n+=`?${s}`)),Object.assign(Object.assign({},t),n?{thumbnailUrl:n}:{})}function tt(t,e){let s=D(t,e),n=Object.assign({httpMethod:"GET"},e);return P(s,n).then(async a=>{let r=e?.portal||_(e),o;if(e?.authentication&&typeof e.authentication!="string"&&a.access!=="public")try{o=await e.authentication.getToken(s)}catch{}return X(a,r,o)})}var D=(t,e)=>`${typeof e=="string"?e:_(e)}/content/items/${t}`;function et(t,e){let s=`${D(t,e)}/data`,n=Object.assign({httpMethod:"GET",params:{}},e);return n.file&&(n.params.f=null),P(s,n).catch(a=>{if(!RegExp(/The string did not match the expected pattern|(Unexpected end of (JSON input|data at line 1 column 1))/i).test(a.message))throw a})}export{Q as a,v as b,M as c,P as d,_ as e,V as f,Y as g,Z as h,X as i,tt as j,et as k};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import e from"./NPOHA56R.js";import d from"./ZP6VPBP4.js";import c from"./XXT542UR.js";import a from"./X5EABWHE.js";import{b as v}from"./2B4SGB3I.js";import{b as y}from"./YKQDHR27.js";import{nb as b}from"./J75MHJID.js";import{a as g}from"./R67EKKSL.js";import"./BVWAUO73.js";import"./K3DQKY7V.js";import"./TEHBW75B.js";import"./ALSK2SPM.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./BMBNSJZQ.js";import"./5HZMUGQD.js";import"./5VDDAINK.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./XQQ52NKX.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as f}from"./KIUBUHVM.js";import{G as m,I as u,K as l,h,i as o,q as p}from"./H5E6ISYP.js";import"./QPIMTXPL.js";export default $arcgis.t(([{q:x},,{o:$},{f:_}])=>{var w=h`calcite-card{height:100%;padding-bottom:2px;border:2px solid transparent;transition:border-color .1s ease;box-sizing:border-box}@media(max-width:400px){calcite-card{width:100%}}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{border-color:var(--calcite-color-brand);cursor:pointer}.chip-status{--calcite-chip-icon-color: var(--calcite-color-brand);cursor:pointer}.chip-deployed{--calcite-chip-icon-color: var(--calcite-color-status-success)}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:1.2rem}.font-color-text-2{--calcite-label-text-color: var(--calcite-color-text-2)}.font-line-height{line-height:1.4}.font-size-size--1{font-size:var(--calcite-font-size--1)}.header-line-height{--calcite-label-margin-bottom: 0;margin-top:.5rem;margin-bottom:.7rem}.info-icon{--calcite-icon-color: var(--calcite-color-text-inverse);padding-inline-end:.3rem}.card-image-wrap{flex:0 0 auto}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip}a{text-decoration:none;color:inherit;outline:0;padding:0;margin:0;display:inherit;height:100%}`,d=class extends m{constructor(){super(...arguments),this.referrerSolutionId="",this.referrerSolutionTitle="",this.referrerSolutionVersion="",this.source="all-solutions",this._deployedTooltipContent="",this._translations=g({name:"solution-details-card",blocking:!0}),this._configContextConsumer=y({context:v,subscribe:!0}),this.detailsCardSelected=p()}static{this.properties={card:0,referrerSolutionId:1,referrerSolutionTitle:1,referrerSolutionVersion:1,source:1,_deployedTooltipContent:16,_translations:16}}static{this.styles=w}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}render(){let e=_(this.card.title);return o`<a href=${e??l} @click=${this._anchorClick} tabindex=-1 .title=${`${this._translations.arcgisSolutions} | ${this.card.title}`}>${this._renderCard()}</a>`}_anchorClick(e){e.preventDefault()}_cardSelected(){if(this.source==="you-may-also-like"){let e=[this.referrerSolutionTitle,this.referrerSolutionId,this.referrerSolutionVersion,this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""];this._telemetry?.logEvent({category:$.SOLUTION_DETAILS,action:"Related Solution",dimensions:e})}this.detailsCardSelected.emit(this.card)}_renderChips(e){let r=e.filter(t=>t==="deployed"||t==="deployedOlderVersion"),C=e.filter(t=>t!=="deployed"&&t!=="deployedOlderVersion"),c=[];return C.forEach(t=>{let a="chip-status",i=`solution-details-card-chip-${t}`,n=t==="new"?"star":"mega-phone",s=t==="new"?this._translations.newSolution:this._translations.updated;c.push(o`<calcite-chip class=${u(a)} .icon=${n} id=${i??l} .label=${s} .value=${s} scale=s></calcite-chip><calcite-tooltip .referenceElement=${i}><span>${s}</span></calcite-tooltip>`)}),r.length>0&&c.push(o`<calcite-chip class="chip-deployed" .icon=${r[0]==="deployedOlderVersion"?"recent":"check-circle"} id=solution-details-card-chip-deployed .label=${this._translations.deployed} .value=${this._translations.deployed} scale=s></calcite-chip><calcite-tooltip placement=bottom reference-element=solution-details-card-chip-deployed @calciteTooltipBeforeOpen=${async()=>{let t={q:`${this.card?.deployCommonId} and owner:${this._configContextConsumer.value?.userSession?.username}`,authentication:this._configContextConsumer.value?.userSession,pagingParam:{start:1,num:100}},a=await b(t);console.log(a),this._deployedTooltipContent=o`<solutions-deployed-list .cards=${a.results.map(i=>{let n=i.typeKeywords?.find(S=>S.startsWith("solutionversion-")),s=n?n.split("-")[1]:"unknown";return{id:i.id,title:i.title,deployVersion:s,created:i.created}})} .listTitle=${r[0]==="deployedOlderVersion"?this._translations.deployedPreviousTitle:this._translations.deployedTitle}></solutions-deployed-list>`}}>${this._deployedTooltipContent}</calcite-tooltip>`),c}_renderCard(){let e=this.card;return o`<calcite-card .label=${e.snippet} @click=${this._cardSelected} @keydown=${r=>x(r,()=>this._cardSelected())}><div class="card-image-wrap" slot=thumbnail><img alt=${e.title??l} class="thumbnail card-image" src=${e.thumbnailUrl??l}><div class="hover-text">${this._translations.viewDetails}</div></div><calcite-label slot=heading class="header-line-height" scale=l>${e.title}</calcite-label><p slot=description class="font-color-text-2 font-line-height font-size-size--1">${e.snippet}</p>${e.chips&&e.chips.length>0?o`<div slot=footer-end style="display: flex; gap: 0.5rem; justify-content: flex-end;">${this._renderChips(e.chips)}</div>`:void 0}<div slot=footer-start></div></calcite-card>`}};f("solution-details-card",d);return d},a,c,d,e)
|