@arcgis/portal-components 5.2.0-next.61 → 5.2.0-next.63
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/{25BWGJFT.js → 332KSPIN.js} +1 -1
- package/dist/cdn/5KADGOPQ.js +2 -0
- package/dist/cdn/6RLJVPF6.js +2 -0
- package/dist/cdn/7PPA7V23.js +2 -0
- package/dist/cdn/{KZVNGOD4.js → 7YQTBSDS.js} +56 -56
- package/dist/cdn/CG4WYBHN.js +2 -0
- package/dist/cdn/{NMAP3FYP.js → DML7662F.js} +1 -1
- package/dist/cdn/{UL2NWFFH.js → EEELQMTE.js} +1 -1
- package/dist/cdn/{IXATTQKO.js → G2KWSRCG.js} +1 -1
- package/dist/cdn/JZTBGLFH.js +2 -0
- package/dist/cdn/{UDTQ7U6L.js → LUT4IGPP.js} +1 -1
- package/dist/cdn/RKWOBE3M.js +2 -0
- package/dist/cdn/SOJU4OFZ.js +2 -0
- package/dist/cdn/{6LMJGR6F.js → WEJQVIN4.js} +1 -1
- package/dist/cdn/XW42SAEJ.js +2 -0
- package/dist/cdn/{THRK2DGY.js → ZK2VXTNX.js} +1 -1
- package/dist/cdn/{5VMPZXL3.js → ZXIRKL4X.js} +1 -1
- package/dist/cdn/assets/portal-navigation/apps/notebook.avif +0 -0
- package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/portal-browser.js +0 -3
- package/dist/components/arcgis-portal-account-switcher/customElement.js +124 -115
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +3 -1
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +2 -0
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +144 -149
- package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +34 -0
- package/dist/components/arcgis-portal-browser/customElement.js +2 -5
- package/dist/components/arcgis-portal-browser/utils/store.d.ts +7 -3
- package/dist/components/arcgis-portal-classification-config/customElement.js +6 -6
- package/dist/components/arcgis-portal-group-browser/customElement.d.ts +174 -0
- package/dist/components/arcgis-portal-group-browser/customElement.js +66 -68
- package/dist/components/arcgis-portal-group-browser/types.d.ts +3 -3
- package/dist/components/arcgis-portal-navigation/customElement.d.ts +7 -0
- package/dist/components/arcgis-portal-navigation/customElement.js +398 -395
- package/dist/components/arcgis-portal-navigation/index.js +4 -6
- package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +14 -0
- package/dist/components/{arcgis-portal-browser-filter → portal-browser/components/portal-browser-filter}/index.js +0 -1
- package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +59 -0
- package/dist/components/{arcgis-portal-browser-filter-date → portal-browser/components/portal-browser-filter-date}/index.js +1 -2
- package/dist/components/portal-browser/components/portal-browser-filter-date/portal-browser-filter-date.d.ts +122 -0
- package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +11 -0
- package/dist/components/portal-group-browser-filters/customElement.js +113 -86
- package/dist/components/portal-group-browser-filters/index.js +0 -3
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.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 +0 -24
- package/dist/loader.js +2 -5
- package/dist/types/lumina.d.ts +1 -18
- package/dist/types/preact.d.ts +1 -21
- package/dist/types/react.d.ts +1 -24
- package/dist/types/stencil.d.ts +1 -18
- package/package.json +4 -4
- package/dist/cdn/3527GI5O.js +0 -2
- package/dist/cdn/3Y33UPZ6.js +0 -2
- package/dist/cdn/744FUP4K.js +0 -2
- package/dist/cdn/DUBJA7PZ.js +0 -2
- package/dist/cdn/FGJNEKPQ.js +0 -2
- package/dist/cdn/HEA66RTI.js +0 -2
- package/dist/cdn/JPHGWARN.js +0 -2
- package/dist/cdn/JUNNQTQU.js +0 -2
- package/dist/cdn/MNU537SB.js +0 -2
- package/dist/cdn/SE5YJGIJ.js +0 -2
- package/dist/cdn/XMUR4HRH.js +0 -2
- package/dist/cdn/XX4U6IRN.js +0 -2
- package/dist/cdn/Y3RUZTB3.js +0 -2
- package/dist/cdn/YIU7GBUN.js +0 -2
- package/dist/cdn/ZOEF7HBV.js +0 -2
- package/dist/components/arcgis-portal-browser-filter/customElement.d.ts +0 -226
- package/dist/components/arcgis-portal-browser-filter/customElement.js +0 -32
- package/dist/components/arcgis-portal-browser-filter/index.d.ts +0 -1
- package/dist/components/arcgis-portal-browser-filter-date/customElement.d.ts +0 -233
- package/dist/components/arcgis-portal-browser-filter-date/customElement.js +0 -118
- package/dist/components/arcgis-portal-browser-filter-date/index.d.ts +0 -1
- package/dist/components/arcgis-portal-browser-filters/customElement.d.ts +0 -7
- package/dist/components/arcgis-portal-browser-filters/customElement.js +0 -29
- package/dist/components/arcgis-portal-browser-filters/index.d.ts +0 -1
- /package/dist/cdn/{F3PB42AG.js → 4E65YWCP.js} +0 -0
- /package/dist/components/{arcgis-portal-browser-filters → portal-browser/components/portal-browser-filters}/index.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"./
|
|
2
|
+
import e from"./DML7662F.js";import d from"./LUT4IGPP.js";import"./CFBSBZSS.js";import c from"./QQ432AB6.js";import"./7NVVHX75.js";import"./OBBYT2AV.js";import"./U5B2LAPJ.js";import"./UZCHLKLO.js";import"./DFTUMKSN.js";import b from"./G2KWSRCG.js";import a from"./DALGPO36.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import"./SWAVECPM.js";import"./7ZXEX3LI.js";import"./SKUPHVNO.js";import"./TNLGQ7HL.js";import"./TSTTPCWU.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,{g:a}])=>{return a},a,b,c,d,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import f from"./WWMB4NWC.js";import e from"./Q75EBGI2.js";import{a as S,b as P}from"./52B4FWCM.js";import c from"./NITKS6KJ.js";import a from"./DALGPO36.js";import{a as w}from"./7ZXEX3LI.js";import{a as E,e as I}from"./SKUPHVNO.js";import"./TNLGQ7HL.js";import{K as d,L as m,M as b,P as C,S as y,h as g,j as n}from"./TSTTPCWU.js";import"./UZLQALHY.js";export default $arcgis.t(([{createArcadeExecutor:F},{watch:q},{c:v},,{a:f,b:c,c:p,d:R,e:_,f:O},{a:x,b:$}])=>{async function k({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await T(e,r,t);return{[e]:{enabled:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function T(r,t,i){let a=t?.attributes?.[r];if(!a)return!1;let{isAttributeEnabled:e}=a;return e?await h(e,JSON.stringify(t),i):!0}async function j({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await M(e,r,t);return{[e]:{valueExpressionResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function M(r,t,i){let a=t.attributes[r];if(!a)throw Error(`Attribute ${r} not found in schema`);let e=a.valueExpression,s=a.validValues,o=a.validValuesMap;return s?.length?s:o&&Object.keys(o)?.length?o:e?await h(e,t,i,r):null}async function N({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await H(e,r,t);return{[e]:{attributeValidationResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function H(r,t,i){let a=t?.attributes?.[r];if(!a)return null;let e=a?.attributeValidation;return e?await h(e,JSON.stringify(t),i,r):null}var D=async(r,t)=>{let i=r?.bannerExpression;return i?.length?await h(i,r,t):W(r,t)},W=(r,t)=>{let i=Object.entries(r.attributes).sort(([,s],[,o])=>(s?.bannerOrder??0)-(o?.bannerOrder??0)),a=[],e=[];return i.forEach(([s,o])=>{let l=t?.[s];l&&o.bannerOrder&&(a.push(U({elementType:o.uiElement??"",selectionDisplayLabel:o.bannerLabel??"",labelDelimiter:o.labelDelimiter??"",classificationProp:l,valueDelimiter:o.valueDelimiter??""})),e.push(o.attributeDelimiter??""))}),a.length>0?a.reduce((s,o,l)=>l===0?o:`${s}${e[l-1]}${o}`,""):""},U=({elementType:r,selectionDisplayLabel:t,labelDelimiter:i,classificationProp:a,valueDelimiter:e})=>{let s=r.includes("multi")&&a?a.split("").join(e):a;return`${t}${i}${s}`};async function h(r,t,i,a=""){let e={schemaJsonString:typeof t=="string"?t:JSON.stringify(t),valueJsonString:JSON.stringify(i),attributeId:a};return(await J(r)).execute(e)}async function J(r){return await F(r,{variables:[{name:"schemaJsonString",type:"text"},{name:"valueJsonString",type:"text"},{name:"attributeId",type:"text"}]})}var L=g`:host{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.header-section{padding:var(--calcite-spacing-sm)}.header-section__title-container{display:flex;align-items:center;justify-content:space-between}.header-section__title-text{margin:unset;font-weight:unset;font-size:var(--calcite-font-size)}.header-section__title-popover{padding:var(--calcite-spacing-md)}.form-section{display:flex;border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);padding:var(--calcite-spacing-sm);height:100%;overflow:hidden}.form-section__sidebar{flex:1;padding:var(--calcite-spacing-sm)}.form-section__main-content{flex:3;padding:var(--calcite-spacing-sm);overflow:auto}.danger{color:var(--calcite-color-status-danger)}.spacing-y{margin:var(--calcite-spacing-md) 0}`,u=class extends b{constructor(){super(),this.classificationModel=x(this),this.messages=w(),this.formMainContentRef=d(),this.bannerRef=d(),this._classificationDataTask=$(this),this._formCreationTask=new P(this,{task:async()=>{if(await this._classificationDataTask.taskComplete,!this.portalClassificationSchema||!this.portalItem)throw new Error("Portal item and classification schema are required to render the form");let t=this.portalItem.clone();if(await t.load(),!this.primaryAttribute)throw new Error("primaryAttribute is required but was undefined.");this.existingClassification=!!t.classification,t.classification=f(t.classification,this.primaryAttribute,this.portalClassificationSchema),t.classification&&(t.classification.banner=await D(this.portalClassificationSchema,t.classification)),this.pendingPortalItem=t,this.cleanupItemClassificationWatchHandle(),this._itemClassificationWatchHandle=q(()=>this.portalItem.classification,i=>{if(this.pendingPortalItem){let a=this.pendingPortalItem.clone();a.load().then(()=>{a.classification=i,this.pendingPortalItem=a}).catch(e=>{console.error(e)})}}),this._itemClassificationWatchPortalItem=this.portalItem,this._itemClassificationWatchPortalItem.addHandles(this._itemClassificationWatchHandle,"arcgis-classification-config"),await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.pendingPortalItem=this.pendingPortalItem.clone(),this.existingClassification&&this.validateForm()},args:()=>[this.portalItem,this.portalClassificationSchema]}),this.getFormDisplayOrder=t=>this.portalClassificationSchema?.layouts.default.layoutElements[t].formDisplayOrder??0,this.addEditInfoAttributes=()=>{if(!this.pendingPortalItem?.classification)return{};let t=structuredClone(this.pendingPortalItem.classification),i=O(this.pendingPortalItem,t);return{...t,...i}},this.updateFavoriteClassification=t=>{this.favoriteClassifications=t},this.updateClassificationData=async t=>{let i=t.classification;if(this.selectedFavoriteClassificationName=t.name,this.pendingPortalItem){let a=this.pendingPortalItem.clone();if(await a.load(),a.classification=p(this.portalClassificationSchema,i),!this.portalClassificationSchema)return;await this.evaluateAttributeExpressions(this.portalClassificationSchema,a),a.classification=c(a.classification,this.attributeExpressionResults),this.pendingPortalItem=a}},this.existingClassification=!1,this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.primaryAttribute=this.classificationModel.primaryAttribute,this.attributeExpressionResults=new Map,this.formValidationErrors=[],this.remoteValidationErrors="",this.canUserConfigureClassification=!0,this.favoriteClassifications=[],this.isRequiredErrors=new Set,this.status=this.classificationModel.status,this.values={},this.valid=!1,this.autoDestroyDisabled=!1,this.arcgisPropertyChange=I()("status","values","valid")}static{this.properties={existingClassification:16,portalClassificationSchema:16,primaryAttribute:16,attributeExpressionResults:16,formValidationErrors:16,itemClassification:16,pendingPortalItem:16,selectedCategory:16,remoteValidationErrors:16,canUserConfigureClassification:16,favoriteClassifications:16,selectedFavoriteClassificationName:16,isRequiredErrors:16,portalItem:0,status:35,values:[1,{type:Object}],valid:7,autoDestroyDisabled:5}}static{this.styles=L}async destroy(){this.cleanupItemClassificationWatchHandle(),await this.destroyManagedChildren(),await this.manager.destroy()}async resetForm(){if(this.existingClassification)this.pendingPortalItem=this.portalItem?.clone(),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.validateForm());else if(this.portalItem&&this.primaryAttribute&&this.portalClassificationSchema){let t=this.portalItem.clone();await t.load(),this.pendingPortalItem=this.portalItem?.clone(),this.pendingPortalItem.classification=f(t.classification,this.primaryAttribute,this.portalClassificationSchema),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults))}}async validateForm(){this.updateFormValidationErrors(),await this.updateRemoteValidationErrors()}async load(){try{await _(this.portalItem)||(this.canUserConfigureClassification=!1);let t=await v(this.portalItem);if(t){let{result:i,error:a}=t;if(a&&a.details.raw.messageCode!=="COM_1177"){console.error(a);return}i&&(this.favoriteClassifications=i.favorites)}}catch(t){console.error("Error occured while loading arcgis-classification-config:",t)}}willUpdate(t){if(t.has("pendingPortalItem")){let i=this.addEditInfoAttributes();this.values=i}(t.has("formValidationErrors")||t.has("remoteValidationErrors"))&&(this.valid=!this.formValidationErrors.length&&!this.remoteValidationErrors)}loaded(){let t=E(this.el,"form");t&&(this.listenOn(t,"formdata",this.updateFormData),this.listenOn(t,"submit",this.handleFormSubmit)),this.listen("submit",this.handleFormSubmit)}async updateClassificationProperty(t){if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let i=this.pendingPortalItem.clone();await i.load(),Object.entries(t??{}).forEach(([a,e])=>{if(a===this.primaryAttribute){let s=R(e,i.classification,this.primaryAttribute);s=p(this.portalClassificationSchema,s),i.classification=s}else{let s=new Map(Object.entries(i.classification??{}));if(e===void 0||e===""||Array.isArray(e)&&e.length===0)s.delete(a);else if(s.set(a,e),a==="fgi"&&!s.has("fgiOptions")){let o=this.portalClassificationSchema?.attributes?.fgiOptions?.defaultValue??[];s.set("fgiOptions",Array.isArray(o)?o:[o])}i.classification=Object.fromEntries(s)}}),i.classification&&!i.classification.fgi&&delete i.classification.fgiOptions,await this.evaluateAttributeExpressions(this.portalClassificationSchema,i),i.classification=c(i.classification,this.attributeExpressionResults),i.classification&&(i.classification.banner=await D(this.portalClassificationSchema,i.classification)),this.pendingPortalItem=i,this.existingClassification&&this.validateForm(),t&&"classification"in t&&this.updateIsRequiredErrors()}handleCategorySelectChange(t){this.selectedCategory=t.target.selectedItems[0].value}async evaluateAttributeExpressions(t,i){let a=await k({portalClassificationSchema:t,itemClassification:i.classification}),e=await j({portalClassificationSchema:t,itemClassification:i.classification}),s=await N({portalClassificationSchema:t,itemClassification:i.classification});Object.keys(t.attributes).forEach(o=>{let l=a[o]?.enabled??!0,V=e[o]?.valueExpressionResult,A=s[o]?.attributeValidationResult;this.attributeExpressionResults.set(o,{enabled:l,valueExpressionResult:V,attributeValidationResult:A})})}updateIsRequiredErrors(){let t=new Set;Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([i,a])=>{a.isRequired&&!this.pendingPortalItem?.classification?.[i]&&this.pendingPortalItem?.classification?.[i]!==0&&t.add(i)}),this.isRequiredErrors=t}updateFormValidationErrors(t=!1){let i=[];Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([a,e])=>{e.isRequired&&!this.pendingPortalItem?.classification?.[a]&&this.pendingPortalItem?.classification?.[a]!==0&&(!t||this.isRequiredErrors.has(a))&&i.push({attribute:e.label,reason:this.messages.isrequired??"is required",category:e.attributeCategory}),this.attributeExpressionResults.get(a)?.attributeValidationResult&&i.push({attribute:e.label,reason:this.attributeExpressionResults.get(a)?.attributeValidationResult??"",category:e.attributeCategory})}),this.formValidationErrors=i}async updateRemoteValidationErrors(){if(!this.pendingPortalItem?.classification)return;let t=await this.classificationModel.validateClassification(void 0,this.pendingPortalItem?.classification,this.pendingPortalItem.portal.restUrl);this.remoteValidationErrors=t}cleanupItemClassificationWatchHandle(){this._itemClassificationWatchHandle?.remove(),this._itemClassificationWatchHandle=void 0,this._itemClassificationWatchPortalItem?.removeHandles("arcgis-classification-config"),this._itemClassificationWatchPortalItem=void 0}async destroyManagedChildren(){let t=this.bannerRef.value;!t?.autoDestroyDisabled||t.manager?.destroyed||await t.destroy()}async handleFormSubmit(t){this.validateForm(),this.updateIsRequiredErrors(),this.formMainContentRef.value?.scrollIntoView()}updateFormData(t){let i=t.formData,a=this.addEditInfoAttributes();a=c(a,this.attributeExpressionResults),Object.entries(a??{}).forEach(([e,s])=>{i.set(e,s)})}renderCategoryTabs(){return this._classificationDataTask.render({complete:()=>{if(this.portalClassificationSchema?.attributeCategories?.length)return this.selectedCategory||(this.selectedCategory=this.portalClassificationSchema?.attributeCategories[0]),n`<calcite-list .label=${this.messages.selectcategory??"select category"} selection-appearance=border selection-mode=single-persist @calciteListChange=${this.handleCategorySelectChange}>${this.portalClassificationSchema.attributeCategories.map(t=>{let i=this.formValidationErrors.filter(a=>a.category===t).length;return n`<calcite-list-item .label=${t} .value=${t} .selected=${this.selectedCategory===t} .description=${i?`${i} ${i>1?this.messages.errors:this.messages.error}`:void 0}>${i&&n`<div slot=content-end class="danger"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon></div>`||""}</calcite-list-item>`})}</calcite-list>`}})}renderValidationErrors(){return this.formValidationErrors.length&&(!this.selectedCategory||this.formValidationErrors.some(t=>this.selectedCategory===t.category))?n`<calcite-notice open icon=exclamation-mark-triangle class="spacing-y" kind=danger><div slot=message>${this.messages.bannererror??"Some fields are incomplete or contain errors. Check the highlighted fields for details."}</div></calcite-notice>`:null}renderFavoriteClassification(){let t=this.portalClassificationSchema?.attributeCategories?.[0]??"Default";return this.selectedCategory=this.portalClassificationSchema?.attributeCategories?.length?this.selectedCategory:"Default",this.selectedCategory===t?n`<arcgis-portal-classification-favorite .portalItem=${this.pendingPortalItem??this.portalItem} .classificationValue=${this.pendingPortalItem?.classification} .favoriteClassifications=${this.favoriteClassifications} .selectedFavoriteClassificationName=${this.selectedFavoriteClassificationName} .attributeExpressionResults=${this.attributeExpressionResults} .resetFavoriteClassification=${i=>this.updateFavoriteClassification(i)} .updateClassificationData=${async i=>{await this.updateClassificationData(i),this.updateFormValidationErrors(),this.updateIsRequiredErrors()}}></arcgis-portal-classification-favorite>`:null}renderForm(){return this._formCreationTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,complete:()=>{if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let t=Object.entries(this.portalClassificationSchema.attributes).sort(([i],[a])=>this.getFormDisplayOrder(i)-this.getFormDisplayOrder(a));return n`${this.renderValidationErrors()}${this.renderFavoriteClassification()}${t.filter(([,{attributeCategory:i}])=>this.selectedCategory===i||!i).map(([i,a])=>{if(this.attributeExpressionResults.get(i)?.enabled===!1)return null;let e=this.pendingPortalItem?.classification?.[i];return n`<arcgis-portal-classification-form-element .attributeKey=${i} .attribute=${a} .value=${e} @arcgisAttributeValueChange=${async s=>{await this.updateClassificationProperty(s.detail),a.isRequired&&!s.detail[i]?this.isRequiredErrors.add(i):this.isRequiredErrors=new Set(Array.from(this.isRequiredErrors).filter(o=>o!==i)),this.updateFormValidationErrors(!0)}} .renderingInfo=${this.attributeExpressionResults.get(i)} .isRequiredErrors=${this.isRequiredErrors}></arcgis-portal-classification-form-element>`})}`}})}renderNotice(t,i="warning"){return n`<calcite-notice icon=exclamation-mark-triangle open class="spacing-y" .kind=${i}><div slot=message>${t}</div></calcite-notice>`}renderHelpTooltip(){return this.portalClassificationSchema?.helpTooltip?n`<calcite-action id=portal-classification-config-tooltip-button .text=${this.portalClassificationSchema?.helpTooltip} icon=information></calcite-action><calcite-popover .label=${this.portalClassificationSchema?.helpTooltip} reference-element=portal-classification-config-tooltip-button placement=bottom-end overlay-positioning=fixed auto-close><div class="header-section__title-popover"><calcite-link .href=${this.portalClassificationSchema?.helpUrl} target=_blank id=portal-classification-config-tooltip-button>${this.portalClassificationSchema?.helpTooltip}</calcite-link></div></calcite-popover>`:null}render(){return this.portalItem?this._classificationDataTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,error:()=>this.renderNotice(this.messages.anerroroccurred??"An error has occurred.","danger"),complete:()=>this.portalItem?this.canUserConfigureClassification?this.portalItem.portal.hasClassificationSchema?n`<div class="header-section" role=region aria-label=${this.messages.documentbannerpreview??"documentbannerpreview"??C}><div class="header-section__title-container"><h2 class="header-section__title-text">${this.messages.documentbannerpreview??"documentbannerpreview"}</h2>${this.renderHelpTooltip()}</div>${this._formCreationTask.status===S.COMPLETE&&n`<arcgis-portal-classification-banner .portalItem=${this.pendingPortalItem??this.portalItem} variant=preview .missingExistingClassification=${!this.existingClassification} .autoDestroyDisabled=${this.autoDestroyDisabled} ${m(this.bannerRef)}></arcgis-portal-classification-banner>`||""}</div><div class="form-section">${this.portalClassificationSchema?.attributeCategories?.length&&n`<div class="form-section__sidebar">${this.renderCategoryTabs()}</div>`||""}<div class="form-section__main-content" ${m(this.formMainContentRef)}>${this.renderForm()}</div></div>`:this.renderNotice(this.messages.missingclassificationschema??"Portal is missing classification schema."):this.renderNotice(this.messages.userconfigurepermissionrequired??"User configuration permission is required."):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}};y("arcgis-portal-classification-config",u);return u},"arcade","core/reactiveUtils",a,c,e,f)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import c from"./3LBJM7GA.js";import"./CG4WYBHN.js";import"./OBBYT2AV.js";import"./U5B2LAPJ.js";import b from"./EB4XGKGD.js";import a from"./NITKS6KJ.js";import"./DFTUMKSN.js";import"./2GBRZSEC.js";import"./7ZXEX3LI.js";import"./SKUPHVNO.js";import"./TNLGQ7HL.js";import"./TSTTPCWU.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as T}from"./YVKSTDL6.js";import c from"./G2KWSRCG.js";import a from"./DALGPO36.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import{b as C}from"./2GBRZSEC.js";import{a as L}from"./44XITKIX.js";import{a as M}from"./7ZXEX3LI.js";import"./SKUPHVNO.js";import"./TNLGQ7HL.js";import{M as S,P as _,S as v,j as d,k as b,w as f}from"./TSTTPCWU.js";import"./UZLQALHY.js";export default $arcgis.t(([p,{substitute:g},,{i:x,j:O,k:E,l:I}])=>{var A=1260*1e3;function K(n,e="_blank",t=582,s=670){let i=window.screenLeft??0,r=window.screenTop??0,o=window.innerWidth||document.documentElement.clientWidth||window.screen.width,a=window.innerHeight||document.documentElement.clientHeight||window.screen.height,c=o/2-t/2+i,u=a/2-s/2+r,l=window.open(n,e,`scrollbars=no, width=${t}, height=${s}, top=${u}, left=${c}`);return l?.focus(),l}function J(n){let e=(n||window.location.origin).split(".")[1].replace("maps","");return`https://${e?`${e}${e==="qa"?"ext":""}.`:""}arcgis.com/sharing/rest/`}function P(n,e){let t=p.findOAuthInfo(n.url),{locale:s="en",expiration:i=A}=t??{},r=new URLSearchParams({locale:s,client_id:"arcgisonline",response_type:"token",expiration:`${i}`,linkUserRequest:"true",showSocialLogins:"true",hideEnterpriseLogins:"false",force_login:"true",parent:window.location.origin,redirect_uri:`https://${n.portalHostname}/home/link_account_callback.html`,state:JSON.stringify({useMessage:!0})}),o=`${J(e)}oauth2/authorize?${r.toString()}`;K(o)}function H(n){let{config:e,credential:t,clientId:s="arcgisonline",redirectToClientUri:i=!1,displaySignoutComplete:r=!1}=n,o=new URLSearchParams({display:"iframe",client_id:s,...t.token&&{token:t.token},parent:window.location.origin,redirect_uri:`${e.baseUrl}signout_callback.html`,state:JSON.stringify({signout:!0,origin:window.location.origin,redirectToClientUri:i,displaySignoutComplete:r})}),a=`${e.restBaseUrl}oauth2/signout?${o.toString()}`,c=document.createElement("iframe");c.src=a,c.style.display="none",document.body.appendChild(c)}function R(n,e){let t=h(n.orgUrlKey,e),s=p.findOAuthInfo(t),{locale:i="en",expiration:r=A}=s??{},o=y(n.provider),a=new URLSearchParams({locale:i,client_id:"arcgisonline",response_type:"token",expiration:`${r}`,parent:window.location.origin,...o==="social"&&{socialLoginProviderName:n.provider},...o==="default"&&{prepopulatedusername:n.username},force_login:"true",redirect_uri:`${t}/home/sign_in_callback.html`,state:JSON.stringify({user:n.username,server:t,portalUrl:t,origin:window.location.origin})}),c=`${U(n,e)}?${a.toString()}`;K(c)}function B({account:n,credential:e,portal:t}){let s=y(n.provider),i=U(n,t),r=N(n,t),o=new URLSearchParams({client_id:"arcgisonline",redirect_uri:r,parent:window.location.origin,response_type:"token",force_login:"false",...e.userId&&{prepopulatedusername:e.userId},...s==="social"&&{socialLoginProviderName:n.provider},expiration:`${(e?.expires??Date.now()+A)-Date.now()}`});return`${i}?${o.toString()}`}function y(n){return D(n)?"social":n==="enterprise"?"enterprise":n.includes("oidc")?"oidc":"default"}function D(n){return["apple","facebook","github","google"].includes(n)}function U(n,e){let t=h(n.orgUrlKey,e).toLowerCase(),s=y(n.provider),i="";switch(s){case"social":i="social/";break;case"enterprise":i="saml/";break;case"oidc":i=`oidc/${n.provider.split("_")[1]}/`;break}return`${t}/sharing/rest/oauth2/${i}authorize`}function h(n,e){return n?.startsWith("https://")?n:n&&e.customBaseUrl?`https://${n}.${e.customBaseUrl}`:`https://${e.portalHostname}`}function N(n,e){return`${h(n.orgUrlKey,e)}/home/accountswitcher-callback.html`}function q({origin:n,redirectToClientUri:e,displaySignoutComplete:t}){console.log("Signout complete",n,e,t)}function z(n,e){return p.findCredential(h(n.orgUrlKey,e),n.username)}function j(n,e){let t=z(n,e);if(t)return t;let s=h(n.orgUrlKey,e),i=`${s}/home/check_sign_in_status.html#state=${JSON.stringify({origin:window.location.origin,server:s,orgKey:s})}`;G(i,`iframe__for-${s}`)}function G(n,e){let t=document.createElement("iframe");t.src=n,t.id=e,t.style.display="none",document.body.appendChild(t)}var w=100,$=class extends S{constructor(){super(),this.messages=M({blocking:!0}),this.clientId="arcgisonline",this.targetUser="",this.targetToken="",this.baseUrl="",this.linkedAccounts=[],this.loading=!1,this.signedInStatus={},this.showAssociatedAccountsWarning=!1,this.arcgisAccountSwitch=f(),this.arcgisClose=f(),this.listenOn(window,"message",this.handleMessageEvent)}static{this.properties={linkedAccounts:16,userAccounts:16,user:16,credential:16,alertOptions:16,loading:16,signedInStatus:16,showAssociatedAccountsWarning:16,portal:0}}static{this.styles=L}connectedCallback(){super.connectedCallback(),this.baseUrl=h(this.portal?.urlKey??"",this.portal)}willUpdate(e){e.has("portal")&&(this.user=this.portal?.user),(e.has("portal")||e.has("user"))&&this.portal&&this.user&&this.findLinkedUsers()}handleMessageEvent(e){if(new URL(e.origin).hostname!=="localhost"&&(e.origin.endsWith(".arcgis.com")||e.origin===window.location.origin)){if(typeof e.data=="string"){JSON.parse(e.data).type==="token_exchange"&&this.handleExchangeTokenMessage(e);return}if("type"in e.data)switch(e.data.type){case"signin":this.handleSigninMessage(e);return;case"signout":this.handleSignoutMessage(e);return;case"linkUser":this.handleLinkUserMessage(e);return;case"token_exchange":this.handleExchangeTokenMessage(e);return}if("credential"in e.data){this.handleSigninMessage(e);return}this.handleCheckSignInStatusMessage(e)}}handleSignoutMessage(e){let{error:t,signout:s,accountOrigin:i,redirectToClientUri:r,displaySignoutComplete:o}=e.data;if(t&&t!=="unknown"){console.error(t),reportError(this.messages.errors.signout);return}s&&(this.user=void 0,this.credential=void 0,q({origin:i,redirectToClientUri:r,displaySignoutComplete:o}))}handleSigninMessage(e){let{messages:t}=this,{error:s,status:i,state:r,access_token:o,ssl:a}=e.data;if(s){console.error(s),reportError(t.errors.signin);return}if(i==="success"){let{portal:c,user:u}=this,l=this.linkedAccounts.find(W=>W.username===r.user);l?.orgUrlKey===this.portal.urlKey&&p.findCredential(`https://${c.portalHostname}`,u?.username)?.destroy();let m={server:r.portalUrl,userId:r.user,token:o,expires:Number(e.data.expires_in)+Date.now(),ssl:a===void 0||a!=="false"};p.registerToken(m);let k=B({account:l,credential:m,portal:c});window.self!==window.top?window.top?.postMessage({type:"navigate",url:k}):window.location.href=k}}handleCheckSignInStatusMessage(e){let{success:t,orgKey:s,server:i,userId:r,token:o,expires:a,ssl:c}=e.data;s&&i&&t&&r&&o&&a&&c!==void 0&&(this.signedInStatus[r]={token:o,expires:a,ssl:c})}async handleLinkUserMessage(e){let{error:t,username:s,access_token:i}=e.data,{portal:r,user:o,linkedAccounts:a,messages:c}=this;if(t){if(t.toString().toLowerCase().includes("user denied your request"))return;reportError(c.errors.accessAccount);return}if(s===o?.username){reportError(c.errors.selfLink);return}if(a.find(l=>l.username===s)){reportError(g(c.errors.alreadyLinked,{username:s}));return}let u=await O(r,s,i);if(u?.length){this.userAccounts=u,this.targetUser=s??"",this.targetToken=i??"",this.showAssociatedAccountsWarning=!0;return}this.linkAccount(s,i)}handleExchangeTokenMessage(e){let t=typeof e.data=="string"?JSON.parse(e.data):e.data;if(!(t.type&&t.type!=="token_exchange")){if(t.error)console.error(t);else if(t.status==="success"&&this.targetUser){let{portal:s,linkedAccounts:i,targetUser:r,clientId:o}=this,a=i.find(k=>k.username===r);if(!a)return;let c=N(a,s),u=h(a.orgUrlKey,s),l=new URLSearchParams({response_type:"token",client_id:o,redirect_uri:c,state:JSON.stringify({user:a.username,portalUrl:u})}),m=`${U(a,s)}?${l.toString()}`;window.opener?(window.opener.location.href=m,window.close()):window.location.href=m}}}async findLinkedUsers(){if(!this.portal||!this.user){this.linkedAccounts=[];return}this.loading=!0,this.linkedAccounts=await x(this.portal,this.user),this.linkedAccounts.length&&(this.signedInStatus=this.linkedAccounts.filter(e=>e.orgUrlKey!==this.portal.urlKey).reduce((e,t)=>(e[t.username]=j(t,this.portal)??null,e),{})),this.loading=!1}async linkAccount(e,t){let{portal:s,user:i}=this;if(!s||!i)return;let r=await E({portal:s,user:i,targetUser:e,targetToken:t}),{messages:o}=this;if(r.error){this.reportError(g(o.errors.linkAccount,{username:e})),this.targetUser="",this.userAccounts=[];return}let a=this.userAccounts?.length?o.success.linkAccountMultiple:o.success.linkAccount;this.reportSuccess(g(a,{username:e})),this.targetUser="",this.userAccounts=[],await C(350),this.findLinkedUsers()}async unlinkAccount(e){if(!this.portal||!this.user)return;let{messages:t,portal:s,user:i}=this,{success:r}=await I({portal:s,user:i,linkedUsername:e.username});r?this.reportSuccess(g(t.success.unlinkAccount,{username:e.username})):this.reportError(g(t.errors.unlinkAccount,{username:e.username})),await this.findLinkedUsers()}startAccountLink(){P(this.portal,this.baseUrl)}switchAccount(e){let{portal:t,user:s,clientId:i}=this;if(!t||!s||!e)return;let r=h(s.sourceJSON.orgUrlKey??"",t),o=p.findCredential(r,s.id||s.username);o&&H({config:{baseUrl:r,restBaseUrl:`${r}/sharing/rest`},credential:o,clientId:i}),R(e,t)}reportError(e,t,s=!1){this.alertOptions={kind:s?"warning":"danger",title:t,message:e}}reportSuccess(e,t){this.alertOptions={kind:"success",title:t,message:e}}showUnlinkConfirmation(e){let{messages:t}=this;this.alertOptions={kind:"danger",icon:"exclamation-mark-triangle-f",title:t.unlinkTitle,message:t.unlinkWarning,actions:[{text:t.unlink,kind:"danger",clickHandler:()=>{this.alertOptions=void 0,this.unlinkAccount(e)}}]}}render(){let{linkedAccounts:e,user:t,portal:s,messages:i}=this;return!s||!t?null:d`<calcite-dialog .heading=${i.switchAccounts} scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${()=>{this.arcgisClose.emit()}}><calcite-block .heading=${i.currentAccount} expanded class="current-account-block"><calcite-list .label=${g(i.currentAccountLabel,{username:t.username})} interaction-mode=static selection-mode=none class="current-account-list"><calcite-list-item><arcgis-portal-user-avatar .user=${t} .portal=${s} show-name .heading=${t.username} .description=${s.name||""} slot=content-start></arcgis-portal-user-avatar></calcite-list-item></calcite-list></calcite-block>${e.length>0?d`<calcite-block .heading=${i.chooseAccount} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${e.length>=w}>${i.linkAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${e} .signedInUsers=${Object.keys(this.signedInStatus).filter(r=>this.signedInStatus[r]!==null)} .label=${i.usersList} interactive @arcgisAccountSwitch=${r=>{this.switchAccount(r.detail.account)}} @arcgisAccountUnlink=${r=>{this.showUnlinkConfirmation(r.detail.account)}}></arcgis-portal-account-switcher-list></calcite-block>`:d`<calcite-block .heading=${i.chooseAccount} expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${b`<path d=${T.couple??_} fill=currentColor />`}</svg><h4>${i.emptyListTitle}</h4><p>${i.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${e.length>=w}>${i.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${e.length>=w}><div slot=message>${i.maxAccounts}</div></calcite-notice><calcite-alert .label=${i.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind!=="danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${()=>{this.alertOptions=void 0}}>${this.alertOptions?.title&&d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>`||""}${this.alertOptions?.message&&d`<p slot=message class="alert-message">${this.alertOptions.message}</p>`||""}${this.alertOptions?.actions?.map(r=>d`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning&&d`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts??[]} @arcgisLinkAll=${()=>{this.linkAccount(this.targetUser,this.targetToken)}} @arcgisCloseDialog=${()=>{this.showAssociatedAccountsWarning=!1}}></arcgis-portal-account-switcher-accounts>`||""}`}};v("arcgis-portal-account-switcher",$);return $},"identity/IdentityManager","intl",a,c)
|