@orangelogic/orange-dam-content-browser-sdk 2.3.1 → 2.3.2-pr102935.2
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.
|
@@ -2281,7 +2281,7 @@
|
|
|
2281
2281
|
</cx-space>
|
|
2282
2282
|
<slot></slot>
|
|
2283
2283
|
</cx-space>
|
|
2284
|
-
`}};b4.styles=[ga,f4],b4.dependencies={"cx-avatar":JC,"cx-divider":PS,"cx-dropdown":hT,"cx-icon":vh,"cx-icon-button":Sh,"cx-line-clamp":rv,"cx-menu":tT,"cx-menu-item":$S,"cx-skeleton":NO,"cx-space":vv,"cx-typography":uv},v4([dt({type:Boolean})],b4.prototype,"bordered",2),v4([dt({attribute:"application-name",type:String})],b4.prototype,"applicationName",2),v4([dt({type:Boolean})],b4.prototype,"loading",2),v4([dt({attribute:"is-fetching",type:Boolean})],b4.prototype,"isFetching",2),v4([dt({attribute:"avatar",type:String})],b4.prototype,"avatar",2),v4([dt({attribute:"full-name",type:String})],b4.prototype,"fullName",2),v4([dt({attribute:"folder-title",type:String})],b4.prototype,"folderTitle",2),v4([dt({attribute:"show-close-button",type:Boolean})],b4.prototype,"showCloseButton",2),v4([dt({attribute:"can-logout",type:Boolean})],b4.prototype,"canLogout",2),b4=v4([Us("cx-content-browser-header")],b4);const A4="CoreField.LargeSizePreview",w4="AllowATSLink",x4="CoreField.DocType",_4="Document.FileExtension",E4="CoreField.FileSize",C4="CoreField.Identifier",S4="CoreField.Keywords",T4="CoreField.MaxHeight",k4="CoreField.MaxWidth",I4="CoreField.OriginalFileName",M4="Document.RecordID",P4="ScrubURL",R4="CoreField.S6_StorageGroup",B4="CoreField.DocSubType",O4="CoreField.TitleWithFallback",D4="CoreField.UpdatedFileName",L4="CoreField.OriginalPreview";function N4(e){return e&&0!==Object.keys(e).length?Object.entries(e).reduce((e,[t,n])=>n&&0!==n.length?B(R({},e),"Types"===t?{SubtypeCriteria:n}:{FacetFilters:B(R({},e.FacetFilters),{[t]:n})}):e,{}):{}}const z4=new Set([405,501]),F4=new Set;function j4(){const e=globalThis.crypto;if(null==e?void 0:e.randomUUID)return e.randomUUID();if(null==e?void 0:e.getRandomValues){const t=e.getRandomValues(new Uint8Array(16));t[6]=15&t[6]|64,t[8]=63&t[8]|128;const n=Array.from(t,e=>e.toString(16).padStart(2,"0"));return[n.slice(0,4).join(""),n.slice(4,6).join(""),n.slice(6,8).join(""),n.slice(8,10).join(""),n.slice(10).join("")].join("-")}return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function U4({asset:e,extension:t,parameters:n,permanentLink:i,rawResponse:r,transformations:o,useSession:a}){let s=i||r.imageUrl,l="";o&&o.length>0&&(l+="/t/"),null==o||o.forEach(({key:e,value:t})=>{if(e===mS.Resize){const e=[...[{key:"re_w_",value:t.width},{key:"re_h_",value:t.height}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))})),{key:"re_rm_",value:"stretch"}];e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}if(e===mS.Crop){const e=[...[{key:"c_w_",value:t.width},{key:"c_h_",value:t.height},{key:"c_x_",value:t.x},{key:"c_y_",value:t.y}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))})),{key:"c_whu_",value:"pixel"}];e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}if(e===mS.Rotate){const e=[{key:"r_a_",value:t.rotation}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))}));e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}if(e===mS.Quality){const e=[{key:"q_level_",value:t.quality}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))}));e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}e===mS.Metadata&&!0===t.keepMetadata&&(l+="fl_keep_metadata/")});const c=Boolean(o&&o.length>0);if(c&&(l+=`${e.identifier}`),!i){const n=null!=t?t:e.extension,i=n.startsWith(".")?n:`.${n}`;if(c)l+=i;else{const[e,t]=s.split(/([?#].*)$/,2);s=e.replace(/\.[^./]+$/,"")+i+(null!=t?t:"")}}const u=[];return null==n||n.forEach(({key:e,value:t})=>{u.push(`${encodeURIComponent(e.trim())}=${encodeURIComponent(t.trim())}`)}),a&&u.push(`UseSession=${encodeURIComponent(a)}`),((e,t,n=[])=>{const i=[e.indexOf("?"),e.indexOf("#")].filter(e=>-1!==e).reduce((e,t)=>-1===e?t:Math.min(e,t),-1),r=-1===i?e:e.slice(0,i),o=-1===i?"":e.slice(i),a=o.indexOf("#"),s=-1===a?"":o.slice(a),l=(-1===a?o:o.slice(0,a)).replace(/^\?/,""),c=e=>e.split("=")[0].toLowerCase(),u=new Set(n.map(c)),d=[...l.split("&").filter(e=>e&&!u.has(c(e))),...n];return`${r}${t}${d.length>0?`?${d.join("&")}`:""}${s}`})(s,l,u)}function H4(e){return U(this,arguments,function*({extraFields:e,recordIds:t}){var n;if(!Array.isArray(t)||0===t.length)return{facets:[],items:[],totalCount:0};const i=null!=(n=null==e?void 0:e.filter(e=>e&&"string"==typeof e))?n:[];try{return(yield ca.request({method:"GET",params:{ExtraFilters:`RecordID:${t.join(" OR ")}`,Fields:[...i,L4,D4,I4,"Document.Title","Document.CaptionLong"],SeeThru:!0},paramsSerializer:{indexes:null},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var n,r;const o=null!=(r=null==(n=e.contentItems)?void 0:n.map(e=>{var t,n,r;let o=null!=(t=e.fields[D4])?t:"";return""===o&&(o=null!=(n=e.fields[I4])?n:""),R({name:o,originalUrl:null!=(r=e.fields[L4])?r:"",recordId:e.recordID},i.reduce((t,n)=>{var i;return t[n]=null!=(i=e.fields[n])?i:"",t},{}))}))?r:[];return o.sort((e,n)=>t.indexOf(e.recordId)-t.indexOf(n.recordId)),{facets:e.facets,items:o,totalCount:e.totalCount}}],url:da.GET_CONTENT_V1})).data}catch(r){return{facets:[],items:[],totalCount:0}}})}function Q4(e){return U(this,arguments,function*({folderId:e,isSeeThrough:t,limitedToDocTypes:n=[],pageSize:i,searchText:r,selectedFacets:o,sortOrder:a,start:s,useSession:l}){try{return(yield ca.request({data:R({Fields:[A4,x4,_4,E4,C4,S4,T4,k4,I4,M4,B4,O4,D4,R4,L4],Limit:i||void 0,LimitedToDocTypes:n,ObjectRecordID:e||void 0,OrderBy:a,SeeThru:t||void 0,SelectedFacets:o,Start:s,Text:r||void 0,UseSession:l||void 0},N4(o)),method:"POST",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n;const i=null!=(n=null==(t=e.contentItems)?void 0:t.map(e=>{var t,n,i,r,o,a,s,l,c,u,d,h;let p=null!=(t=e.fields[_4])?t:"";const f=e.fields[O4];return p&&!p.startsWith(".")&&(p="."+p),{allowATSLink:"True"===e.fields[w4],docSubType:null!=(n=e.fields[B4])?n:"",docType:null!=(i=e.fields[x4])?i:"",extension:p,height:null!=(r=e.fields[T4])?r:"0",id:e.recordID,identifier:null!=(o=e.fields[C4])?o:"",imageUrl:null!=(a=e.fields[A4])?a:"",inColdStorage:"Cold Storage"===e.fields[R4],name:null!=f?f:"",originalUrl:null!=(s=e.fields[L4])?s:"",recordId:null!=(l=e.fields[M4])?l:"",scrubUrl:null!=(c=e.fields[P4])?c:"",size:null!=(u=e.fields[E4])?u:"0 MB",tags:null!=(d=e.fields[S4])?d:"",width:null!=(h=e.fields[k4])?h:"0"}}))?n:[];return{facets:e.facets,items:i,totalCount:e.totalCount}}],url:da.GET_CONTENT_V3})).data}catch(c){return{facets:[],items:[],totalCount:0}}})}function V4(e){return U(this,arguments,function*({assetRecordId:e,siteUrl:t}){try{return(yield ca.request({baseURL:t,method:"GET",params:{RecordId:e},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n,i;return e&&"object"==typeof e?{previewUrl:null!=(t=e.previewUrl)?t:"",proxies:null!=(i=null==(n=e.proxies)?void 0:n.map(e=>({cdnName:e.cdnName,extension:e.extension,formatHeight:e.formatHeight,formatWidth:e.formatWidth,height:e.height,id:j4(),permanentLink:e.permanentLink,proxyLabel:e.proxyLabel,proxyName:e.proxyName,width:e.width})))?i:[]}:{previewUrl:"",proxies:[]}}],url:da.GET_AVAILABLE_PROXIES})).data}catch(n){return{previewUrl:"",proxies:[]}}})}var G4=(e=>(e.CollectionSubtypeCriteria="CollectionSubtypeCriteria",e.EnableATSInGetLink="EnableATSInGetLink",e.ExtensionAuto="ExtensionAuto",e.ExtensionsEmbeddableInWeb="ExtensionsEmbeddableInWeb",e.ExtensionsThatSupportTransformationUsingATS="ExtensionsThatSupportTransformationUsingATS",e.RepresentativeSupportedDocSubType="RepresentativeSupportedDocSubType",e.SupportDocTypes="SupportDocTypes",e.SupportedDocSubTypesV2="SupportedDocSubTypesV2",e))(G4||{});var W4=Math.min;var q4=Math.max;var $4=function(){try{var e=bE(Object,"defineProperty");return e({},"",{}),e}catch(Pg){}}(),X4=$4?function(e,t){return $4(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:hk,Y4=Date.now;var K4=function(e){var t=0,n=0;return function(){var i=Y4(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(X4);function Z4(e){return function(e){return Mt(e)&&gC(e)}(e)?e:[]}var J4=function(e,t){return K4(function(e,t,n){return t=q4(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=q4(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,hk),e+"")}(function(e){var t=wt(e,Z4);return t.length&&t[0]===e[0]?function(e,t,n){for(var i=n?vk:gk,r=e[0].length,o=e.length,a=o,s=Array(o),l=1/0,c=[];a--;){var u=e[a];a&&t&&(u=wt(u,nC(t))),l=W4(u.length,l),s[a]=!n&&(t||r>=120&&u.length>=120)?new kE(a&&u):void 0}u=e[0];var d=-1,h=s[0];e:for(;++d<r&&c.length<l;){var p=u[d],f=t?t(p):p;if(p=n||0!==p?p:0,!(h?ME(h,f):i(c,f,n))){for(a=o;--a;){var m=s[a];if(!(m?ME(m,f):i(e[a],f,n)))continue e}h&&h.push(f),c.push(p)}}return c}(t):[]});class e5{constructor(e,{availableDocTypes:t,baseUrl:n,defaultFolderId:i,defaultIsSeeThrough:r,defaultSearchText:o,defaultSelectedFacets:a,defaultSortDirection:s,defaultSortOrderName:l,token:c,useSession:u}){var d,h;z(this,v),z(this,y),z(this,b),z(this,A),this.availableFacets=[],this.facets=[],this.items=[],this.totalCount=0,this.lastRequest=null,this.sortOrders={},this.parameters=null,this.availableExtensions=null,this.userInfo=null,this.loading=!1,this.isLoggedIn=!0,this.pendingTokenRefresh=null,this.resolvePendingTokenRefresh=null,this.tokenRefreshTimeoutMs=15e3,F(this,v,null),F(this,y,null),F(this,b,null),F(this,A,!1),this.requestInterceptorId=null,this.responseInterceptorId=null,this._debouncePromise=null,this._debounceResolve=null,this.host=e,this.availableDocTypes=t,this.defaultFolderId=i,this.defaultIsSeeThrough=r,this.defaultSearchText=o,this.defaultSelectedFacets=a,this.defaultSortOrderName=l,this.defaultSortDirection=s,this.token=c,this.useSession=u,ca.defaults.baseURL=n,this.requestInterceptorId=ca.interceptors.request.use(e=>(e.url&&![da.GET_AVAILABLE_EXTENSIONS,da.GET_ASSET_VERSION_HISTORY,da.GET_CONTENT_V1,da.ADD_ASSET_TO_FAVORITE,da.REMOVE_ASSET_FROM_FAVORITE,da.GET_FAVORITE_ASSETS,da.GET_CONTENT_V3,da.GET_AVAILABLE_PROXIES,da.GET_ASSET_LINK,pa.GET_AVAILABLE_FACETS,pa.GET_CONTENT_BROWSER_PARAMETERS,pa.GET_SORT_ORDERS,ha.GET_USER_INFO,ua].includes(e.url)||(n&&(e.baseURL=n),e.params=B(R({},e.params),{Token:this.token||void 0,UseSession:this.useSession||void 0})),e)),this.responseInterceptorId=ca.interceptors.response.use(e=>(e.status>=200&&e.status<300&&!this.isLoggedIn&&(this.isLoggedIn=!0,this.host.requestUpdate()),e),e=>U(this,null,function*(){var t;const n=null==e?void 0:e.config;if(401===(null==(t=null==e?void 0:e.response)?void 0:t.status)&&n&&!n._retry){n._retry=!0;return(yield this.waitForNewToken())?ca.request(n):(this.isLoggedIn=!1,this.host.requestUpdate(),Promise.reject(e))}return Promise.reject(e)})),null==(h=(d=this.host).addController)||h.call(d,this)}waitForNewToken(){return this.pendingTokenRefresh||(this.pendingTokenRefresh=new Promise(e=>{this.resolvePendingTokenRefresh=e}),globalThis.dispatchEvent(new CustomEvent("cx-unauthorized")),setTimeout(()=>{this.resolvePendingTokenRefresh&&(this.resolvePendingTokenRefresh(null),this.pendingTokenRefresh=null,this.resolvePendingTokenRefresh=null)},this.tokenRefreshTimeoutMs)),this.pendingTokenRefresh}updateAuth(e,t){const n=this.token!==e,i=!this.isLoggedIn;this.token=e,this.useSession=t,n&&this.resolvePendingTokenRefresh&&(this.resolvePendingTokenRefresh(e||null),this.pendingTokenRefresh=null,this.resolvePendingTokenRefresh=null),n&&i&&e&&(this.isLoggedIn=!0,this.fetchInitialData(),this.lastRequest&&this.fetchAndMergeAssets(this.lastRequest),this.host.requestUpdate())}fetchInitialData(){(function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n,i,r;if(!e||"object"!=typeof e)throw new Error("Invalid response format");return(null==(t=e.avatar)?void 0:t.includes("://"))?e:B(R({},e),{avatar:`${null!=(i=null==(n=ca.defaults.baseURL)?void 0:n.replace(/\/$/,""))?i:""}/${null==(r=e.avatar)?void 0:r.replace(/^\//,"")}`})}],url:ha.GET_USER_INFO})).data}catch(e){return null}})})().then(e=>{this.userInfo=e,this.host.requestUpdate()}),function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>Array.isArray(null==e?void 0:e.facets)?e.facets:[]],url:pa.GET_AVAILABLE_FACETS})).data}catch(e){return[]}})}().then(e=>{this.availableFacets=e,this.host.requestUpdate()}),function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n,i,r,o,a,s,l;return{ATSEnabled:"true"===e[G4.EnableATSInGetLink].toLowerCase(),autoExtension:null!=(n=null==(t=e[G4.ExtensionAuto])?void 0:t.toLowerCase())?n:".auto",collectionPath:null!=(r=null==(i=e[G4.CollectionSubtypeCriteria])?void 0:i.toLowerCase())?r:"",supportedExtensions:null!=(a=null==(o=e[G4.ExtensionsThatSupportTransformationUsingATS])?void 0:o.split("\n"))?a:[],supportedRepresentativeSubtypes:null!=(l=null==(s=e[G4.RepresentativeSupportedDocSubType])?void 0:s.split("\r\n"))?l:[]}}],url:pa.GET_CONTENT_BROWSER_PARAMETERS})).data}catch(e){return{ATSEnabled:!1,autoExtension:".auto",collectionPath:"",supportedExtensions:[],supportedRepresentativeSubtypes:[]}}})}().then(e=>{this.parameters=e,this.host.requestUpdate()}),function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>e.extensions],url:da.GET_AVAILABLE_EXTENSIONS})).data}catch(e){return{}}})}().then(e=>{this.availableExtensions=e,this.host.requestUpdate()})}mapAvailableExtensions(e){return this.availableExtensions&&e&&0!==e.length?Object.entries(this.availableExtensions).reduce((t,[n,i])=>B(R({},t),{[n]:i.filter(t=>!e||0===e.length||e.some(e=>t.value.toLowerCase()===`.${e.toLowerCase()}`))}),this.availableExtensions):this.availableExtensions}fetchAssets(e){return U(this,null,function*(){return yield Q4(e)})}fetchFolders(e){return U(this,null,function*(){return yield function(e){return U(this,arguments,function*({allowedFolders:e,baseUrl:t,bearerToken:n,excludeVirtualFolders:i,folderId:r,includeDirectChild:o,limit:a=50,searchTerm:s,self:l,start:c=0,token:u}){let d=[],h=null==o||o;e&&e.length>0&&!r?(d=e,l=!0,h=!1):r&&(d=[r]);try{return(yield ca.request({baseURL:t,headers:{Authorization:`Bearer ${n}`},method:"GET",params:{IncludeDirectChild:h,IncludeVirtualFolders:!i,Limit:a,ObjectRecordIDs:d,SeeThru:!!s,Self:l,Start:c,Text:s||void 0,Token:u||void 0},paramsSerializer:{indexes:null},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],(e,t,n)=>{var i,r,o,a;if(void 0!==n&&(n<200||n>=300))return{data:[],hasMore:!1,totalCount:0};if(!e||"object"!=typeof e)throw new Error("Invalid response format");const s=null!=(r=null==(i=e.contentItems)?void 0:i.length)?r:0;return{data:null!=(a=null==(o=e.contentItems)?void 0:o.map(e=>{var t,n,i,r;return{docType:null!=(t=e.fields[fa.DocType])?t:"",fullPath:null!=(n=e.fields[fa.CortexPath])?n:"",hasChildren:"1"===e.fields[fa.HasBrowserChildren],id:e.recordID,isShared:"DO_OR1ND000001913488"===e.fields[fa.rawDocSubtype],representativeAssetId:null!=(i=e.fields[fa.RepresentativeAssetId])?i:"",title:null!=(r=e.fields[fa.TitleWithFallback])?r:""}}))?a:[],hasMore:c+s<e.totalCount,totalCount:e.totalCount}}],url:ua})).data}catch(p){return{data:[],hasMore:!1,totalCount:0}}})}(e)})}mergeFacetsWithSelected(e,t,n={}){const i=e=>`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,r=new Map(t.map(e=>[i(e),B(R({},e),{values:e.values.filter(t=>{var i;return null==(i=n[e.facetDetails.facetFieldName])?void 0:i.includes(t.value)}).map(e=>B(R({},e),{count:0}))})]));return e.filter(e=>e.values.length>0).forEach(e=>{var t,n;const o=null!=(n=null==(t=r.get(i(e)))?void 0:t.values)?n:[],a=[...e.values,...o.filter(t=>!e.values.some(e=>e.value===t.value&&e.displayValue===t.displayValue))];r.set(i(e),B(R({},e),{values:a}))}),Array.from(r.values())}fetchAndMergeAssets(e){return U(this,null,function*(){this.loading=!0,this.host.requestUpdate(),null!==e.start&&(this._debounceTimeout&&(clearTimeout(this._debounceTimeout),this._debounceTimeout=void 0),null!=this._debouncePromise||(this._debouncePromise=new Promise(e=>{this._debounceResolve=e})),this._debounceTimeout=setTimeout(()=>U(this,null,function*(){var t,n,i,r,o;if(0===Object.keys(this.sortOrders).length){const e=yield function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>(Array.isArray(null==e?void 0:e.sortOrders)?e.sortOrders:[]).reduce((e,t)=>{var n,i,r;const o=(null==(n=null==t?void 0:t.sortDirectionGroupKey)?void 0:n.trim())||(null==(i=null==t?void 0:t.name)?void 0:i.trim());if(!o)return e;const a=o.toLowerCase();return e[a]=[...null!=(r=e[a])?r:[],t],e},{})],url:pa.GET_SORT_ORDERS})).data}catch(e){return{}}})}();this.sortOrders=e}const a=e.start===(null==(t=this.lastRequest)?void 0:t.start)&&!!e.pageSize&&!!(null==(n=this.lastRequest)?void 0:n.pageSize)&&e.pageSize>(null==(i=this.lastRequest)?void 0:i.pageSize);let s;N(this,A)||(e=B(R({},e),{folderId:this.defaultFolderId,isSeeThrough:this.defaultIsSeeThrough,searchText:this.defaultSearchText,selectedFacets:this.defaultSelectedFacets,sortDirection:this.defaultSortDirection,sortOrderName:this.defaultSortOrderName})),e.sortOrderName&&e.sortDirection&&(s=null==(o=null==(r=this.sortOrders[e.sortOrderName])?void 0:r.find(t=>{var n;return t.sortDirection.toLowerCase()===(null==(n=e.sortDirection)?void 0:n.toLowerCase())}))?void 0:o.id,!s&&this.sortOrders[e.sortOrderName][0]&&(s=this.sortOrders[e.sortOrderName][0].id,e.sortDirection=this.sortOrders[e.sortOrderName][0].sortDirection)),e=B(R({},e),{limitedToDocTypes:this.availableDocTypes}),this.lastRequest=e;const l=yield Q4(B(R({},e),{sortOrder:s}));e.start&&e.start>0&&!a?this.items=bk([...this.items,...l.items],"recordId"):this.items=l.items,this.facets=this.mergeFacetsWithSelected(l.facets,this.facets,e.selectedFacets),this.totalCount=l.totalCount,this.loading=!1,F(this,A,!0),this.host.requestUpdate(),this._debounceResolve&&this._debounceResolve(this.lastRequest),this._debouncePromise=null,this._debounceResolve=null}),200))})}fetchAssetFavoriteStatus(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e}){try{return(yield ca.request({method:"GET",params:{RecordId:e},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],t=>!!t.favoriteRecordIds&&t.favoriteRecordIds.includes(e)],url:da.GET_FAVORITE_ASSETS})).data}catch(t){return!1}})}({assetRecordId:e})})}fetchAssetByID(e,t){return U(this,null,function*(){var n,i,r,o,a,s,l,c,u,d,h,p,f,m;const{allowedExtensions:g=[],canFavorite:v=!1}=null!=t?t:{},y=[H4({extraFields:[A4,x4,_4,E4,C4,S4,T4,k4,I4,M4,B4,O4,L4],recordIds:[e]}),V4({assetRecordId:e})];v?y.push(this.fetchAssetFavoriteStatus(e)):y.push(Promise.resolve(!1));const[b,A,w=!1]=yield Promise.all(y),x=null==b?void 0:b.items[0];if(!x)return;let _=x[_4];return _&&!_.startsWith(".")&&(_="."+_),{asset:{allowATSLink:"True"===x[w4],docSubType:null!=(n=x[B4])?n:"",docType:null!=(i=x[x4])?i:"",extension:_,height:null!=(r=x[T4])?r:"0",id:x.recordId,identifier:null!=(o=x[C4])?o:"",imageUrl:null!=(a=x[A4])?a:"",inColdStorage:Boolean(x.inColdStorage),name:null!=(s=x[O4])?s:"",originalUrl:null!=(l=x[L4])?l:"",previewUrl:null!=(c=null==A?void 0:A.previewUrl)?c:"",recordId:null!=(u=x[M4])?u:"",scrubUrl:null!=(d=x[P4])?d:"",size:null!=(h=x[E4])?h:"0 MB",tags:null!=(p=x[S4])?p:"",width:null!=(f=x[k4])?f:"0"},isFavorite:w,proxies:(null!=(m=null==A?void 0:A.proxies)?m:[]).filter(e=>{var t;if(!g||0===g.length)return!0;let n="";if(e.extension)n=e.extension.replace(".","");else{const i=null==(t=e.permanentLink)?void 0:t.split(".").at(-1);n=null!=i?i:""}return g.some(e=>!!n&&n.toLowerCase()===e.toLowerCase())})}})}fetchAssetVersionHistory(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e}){try{return(yield ca.request({method:"GET",params:{RecordId:e},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>({count:e.count,versions:e.versions.map(e=>({createByEmail:e.CreateByEmail,fileImportDate:e.FileImportDate,scrubUrl:e.ScrubUrl,versionCreateDate:e.VersionCreateDate,versionFileName:e.UpdatedFileName||e.VersionFileName,versionFileUrl:e.PreviewUrl,versionId:e.VersionID,versionNumber:Number(e.VersionNumber),versionNumberDisplay:e.VersionNumberDisplay}))})],url:da.GET_ASSET_VERSION_HISTORY})).data}catch(t){return{count:0,versions:[]}}})}({assetRecordId:e})})}addAssetToFavorite(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e,siteUrl:t}){try{return(yield ca.request({baseURL:t,data:{RecordId:e},method:"POST",responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>!!e.success],url:da.ADD_ASSET_TO_FAVORITE})).data}catch(n){return!1}})}({assetRecordId:e})})}removeAssetFromFavorite(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e,siteUrl:t}){try{return(yield ca.request({baseURL:t,data:{RecordId:e},method:"POST",responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>!!e.success],url:da.REMOVE_ASSET_FROM_FAVORITE})).data}catch(n){return!1}})}({assetRecordId:e})})}getAssetLink(e){return U(this,null,function*(){var t;const n=yield function(e){return U(this,arguments,function*({assets:e,extension:t,extraFields:n,parameters:i,permanentLink:r,proxyPreference:o,transformations:a,useSession:s}){var l;const c={},u=1===e.length;let d=!1;const h=null!=(l=ca.defaults.baseURL)?l:window.location.origin;try{const l=(yield Promise.allSettled(e.map(e=>U(null,null,function*(){const l={GenerateAssetUrl:!r,Parameters:i,Proxy:o,RecordId:e.recordId};(null==n?void 0:n.length)&&(l.ExtraFields=n);const p=s?`?${new URLSearchParams({UseSession:s}).toString()}`:"";let f;if(!F4.has(h))try{const e=yield ca.request({data:l,method:"POST",url:`${da.GET_ASSET_LINK}${p}`,validateStatus:()=>!0});z4.has(e.status)?F4.add(h):f=e.data}catch(Pg){}if(void 0===f&&(f=(yield ca.request({method:"GET",params:B(R({},l),{UseSession:s||void 0}),paramsSerializer:{indexes:null},url:da.GET_ASSET_LINK})).data),(m=f)&&"object"==typeof m&&"ErrorCode"in m)return d=!0,u&&(c[f.ErrorCode]?c[f.ErrorCode].push(e):c[f.ErrorCode]=[e]),{imageUrl:e.imageUrl};var m;const g=U4({asset:e,extension:t,parameters:i,permanentLink:r,rawResponse:f,transformations:a,useSession:s});return B(R({},f),{imageUrl:g})})))).flatMap(e=>"fulfilled"===e.status?[e.value]:(d=!0,[]));return{data:l,isError:d}}catch(Pg){return{data:[],isError:!0}}})}(B(R({},e),{useSession:null!=(t=e.useSession)?t:this.useSession}));return e.useRepresentative?B(R({},n),{data:n.data.map((t,n)=>{var i,r;return B(R({},t),{imageUrl:null!=(r=null==(i=e.assets[n])?void 0:i.imageUrl)?r:t.imageUrl})})}):n})}getData(e){var t,n;const{allowedExtensions:i=[],availableRepresentativeSubtypes:r=[]}=null!=e?e:{};return HC(N(this,v),e)||(F(this,v,{allowedExtensions:i,availableRepresentativeSubtypes:r}),F(this,y,this.mapAvailableExtensions(i))),F(this,b,{availableExtensions:N(this,y),availableFacets:this.availableFacets,facets:this.facets,isLoggedIn:this.isLoggedIn,items:this.items,loading:this.loading,parameters:this.parameters?B(R({},this.parameters),{supportedRepresentativeSubtypes:(null==r?void 0:r.length)?J4(r,null!=(t=this.parameters.supportedRepresentativeSubtypes)?t:[]):null!=(n=this.parameters.supportedRepresentativeSubtypes)?n:[]}):null,request:this.lastRequest,sortOrders:this.sortOrders,totalCount:this.totalCount,userInfo:this.userInfo}),N(this,b)}hostConnected(){this.fetchInitialData()}hostDisconnected(){null!==this.requestInterceptorId&&(ca.interceptors.request.eject(this.requestInterceptorId),this.requestInterceptorId=null),null!==this.responseInterceptorId&&(ca.interceptors.response.eject(this.responseInterceptorId),this.responseInterceptorId=null),this.facets=[],this.items=[],this.totalCount=0,this.sortOrders={}}}function t5(e){return Number.isNaN(e)||!Number.isInteger(e)?0:e}v=new WeakMap,y=new WeakMap,b=new WeakMap,A=new WeakMap;const n5=ie`
|
|
2284
|
+
`}};b4.styles=[ga,f4],b4.dependencies={"cx-avatar":JC,"cx-divider":PS,"cx-dropdown":hT,"cx-icon":vh,"cx-icon-button":Sh,"cx-line-clamp":rv,"cx-menu":tT,"cx-menu-item":$S,"cx-skeleton":NO,"cx-space":vv,"cx-typography":uv},v4([dt({type:Boolean})],b4.prototype,"bordered",2),v4([dt({attribute:"application-name",type:String})],b4.prototype,"applicationName",2),v4([dt({type:Boolean})],b4.prototype,"loading",2),v4([dt({attribute:"is-fetching",type:Boolean})],b4.prototype,"isFetching",2),v4([dt({attribute:"avatar",type:String})],b4.prototype,"avatar",2),v4([dt({attribute:"full-name",type:String})],b4.prototype,"fullName",2),v4([dt({attribute:"folder-title",type:String})],b4.prototype,"folderTitle",2),v4([dt({attribute:"show-close-button",type:Boolean})],b4.prototype,"showCloseButton",2),v4([dt({attribute:"can-logout",type:Boolean})],b4.prototype,"canLogout",2),b4=v4([Us("cx-content-browser-header")],b4);const A4="CoreField.LargeSizePreview",w4="AllowATSLink",x4="CoreField.DocType",_4="Document.FileExtension",E4="CoreField.FileSize",C4="CoreField.Identifier",S4="CoreField.Keywords",T4="CoreField.MaxHeight",k4="CoreField.MaxWidth",I4="CoreField.OriginalFileName",M4="Document.RecordID",P4="ScrubURL",R4="CoreField.S6_StorageGroup",B4="CoreField.DocSubType",O4="CoreField.TitleWithFallback",D4="CoreField.UpdatedFileName",L4="CoreField.OriginalPreview";function N4(e){return e&&0!==Object.keys(e).length?Object.entries(e).reduce((e,[t,n])=>n&&0!==n.length?B(R({},e),"Types"===t?{SubtypeCriteria:n}:{FacetFilters:B(R({},e.FacetFilters),{[t]:n})}):e,{}):{}}const z4=new Set([405,501]),F4=new Set;function j4(){const e=globalThis.crypto;if(null==e?void 0:e.randomUUID)return e.randomUUID();if(null==e?void 0:e.getRandomValues){const t=e.getRandomValues(new Uint8Array(16));t[6]=15&t[6]|64,t[8]=63&t[8]|128;const n=Array.from(t,e=>e.toString(16).padStart(2,"0"));return[n.slice(0,4).join(""),n.slice(4,6).join(""),n.slice(6,8).join(""),n.slice(8,10).join(""),n.slice(10).join("")].join("-")}return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function U4({asset:e,extension:t,parameters:n,permanentLink:i,rawResponse:r,transformations:o,useSession:a}){let s=i||r.imageUrl,l="";o&&o.length>0&&(l+="/t/"),null==o||o.forEach(({key:e,value:t})=>{if(e===mS.Resize){const e=[...[{key:"re_w_",value:t.width},{key:"re_h_",value:t.height}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))})),{key:"re_rm_",value:"stretch"}];e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}if(e===mS.Crop){const e=[...[{key:"c_w_",value:t.width},{key:"c_h_",value:t.height},{key:"c_x_",value:t.x},{key:"c_y_",value:t.y}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))})),{key:"c_whu_",value:"pixel"}];e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}if(e===mS.Rotate){const e=[{key:"r_a_",value:t.rotation}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))}));e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}if(e===mS.Quality){const e=[{key:"q_level_",value:t.quality}].filter(e=>void 0!==e.value).map(e=>({key:e.key,value:Math.round(Number(e.value))}));e.forEach(({key:t,value:n},i)=>{l+=`${t}${n}${i<e.length-1?",":""}`}),l+="/"}e===mS.Metadata&&!0===t.keepMetadata&&(l+="fl_keep_metadata/")});const c=Boolean(o&&o.length>0);if(c&&(l+=`${e.identifier}`),!i){const n=null!=t?t:e.extension,i=n.startsWith(".")?n:`.${n}`;if(c)l+=i;else{const[e,t]=s.split(/([?#].*)$/,2);s=e.replace(/\.[^./]+$/,"")+i+(null!=t?t:"")}}const u=[];return null==n||n.forEach(({key:e,value:t})=>{u.push(`${encodeURIComponent(e.trim())}=${encodeURIComponent(t.trim())}`)}),a&&u.push(`UseSession=${encodeURIComponent(a)}`),((e,t,n=[])=>{const i=[e.indexOf("?"),e.indexOf("#")].filter(e=>-1!==e).reduce((e,t)=>-1===e?t:Math.min(e,t),-1),r=-1===i?e:e.slice(0,i),o=-1===i?"":e.slice(i),a=o.indexOf("#"),s=-1===a?"":o.slice(a),l=(-1===a?o:o.slice(0,a)).replace(/^\?/,""),c=e=>e.split("=")[0].toLowerCase(),u=new Set(n.map(c)),d=[...l.split("&").filter(e=>e&&!u.has(c(e))),...n];return`${r}${t}${d.length>0?`?${d.join("&")}`:""}${s}`})(s,l,u)}function H4(e){return U(this,arguments,function*({extraFields:e,recordIds:t}){var n;if(!Array.isArray(t)||0===t.length)return{facets:[],items:[],totalCount:0};const i=null!=(n=null==e?void 0:e.filter(e=>e&&"string"==typeof e))?n:[];try{return(yield ca.request({method:"GET",params:{ExtraFilters:`RecordID:${t.join(" OR ")}`,Fields:[...i,L4,D4,I4,"Document.Title","Document.CaptionLong"],SeeThru:!0},paramsSerializer:{indexes:null},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var n,r;const o=null!=(r=null==(n=e.contentItems)?void 0:n.map(e=>{var t,n,r;let o=null!=(t=e.fields[D4])?t:"";return""===o&&(o=null!=(n=e.fields[I4])?n:""),R({name:o,originalUrl:null!=(r=e.fields[L4])?r:"",recordId:e.recordID},i.reduce((t,n)=>{var i;return t[n]=null!=(i=e.fields[n])?i:"",t},{}))}))?r:[];return o.sort((e,n)=>t.indexOf(e.recordId)-t.indexOf(n.recordId)),{facets:e.facets,items:o,totalCount:e.totalCount}}],url:da.GET_CONTENT_V1})).data}catch(r){return{facets:[],items:[],totalCount:0}}})}function Q4(e){return U(this,arguments,function*({folderId:e,isSeeThrough:t,limitedToDocTypes:n=[],pageSize:i,searchText:r,selectedFacets:o,sortOrder:a,start:s,useSession:l}){try{return(yield ca.request({data:R({Fields:[A4,x4,_4,E4,C4,S4,T4,k4,I4,M4,B4,O4,D4,R4,L4],Limit:i||void 0,LimitedToDocTypes:n,ObjectRecordID:e||void 0,OrderBy:a,SeeThru:t||void 0,SelectedFacets:o,Start:s,Text:r||void 0,UseSession:l||void 0},N4(o)),method:"POST",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n;const i=null!=(n=null==(t=e.contentItems)?void 0:t.map(e=>{var t,n,i,r,o,a,s,l,c,u,d,h;let p=null!=(t=e.fields[_4])?t:"";const f=e.fields[O4];return p&&!p.startsWith(".")&&(p="."+p),{allowATSLink:"True"===e.fields[w4],docSubType:null!=(n=e.fields[B4])?n:"",docType:null!=(i=e.fields[x4])?i:"",extension:p,height:null!=(r=e.fields[T4])?r:"0",id:e.recordID,identifier:null!=(o=e.fields[C4])?o:"",imageUrl:null!=(a=e.fields[A4])?a:"",inColdStorage:"Cold Storage"===e.fields[R4],name:null!=f?f:"",originalUrl:null!=(s=e.fields[L4])?s:"",recordId:null!=(l=e.fields[M4])?l:"",scrubUrl:null!=(c=e.fields[P4])?c:"",size:null!=(u=e.fields[E4])?u:"0 MB",tags:null!=(d=e.fields[S4])?d:"",width:null!=(h=e.fields[k4])?h:"0"}}))?n:[];return{facets:e.facets,items:i,totalCount:e.totalCount}}],url:da.GET_CONTENT_V3})).data}catch(c){return{facets:[],items:[],totalCount:0}}})}function V4(e){return U(this,arguments,function*({assetRecordId:e,siteUrl:t}){try{return(yield ca.request({baseURL:t,method:"GET",params:{RecordId:e},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n,i;return e&&"object"==typeof e?{previewUrl:null!=(t=e.previewUrl)?t:"",proxies:null!=(i=null==(n=e.proxies)?void 0:n.map(e=>({cdnName:e.cdnName,extension:e.extension,formatHeight:e.formatHeight,formatWidth:e.formatWidth,height:e.height,id:j4(),permanentLink:e.permanentLink,proxyLabel:e.proxyLabel,proxyName:e.proxyName,width:e.width})))?i:[]}:{previewUrl:"",proxies:[]}}],url:da.GET_AVAILABLE_PROXIES})).data}catch(n){return{previewUrl:"",proxies:[]}}})}var G4=(e=>(e.CollectionSubtypeCriteria="CollectionSubtypeCriteria",e.EnableATSInGetLink="EnableATSInGetLink",e.ExtensionAuto="ExtensionAuto",e.ExtensionsEmbeddableInWeb="ExtensionsEmbeddableInWeb",e.ExtensionsThatSupportTransformationUsingATS="ExtensionsThatSupportTransformationUsingATS",e.RepresentativeSupportedDocSubType="RepresentativeSupportedDocSubType",e.SupportDocTypes="SupportDocTypes",e.SupportedDocSubTypesV2="SupportedDocSubTypesV2",e))(G4||{});var W4=Math.min;var q4=Math.max;var $4=function(){try{var e=bE(Object,"defineProperty");return e({},"",{}),e}catch(Pg){}}(),X4=$4?function(e,t){return $4(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:hk,Y4=Date.now;var K4=function(e){var t=0,n=0;return function(){var i=Y4(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(X4);function Z4(e){return function(e){return Mt(e)&&gC(e)}(e)?e:[]}var J4=function(e,t){return K4(function(e,t,n){return t=q4(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=q4(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,hk),e+"")}(function(e){var t=wt(e,Z4);return t.length&&t[0]===e[0]?function(e,t,n){for(var i=n?vk:gk,r=e[0].length,o=e.length,a=o,s=Array(o),l=1/0,c=[];a--;){var u=e[a];a&&t&&(u=wt(u,nC(t))),l=W4(u.length,l),s[a]=!n&&(t||r>=120&&u.length>=120)?new kE(a&&u):void 0}u=e[0];var d=-1,h=s[0];e:for(;++d<r&&c.length<l;){var p=u[d],f=t?t(p):p;if(p=n||0!==p?p:0,!(h?ME(h,f):i(c,f,n))){for(a=o;--a;){var m=s[a];if(!(m?ME(m,f):i(e[a],f,n)))continue e}h&&h.push(f),c.push(p)}}return c}(t):[]});class e5{constructor(e,{availableDocTypes:t,baseUrl:n,defaultFolderId:i,defaultIsSeeThrough:r,defaultSearchText:o,defaultSelectedFacets:a,defaultSortDirection:s,defaultSortOrderName:l,token:c,useSession:u}){var d,h;z(this,v),z(this,y),z(this,b),z(this,A),this.availableFacets=[],this.facets=[],this.items=[],this.totalCount=0,this.lastRequest=null,this.sortOrders={},this.parameters=null,this.availableExtensions=null,this.userInfo=null,this.loading=!1,this.isLoggedIn=!0,this.pendingTokenRefresh=null,this.resolvePendingTokenRefresh=null,this.tokenRefreshTimeoutMs=15e3,F(this,v,null),F(this,y,null),F(this,b,null),F(this,A,!1),this.requestInterceptorId=null,this.responseInterceptorId=null,this._debouncePromise=null,this._debounceResolve=null,this.host=e,this.availableDocTypes=t,this.defaultFolderId=i,this.defaultIsSeeThrough=r,this.defaultSearchText=o,this.defaultSelectedFacets=a,this.defaultSortOrderName=l,this.defaultSortDirection=s,this.token=c,this.useSession=u,ca.defaults.baseURL=n,this.requestInterceptorId=ca.interceptors.request.use(e=>(e.url&&![da.GET_AVAILABLE_EXTENSIONS,da.GET_ASSET_VERSION_HISTORY,da.GET_CONTENT_V1,da.ADD_ASSET_TO_FAVORITE,da.REMOVE_ASSET_FROM_FAVORITE,da.GET_FAVORITE_ASSETS,da.GET_CONTENT_V3,da.GET_AVAILABLE_PROXIES,da.GET_ASSET_LINK,pa.GET_AVAILABLE_FACETS,pa.GET_CONTENT_BROWSER_PARAMETERS,pa.GET_SORT_ORDERS,ha.GET_USER_INFO,ua].includes(e.url.split("?")[0])||(n&&(e.baseURL=n),e.params=B(R({},e.params),{Token:this.token||void 0,UseSession:this.useSession||void 0})),e)),this.responseInterceptorId=ca.interceptors.response.use(e=>(e.status>=200&&e.status<300&&!this.isLoggedIn&&(this.isLoggedIn=!0,this.host.requestUpdate()),e),e=>U(this,null,function*(){var t;const n=null==e?void 0:e.config;if(401===(null==(t=null==e?void 0:e.response)?void 0:t.status)&&n&&!n._retry){n._retry=!0;return(yield this.waitForNewToken())?ca.request(n):(this.isLoggedIn=!1,this.host.requestUpdate(),Promise.reject(e))}return Promise.reject(e)})),null==(h=(d=this.host).addController)||h.call(d,this)}waitForNewToken(){return this.pendingTokenRefresh||(this.pendingTokenRefresh=new Promise(e=>{this.resolvePendingTokenRefresh=e}),globalThis.dispatchEvent(new CustomEvent("cx-unauthorized")),setTimeout(()=>{this.resolvePendingTokenRefresh&&(this.resolvePendingTokenRefresh(null),this.pendingTokenRefresh=null,this.resolvePendingTokenRefresh=null)},this.tokenRefreshTimeoutMs)),this.pendingTokenRefresh}updateAuth(e,t){const n=this.token!==e,i=!this.isLoggedIn;this.token=e,this.useSession=t,n&&this.resolvePendingTokenRefresh&&(this.resolvePendingTokenRefresh(e||null),this.pendingTokenRefresh=null,this.resolvePendingTokenRefresh=null),n&&i&&e&&(this.isLoggedIn=!0,this.fetchInitialData(),this.lastRequest&&this.fetchAndMergeAssets(this.lastRequest),this.host.requestUpdate())}fetchInitialData(){(function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n,i,r;if(!e||"object"!=typeof e)throw new Error("Invalid response format");return(null==(t=e.avatar)?void 0:t.includes("://"))?e:B(R({},e),{avatar:`${null!=(i=null==(n=ca.defaults.baseURL)?void 0:n.replace(/\/$/,""))?i:""}/${null==(r=e.avatar)?void 0:r.replace(/^\//,"")}`})}],url:ha.GET_USER_INFO})).data}catch(e){return null}})})().then(e=>{this.userInfo=e,this.host.requestUpdate()}),function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>Array.isArray(null==e?void 0:e.facets)?e.facets:[]],url:pa.GET_AVAILABLE_FACETS})).data}catch(e){return[]}})}().then(e=>{this.availableFacets=e,this.host.requestUpdate()}),function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>{var t,n,i,r,o,a,s,l;return{ATSEnabled:"true"===e[G4.EnableATSInGetLink].toLowerCase(),autoExtension:null!=(n=null==(t=e[G4.ExtensionAuto])?void 0:t.toLowerCase())?n:".auto",collectionPath:null!=(r=null==(i=e[G4.CollectionSubtypeCriteria])?void 0:i.toLowerCase())?r:"",supportedExtensions:null!=(a=null==(o=e[G4.ExtensionsThatSupportTransformationUsingATS])?void 0:o.split("\n"))?a:[],supportedRepresentativeSubtypes:null!=(l=null==(s=e[G4.RepresentativeSupportedDocSubType])?void 0:s.split("\r\n"))?l:[]}}],url:pa.GET_CONTENT_BROWSER_PARAMETERS})).data}catch(e){return{ATSEnabled:!1,autoExtension:".auto",collectionPath:"",supportedExtensions:[],supportedRepresentativeSubtypes:[]}}})}().then(e=>{this.parameters=e,this.host.requestUpdate()}),function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>e.extensions],url:da.GET_AVAILABLE_EXTENSIONS})).data}catch(e){return{}}})}().then(e=>{this.availableExtensions=e,this.host.requestUpdate()})}mapAvailableExtensions(e){return this.availableExtensions&&e&&0!==e.length?Object.entries(this.availableExtensions).reduce((t,[n,i])=>B(R({},t),{[n]:i.filter(t=>!e||0===e.length||e.some(e=>t.value.toLowerCase()===`.${e.toLowerCase()}`))}),this.availableExtensions):this.availableExtensions}fetchAssets(e){return U(this,null,function*(){return yield Q4(e)})}fetchFolders(e){return U(this,null,function*(){return yield function(e){return U(this,arguments,function*({allowedFolders:e,baseUrl:t,bearerToken:n,excludeVirtualFolders:i,folderId:r,includeDirectChild:o,limit:a=50,searchTerm:s,self:l,start:c=0,token:u}){let d=[],h=null==o||o;e&&e.length>0&&!r?(d=e,l=!0,h=!1):r&&(d=[r]);try{return(yield ca.request({baseURL:t,headers:{Authorization:`Bearer ${n}`},method:"GET",params:{IncludeDirectChild:h,IncludeVirtualFolders:!i,Limit:a,ObjectRecordIDs:d,SeeThru:!!s,Self:l,Start:c,Text:s||void 0,Token:u||void 0},paramsSerializer:{indexes:null},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],(e,t,n)=>{var i,r,o,a;if(void 0!==n&&(n<200||n>=300))return{data:[],hasMore:!1,totalCount:0};if(!e||"object"!=typeof e)throw new Error("Invalid response format");const s=null!=(r=null==(i=e.contentItems)?void 0:i.length)?r:0;return{data:null!=(a=null==(o=e.contentItems)?void 0:o.map(e=>{var t,n,i,r;return{docType:null!=(t=e.fields[fa.DocType])?t:"",fullPath:null!=(n=e.fields[fa.CortexPath])?n:"",hasChildren:"1"===e.fields[fa.HasBrowserChildren],id:e.recordID,isShared:"DO_OR1ND000001913488"===e.fields[fa.rawDocSubtype],representativeAssetId:null!=(i=e.fields[fa.RepresentativeAssetId])?i:"",title:null!=(r=e.fields[fa.TitleWithFallback])?r:""}}))?a:[],hasMore:c+s<e.totalCount,totalCount:e.totalCount}}],url:ua})).data}catch(p){return{data:[],hasMore:!1,totalCount:0}}})}(e)})}mergeFacetsWithSelected(e,t,n={}){const i=e=>`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,r=new Map(t.map(e=>[i(e),B(R({},e),{values:e.values.filter(t=>{var i;return null==(i=n[e.facetDetails.facetFieldName])?void 0:i.includes(t.value)}).map(e=>B(R({},e),{count:0}))})]));return e.filter(e=>e.values.length>0).forEach(e=>{var t,n;const o=null!=(n=null==(t=r.get(i(e)))?void 0:t.values)?n:[],a=[...e.values,...o.filter(t=>!e.values.some(e=>e.value===t.value&&e.displayValue===t.displayValue))];r.set(i(e),B(R({},e),{values:a}))}),Array.from(r.values())}fetchAndMergeAssets(e){return U(this,null,function*(){this.loading=!0,this.host.requestUpdate(),null!==e.start&&(this._debounceTimeout&&(clearTimeout(this._debounceTimeout),this._debounceTimeout=void 0),null!=this._debouncePromise||(this._debouncePromise=new Promise(e=>{this._debounceResolve=e})),this._debounceTimeout=setTimeout(()=>U(this,null,function*(){var t,n,i,r,o;if(0===Object.keys(this.sortOrders).length){const e=yield function(){return U(this,null,function*(){try{return(yield ca.request({method:"GET",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>(Array.isArray(null==e?void 0:e.sortOrders)?e.sortOrders:[]).reduce((e,t)=>{var n,i,r;const o=(null==(n=null==t?void 0:t.sortDirectionGroupKey)?void 0:n.trim())||(null==(i=null==t?void 0:t.name)?void 0:i.trim());if(!o)return e;const a=o.toLowerCase();return e[a]=[...null!=(r=e[a])?r:[],t],e},{})],url:pa.GET_SORT_ORDERS})).data}catch(e){return{}}})}();this.sortOrders=e}const a=e.start===(null==(t=this.lastRequest)?void 0:t.start)&&!!e.pageSize&&!!(null==(n=this.lastRequest)?void 0:n.pageSize)&&e.pageSize>(null==(i=this.lastRequest)?void 0:i.pageSize);let s;N(this,A)||(e=B(R({},e),{folderId:this.defaultFolderId,isSeeThrough:this.defaultIsSeeThrough,searchText:this.defaultSearchText,selectedFacets:this.defaultSelectedFacets,sortDirection:this.defaultSortDirection,sortOrderName:this.defaultSortOrderName})),e.sortOrderName&&e.sortDirection&&(s=null==(o=null==(r=this.sortOrders[e.sortOrderName])?void 0:r.find(t=>{var n;return t.sortDirection.toLowerCase()===(null==(n=e.sortDirection)?void 0:n.toLowerCase())}))?void 0:o.id,!s&&this.sortOrders[e.sortOrderName][0]&&(s=this.sortOrders[e.sortOrderName][0].id,e.sortDirection=this.sortOrders[e.sortOrderName][0].sortDirection)),e=B(R({},e),{limitedToDocTypes:this.availableDocTypes}),this.lastRequest=e;const l=yield Q4(B(R({},e),{sortOrder:s}));e.start&&e.start>0&&!a?this.items=bk([...this.items,...l.items],"recordId"):this.items=l.items,this.facets=this.mergeFacetsWithSelected(l.facets,this.facets,e.selectedFacets),this.totalCount=l.totalCount,this.loading=!1,F(this,A,!0),this.host.requestUpdate(),this._debounceResolve&&this._debounceResolve(this.lastRequest),this._debouncePromise=null,this._debounceResolve=null}),200))})}fetchAssetFavoriteStatus(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e}){try{return(yield ca.request({method:"GET",params:{RecordId:e},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],t=>!!t.favoriteRecordIds&&t.favoriteRecordIds.includes(e)],url:da.GET_FAVORITE_ASSETS})).data}catch(t){return!1}})}({assetRecordId:e})})}fetchAssetByID(e,t){return U(this,null,function*(){var n,i,r,o,a,s,l,c,u,d,h,p,f,m;const{allowedExtensions:g=[],canFavorite:v=!1}=null!=t?t:{},y=[H4({extraFields:[A4,x4,_4,E4,C4,S4,T4,k4,I4,M4,B4,O4,L4],recordIds:[e]}),V4({assetRecordId:e})];v?y.push(this.fetchAssetFavoriteStatus(e)):y.push(Promise.resolve(!1));const[b,A,w=!1]=yield Promise.all(y),x=null==b?void 0:b.items[0];if(!x)return;let _=x[_4];return _&&!_.startsWith(".")&&(_="."+_),{asset:{allowATSLink:"True"===x[w4],docSubType:null!=(n=x[B4])?n:"",docType:null!=(i=x[x4])?i:"",extension:_,height:null!=(r=x[T4])?r:"0",id:x.recordId,identifier:null!=(o=x[C4])?o:"",imageUrl:null!=(a=x[A4])?a:"",inColdStorage:Boolean(x.inColdStorage),name:null!=(s=x[O4])?s:"",originalUrl:null!=(l=x[L4])?l:"",previewUrl:null!=(c=null==A?void 0:A.previewUrl)?c:"",recordId:null!=(u=x[M4])?u:"",scrubUrl:null!=(d=x[P4])?d:"",size:null!=(h=x[E4])?h:"0 MB",tags:null!=(p=x[S4])?p:"",width:null!=(f=x[k4])?f:"0"},isFavorite:w,proxies:(null!=(m=null==A?void 0:A.proxies)?m:[]).filter(e=>{var t;if(!g||0===g.length)return!0;let n="";if(e.extension)n=e.extension.replace(".","");else{const i=null==(t=e.permanentLink)?void 0:t.split(".").at(-1);n=null!=i?i:""}return g.some(e=>!!n&&n.toLowerCase()===e.toLowerCase())})}})}fetchAssetVersionHistory(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e}){try{return(yield ca.request({method:"GET",params:{RecordId:e},responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>({count:e.count,versions:e.versions.map(e=>({createByEmail:e.CreateByEmail,fileImportDate:e.FileImportDate,scrubUrl:e.ScrubUrl,versionCreateDate:e.VersionCreateDate,versionFileName:e.UpdatedFileName||e.VersionFileName,versionFileUrl:e.PreviewUrl,versionId:e.VersionID,versionNumber:Number(e.VersionNumber),versionNumberDisplay:e.VersionNumberDisplay}))})],url:da.GET_ASSET_VERSION_HISTORY})).data}catch(t){return{count:0,versions:[]}}})}({assetRecordId:e})})}addAssetToFavorite(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e,siteUrl:t}){try{return(yield ca.request({baseURL:t,data:{RecordId:e},method:"POST",responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>!!e.success],url:da.ADD_ASSET_TO_FAVORITE})).data}catch(n){return!1}})}({assetRecordId:e})})}removeAssetFromFavorite(e){return U(this,null,function*(){return function(e){return U(this,arguments,function*({assetRecordId:e,siteUrl:t}){try{return(yield ca.request({baseURL:t,data:{RecordId:e},method:"POST",responseType:"json",transformResponse:[...Array.isArray(ca.defaults.transformResponse)?ca.defaults.transformResponse:[],e=>!!e.success],url:da.REMOVE_ASSET_FROM_FAVORITE})).data}catch(n){return!1}})}({assetRecordId:e})})}getAssetLink(e){return U(this,null,function*(){var t;const n=yield function(e){return U(this,arguments,function*({assets:e,extension:t,extraFields:n,parameters:i,permanentLink:r,proxyPreference:o,transformations:a,useSession:s}){var l;const c={},u=1===e.length;let d=!1;const h=null!=(l=ca.defaults.baseURL)?l:window.location.origin;try{const l=(yield Promise.allSettled(e.map(e=>U(null,null,function*(){const l={GenerateAssetUrl:!r,Parameters:i,Proxy:o,RecordId:e.recordId};(null==n?void 0:n.length)&&(l.ExtraFields=n);const p=s?{UseSession:s}:void 0;let f;if(!F4.has(h))try{const e=yield ca.request({data:l,method:"POST",params:p,url:da.GET_ASSET_LINK,validateStatus:()=>!0});z4.has(e.status)?F4.add(h):f=e.data}catch(Pg){}if(void 0===f&&(f=(yield ca.request({method:"GET",params:B(R({},l),{UseSession:s||void 0}),paramsSerializer:{indexes:null},url:da.GET_ASSET_LINK})).data),(m=f)&&"object"==typeof m&&"ErrorCode"in m)return d=!0,u&&(c[f.ErrorCode]?c[f.ErrorCode].push(e):c[f.ErrorCode]=[e]),{imageUrl:e.imageUrl};var m;const g=U4({asset:e,extension:t,parameters:i,permanentLink:r,rawResponse:f,transformations:a,useSession:s});return B(R({},f),{imageUrl:g})})))).flatMap(e=>"fulfilled"===e.status?[e.value]:(d=!0,[]));return{data:l,isError:d}}catch(Pg){return{data:[],isError:!0}}})}(B(R({},e),{useSession:null!=(t=e.useSession)?t:this.useSession}));return e.useRepresentative?B(R({},n),{data:n.data.map((t,n)=>{var i,r;return B(R({},t),{imageUrl:null!=(r=null==(i=e.assets[n])?void 0:i.imageUrl)?r:t.imageUrl})})}):n})}getData(e){var t,n;const{allowedExtensions:i=[],availableRepresentativeSubtypes:r=[]}=null!=e?e:{};return HC(N(this,v),e)||(F(this,v,{allowedExtensions:i,availableRepresentativeSubtypes:r}),F(this,y,this.mapAvailableExtensions(i))),F(this,b,{availableExtensions:N(this,y),availableFacets:this.availableFacets,facets:this.facets,isLoggedIn:this.isLoggedIn,items:this.items,loading:this.loading,parameters:this.parameters?B(R({},this.parameters),{supportedRepresentativeSubtypes:(null==r?void 0:r.length)?J4(r,null!=(t=this.parameters.supportedRepresentativeSubtypes)?t:[]):null!=(n=this.parameters.supportedRepresentativeSubtypes)?n:[]}):null,request:this.lastRequest,sortOrders:this.sortOrders,totalCount:this.totalCount,userInfo:this.userInfo}),N(this,b)}hostConnected(){this.fetchInitialData()}hostDisconnected(){null!==this.requestInterceptorId&&(ca.interceptors.request.eject(this.requestInterceptorId),this.requestInterceptorId=null),null!==this.responseInterceptorId&&(ca.interceptors.response.eject(this.responseInterceptorId),this.responseInterceptorId=null),this.facets=[],this.items=[],this.totalCount=0,this.sortOrders={}}}function t5(e){return Number.isNaN(e)||!Number.isInteger(e)?0:e}v=new WeakMap,y=new WeakMap,b=new WeakMap,A=new WeakMap;const n5=ie`
|
|
2285
2285
|
:host {
|
|
2286
2286
|
--cx-button-text-transform: none;
|
|
2287
2287
|
--default-representative-background-color: #6cdaf3;
|
|
@@ -2457,7 +2457,7 @@
|
|
|
2457
2457
|
font-size: clamp(1rem, 2cqw, 3rem);
|
|
2458
2458
|
}
|
|
2459
2459
|
}
|
|
2460
|
-
`,Cne=({onCancel:e})=>{const t=vne();return f5.useEffect(()=>{Dte(Tte).then(e=>{e&&t(ine(e))}).catch(()=>{})}),K.jsx(_ne,{onCancel:e,children:K.jsx(Ene,{variant:"h4",children:"Trying to restore your previous session"})})},Sne=({onCancel:e})=>{const t=yne(lne);return K.jsx(_ne,{onCancel:e,children:K.jsxs(Ene,{variant:"h4",children:["Requesting login url from",K.jsx("cx-typography",{variant:"body1",style:{overflowWrap:"break-word",lineBreak:"anywhere"},children:t})]})})},Tne=({onCancel:e})=>{const t=yne(hne),{pluginInfo:n}=f5.useContext(p9),{onAppAuthUrlCopied:i}=f5.useContext(Z7),r=f5.useRef(null),[o,a]=f5.useState(!1);return f5.useEffect(()=>{customElements.whenDefined("cx-copy-button").then(()=>{a(!0)})},[]),f5.useEffect(()=>{if(!o)return;const e=r.current;e&&(e.writeToClipboard=i)},[o,i]),K.jsxs(_ne,{footer:K.jsxs("cx-space",{spacing:"small",direction:"vertical",children:[K.jsx("cx-typography",{className:"footer__title",variant:"body2",children:K.jsx("span",{style:{fontWeight:"var(--cx-font-weight-semibold)"},children:"I was not redirected automatically?"})}),K.jsx("cx-typography",{variant:"body2",children:"Copy the URL and open it in a new tab"}),K.jsx("br",{}),K.jsx("cx-typography",{variant:"body3",children:K.jsxs("cx-space",{spacing:"3x-small",direction:"horizontal",wrap:"nowrap",alignItems:"center",justifyContent:"center",children:[K.jsx("a",{id:"OL-redirect-url",href:t,target:"_blank",rel:"noopener noreferrer",style:{minWidth:0,flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--cx-color-primary-600)"},children:t}),K.jsx("cx-copy-button",{ref:r,size:"small",from:"OL-redirect-url[href]"})]})})]}),onCancel:e,children:[K.jsxs(Ene,{variant:"h4",children:["Please authorize the ",n.pluginName," plugin"]}),K.jsxs("cx-typography",{variant:"body2",children:["You will be automatically redirected to authorize ",n.pluginName," ",n.publicApplicationName?`in ${n.publicApplicationName}`:""]})]})},kne=()=>{const e=vne(),t=yne(une),n=f5.useCallback(()=>{e(pne())},[e]);return f5.useMemo(()=>{switch(t){case"unauthenticated":return K.jsx(xne,{});case"restoreSession":return K.jsx(Cne,{onCancel:n});case"requestLogin":return K.jsx(Sne,{onCancel:n});case"waitForAuthorize":return K.jsx(Tne,{onCancel:n})}},[t,n])},Ine=W7.div`
|
|
2460
|
+
`,Cne=({onCancel:e})=>{const t=vne(),n=yne(dne);return f5.useEffect(()=>{n||Dte(Tte).then(e=>{e&&t(ine(e))}).catch(()=>{})}),K.jsx(_ne,{onCancel:e,children:K.jsx(Ene,{variant:"h4",children:"Trying to restore your previous session"})})},Sne=({onCancel:e})=>{const t=yne(lne);return K.jsx(_ne,{onCancel:e,children:K.jsxs(Ene,{variant:"h4",children:["Requesting login url from",K.jsx("cx-typography",{variant:"body1",style:{overflowWrap:"break-word",lineBreak:"anywhere"},children:t})]})})},Tne=({onCancel:e})=>{const t=yne(hne),{pluginInfo:n}=f5.useContext(p9),{onAppAuthUrlCopied:i}=f5.useContext(Z7),r=f5.useRef(null),[o,a]=f5.useState(!1);return f5.useEffect(()=>{customElements.whenDefined("cx-copy-button").then(()=>{a(!0)})},[]),f5.useEffect(()=>{if(!o)return;const e=r.current;e&&(e.writeToClipboard=i)},[o,i]),K.jsxs(_ne,{footer:K.jsxs("cx-space",{spacing:"small",direction:"vertical",children:[K.jsx("cx-typography",{className:"footer__title",variant:"body2",children:K.jsx("span",{style:{fontWeight:"var(--cx-font-weight-semibold)"},children:"I was not redirected automatically?"})}),K.jsx("cx-typography",{variant:"body2",children:"Copy the URL and open it in a new tab"}),K.jsx("br",{}),K.jsx("cx-typography",{variant:"body3",children:K.jsxs("cx-space",{spacing:"3x-small",direction:"horizontal",wrap:"nowrap",alignItems:"center",justifyContent:"center",children:[K.jsx("a",{id:"OL-redirect-url",href:t,target:"_blank",rel:"noopener noreferrer",style:{minWidth:0,flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--cx-color-primary-600)"},children:t}),K.jsx("cx-copy-button",{ref:r,size:"small",from:"OL-redirect-url[href]"})]})})]}),onCancel:e,children:[K.jsxs(Ene,{variant:"h4",children:["Please authorize the ",n.pluginName," plugin"]}),K.jsxs("cx-typography",{variant:"body2",children:["You will be automatically redirected to authorize ",n.pluginName," ",n.publicApplicationName?`in ${n.publicApplicationName}`:""]})]})},kne=()=>{const e=vne(),t=yne(une),n=f5.useCallback(()=>{e(pne())},[e]);return f5.useMemo(()=>{switch(t){case"unauthenticated":return K.jsx(xne,{});case"restoreSession":return K.jsx(Cne,{onCancel:n});case"requestLogin":return K.jsx(Sne,{onCancel:n});case"waitForAuthorize":return K.jsx(Tne,{onCancel:n})}},[t,n])},Ine=W7.div`
|
|
2461
2461
|
background-color: var(--cx-color-neutral-0);
|
|
2462
2462
|
display: ${({open:e})=>e?"block":"none"};
|
|
2463
2463
|
height: 100vh;
|
|
@@ -2466,7 +2466,7 @@
|
|
|
2466
2466
|
top: 0;
|
|
2467
2467
|
width: 100vw;
|
|
2468
2468
|
z-index: var(--cx-z-index-dialog);
|
|
2469
|
-
`,Mne=({extraFields:e=[],containerId:t,loadExternalFonts:n=!0,multiSelect:i,onClose:r,onError:o,getPinnedState:a,onAssetAction:s,onAssetSelected:l,onAppAuthUrlCopied:c,onImageSelected:u,onPinAsset:d,onConnectClicked:h,onTokenChanged:p,onUnpinAsset:f,onSiteUrlChanged:m,assetsPickerRef:g})=>{const v=yne(ane),y=yne(sne),b=yne(lne),[A,w]=f5.useState(!0);f5.useEffect(()=>{n?K7.load({google:{families:["Fira Code:400","Fira Mono:400","Fira Sans:300,400,600","Fira Sans Condensed:300,400,600","Fira Sans Extra Condensed:300,400,600"]}}):Promise.resolve().then(()=>iie)},[n]),f5.useEffect(()=>{p&&p(null!=y?y:"")},[y,p]),f5.useEffect(()=>{m&&m(null!=b?b:"")},[b,m]);const x=f5.useCallback(()=>{w(!1),null==r||r()},[r]),_=f5.useMemo(()=>({extraFields:e,getPinnedState:a,onAssetAction:s,onAssetSelected:l,onAppAuthUrlCopied:c,onImageSelected:u,onPinAsset:d,onError:o,onClose:x,onConnectClicked:h,onUnpinAsset:f}),[e,a,s,l,c,u,d,o,x,h,f]);let E=K.jsx(kne,{});if(v){const e=K.jsx(wne,{ref:g,accessToken:y,siteUrl:b,multiSelect:i});E=t?e:K.jsx(Ine,{open:A,children:e})}return K.jsx(Z7.Provider,{value:_,children:K.jsx(f5.Suspense,{fallback:K.jsx("cx-content-browser-loader",{}),children:E})})},Pne=['[aria-modal="true"]',"dialog[open]",".ui-dialog",".modal.show",".modal.in",'[data-focus-lock-disabled="false"]'].join(",");function Rne(e){var t;return null!=(t=e.ownerDocument.defaultView)?t:window}function Bne(e){if(!e||!e.isConnected)return!1;const t=Rne(e);if(!(e instanceof t.HTMLElement))return!1;const n=t.getComputedStyle(e);if("hidden"===n.visibility||"none"===n.display)return!1;const i=e.getBoundingClientRect();return i.width>0&&i.height>0}function One(e=document){var t;const n=null!=(t=e.defaultView)?t:window,i=e.activeElement,r=i instanceof n.HTMLElement?i.closest(Pne):null,o=r&&Bne(r)&&r||(0===(a=Array.from(e.querySelectorAll(Pne)).filter(Bne)).length?null:a.reduce((e,t)=>{const n=parseInt(Rne(e).getComputedStyle(e).zIndex,10)||0,i=parseInt(Rne(t).getComputedStyle(t).zIndex,10)||0;return i!==n?i>n?t:e:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING?t:e}));var a;return o?function(e){var t;const n=e.ownerDocument,i=null!=(t=n.defaultView)?t:window;let r=e;for(;r&&r!==n.body&&r!==n.documentElement;){const e=i.getComputedStyle(r);if(e.transform&&"none"!==e.transform||e.perspective&&"none"!==e.perspective||e.filter&&"none"!==e.filter||/transform|perspective|filter/.test(e.willChange||"")||/paint|layout|strict|content/.test(e.contain||""))return!0;r=r.parentElement}return!1}(o)?(console.warn("[ContentBrowserSDK] An active modal was detected, but it establishes a CSS containing block that would clip the picker overlay. Falling back to document.body. Pass `containerId` (an element inside the modal) to embed the picker correctly."),null):o:null}globalThis.addEventListener("cx-unauthorized",Vte);const Dne=f5.createRef(),Lne={help:()=>{console.log("/* Orange DAM Content Browser SDK Example */\n window.OrangeDAMContentBrowser.open({\n onAssetSelected: (assets) => {\n // Callback function triggered when assets are selected\n console.log(assets);\n window.open(assets[0]?.imageUrl, '_blank');\n },\n onError: (errorMessage, error) => {\n // Callback function triggered when an error occurs\n console.error(errorMessage, error);\n },\n onClose: () => {\n // Callback function triggered when the browser is closed\n window.alert('Content Browser is closing');\n },\n getPinnedState: (recordId) => {\n // Callback function to get the pinned state of an asset\n return localStorage.getItem(`pinned:${recordId}`) === 'true';\n },\n onPinAsset: async (recordId) => {\n // Callback function triggered when an asset is pinned\n localStorage.setItem(`pinned:${recordId}`, 'true');\n },\n onUnpinAsset: async (recordId) => {\n // Callback function triggered when an asset is unpinned\n localStorage.removeItem(`pinned:${recordId}`);\n },\n containerId: \"\", // ID of the container to attach the browser; opens in a popup if blank\n extraFields: ['coreField.OriginalFileName', 'document.CortexPath'], // Additional fields to retrieve from the assets\n baseUrl: \"\", // Default base URL to pre-fill in the content browser\n displayInfo: {\n title: true, // Whether to display the asset title\n dimension: true, // Whether to display the asset dimensions\n fileSize: false, // Whether to display the file size\n tags: false, // Whether to display the asset tags\n },\n publicApplicationName: \"\", // Public name of the DAM to display on the login screen\n pluginName: \"OrangeDAM Content Browser\", // Name of the plugin to display on the login screen\n ctaText: \"Insert\", // Text to display on the insert button\n ctaTextTransform: \"capitalize\", // Text transform: 'none', 'uppercase', 'lowercase', 'capitalize' (default: 'capitalize')\n persistMode: true, // Whether the browser remains open after selecting an asset\n availableDocTypes: ['Images*', 'Videos*', 'Audio*', 'Others*'], // An array of available OrangeDAM asset types to filter the assets. The available doc types will be configured in OL Platform. If not provided, all doc types will be available. \n availableRepresentativeSubtypes: ['Other'], // Array of supported subtypes for representative images\n showCollections: true, // Whether to show collections in the content browser\n lastLocationMode: true, // Whether to open the last selected folder on load\n allowTracking: true, // Whether to enable tracking parameters for asset URLs\n allowFormatDialogPin: true, // Whether to show pin/unpin actions in format dialog\n });")},open:e=>U(null,[e],function*({onAssetAction:e,getPinnedState:t,onAssetSelected:n,onAppAuthUrlCopied:i,onImageSelected:r,onError:o,onClose:a,onPinAsset:s,onRequestToken:l,onTokenChanged:c,onUnpinAsset:u,onConnectClicked:d,onSiteUrlChanged:h,customStorage:p,allowedExtensions:f,allowedFolders:m,allowFavorites:g,allowFormatDialogPin:v,allowPin:y,allowLogout:b,allowProxy:A,allowTracking:w,availableDocTypes:x,availableRepresentativeSubtypes:_,baseUrl:E,containerId:C,ctaText:S,ctaTextTransform:T,displayInfo:k={title:!0,dimension:!0,fileSize:!1,tags:!1},extraFields:I,lastLocationMode:M,loadExternalFonts:P,multiSelect:R,persistMode:B,pluginName:O,publicApplicationName:D,showCollections:L,showFavoriteFolder:N,showVersions:z,useSession:F,defaultGridView:j}){var H;const Q="object"==typeof p&&p&&"function"==typeof p.delete&&p.delete&&"function"==typeof p.get&&p.get&&"function"==typeof p.set&&p.set?p:void 0;window.OrangeDAMContentBrowser._customStorage=Q;let V=C&&document.getElementById(C);if(C){if(!V)return void console.error(`Container with id ${C} is not found`)}else V=null!=(H=One())?H:document.body;let G=V.querySelector("#cortex-asset-picker-root");G||(G=document.createElement("div"),G.id="cortex-asset-picker-root",G.style.width="100%",G.style.height="100%",G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.position="relative",V.appendChild(G));const W=P5.createRoot(G);l&&(window.OrangeDAMContentBrowser._onRequestToken=()=>l().then(e=>({token:e,siteUrl:E}))),E&&gne.dispatch(nne(E)),l&&gne.dispatch(rne(!0)),gne.dispatch(mne());const q="function"==typeof o&&o?o:console.log,$="function"==typeof e&&e?e:()=>{},X="function"==typeof n&&n?n:()=>{},Y="function"==typeof i&&i?i:e=>U(null,null,function*(){yield navigator.clipboard.writeText(e)}),Z="function"==typeof r&&r?r:()=>{},J="function"==typeof c&&c?c:void 0,ee="function"==typeof t&&t?t:()=>!1,te="function"==typeof s&&s?s:void 0,ne="function"==typeof u&&u?u:void 0,ie=()=>{W.unmount(),window.OrangeDAMContentBrowser._onAssetSelected=void 0,window.OrangeDAMContentBrowser._onImageSelected=void 0,window.OrangeDAMContentBrowser._onError=void 0,window.OrangeDAMContentBrowser._onClose=void 0,window.OrangeDAMContentBrowser._customStorage=void 0,null==a||a()};window.OrangeDAMContentBrowser._onAssetAction=$,window.OrangeDAMContentBrowser._onAssetSelected=X,window.OrangeDAMContentBrowser._onImageSelected=Z,window.OrangeDAMContentBrowser._onError=q,window.OrangeDAMContentBrowser._onClose=ie,W.render(K.jsx(q5,{store:gne,children:K.jsx(p9.Provider,{value:{allowedExtensions:f,allowedFolders:m,availableDocTypes:x,availableRepresentativeSubtypes:_,ctaText:null!=S?S:"Insert",ctaTextTransform:null!=T?T:"capitalize",displayInfo:k,lastLocationMode:void 0===M||!!M,persistMode:!!B,pluginInfo:{publicApplicationName:null!=D?D:"",pluginName:null!=O?O:"OrangeDAM Content Browser"},isContentBrowserPopedup:!C,showCollections:!!L,showFavoriteFolder:!1!==N,showVersions:!!z,useSession:F,allowPin:!!y,allowFormatDialogPin:!!v,allowLogout:void 0===b||!!b,allowTracking:void 0===w||!!w,allowProxy:void 0===A||!!A,allowFavorites:!!g,defaultGridView:null!=j?j:""},children:K.jsx(Mne,{containerId:C,extraFields:I,loadExternalFonts:P,multiSelect:!!R,onError:q,getPinnedState:ee,onAssetAction:$,onAssetSelected:X,onAppAuthUrlCopied:Y,onImageSelected:Z,onPinAsset:te,onClose:ie,onConnectClicked:d,onTokenChanged:J,onUnpinAsset:ne,onSiteUrlChanged:h,assetsPickerRef:Dne})})}))}),close:()=>{var e,t;null==(t=(e=window.OrangeDAMContentBrowser)._onClose)||t.call(e)},fetchAssets:e=>{var t;return null==(t=Dne.current)?void 0:t.fetchAssets(e)},fetchFolders:e=>{var t;return null==(t=Dne.current)?void 0:t.fetchFolders(e)},previewAsset:e=>{var t;return null==(t=Dne.current)?void 0:t.selectAsset(e)}};globalThis.OrangeDAMContentBrowser=Lne;const Nne={svg:as`<svg
|
|
2469
|
+
`,Mne=({extraFields:e=[],containerId:t,loadExternalFonts:n=!0,multiSelect:i,onClose:r,onError:o,getPinnedState:a,onAssetAction:s,onAssetSelected:l,onAppAuthUrlCopied:c,onImageSelected:u,onPinAsset:d,onConnectClicked:h,onTokenChanged:p,onUnpinAsset:f,onSiteUrlChanged:m,assetsPickerRef:g})=>{const v=yne(ane),y=yne(sne),b=yne(lne),[A,w]=f5.useState(!0);f5.useEffect(()=>{n?K7.load({google:{families:["Fira Code:400","Fira Mono:400","Fira Sans:300,400,600","Fira Sans Condensed:300,400,600","Fira Sans Extra Condensed:300,400,600"]}}):Promise.resolve().then(()=>iie)},[n]),f5.useEffect(()=>{p&&p(null!=y?y:"")},[y,p]),f5.useEffect(()=>{m&&m(null!=b?b:"")},[b,m]);const x=f5.useCallback(()=>{w(!1),null==r||r()},[r]),_=f5.useMemo(()=>({extraFields:e,getPinnedState:a,onAssetAction:s,onAssetSelected:l,onAppAuthUrlCopied:c,onImageSelected:u,onPinAsset:d,onError:o,onClose:x,onConnectClicked:h,onUnpinAsset:f}),[e,a,s,l,c,u,d,o,x,h,f]);let E=K.jsx(kne,{});if(v){const e=K.jsx(wne,{ref:g,accessToken:y,siteUrl:b,multiSelect:i});E=t?e:K.jsx(Ine,{open:A,children:e})}return K.jsx(Z7.Provider,{value:_,children:K.jsx(f5.Suspense,{fallback:K.jsx("cx-content-browser-loader",{}),children:E})})},Pne=['[aria-modal="true"]',"dialog[open]",".ui-dialog",".modal.show",".modal.in",'[data-focus-lock-disabled="false"]'].join(",");function Rne(e){var t;return null!=(t=e.ownerDocument.defaultView)?t:window}function Bne(e){if(!e||!e.isConnected)return!1;const t=Rne(e);if(!(e instanceof t.HTMLElement))return!1;const n=t.getComputedStyle(e);if("hidden"===n.visibility||"none"===n.display)return!1;const i=e.getBoundingClientRect();return i.width>0&&i.height>0}function One(e=document){var t;const n=null!=(t=e.defaultView)?t:window,i=e.activeElement,r=i instanceof n.HTMLElement?i.closest(Pne):null,o=r&&Bne(r)&&r||(0===(a=Array.from(e.querySelectorAll(Pne)).filter(Bne)).length?null:a.reduce((e,t)=>{const n=parseInt(Rne(e).getComputedStyle(e).zIndex,10)||0,i=parseInt(Rne(t).getComputedStyle(t).zIndex,10)||0;return i!==n?i>n?t:e:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING?t:e}));var a;return o?function(e){var t;const n=e.ownerDocument,i=null!=(t=n.defaultView)?t:window;let r=e;for(;r&&r!==n.body&&r!==n.documentElement;){const e=i.getComputedStyle(r);if(e.transform&&"none"!==e.transform||e.perspective&&"none"!==e.perspective||e.filter&&"none"!==e.filter||/transform|perspective|filter/.test(e.willChange||"")||/paint|layout|strict|content/.test(e.contain||""))return!0;r=r.parentElement}return!1}(o)?(console.warn("[ContentBrowserSDK] An active modal was detected, but it establishes a CSS containing block that would clip the picker overlay. Falling back to document.body. Pass `containerId` (an element inside the modal) to embed the picker correctly."),null):o:null}globalThis.addEventListener("cx-unauthorized",Vte);const Dne=f5.createRef(),Lne={help:()=>{console.log("/* Orange DAM Content Browser SDK Example */\n window.OrangeDAMContentBrowser.open({\n onAssetSelected: (assets) => {\n // Callback function triggered when assets are selected\n console.log(assets);\n window.open(assets[0]?.imageUrl, '_blank');\n },\n onError: (errorMessage, error) => {\n // Callback function triggered when an error occurs\n console.error(errorMessage, error);\n },\n onClose: () => {\n // Callback function triggered when the browser is closed\n window.alert('Content Browser is closing');\n },\n getPinnedState: (recordId) => {\n // Callback function to get the pinned state of an asset\n return localStorage.getItem(`pinned:${recordId}`) === 'true';\n },\n onPinAsset: async (recordId) => {\n // Callback function triggered when an asset is pinned\n localStorage.setItem(`pinned:${recordId}`, 'true');\n },\n onUnpinAsset: async (recordId) => {\n // Callback function triggered when an asset is unpinned\n localStorage.removeItem(`pinned:${recordId}`);\n },\n containerId: \"\", // ID of the container to attach the browser; opens in a popup if blank\n extraFields: ['coreField.OriginalFileName', 'document.CortexPath'], // Additional fields to retrieve from the assets\n baseUrl: \"\", // Default base URL to pre-fill in the content browser\n displayInfo: {\n title: true, // Whether to display the asset title\n dimension: true, // Whether to display the asset dimensions\n fileSize: false, // Whether to display the file size\n tags: false, // Whether to display the asset tags\n },\n publicApplicationName: \"\", // Public name of the DAM to display on the login screen\n pluginName: \"OrangeDAM Content Browser\", // Name of the plugin to display on the login screen\n ctaText: \"Insert\", // Text to display on the insert button\n ctaTextTransform: \"capitalize\", // Text transform: 'none', 'uppercase', 'lowercase', 'capitalize' (default: 'capitalize')\n persistMode: true, // Whether the browser remains open after selecting an asset\n availableDocTypes: ['Images*', 'Videos*', 'Audio*', 'Others*'], // An array of available OrangeDAM asset types to filter the assets. The available doc types will be configured in OL Platform. If not provided, all doc types will be available. \n availableRepresentativeSubtypes: ['Other'], // Array of supported subtypes for representative images\n showCollections: true, // Whether to show collections in the content browser\n lastLocationMode: true, // Whether to open the last selected folder on load\n allowTracking: true, // Whether to enable tracking parameters for asset URLs\n allowFormatDialogPin: true, // Whether to show pin/unpin actions in format dialog\n });")},open:e=>U(null,[e],function*({onAssetAction:e,getPinnedState:t,onAssetSelected:n,onAppAuthUrlCopied:i,onImageSelected:r,onError:o,onClose:a,onPinAsset:s,onRequestToken:l,onTokenChanged:c,onUnpinAsset:u,onConnectClicked:d,onSiteUrlChanged:h,customStorage:p,allowedExtensions:f,allowedFolders:m,allowFavorites:g,allowFormatDialogPin:v,allowPin:y,allowLogout:b,allowProxy:A,allowTracking:w,availableDocTypes:x,availableRepresentativeSubtypes:_,baseUrl:E,containerId:C,ctaText:S,ctaTextTransform:T,displayInfo:k={title:!0,dimension:!0,fileSize:!1,tags:!1},extraFields:I,lastLocationMode:M,loadExternalFonts:P,multiSelect:R,persistMode:B,pluginName:O,publicApplicationName:D,showCollections:L,showFavoriteFolder:N,showVersions:z,useSession:F,defaultGridView:j}){var H;const Q="object"==typeof p&&p&&"function"==typeof p.delete&&p.delete&&"function"==typeof p.get&&p.get&&"function"==typeof p.set&&p.set?p:void 0;window.OrangeDAMContentBrowser._customStorage=Q;let V=C&&document.getElementById(C);if(C){if(!V)return void console.error(`Container with id ${C} is not found`)}else V=null!=(H=One())?H:document.body;let G=V.querySelector("#cortex-asset-picker-root");G||(G=document.createElement("div"),G.id="cortex-asset-picker-root",G.style.width="100%",G.style.height="100%",G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.position="relative",V.appendChild(G));const W=P5.createRoot(G);l&&(window.OrangeDAMContentBrowser._onRequestToken=()=>l().then(e=>({token:e,siteUrl:E}))),E&&gne.dispatch(nne(E)),l&&gne.dispatch(rne(!0)),F&&gne.dispatch(ine(F)),gne.dispatch(mne());const q="function"==typeof o&&o?o:console.log,$="function"==typeof e&&e?e:()=>{},X="function"==typeof n&&n?n:()=>{},Y="function"==typeof i&&i?i:e=>U(null,null,function*(){yield navigator.clipboard.writeText(e)}),Z="function"==typeof r&&r?r:()=>{},J="function"==typeof c&&c?c:void 0,ee="function"==typeof t&&t?t:()=>!1,te="function"==typeof s&&s?s:void 0,ne="function"==typeof u&&u?u:void 0,ie=()=>{W.unmount(),window.OrangeDAMContentBrowser._onAssetSelected=void 0,window.OrangeDAMContentBrowser._onImageSelected=void 0,window.OrangeDAMContentBrowser._onError=void 0,window.OrangeDAMContentBrowser._onClose=void 0,window.OrangeDAMContentBrowser._customStorage=void 0,null==a||a()};window.OrangeDAMContentBrowser._onAssetAction=$,window.OrangeDAMContentBrowser._onAssetSelected=X,window.OrangeDAMContentBrowser._onImageSelected=Z,window.OrangeDAMContentBrowser._onError=q,window.OrangeDAMContentBrowser._onClose=ie,W.render(K.jsx(q5,{store:gne,children:K.jsx(p9.Provider,{value:{allowedExtensions:f,allowedFolders:m,availableDocTypes:x,availableRepresentativeSubtypes:_,ctaText:null!=S?S:"Insert",ctaTextTransform:null!=T?T:"capitalize",displayInfo:k,lastLocationMode:void 0===M||!!M,persistMode:!!B,pluginInfo:{publicApplicationName:null!=D?D:"",pluginName:null!=O?O:"OrangeDAM Content Browser"},isContentBrowserPopedup:!C,showCollections:!!L,showFavoriteFolder:!1!==N,showVersions:!!z,useSession:F,allowPin:!!y,allowFormatDialogPin:!!v,allowLogout:void 0===b||!!b,allowTracking:void 0===w||!!w,allowProxy:void 0===A||!!A,allowFavorites:!!g,defaultGridView:null!=j?j:""},children:K.jsx(Mne,{containerId:C,extraFields:I,loadExternalFonts:P,multiSelect:!!R,onError:q,getPinnedState:ee,onAssetAction:$,onAssetSelected:X,onAppAuthUrlCopied:Y,onImageSelected:Z,onPinAsset:te,onClose:ie,onConnectClicked:d,onTokenChanged:J,onUnpinAsset:ne,onSiteUrlChanged:h,assetsPickerRef:Dne})})}))}),close:()=>{var e,t;null==(t=(e=window.OrangeDAMContentBrowser)._onClose)||t.call(e)},fetchAssets:e=>{var t;return null==(t=Dne.current)?void 0:t.fetchAssets(e)},fetchFolders:e=>{var t;return null==(t=Dne.current)?void 0:t.fetchFolders(e)},previewAsset:e=>{var t;return null==(t=Dne.current)?void 0:t.selectAsset(e)}};globalThis.OrangeDAMContentBrowser=Lne;const Nne={svg:as`<svg
|
|
2470
2470
|
xmlns="http://www.w3.org/2000/svg"
|
|
2471
2471
|
aria-label="Mailchimp"
|
|
2472
2472
|
role="img"
|
|
@@ -12991,7 +12991,7 @@ function apiGetAssetLinks(_0) {
|
|
|
12991
12991
|
if (extraFields == null ? void 0 : extraFields.length) {
|
|
12992
12992
|
requestBody.ExtraFields = extraFields;
|
|
12993
12993
|
}
|
|
12994
|
-
const
|
|
12994
|
+
const useSessionParams = useSession ? { UseSession: useSession } : void 0;
|
|
12995
12995
|
const attemptPost = !postUnsupportedOrigins.has(origin2);
|
|
12996
12996
|
let rawResponse;
|
|
12997
12997
|
if (attemptPost) {
|
|
@@ -12999,7 +12999,8 @@ function apiGetAssetLinks(_0) {
|
|
|
12999
12999
|
const postResult = yield http.request({
|
|
13000
13000
|
data: requestBody,
|
|
13001
13001
|
method: "POST",
|
|
13002
|
-
|
|
13002
|
+
params: useSessionParams,
|
|
13003
|
+
url: AssetApiEndpoint.GET_ASSET_LINK,
|
|
13003
13004
|
validateStatus: () => true
|
|
13004
13005
|
});
|
|
13005
13006
|
if (POST_UNSUPPORTED_STATUSES.has(postResult.status)) {
|
|
@@ -13735,7 +13736,7 @@ class FetchAndMergeAssetsController {
|
|
|
13735
13736
|
MetadataApiEndpoint.GET_SORT_ORDERS,
|
|
13736
13737
|
AuthApiEndpoint.GET_USER_INFO,
|
|
13737
13738
|
FOLDER_API_ENDPOINT
|
|
13738
|
-
].includes(config.url)) {
|
|
13739
|
+
].includes(config.url.split("?")[0])) {
|
|
13739
13740
|
return config;
|
|
13740
13741
|
}
|
|
13741
13742
|
if (baseUrl) {
|
package/build/index.mjs
CHANGED
|
@@ -13057,7 +13057,7 @@ function apiGetAssetLinks(_0) {
|
|
|
13057
13057
|
if (extraFields == null ? void 0 : extraFields.length) {
|
|
13058
13058
|
requestBody.ExtraFields = extraFields;
|
|
13059
13059
|
}
|
|
13060
|
-
const
|
|
13060
|
+
const useSessionParams = useSession ? { UseSession: useSession } : void 0;
|
|
13061
13061
|
const attemptPost = !postUnsupportedOrigins.has(origin2);
|
|
13062
13062
|
let rawResponse;
|
|
13063
13063
|
if (attemptPost) {
|
|
@@ -13065,7 +13065,8 @@ function apiGetAssetLinks(_0) {
|
|
|
13065
13065
|
const postResult = yield http.request({
|
|
13066
13066
|
data: requestBody,
|
|
13067
13067
|
method: "POST",
|
|
13068
|
-
|
|
13068
|
+
params: useSessionParams,
|
|
13069
|
+
url: AssetApiEndpoint.GET_ASSET_LINK,
|
|
13069
13070
|
validateStatus: () => true
|
|
13070
13071
|
});
|
|
13071
13072
|
if (POST_UNSUPPORTED_STATUSES.has(postResult.status)) {
|
|
@@ -13801,7 +13802,7 @@ class FetchAndMergeAssetsController {
|
|
|
13801
13802
|
MetadataApiEndpoint.GET_SORT_ORDERS,
|
|
13802
13803
|
AuthApiEndpoint.GET_USER_INFO,
|
|
13803
13804
|
FOLDER_API_ENDPOINT
|
|
13804
|
-
].includes(config.url)) {
|
|
13805
|
+
].includes(config.url.split("?")[0])) {
|
|
13805
13806
|
return config;
|
|
13806
13807
|
}
|
|
13807
13808
|
if (baseUrl) {
|
|
@@ -32599,7 +32600,9 @@ const ResponsiveTypography = dt("cx-typography")`
|
|
|
32599
32600
|
`;
|
|
32600
32601
|
const RestoreSession = ({ onCancel }) => {
|
|
32601
32602
|
const dispatch = useAppDispatch();
|
|
32603
|
+
const currentSession = useAppSelector(applySessionSelector);
|
|
32602
32604
|
reactExports.useEffect(() => {
|
|
32605
|
+
if (currentSession) return;
|
|
32603
32606
|
getData(USE_SESSION).then((storedSession) => {
|
|
32604
32607
|
if (storedSession) {
|
|
32605
32608
|
dispatch(setUseSession(storedSession));
|
|
@@ -33024,6 +33027,9 @@ const ContentBrowser = {
|
|
|
33024
33027
|
if (onRequestToken) {
|
|
33025
33028
|
store.dispatch(setUseHeaders(true));
|
|
33026
33029
|
}
|
|
33030
|
+
if (useSession) {
|
|
33031
|
+
store.dispatch(setUseSession(useSession));
|
|
33032
|
+
}
|
|
33027
33033
|
store.dispatch(initAuthInfoFromCache());
|
|
33028
33034
|
const errorHandler = typeof onError === "function" && !!onError ? onError : console.log;
|
|
33029
33035
|
const assetActionHandler = typeof onAssetAction === "function" && !!onAssetAction ? onAssetAction : () => {
|
package/package.json
CHANGED