@orangelogic/orange-dam-content-browser-sdk 2.1.59 → 2.1.61

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.
@@ -1007,7 +1007,7 @@
1007
1007
  height: 100%;
1008
1008
  display: flex;
1009
1009
  flex-direction: column;
1010
- `,qr={containerSize:{width:0,height:0},currentCount:0,currentFolder:Nt,defaultPageSize:Ut.md,facets:[],hasScrolled:!1,isLoading:!1,isSeeThrough:!0,openBrowser:!1,start:0,pageSize:0,maxPageSize:0,searchText:"",selectedFacets:{},shouldResetFilters:!0,sortDirection:void 0,sortOrder:"",totalCount:0,view:Qt.gf.Medium},Hr=(e,t)=>{const n={start:0,pageSize:e.maxPageSize};switch(t.type){case"SET_CONTAINER_SIZE":return{...e,containerSize:t.payload};case"SET_CURRENT_COUNT":return{...e,currentCount:t.payload};case"SET_CURRENT_FOLDER":return{...e,currentFolder:t.payload.folder,shouldResetFilters:!!t.payload.shouldResetFilters,...n};case"SET_FACETS":return{...e,facets:t.payload};case"SET_FILTERS":return{...e,selectedFacets:t.payload,shouldResetFilters:!1,...n};case"SET_HAS_SCROLLED":return{...e,hasScrolled:t.payload};case"SET_IS_LOADING":return{...e,isLoading:t.payload};case"SET_IS_SEE_THROUGH":return{...e,isSeeThrough:t.payload,...n};case"SET_OPEN_BROWSER":return{...e,openBrowser:t.payload};case"SET_START":return{...e,start:t.payload,pageSize:e.defaultPageSize};case"SET_PAGE_SIZE":{const n={...e,pageSize:t.payload.pageSize,maxPageSize:t.payload.pageSize};return t.payload.returnToFirstPage&&(n.start=0),n}case"SET_SEARCH_TEXT":return{...e,...n,searchText:t.payload};case"SET_SORT_DIRECTION":return{...e,...n,sortDirection:t.payload};case"SET_SORT_ORDER":return{...e,...n,sortOrder:t.payload};case"SET_TOTAL_COUNT":return{...e,totalCount:t.payload};case"SET_VIEW":{let n=Ut.md;switch(t.payload){case Qt.gf.Large:n=15;break;case Qt.gf.Medium:n=20;break;case Qt.gf.Small:n=30}return{...e,view:t.payload,defaultPageSize:n}}case"RESET_SEARCH":return{...e,currentCount:0,currentFolder:Nt,searchText:"",totalCount:0};default:return e}},Wr=()=>{var e;const[t,n]=(0,wt.useReducer)(Hr,qr),r=(0,Mr.GV)(Fr.jT),o=(0,Mr.GV)(Fr.wL),i=(0,Mr.GV)(Lr.OC),{allowedExtensions:a,allowedFolders:s,allowFavorites:l,allowPin:c,allowProxy:u,allowTracking:d,availableDocTypes:h,availableRepresentativeSubtypes:p,ctaText:f,lastLocationMode:m,persistMode:g,showCollections:v,showFavoriteFolder:b,showVersions:y,defaultGridView:x}=(0,wt.useContext)(ir.t),{extraFields:w,onAssetAction:S,onAssetSelected:k,onClose:_}=(0,wt.useContext)(zt.B),{data:C,isFetching:E,isError:A}=(0,Rt.aM)(i?{id:i,useSession:o}:Lt.hT),T=(0,wt.useMemo)((()=>C&&i&&C.recordId===i?C:null),[C,i]),{data:O,isFetching:P,isLoading:z,refetch:D}=(0,Br.X)({});(0,wt.useEffect)((()=>{r&&D()}),[r,D]);const{data:R,isFetching:j,isError:N}=(0,Yn.t$)(T?{assetImages:T?[T]:[],useSession:o}:Lt.hT),{data:I}=(0,Yn.jS)({useSession:o}),{data:M}=(0,Yn.M$)({useSession:o}),{ATSEnabled:L,autoExtension:F=".auto",collectionPath:B,supportedExtensions:U,supportedRepresentativeSubtypes:V}=M||{},{data:q}=(0,Yn.ZP)({useSession:o}),{data:H}=(0,Yn.nb)({useSession:o}),{data:W,refetch:K}=(0,Rt.E7)(T&&l?{recordId:T.id}:Lt.hT),[$,Q]=(0,wt.useState)(!1),[X,G]=(0,wt.useState)(!1),[Z,Y]=(0,wt.useState)(sn.EI.Hide),[J,ee]=(0,wt.useState)(0),[te,ne]=(0,wt.useState)(!1),re=(0,wt.useRef)($),oe=(0,wt.useRef)(null),ie=(0,wt.useRef)(null),ae=(0,wt.useRef)(null),le=(0,wt.useRef)(!1),ce=(0,wt.useRef)([]),ue=(0,Mr.jL)(),de=(0,wt.useRef)(t.pageSize),he=(0,wt.useRef)(t.view),pe=(0,wt.useRef)(!1),fe=(0,wt.useRef)(null);re.current=$,ce.current=t.facets,he.current=t.view,de.current=t.pageSize;const me=(0,wt.useRef)(null),ge=(0,wt.useMemo)((()=>t.selectedFacets.Types&&t.selectedFacets.Types.length>0?t.selectedFacets.Types:["*"]),[t.selectedFacets]),ve=(0,wt.useMemo)((()=>!(null!==ge&&void 0!==ge&&ge.length)||0===ge.length),[ge]),be=(0,wt.useMemo)((()=>{var e;if(!q)return;const r=null===(e=Object.values(q).find((e=>e.some((e=>e.isDefault)))))||void 0===e?void 0:e[0];return t.sortOrder&&q[t.sortOrder]&&0!==q[t.sortOrder].length?1===q[t.sortOrder].length?q[t.sortOrder][0]:q[t.sortOrder].find((e=>{let{sortDirection:n}=e;return n.toLowerCase()===t.sortDirection})):(r&&(n({type:"SET_SORT_DIRECTION",payload:r.sortDirection.toLowerCase()}),n({type:"SET_SORT_ORDER",payload:r.sortDirectionGroupKey.toLowerCase()})),r)}),[q,t.sortDirection,t.sortOrder]),ye=(0,wt.useMemo)((()=>null===R||void 0===R?void 0:R.proxies.filter((e=>{if(!a||0===a.length)return!0;let t="";if(e.extension)t=e.extension.replace(".","");else{var n;const r=null===(n=e.permanentLink)||void 0===n?void 0:n.split(".").at(-1);t=null!==r&&void 0!==r?r:""}return a.some((e=>!!t&&t.toLowerCase()===e.toLowerCase()))}))),[R,a]),xe=(0,wt.useMemo)((()=>X&&q&&(null===ge||void 0===ge?void 0:ge.length)&&$),[X,q,ge,$]),{data:we,isFetching:Se,isError:_e,refetch:Ce}=(0,Rt.pf)(xe?{folderID:t.currentFolder.id,isSeeThrough:t.isSeeThrough,limitedToDocTypes:h,pageSize:t.pageSize,searchText:t.searchText,selectedFacets:t.selectedFacets,sortOrder:null===be||void 0===be?void 0:be.id,start:t.start,useSession:o}:Lt.hT);(0,wt.useEffect)((()=>{var e;ee(null!==(e=null===we||void 0===we?void 0:we.items.length)&&void 0!==e?e:0)}),[null===we||void 0===we?void 0:we.items.length]),(0,wt.useEffect)((()=>{A&&ue((0,Lr.DM)(null))}),[ue,A]),(0,wt.useEffect)((()=>{S&&null!==T&&void 0!==T&&T.recordId&&S("select",T.recordId)}),[S,T]),(0,wt.useEffect)((()=>{let e=null;return Se?n({type:"SET_IS_LOADING",payload:!0}):e=setTimeout((()=>{n({type:"SET_IS_LOADING",payload:Se})}),200),()=>{e&&clearTimeout(e)}}),[Se]),(0,wt.useEffect)((()=>{r&&(ue((0,Lr.DM)(null)),n({type:"RESET_SEARCH"}),Promise.all([(0,Mt.bQ)("selectedSortOrder"),(0,Mt.bQ)("selectedSortDirection"),(0,Mt.bQ)("selectedView"),(0,Mt.bQ)("newFacets"),(0,Mt.bQ)("selectedFilter"),(0,Mt.bQ)("selectedIsSeeThrough"),(0,Mt.bQ)("searchText")]).then((e=>{let[t,r,o,i,a,s,l]=e;if(t&&n({type:"SET_SORT_ORDER",payload:t}),"ascending"!==r&&"descending"!==r||n({type:"SET_SORT_DIRECTION",payload:r}),null===o&&(o=x),"string"===typeof o&&(Object.values(Qt.gf).includes(o)?n({type:"SET_VIEW",payload:o}):n({type:"SET_VIEW",payload:Qt.gf.Medium})),m){if(i){const e=JSON.parse(i);(0,Xe.A)(e)?n({type:"SET_FACETS",payload:e}):n({type:"SET_FACETS",payload:[]})}if(a){const e=JSON.parse(a);n(e?{type:"SET_FILTERS",payload:xt(e,Xe.A)}:{type:"SET_FILTERS",payload:{}})}s&&n({type:"SET_IS_SEE_THROUGH",payload:"true"===s}),l&&n({type:"SET_SEARCH_TEXT",payload:l})}le.current=!0})))}),[ue,r,m,x]),(0,wt.useEffect)((()=>{let e=null;const t=oe.current;if(!t)return;const n=t.offsetWidth;return t.style.width=n-1+"px",e=setTimeout((()=>{t.style.width="100%"}),50),()=>{e&&clearTimeout(e)}}),[r]),(0,wt.useEffect)((()=>{const e=ae.current;if(!e)return;const t=e=>{const t=e.detail.entries;window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&t[0].target===oe.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:t[0].contentRect.width,height:t[0].contentRect.height}})}))};return e.addEventListener("cx-resize",t),()=>{e.removeEventListener("cx-resize",t)}}),[]),(0,wt.useEffect)((()=>{!be&&le.current&&n({type:"SET_SORT_ORDER",payload:qr.sortOrder})}),[be,q]),(0,wt.useEffect)((()=>{le.current&&((0,Mt.yt)("selectedSortOrder",t.sortOrder),t.sortDirection&&(0,Mt.yt)("selectedSortDirection",t.sortDirection),(0,Mt.yt)("selectedView",t.view),(0,Mt.yt)("newFacets",JSON.stringify(t.facets)),(0,Mt.yt)("selectedFilter",JSON.stringify(t.selectedFacets)),(0,Mt.yt)("selectedIsSeeThrough",t.isSeeThrough.toString()),(0,Mt.yt)("searchText",t.searchText))}),[t.currentFolder,t.facets,t.isSeeThrough,t.sortDirection,t.sortOrder,t.searchText,t.view,t.selectedFacets]);const Ee=t.containerSize.width<=Ut.Pm,Ae=e=>{ue((0,Lr.DM)(e.recordId))},Te=(0,wt.useCallback)((e=>{ue((0,Lr.DM)(null)),n({type:"SET_SEARCH_TEXT",payload:e})}),[ue]),Oe=(0,wt.useRef)(0),Pe=(0,wt.useRef)(0),ze=(0,wt.useRef)(t.defaultPageSize);ze.current=t.defaultPageSize;const De=(0,wt.useCallback)(((e,t)=>{var r;const{width:o,height:i}=e,a=o||0,s=i||0;if(a*s===0||!le.current)return;const l=Oe.current,c=Pe.current;if(Math.abs(l-s)<10&&Math.abs(c-a)<10&&(null===t||void 0===t||!t.force))return;Oe.current=s,Pe.current=a;const u=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cx-spacing-medium")||"16",10),d=(null===(r=Dr[he.current])||void 0===r?void 0:r.minWidth)||Dr[Qt.gf.Large].minWidth,h=Math.max(1,Math.floor((a+u)/(d+u))),p=Math.ceil(s/(d+u)),f=Math.ceil(p*h/ze.current+1)*ze.current;G(!0),f!==de.current&&0!==f&&n({type:"SET_PAGE_SIZE",payload:{pageSize:f,returnToFirstPage:!(null===t||void 0===t||!t.returnToFirstPage)}})}),[]),Re=(0,wt.useMemo)((()=>ke(De,Ut.h,{leading:!1})),[De]);(0,wt.useEffect)((()=>{if(le.current){const e=ie.current;he.current=t.view,e&&Re({width:e.clientWidth,height:e.clientHeight},{returnToFirstPage:!0,force:!0})}}),[Re,t.view]);const je=(0,wt.useCallback)(((e,t)=>{switch(e){case"view":n({type:"SET_VIEW",payload:t});break;case"sortDirection":n({type:"SET_SORT_DIRECTION",payload:t});break;case"sortOrder":n({type:"SET_SORT_ORDER",payload:t.toString()});break;case"isSeeThrough":n({type:"SET_IS_SEE_THROUGH",payload:Boolean(t)});break;case"filter":n({type:"SET_FILTERS",payload:t})}}),[]),Ne=(0,wt.useCallback)((e=>{n({type:"SET_CURRENT_COUNT",payload:e.currentCount}),n({type:"SET_TOTAL_COUNT",payload:e.totalCount}),n({type:"SET_FACETS",payload:e.facets})}),[]),Ie=(0,wt.useCallback)((async e=>{re.current||Q(!0);const t=await ue(It(e));It.fulfilled.match(t)&&(n({type:"SET_CURRENT_FOLDER",payload:{folder:e,shouldResetFilters:re.current}}),te||n({type:"SET_OPEN_BROWSER",payload:!1}),ue((0,Lr.DM)(null)),(0,Mt.yt)("lastLocation",JSON.stringify(e)))}),[ue,te]),Me=(0,wt.useCallback)((()=>{pe.current?pe.current=!1:n({type:"SET_START",payload:null!==J&&void 0!==J?J:0})}),[J]),Le=(0,wt.useCallback)((e=>{if(!e.target)return;const t=e.target.scrollTop;n(0===t?{type:"SET_HAS_SCROLLED",payload:!1}:{type:"SET_HAS_SCROLLED",payload:!0})}),[]),Fe=(0,wt.useCallback)((async(e,t,n)=>{const r=[...e];Dt.Yq.forEach((e=>{const o=se(e);var i,a,s,l,c,u,d,h,p,f;T&&null!==w&&void 0!==w&&w.includes(e)&&(r[0]={...r[0],extraFields:{...(null===(i=r[0])||void 0===i?void 0:i.extraFields)||{},[e]:T[o]}});n?r[0]={...r[0],assetTransformationSource:t,assetLinkInfo:{extension:n.extension,isCustomFormat:null===(a=n.isCustomFormat)||void 0===a||a,permanentLink:r[0].imageUrl,width:n.width,height:n.height}}:r[0]={...r[0],assetLinkInfo:{cdnName:null!==(s=null===t||void 0===t?void 0:t.cdnName)&&void 0!==s?s:null,extension:null!==(l=null===t||void 0===t?void 0:t.extension)&&void 0!==l?l:null,isCustomFormat:null!==(c=null===t||void 0===t?void 0:t.isCustomFormat)&&void 0!==c&&c,permanentLink:null!==(u=r[0].imageUrl)&&void 0!==u?u:null,proxyLabel:null!==(d=null===t||void 0===t?void 0:t.proxyLabel)&&void 0!==d?d:null,proxyName:null!==(h=null===t||void 0===t?void 0:t.proxyName)&&void 0!==h?h:null,width:null!==(p=null===t||void 0===t?void 0:t.width)&&void 0!==p?p:null,height:null!==(f=null===t||void 0===t?void 0:t.height)&&void 0!==f?f:null}}}));const o=k(r);if("object"===typeof(i=o)&&null!==i&&"function"===typeof i.then)try{await o}catch(a){return void console.error("Error in onAssetSelected:",a)}var i;g||null===_||void 0===_||_()}),[w,k,_,g,T]),Be=(0,wt.useMemo)((()=>!!we&&t.start+t.pageSize<t.totalCount),[we,t.pageSize,t.start,t.totalCount]);(0,wt.useEffect)((()=>{var e,t,n,r;Ne&&Ne({currentCount:null!==(e=null===we||void 0===we?void 0:we.items.length)&&void 0!==e?e:0,items:null!==(t=null===we||void 0===we?void 0:we.items)&&void 0!==t?t:[],facets:null!==(n=null===we||void 0===we?void 0:we.facets)&&void 0!==n?n:[],totalCount:null!==(r=null===we||void 0===we?void 0:we.totalCount)&&void 0!==r?r:0})}),[we,Ne]),(0,wt.useEffect)((()=>{const e=()=>{pe.current=!0,fe.current&&clearTimeout(fe.current),fe.current=setTimeout((()=>{pe.current=!1}),Ut.h)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,wt.useEffect)((()=>{const e=me.current,t=()=>{e&&window.clearTimeout(e)};return t(),E||j?(Y(sn.EI.Hide),me.current=window.setTimeout((()=>{Y(sn.EI.ShowLoader)}),800)):E||j||!(null!==R&&void 0!==R&&R.proxies||N)||me.current&&(t(),Y(sn.EI.ShowDialog)),()=>{t()}}),[R,N,j,E]),(0,wt.useEffect)((()=>{T||Y(sn.EI.ShowDialog)}),[T]);const Ue=(0,wt.useMemo)((()=>I&&a&&0!==a.length?Object.entries(I).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:r.filter((e=>!a||0===a.length||a.some((t=>e.value.toLowerCase()===`.${t.toLowerCase()}`))))}}),I):I),[I,a]),Ve=t.containerSize.width<650;return(0,Vt.jsx)("cx-resize-observer",{ref:ae,children:(0,Vt.jsxs)(Ur,{ref:oe,children:[(0,Vt.jsx)(Yt,{allowedFolders:s,allowPin:c,collectionPath:B,currentFolder:t.currentFolder,favoriteFolderId:null===O||void 0===O?void 0:O.favoriteFolderRecordID,lastLocationMode:m,open:t.openBrowser,showCollections:v,showFavoriteFolder:b,useSession:o,onFolderSelect:Ie,onClose:()=>n({type:"SET_OPEN_BROWSER",payload:!1}),isPersistent:te,onChangePersistent:ne,forceOverlay:Ve}),(0,Vt.jsxs)(Vr,{children:[(0,Vt.jsx)(sr,{bordered:t.hasScrolled,currentFolder:t.currentFolder,isFetching:P,isLoading:z,userInfo:O,onMenuClick:()=>n({type:"SET_OPEN_BROWSER",payload:!0}),onLogout:()=>{ue((0,Fr.ri)()),ue((0,Lr.DM)(null)),n({type:"RESET_SEARCH"})},children:(0,Vt.jsx)(on,{allowSorting:"Mono"!==(null===be||void 0===be?void 0:be.sortDirection)&&!!be,availableFacets:null!==H&&void 0!==H?H:[],currentCount:t.currentCount,facets:t.facets,isMobile:Ee,isSeeThrough:t.isSeeThrough,loading:t.isLoading,searchValue:t.searchText,selectedFacets:t.selectedFacets,sortDirection:t.sortDirection,sortOrder:t.sortOrder,sortOrders:q,totalCount:t.totalCount,view:t.view,onSearchChange:Te,onSettingChange:je})}),(0,Vt.jsx)("div",{style:{flex:1,minHeight:"320px",padding:"0 var(--cx-spacing-medium)",position:"relative"},children:(0,Vt.jsx)(Pt,{onResize:Re,children:e=>{let{height:n,width:r}=e;return(0,Vt.jsx)("div",{style:{height:n+"px",width:r+"px"},children:(0,Vt.jsx)(Ir,{ref:ie,isError:_e,isConfigError:ve,hasNextPage:Be,height:n,isLoadingData:t.isLoading||!we,isFetched:!!we||ve,items:(null===we||void 0===we?void 0:we.items)||[],selectedAsset:null!==T&&void 0!==T?T:null,view:t.view,width:r,onItemSelect:Ae,onLoadMore:Me,onScroll:Le},t.currentFolder.id+t.searchText+Object.values(t.selectedFacets).join("+")+t.isSeeThrough+t.view)})}})}),Z===sn.EI.ShowLoader&&(0,Vt.jsx)("cx-space",{className:"format-loader",children:(0,Vt.jsx)("cx-spinner",{})}),(0,Vt.jsx)(or,{allowCustomFormat:!!L&&!(null===T||void 0===T||!T.allowATSLink),allowFavorites:l,allowProxy:u,allowTracking:d,allowedExtensions:a,appendAutoExtension:null!==(e=null===a||void 0===a?void 0:a.includes(F))&&void 0!==e&&e,autoExtension:F,availableExtensions:Ue,availableProxies:N?[]:j?void 0:ye,ctaText:f,extensions:null!==U&&void 0!==U?U:[],isFavorite:!!W,maxHeight:t.containerSize.height,open:!!T&&Z===sn.EI.ShowDialog,previewUrl:N||j||null===R||void 0===R?void 0:R.previewUrl,selectedAsset:null!==T&&void 0!==T?T:null,showVersions:y,supportedRepresentativeSubtypes:null!==p&&void 0!==p&&p.length?Qe(p,V):V,variant:Ee?"drawer":"dialog",boundary:oe.current,onClose:()=>{ue((0,Lr.DM)(null)),S("unselect","")},onFavorite:async()=>{if(!T)return!1;const e=await ue((0,Lr.P1)({recordId:T.recordId}));return Lr.P1.fulfilled.match(e)&&(S&&S("favorite",T.recordId),await K(),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Ce():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e},onProxyConfirm:async e=>{let{extension:t,value:n,permanentLink:r,parameters:i,useRepresentative:a,selectedProxyMetadata:s}=e;if(!T)return;const l=await ue((0,Lr.Tp)({extension:t,extraFields:w,parameters:i,permanentLink:r,proxiesPreference:n,selectedAsset:T,useRepresentative:a,useSession:o}));Lr.Tp.fulfilled.match(l)&&await Fe(l.payload,s)},onFormatConfirm:async e=>{let{value:t,parameters:n,proxiesPreference:r,extension:i,sourceProxyMetadata:a,transformedAssetMetadata:s}=e;if(!T)return;const l=null!==T&&void 0!==T&&T.width?parseInt(T.width,10):0,c=null!==T&&void 0!==T&&T.height?parseInt(T.height,10):0,u=await ue((0,Lr.Tp)({extraFields:w,extension:i,maxHeight:c,maxWidth:l,parameters:n,proxiesPreference:r,selectedAsset:T,useSession:o,transformations:t}));Lr.Tp.fulfilled.match(u)&&await Fe(u.payload,a,s)},onUnFavorite:async()=>{if(!T)return!1;const e=await ue((0,Lr.BZ)({recordId:T.recordId}));return Lr.BZ.fulfilled.match(e)&&(S&&S("unfavorite",T.recordId),await K(),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Ce():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e}})]})]})})}},9989:e=>{"use strict";var t=!("undefined"===typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},9993:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(4802),o=n(3903),i=n(3239),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;const s=function(e){return(0,i.A)(e)&&(0,o.A)(e.length)&&!!a[(0,r.A)(e)]};var l=n(7328),c=n(8187),u="object"==typeof exports&&exports&&!exports.nodeType&&exports,d=u&&"object"==typeof module&&module&&!module.nodeType&&module,h=d&&d.exports===u&&c.A.process,p=function(){try{var e=d&&d.require&&d.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(t){}}();var f=p&&p.isTypedArray;const m=f?(0,l.A)(f):s}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>Mv});var e=n(4391),t=n(5137);const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;let l=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}};const c=e=>new l("string"==typeof e?e:e+"",void 0,a),u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=1===e.length?e[0]:n.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new l(o,e,a)},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,b=globalThis,y=b.trustedTypes,x=y?y.emptyScript:"",w=b.reactiveElementPolyfillSupport,S=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!h(e,t),C={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:o}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);o?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){const e=this.properties,t=[...m(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const e=this._$Eu(t,n);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:k).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=r;const i=o.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,o=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??_)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,n,r){let{useDefault:o,reflect:i,wrapped:a}=n;o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(Oe){throw e=!1,this._$EM(),Oe}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[S("elementProperties")]=new Map,E[S("finalized")]=new Map,w?.({ReactiveElement:E}),(b.reactiveElementVersions??=[]).push("2.1.1");const A=globalThis,T=A.trustedTypes,O=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+z,R=`<${D}>`,j=document,N=()=>j.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,L="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,V=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,H=/"/g,W=/^(?:script|style|textarea|title)$/i,K=e=>function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return{_$litType$:e,strings:t,values:r}},$=K(1),Q=(K(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),G=new WeakMap,Z=j.createTreeWalker(j,129);function Y(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(t):t}class J{constructor(e,t){let n,{strings:r,_$litType$:o}=e;this.parts=[];let i=0,a=0;const s=r.length-1,l=this.parts,[c,u]=((e,t)=>{const n=e.length-1,r=[];let o,i=2===t?"<svg>":3===t?"<math>":"",a=F;for(let s=0;s<n;s++){const t=e[s];let n,l,c=-1,u=0;for(;u<t.length&&(a.lastIndex=u,l=a.exec(t),null!==l);)u=a.lastIndex,a===F?"!--"===l[1]?a=B:void 0!==l[1]?a=U:void 0!==l[2]?(W.test(l[2])&&(o=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=o??F,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?V:'"'===l[3]?H:q):a===H||a===q?a=V:a===B||a===U?a=F:(a=V,o=void 0);const d=a===V&&e[s+1].startsWith("/>")?" ":"";i+=a===F?t+R:c>=0?(r.push(n),t.slice(0,c)+P+t.slice(c)+z+d):t+z+(-2===c?s:d)}return[Y(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(r,o);if(this.el=J.createElement(c,t),Z.currentNode=this.el.content,2===o||3===o){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const t=u[a++],r=n.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?oe:"?"===o[1]?ie:"@"===o[1]?ae:re}),n.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:i}),n.removeAttribute(e));if(W.test(n.tagName)){const e=n.textContent.split(z),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],N()),Z.nextNode(),l.push({type:2,index:++i});n.append(e[t],N())}}}else if(8===n.nodeType)if(n.data===D)l.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(z,e+1));)l.push({type:7,index:i}),e+=z.length-1}i++}}static createElement(e,t){const n=j.createElement("template");return n.innerHTML=e,n}}function ee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;if(t===Q)return t;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(e),o._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(t=ee(e,o._$AS(e,t.values),o,r)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,a=0,s=n[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new ne(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new se(o,this,e)),this._$AV.push(t),s=n[++a]}i!==s?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=j,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e){e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),I(e)?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==X&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=J.createElement(Y(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new J(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const o of e)r===t.length?t.push(n=new ne(this.O(N()),this.O(N()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let i=!1;if(void 0===o)e=ee(this,e,t,0),i=!I(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const r=e;let a,s;for(e=o[0],a=0;a<o.length-1;a++)s=ee(this,r[n+a],t,a),s===Q&&(s=this._$AH[a]),i||=!I(s)||s!==this._$AH[a],s===X?e=X:e!==X&&(e+=(s??"")+o[a+1]),this._$AH[a]=s}i&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class oe extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ie extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ae extends re{constructor(e,t,n,r,o){super(e,t,n,r,o),this.type=5}_$AI(e){if((e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??X)===Q)return;const t=this._$AH,n=e===X&&t!==X||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,r=e!==X&&(t===X||n);n&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le={I:ne},ce=A.litHtmlPolyfillSupport;ce?.(J,ne),(A.litHtmlVersions??=[]).push("3.3.1");const ue=globalThis;class de extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(void 0===o){const e=n?.renderBefore??null;r._$litPart$=o=new ne(t.insertBefore(N(),e),e,void 0,n??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,ue.litElementHydrateSupport?.({LitElement:de});const he=ue.litElementPolyfillSupport;he?.({LitElement:de}),(ue.litElementVersions??=[]).push("4.2.1");const pe={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:_};function fe(e){return(t,n)=>"object"==typeof n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,o,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];t.call(this,n),this.requestUpdate(r,o,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var me=Object.defineProperty,ge=(e,t,n,r)=>{for(var o,i=void 0,a=e.length-1;a>=0;a--)(o=e[a])&&(i=o(t,n,i)||i);return i&&me(t,n,i),i};const ve=class extends de{constructor(){super(),this.preRender=!1,Object.entries(this.constructor.dependencies).forEach((e=>{let[t,n]=e;this.constructor.define(t,n)}))}emit(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(n),n}static define(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=customElements.get(e);if(!r){try{customElements.define(e,t,n)}catch{customElements.define(e,class extends t{},n)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in r&&r.version&&(i=" v"+r.version),(!o||!i||o!==i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}static createProperty(e,t){super.createProperty(e,t),t?.attribute&&"string"==typeof t.attribute&&!Object.prototype.hasOwnProperty.call(this.prototype,t.attribute)&&Object.prototype.hasOwnProperty.call(this.prototype,e)&&Object.defineProperty(this.prototype,t.attribute,{get(){return this[e]},set(t){this[e]=t}})}firstUpdated(e){super.firstUpdated(e),!this.preRender&&this.runFirstUpdated(e)}runFirstUpdated(e){}adoptedCallback(){ye(this)}disconnectedCallback(){super.disconnectedCallback(),ye(this)}};ve.version="1",ve.dependencies={};let be=ve;function ye(e){if(e instanceof be)return;const t=e.localName||e.tagName,n=customElements.get(t.toLowerCase());n&&Object.setPrototypeOf(e,n.prototype)}ge([fe()],be.prototype,"dir"),ge([fe()],be.prototype,"lang"),ge([fe({attribute:"pre-render",type:Boolean})],be.prototype,"preRender");const xe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.get(e)||window.customElements.define(e,t),t))(e,t):((e,t)=>{const{elements:n,kind:r}=t;return{elements:n,finisher(t){window.customElements.get(e)||window.customElements.define(e,t)},kind:r}})(e,t),we=u`
1010
+ `,qr={containerSize:{width:0,height:0},currentCount:0,currentFolder:Nt,defaultPageSize:Ut.md,facets:[],hasScrolled:!1,isLoading:!1,isSeeThrough:!0,openBrowser:!1,start:0,pageSize:0,maxPageSize:0,searchText:"",selectedFacets:{},shouldResetFilters:!0,sortDirection:void 0,sortOrder:"",totalCount:0,view:Qt.gf.Medium},Hr=(e,t)=>{const n={start:0,pageSize:e.maxPageSize};switch(t.type){case"SET_CONTAINER_SIZE":return{...e,containerSize:t.payload};case"SET_CURRENT_COUNT":return{...e,currentCount:t.payload};case"SET_CURRENT_FOLDER":return{...e,currentFolder:t.payload.folder,shouldResetFilters:!!t.payload.shouldResetFilters,...n};case"SET_FACETS":return{...e,facets:t.payload};case"SET_FILTERS":return{...e,selectedFacets:t.payload,shouldResetFilters:!1,...n};case"SET_HAS_SCROLLED":return{...e,hasScrolled:t.payload};case"SET_IS_LOADING":return{...e,isLoading:t.payload};case"SET_IS_SEE_THROUGH":return{...e,isSeeThrough:t.payload,...n};case"SET_OPEN_BROWSER":return{...e,openBrowser:t.payload};case"SET_START":return{...e,start:t.payload,pageSize:e.defaultPageSize};case"SET_PAGE_SIZE":{const n={...e,pageSize:t.payload.pageSize,maxPageSize:t.payload.pageSize};return t.payload.returnToFirstPage&&(n.start=0),n}case"SET_SEARCH_TEXT":return{...e,...n,searchText:t.payload};case"SET_SORT_DIRECTION":return{...e,...n,sortDirection:t.payload};case"SET_SORT_ORDER":return{...e,...n,sortOrder:t.payload};case"SET_TOTAL_COUNT":return{...e,totalCount:t.payload};case"SET_VIEW":{let n=Ut.md;switch(t.payload){case Qt.gf.Large:n=15;break;case Qt.gf.Medium:n=20;break;case Qt.gf.Small:n=30}return{...e,view:t.payload,defaultPageSize:n}}case"RESET_SEARCH":return{...e,currentCount:0,currentFolder:Nt,searchText:"",totalCount:0};default:return e}},Wr=()=>{var e;const[t,n]=(0,wt.useReducer)(Hr,qr),r=(0,Mr.GV)(Fr.jT),o=(0,Mr.GV)(Fr.wL),i=(0,Mr.GV)(Lr.OC),{allowedExtensions:a,allowedFolders:s,allowFavorites:l,allowPin:c,allowProxy:u,allowTracking:d,availableDocTypes:h,availableRepresentativeSubtypes:p,ctaText:f,lastLocationMode:m,persistMode:g,showCollections:v,showFavoriteFolder:b,showVersions:y,defaultGridView:x}=(0,wt.useContext)(ir.t),{extraFields:w,onAssetAction:S,onAssetSelected:k,onClose:_}=(0,wt.useContext)(zt.B),{data:C,isFetching:E,isError:A}=(0,Rt.aM)(i?{id:i,useSession:o}:Lt.hT),T=(0,wt.useMemo)((()=>C&&i&&C.recordId===i?C:null),[C,i]),{data:O,isFetching:P,isLoading:z,refetch:D}=(0,Br.X)({});(0,wt.useEffect)((()=>{r&&D()}),[r,D]);const{data:R,isFetching:j,isError:N}=(0,Yn.t$)(T?{assetImages:T?[T]:[],useSession:o}:Lt.hT),{data:I}=(0,Yn.jS)({useSession:o}),{data:M}=(0,Yn.M$)({useSession:o}),{ATSEnabled:L,autoExtension:F=".auto",collectionPath:B,supportedExtensions:U,supportedRepresentativeSubtypes:V}=M||{},{data:q}=(0,Yn.ZP)({useSession:o}),{data:H}=(0,Yn.nb)({useSession:o}),{data:W,refetch:K}=(0,Rt.E7)(T&&l?{recordId:T.id}:Lt.hT),[$,Q]=(0,wt.useState)(!1),[X,G]=(0,wt.useState)(!1),[Z,Y]=(0,wt.useState)(sn.EI.Hide),[J,ee]=(0,wt.useState)(0),[te,ne]=(0,wt.useState)(!1),re=(0,wt.useRef)($),oe=(0,wt.useRef)(null),ie=(0,wt.useRef)(null),ae=(0,wt.useRef)(null),le=(0,wt.useRef)(!1),ce=(0,wt.useRef)([]),ue=(0,wt.useRef)({}),de=(0,Mr.jL)(),he=(0,wt.useRef)(t.pageSize),pe=(0,wt.useRef)(t.view),fe=(0,wt.useRef)(!1),me=(0,wt.useRef)(null);re.current=$,ce.current=t.facets,ue.current=t.selectedFacets,pe.current=t.view,he.current=t.pageSize;const ge=(0,wt.useRef)(null),ve=(0,wt.useMemo)((()=>t.selectedFacets.Types&&t.selectedFacets.Types.length>0?t.selectedFacets.Types:["*"]),[t.selectedFacets]),be=(0,wt.useMemo)((()=>!(null!==ve&&void 0!==ve&&ve.length)||0===ve.length),[ve]),ye=(0,wt.useMemo)((()=>{var e;if(!q)return;const r=null===(e=Object.values(q).find((e=>e.some((e=>e.isDefault)))))||void 0===e?void 0:e[0];return t.sortOrder&&q[t.sortOrder]&&0!==q[t.sortOrder].length?1===q[t.sortOrder].length?q[t.sortOrder][0]:q[t.sortOrder].find((e=>{let{sortDirection:n}=e;return n.toLowerCase()===t.sortDirection})):(r&&(n({type:"SET_SORT_DIRECTION",payload:r.sortDirection.toLowerCase()}),n({type:"SET_SORT_ORDER",payload:r.sortDirectionGroupKey.toLowerCase()})),r)}),[q,t.sortDirection,t.sortOrder]),xe=(0,wt.useMemo)((()=>null===R||void 0===R?void 0:R.proxies.filter((e=>{if(!a||0===a.length)return!0;let t="";if(e.extension)t=e.extension.replace(".","");else{var n;const r=null===(n=e.permanentLink)||void 0===n?void 0:n.split(".").at(-1);t=null!==r&&void 0!==r?r:""}return a.some((e=>!!t&&t.toLowerCase()===e.toLowerCase()))}))),[R,a]),we=(0,wt.useMemo)((()=>X&&q&&(null===ve||void 0===ve?void 0:ve.length)&&$),[X,q,ve,$]),{data:Se,isFetching:_e,isError:Ce,refetch:Ee}=(0,Rt.pf)(we?{folderID:t.currentFolder.id,isSeeThrough:t.isSeeThrough,limitedToDocTypes:h,pageSize:t.pageSize,searchText:t.searchText,selectedFacets:t.selectedFacets,sortOrder:null===ye||void 0===ye?void 0:ye.id,start:t.start,useSession:o}:Lt.hT);(0,wt.useEffect)((()=>{var e;ee(null!==(e=null===Se||void 0===Se?void 0:Se.items.length)&&void 0!==e?e:0)}),[null===Se||void 0===Se?void 0:Se.items.length]),(0,wt.useEffect)((()=>{A&&de((0,Lr.DM)(null))}),[de,A]),(0,wt.useEffect)((()=>{S&&null!==T&&void 0!==T&&T.recordId&&S("select",T.recordId)}),[S,T]),(0,wt.useEffect)((()=>{let e=null;return _e?n({type:"SET_IS_LOADING",payload:!0}):e=setTimeout((()=>{n({type:"SET_IS_LOADING",payload:_e})}),200),()=>{e&&clearTimeout(e)}}),[_e]),(0,wt.useEffect)((()=>{r&&(de((0,Lr.DM)(null)),n({type:"RESET_SEARCH"}),Promise.all([(0,Mt.bQ)("selectedSortOrder"),(0,Mt.bQ)("selectedSortDirection"),(0,Mt.bQ)("selectedView"),(0,Mt.bQ)("newFacets"),(0,Mt.bQ)("selectedFilter"),(0,Mt.bQ)("selectedIsSeeThrough"),(0,Mt.bQ)("searchText")]).then((e=>{let[t,r,o,i,a,s,l]=e;if(t&&n({type:"SET_SORT_ORDER",payload:t}),"ascending"!==r&&"descending"!==r||n({type:"SET_SORT_DIRECTION",payload:r}),null===o&&(o=x),"string"===typeof o&&(Object.values(Qt.gf).includes(o)?n({type:"SET_VIEW",payload:o}):n({type:"SET_VIEW",payload:Qt.gf.Medium})),m){if(i){const e=JSON.parse(i);(0,Xe.A)(e)?n({type:"SET_FACETS",payload:e}):n({type:"SET_FACETS",payload:[]})}if(a){const e=JSON.parse(a);n(e?{type:"SET_FILTERS",payload:xt(e,Xe.A)}:{type:"SET_FILTERS",payload:{}})}s&&n({type:"SET_IS_SEE_THROUGH",payload:"true"===s}),l&&n({type:"SET_SEARCH_TEXT",payload:l})}le.current=!0})))}),[de,r,m,x]),(0,wt.useEffect)((()=>{let e=null;const t=oe.current;if(!t)return;const n=t.offsetWidth;return t.style.width=n-1+"px",e=setTimeout((()=>{t.style.width="100%"}),50),()=>{e&&clearTimeout(e)}}),[r]),(0,wt.useEffect)((()=>{const e=ae.current;if(!e)return;const t=e=>{const t=e.detail.entries;window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&t[0].target===oe.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:t[0].contentRect.width,height:t[0].contentRect.height}})}))};return e.addEventListener("cx-resize",t),()=>{e.removeEventListener("cx-resize",t)}}),[]),(0,wt.useEffect)((()=>{!ye&&le.current&&n({type:"SET_SORT_ORDER",payload:qr.sortOrder})}),[ye,q]),(0,wt.useEffect)((()=>{le.current&&((0,Mt.yt)("selectedSortOrder",t.sortOrder),t.sortDirection&&(0,Mt.yt)("selectedSortDirection",t.sortDirection),(0,Mt.yt)("selectedView",t.view),(0,Mt.yt)("newFacets",JSON.stringify(t.facets)),(0,Mt.yt)("selectedFilter",JSON.stringify(t.selectedFacets)),(0,Mt.yt)("selectedIsSeeThrough",t.isSeeThrough.toString()),(0,Mt.yt)("searchText",t.searchText))}),[t.currentFolder,t.facets,t.isSeeThrough,t.sortDirection,t.sortOrder,t.searchText,t.view,t.selectedFacets]);const Ae=t.containerSize.width<=Ut.Pm,Te=e=>{de((0,Lr.DM)(e.recordId))},Oe=(0,wt.useCallback)((e=>{de((0,Lr.DM)(null)),n({type:"SET_SEARCH_TEXT",payload:e})}),[de]),Pe=(0,wt.useRef)(0),ze=(0,wt.useRef)(0),De=(0,wt.useRef)(t.defaultPageSize);De.current=t.defaultPageSize;const Re=(0,wt.useCallback)(((e,t)=>{var r;const{width:o,height:i}=e,a=o||0,s=i||0;if(a*s===0||!le.current)return;const l=Pe.current,c=ze.current;if(Math.abs(l-s)<10&&Math.abs(c-a)<10&&(null===t||void 0===t||!t.force))return;Pe.current=s,ze.current=a;const u=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cx-spacing-medium")||"16",10),d=(null===(r=Dr[pe.current])||void 0===r?void 0:r.minWidth)||Dr[Qt.gf.Large].minWidth,h=Math.max(1,Math.floor((a+u)/(d+u))),p=Math.ceil(s/(d+u)),f=Math.ceil(p*h/De.current+1)*De.current;G(!0),f!==he.current&&0!==f&&n({type:"SET_PAGE_SIZE",payload:{pageSize:f,returnToFirstPage:!(null===t||void 0===t||!t.returnToFirstPage)}})}),[]),je=(0,wt.useMemo)((()=>ke(Re,Ut.h,{leading:!1})),[Re]);(0,wt.useEffect)((()=>{if(le.current){const e=ie.current;pe.current=t.view,e&&je({width:e.clientWidth,height:e.clientHeight},{returnToFirstPage:!0,force:!0})}}),[je,t.view]);const Ne=(0,wt.useCallback)(((e,t)=>{switch(e){case"view":n({type:"SET_VIEW",payload:t});break;case"sortDirection":n({type:"SET_SORT_DIRECTION",payload:t});break;case"sortOrder":n({type:"SET_SORT_ORDER",payload:t.toString()});break;case"isSeeThrough":n({type:"SET_IS_SEE_THROUGH",payload:Boolean(t)});break;case"filter":n({type:"SET_FILTERS",payload:t})}}),[]),Ie=(0,wt.useCallback)((e=>{n({type:"SET_CURRENT_COUNT",payload:e.currentCount}),n({type:"SET_TOTAL_COUNT",payload:e.totalCount}),n({type:"SET_FACETS",payload:e.facets})}),[]),Me=(0,wt.useCallback)((async e=>{re.current||Q(!0);const t=await de(It(e));It.fulfilled.match(t)&&(n({type:"SET_CURRENT_FOLDER",payload:{folder:e,shouldResetFilters:re.current}}),te||n({type:"SET_OPEN_BROWSER",payload:!1}),de((0,Lr.DM)(null)),(0,Mt.yt)("lastLocation",JSON.stringify(e)))}),[de,te]),Le=(0,wt.useCallback)((()=>{fe.current?fe.current=!1:n({type:"SET_START",payload:null!==J&&void 0!==J?J:0})}),[J]),Fe=(0,wt.useCallback)((e=>{if(!e.target)return;const t=e.target.scrollTop;n(0===t?{type:"SET_HAS_SCROLLED",payload:!1}:{type:"SET_HAS_SCROLLED",payload:!0})}),[]),Be=(0,wt.useCallback)((async(e,t,n)=>{const r=[...e];Dt.Yq.forEach((e=>{const o=se(e);var i,a,s,l,c,u,d,h,p,f;T&&null!==w&&void 0!==w&&w.includes(e)&&(r[0]={...r[0],extraFields:{...(null===(i=r[0])||void 0===i?void 0:i.extraFields)||{},[e]:T[o]}});n?r[0]={...r[0],assetTransformationSource:t,assetLinkInfo:{extension:n.extension,isCustomFormat:null===(a=n.isCustomFormat)||void 0===a||a,permanentLink:r[0].imageUrl,width:n.width,height:n.height}}:r[0]={...r[0],assetLinkInfo:{cdnName:null!==(s=null===t||void 0===t?void 0:t.cdnName)&&void 0!==s?s:null,extension:null!==(l=null===t||void 0===t?void 0:t.extension)&&void 0!==l?l:null,isCustomFormat:null!==(c=null===t||void 0===t?void 0:t.isCustomFormat)&&void 0!==c&&c,permanentLink:null!==(u=r[0].imageUrl)&&void 0!==u?u:null,proxyLabel:null!==(d=null===t||void 0===t?void 0:t.proxyLabel)&&void 0!==d?d:null,proxyName:null!==(h=null===t||void 0===t?void 0:t.proxyName)&&void 0!==h?h:null,width:null!==(p=null===t||void 0===t?void 0:t.width)&&void 0!==p?p:null,height:null!==(f=null===t||void 0===t?void 0:t.height)&&void 0!==f?f:null}}}));const o=k(r);if("object"===typeof(i=o)&&null!==i&&"function"===typeof i.then)try{await o}catch(a){return void console.error("Error in onAssetSelected:",a)}var i;g||null===_||void 0===_||_()}),[w,k,_,g,T]),Ue=(0,wt.useMemo)((()=>!!Se&&t.start+t.pageSize<t.totalCount),[Se,t.pageSize,t.start,t.totalCount]);(0,wt.useEffect)((()=>{if(Ie){var e,t,n,r,o;const i=new Map(ce.current.map((e=>[`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,{...e,values:e.values.reduce(((t,n)=>{var r;return(null===(r=ue.current[e.facetDetails.facetFieldName])||void 0===r?void 0:r.find((e=>e===n.value)))&&t.push({...n,count:0}),t}),[])}])));(null!==(e=null===Se||void 0===Se||null===(t=Se.facets)||void 0===t?void 0:t.filter((e=>e.values.length>0)))&&void 0!==e?e:[]).forEach((e=>{var t;const n=i.get(`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`),r=[...e.values,...null!==(t=null===n||void 0===n?void 0:n.values.filter((t=>!(null!==e&&void 0!==e&&e.values.find((e=>t.value===e.value&&t.displayValue===e.displayValue))))))&&void 0!==t?t:[]];i.set(`${e.facetDetails.facetFieldName}|${e.facetDetails.displayName}`,{...e,values:r})})),Ie({currentCount:null!==(n=null===Se||void 0===Se?void 0:Se.items.length)&&void 0!==n?n:0,items:null!==(r=null===Se||void 0===Se?void 0:Se.items)&&void 0!==r?r:[],facets:Array.from(i.values()),totalCount:null!==(o=null===Se||void 0===Se?void 0:Se.totalCount)&&void 0!==o?o:0})}}),[Se,Ie]),(0,wt.useEffect)((()=>{const e=()=>{fe.current=!0,me.current&&clearTimeout(me.current),me.current=setTimeout((()=>{fe.current=!1}),Ut.h)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,wt.useEffect)((()=>{const e=ge.current,t=()=>{e&&window.clearTimeout(e)};return t(),E||j?(Y(sn.EI.Hide),ge.current=window.setTimeout((()=>{Y(sn.EI.ShowLoader)}),800)):E||j||!(null!==R&&void 0!==R&&R.proxies||N)||ge.current&&(t(),Y(sn.EI.ShowDialog)),()=>{t()}}),[R,N,j,E]),(0,wt.useEffect)((()=>{T||Y(sn.EI.ShowDialog)}),[T]);const Ve=(0,wt.useMemo)((()=>I&&a&&0!==a.length?Object.entries(I).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:r.filter((e=>!a||0===a.length||a.some((t=>e.value.toLowerCase()===`.${t.toLowerCase()}`))))}}),I):I),[I,a]),qe=t.containerSize.width<650;return(0,Vt.jsx)("cx-resize-observer",{ref:ae,children:(0,Vt.jsxs)(Ur,{ref:oe,children:[(0,Vt.jsx)(Yt,{allowedFolders:s,allowPin:c,collectionPath:B,currentFolder:t.currentFolder,favoriteFolderId:null===O||void 0===O?void 0:O.favoriteFolderRecordID,lastLocationMode:m,open:t.openBrowser,showCollections:v,showFavoriteFolder:b,useSession:o,onFolderSelect:Me,onClose:()=>n({type:"SET_OPEN_BROWSER",payload:!1}),isPersistent:te,onChangePersistent:ne,forceOverlay:qe}),(0,Vt.jsxs)(Vr,{children:[(0,Vt.jsx)(sr,{bordered:t.hasScrolled,currentFolder:t.currentFolder,isFetching:P,isLoading:z,userInfo:O,onMenuClick:()=>n({type:"SET_OPEN_BROWSER",payload:!0}),onLogout:()=>{de((0,Fr.ri)()),de((0,Lr.DM)(null)),n({type:"RESET_SEARCH"})},children:(0,Vt.jsx)(on,{allowSorting:"Mono"!==(null===ye||void 0===ye?void 0:ye.sortDirection)&&!!ye,availableFacets:null!==H&&void 0!==H?H:[],currentCount:t.currentCount,facets:t.facets,isMobile:Ae,isSeeThrough:t.isSeeThrough,loading:t.isLoading,searchValue:t.searchText,selectedFacets:t.selectedFacets,sortDirection:t.sortDirection,sortOrder:t.sortOrder,sortOrders:q,totalCount:t.totalCount,view:t.view,onSearchChange:Oe,onSettingChange:Ne})}),(0,Vt.jsx)("div",{style:{flex:1,minHeight:"320px",padding:"0 var(--cx-spacing-medium)",position:"relative"},children:(0,Vt.jsx)(Pt,{onResize:je,children:e=>{let{height:n,width:r}=e;return(0,Vt.jsx)("div",{style:{height:n+"px",width:r+"px"},children:(0,Vt.jsx)(Ir,{ref:ie,isError:Ce,isConfigError:be,hasNextPage:Ue,height:n,isLoadingData:t.isLoading||!Se,isFetched:!!Se||be,items:(null===Se||void 0===Se?void 0:Se.items)||[],selectedAsset:null!==T&&void 0!==T?T:null,view:t.view,width:r,onItemSelect:Te,onLoadMore:Le,onScroll:Fe},t.currentFolder.id+t.searchText+Object.values(t.selectedFacets).join("+")+t.isSeeThrough+t.view)})}})}),Z===sn.EI.ShowLoader&&(0,Vt.jsx)("cx-space",{className:"format-loader",children:(0,Vt.jsx)("cx-spinner",{})}),(0,Vt.jsx)(or,{allowCustomFormat:!!L&&!(null===T||void 0===T||!T.allowATSLink),allowFavorites:l,allowProxy:u,allowTracking:d,allowedExtensions:a,appendAutoExtension:null!==(e=null===a||void 0===a?void 0:a.includes(F))&&void 0!==e&&e,autoExtension:F,availableExtensions:Ve,availableProxies:N?[]:j?void 0:xe,ctaText:f,extensions:null!==U&&void 0!==U?U:[],isFavorite:!!W,maxHeight:t.containerSize.height,open:!!T&&Z===sn.EI.ShowDialog,previewUrl:N||j||null===R||void 0===R?void 0:R.previewUrl,selectedAsset:null!==T&&void 0!==T?T:null,showVersions:y,supportedRepresentativeSubtypes:null!==p&&void 0!==p&&p.length?Qe(p,V):V,variant:Ae?"drawer":"dialog",boundary:oe.current,onClose:()=>{de((0,Lr.DM)(null)),S("unselect","")},onFavorite:async()=>{if(!T)return!1;const e=await de((0,Lr.P1)({recordId:T.recordId}));return Lr.P1.fulfilled.match(e)&&(S&&S("favorite",T.recordId),await K(),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Ee():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e},onProxyConfirm:async e=>{let{extension:t,value:n,permanentLink:r,parameters:i,useRepresentative:a,selectedProxyMetadata:s}=e;if(!T)return;const l=await de((0,Lr.Tp)({extension:t,extraFields:w,parameters:i,permanentLink:r,proxiesPreference:n,selectedAsset:T,useRepresentative:a,useSession:o}));Lr.Tp.fulfilled.match(l)&&await Be(l.payload,s)},onFormatConfirm:async e=>{let{value:t,parameters:n,proxiesPreference:r,extension:i,sourceProxyMetadata:a,transformedAssetMetadata:s}=e;if(!T)return;const l=null!==T&&void 0!==T&&T.width?parseInt(T.width,10):0,c=null!==T&&void 0!==T&&T.height?parseInt(T.height,10):0,u=await de((0,Lr.Tp)({extraFields:w,extension:i,maxHeight:c,maxWidth:l,parameters:n,proxiesPreference:r,selectedAsset:T,useSession:o,transformations:t}));Lr.Tp.fulfilled.match(u)&&await Be(u.payload,a,s)},onUnFavorite:async()=>{if(!T)return!1;const e=await de((0,Lr.BZ)({recordId:T.recordId}));return Lr.BZ.fulfilled.match(e)&&(S&&S("unfavorite",T.recordId),await K(),t.currentFolder.id===(null===O||void 0===O?void 0:O.favoriteFolderRecordID)&&(0===t.start?Ee():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e}})]})]})})}},9989:e=>{"use strict";var t=!("undefined"===typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},9993:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(4802),o=n(3903),i=n(3239),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;const s=function(e){return(0,i.A)(e)&&(0,o.A)(e.length)&&!!a[(0,r.A)(e)]};var l=n(7328),c=n(8187),u="object"==typeof exports&&exports&&!exports.nodeType&&exports,d=u&&"object"==typeof module&&module&&!module.nodeType&&module,h=d&&d.exports===u&&c.A.process,p=function(){try{var e=d&&d.require&&d.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(t){}}();var f=p&&p.isTypedArray;const m=f?(0,l.A)(f):s}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>Mv});var e=n(4391),t=n(5137);const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;let l=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}};const c=e=>new l("string"==typeof e?e:e+"",void 0,a),u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=1===e.length?e[0]:n.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new l(o,e,a)},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,b=globalThis,y=b.trustedTypes,x=y?y.emptyScript:"",w=b.reactiveElementPolyfillSupport,S=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!h(e,t),C={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:o}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);o?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){const e=this.properties,t=[...m(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const e=this._$Eu(t,n);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:k).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=r;const i=o.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,o=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??_)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,n,r){let{useDefault:o,reflect:i,wrapped:a}=n;o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(Oe){throw e=!1,this._$EM(),Oe}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[S("elementProperties")]=new Map,E[S("finalized")]=new Map,w?.({ReactiveElement:E}),(b.reactiveElementVersions??=[]).push("2.1.1");const A=globalThis,T=A.trustedTypes,O=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+z,R=`<${D}>`,j=document,N=()=>j.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,L="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,V=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,H=/"/g,W=/^(?:script|style|textarea|title)$/i,K=e=>function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return{_$litType$:e,strings:t,values:r}},$=K(1),Q=(K(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),G=new WeakMap,Z=j.createTreeWalker(j,129);function Y(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(t):t}class J{constructor(e,t){let n,{strings:r,_$litType$:o}=e;this.parts=[];let i=0,a=0;const s=r.length-1,l=this.parts,[c,u]=((e,t)=>{const n=e.length-1,r=[];let o,i=2===t?"<svg>":3===t?"<math>":"",a=F;for(let s=0;s<n;s++){const t=e[s];let n,l,c=-1,u=0;for(;u<t.length&&(a.lastIndex=u,l=a.exec(t),null!==l);)u=a.lastIndex,a===F?"!--"===l[1]?a=B:void 0!==l[1]?a=U:void 0!==l[2]?(W.test(l[2])&&(o=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=o??F,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?V:'"'===l[3]?H:q):a===H||a===q?a=V:a===B||a===U?a=F:(a=V,o=void 0);const d=a===V&&e[s+1].startsWith("/>")?" ":"";i+=a===F?t+R:c>=0?(r.push(n),t.slice(0,c)+P+t.slice(c)+z+d):t+z+(-2===c?s:d)}return[Y(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(r,o);if(this.el=J.createElement(c,t),Z.currentNode=this.el.content,2===o||3===o){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const t=u[a++],r=n.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?oe:"?"===o[1]?ie:"@"===o[1]?ae:re}),n.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:i}),n.removeAttribute(e));if(W.test(n.tagName)){const e=n.textContent.split(z),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],N()),Z.nextNode(),l.push({type:2,index:++i});n.append(e[t],N())}}}else if(8===n.nodeType)if(n.data===D)l.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(z,e+1));)l.push({type:7,index:i}),e+=z.length-1}i++}}static createElement(e,t){const n=j.createElement("template");return n.innerHTML=e,n}}function ee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;if(t===Q)return t;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(e),o._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(t=ee(e,o._$AS(e,t.values),o,r)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,a=0,s=n[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new ne(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new se(o,this,e)),this._$AV.push(t),s=n[++a]}i!==s?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=j,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e){e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),I(e)?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==X&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=J.createElement(Y(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new J(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const o of e)r===t.length?t.push(n=new ne(this.O(N()),this.O(N()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let i=!1;if(void 0===o)e=ee(this,e,t,0),i=!I(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const r=e;let a,s;for(e=o[0],a=0;a<o.length-1;a++)s=ee(this,r[n+a],t,a),s===Q&&(s=this._$AH[a]),i||=!I(s)||s!==this._$AH[a],s===X?e=X:e!==X&&(e+=(s??"")+o[a+1]),this._$AH[a]=s}i&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class oe extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ie extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ae extends re{constructor(e,t,n,r,o){super(e,t,n,r,o),this.type=5}_$AI(e){if((e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??X)===Q)return;const t=this._$AH,n=e===X&&t!==X||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,r=e!==X&&(t===X||n);n&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le={I:ne},ce=A.litHtmlPolyfillSupport;ce?.(J,ne),(A.litHtmlVersions??=[]).push("3.3.1");const ue=globalThis;class de extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(void 0===o){const e=n?.renderBefore??null;r._$litPart$=o=new ne(t.insertBefore(N(),e),e,void 0,n??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,ue.litElementHydrateSupport?.({LitElement:de});const he=ue.litElementPolyfillSupport;he?.({LitElement:de}),(ue.litElementVersions??=[]).push("4.2.1");const pe={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:_};function fe(e){return(t,n)=>"object"==typeof n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,o,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];t.call(this,n),this.requestUpdate(r,o,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var me=Object.defineProperty,ge=(e,t,n,r)=>{for(var o,i=void 0,a=e.length-1;a>=0;a--)(o=e[a])&&(i=o(t,n,i)||i);return i&&me(t,n,i),i};const ve=class extends de{constructor(){super(),this.preRender=!1,Object.entries(this.constructor.dependencies).forEach((e=>{let[t,n]=e;this.constructor.define(t,n)}))}emit(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(n),n}static define(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=customElements.get(e);if(!r){try{customElements.define(e,t,n)}catch{customElements.define(e,class extends t{},n)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in r&&r.version&&(i=" v"+r.version),(!o||!i||o!==i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}static createProperty(e,t){super.createProperty(e,t),t?.attribute&&"string"==typeof t.attribute&&!Object.prototype.hasOwnProperty.call(this.prototype,t.attribute)&&Object.prototype.hasOwnProperty.call(this.prototype,e)&&Object.defineProperty(this.prototype,t.attribute,{get(){return this[e]},set(t){this[e]=t}})}firstUpdated(e){super.firstUpdated(e),!this.preRender&&this.runFirstUpdated(e)}runFirstUpdated(e){}adoptedCallback(){ye(this)}disconnectedCallback(){super.disconnectedCallback(),ye(this)}};ve.version="1",ve.dependencies={};let be=ve;function ye(e){if(e instanceof be)return;const t=e.localName||e.tagName,n=customElements.get(t.toLowerCase());n&&Object.setPrototypeOf(e,n.prototype)}ge([fe()],be.prototype,"dir"),ge([fe()],be.prototype,"lang"),ge([fe({attribute:"pre-render",type:Boolean})],be.prototype,"preRender");const xe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.get(e)||window.customElements.define(e,t),t))(e,t):((e,t)=>{const{elements:n,kind:r}=t;return{elements:n,finisher(t){window.customElements.get(e)||window.customElements.define(e,t)},kind:r}})(e,t),we=u`
1011
1011
  :host {
1012
1012
  box-sizing: border-box;
1013
1013
  }
@@ -11477,5 +11477,5 @@ governing permissions and limitations under the License.
11477
11477
  top: 0;
11478
11478
  width: 100vw;
11479
11479
  z-index: var(--cx-z-index-dialog);
11480
- `,Av=e=>{let{extraFields:t=[],containerId:r,loadExternalFonts:o=!0,multiSelect:i,onClose:a,onError:s,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onConnectClicked:d,onTokenChanged:h,onSiteUrlChanged:p}=e;const f=(0,wv.GV)(Sv.Hb),m=(0,wv.GV)(Sv.KL),[g,v]=(0,pv.useState)(!0);(0,pv.useEffect)((()=>{o?gv().load({google:{families:["Fira Code","Fira Mono","Fira Sans","Fira Sans Condensed","Fira Sans Extra Condensed"]}}):Promise.resolve().then(n.bind(n,4781))}),[o]),(0,pv.useEffect)((()=>{h&&f&&h(f)}),[f,h]),(0,pv.useEffect)((()=>{p&&m&&p(m)}),[m,p]);const b=(0,pv.useCallback)((()=>{v(!1),null===a||void 0===a||a()}),[a]),y=(0,pv.useMemo)((()=>({extraFields:t,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onError:s,onClose:b,onConnectClicked:d})),[t,b,l,c,s,u,d]);return(0,yv.jsx)(vv.B.Provider,{value:y,children:r?(0,yv.jsx)(Cv,{multiSelect:i}):(0,yv.jsx)(Ev,{open:g,children:(0,yv.jsx)(Cv,{multiSelect:i})})})};var Tv=n(5650),Ov=n(5873),Pv=n(3943),zv=n(9063),Dv=n(5029),Rv=n(4413);class jv{static getInstance(){return jv.instance||(jv.instance=new jv),jv.instance}async fetchAssets(e){const t=await wv.M_.dispatch(zv.PG.endpoints.getAssets.initiate(e,{forceRefetch:!0}));return"data"in t?t.data:{facets:[],items:[],totalCount:0}}async fetchFolders(e){var t;const n=await wv.M_.dispatch(zv.PG.endpoints.getFolders.initiate({...e,pageSize:null!==(t=e.pageSize)&&void 0!==t?t:Rv.VH},{forceRefetch:!0}));return"data"in n?n.data:{items:[],totalCount:0}}}jv.instance=void 0;const Nv=jv.getInstance(),Iv={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 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 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 });")},open:async n=>{let{onAssetAction:r,onAssetSelected:o,onImageSelected:i,onError:a,onClose:s,onRequestToken:l,onTokenChanged:c,onConnectClicked:u,onSiteUrlChanged:d,customStorage:h,allowedExtensions:p,allowedFolders:f,allowFavorites:m,allowPin:g,allowLogout:v,allowProxy:b,allowTracking:y,availableDocTypes:x,availableRepresentativeSubtypes:w,baseUrl:S,containerId:k,ctaText:_,displayInfo:C={title:!0,dimension:!0,fileSize:!1,tags:!1},extraFields:E,lastLocationMode:A,loadExternalFonts:T,multiSelect:O,persistMode:P,pluginName:z,publicApplicationName:D,showCollections:R,showFavoriteFolder:j,showVersions:N,useSession:I,defaultGridView:M}=n;const L="object"===typeof h&&h&&"function"===typeof h.delete&&h.delete&&"function"===typeof h.get&&h.get&&"function"===typeof h.set&&h.set?h:void 0;window.OrangeDAMContentBrowser._customStorage=L;let F=k&&document.getElementById(k);if(k){if(!F)return void console.error(`Container with id ${k} is not found`)}else F=document.body;let B=F.querySelector("#cortex-asset-picker-root");B||(B=document.createElement("div"),B.id="cortex-asset-picker-root",B.style.width="100%",B.style.height="100%",B.style.display="flex",B.style.alignItems="center",B.style.justifyContent="center",B.style.position="relative",F.appendChild(B));const U=(0,e.createRoot)(B);l&&(window.OrangeDAMContentBrowser._onRequestToken=()=>l().then((e=>({token:e,siteUrl:S})))),S&&wv.M_.dispatch((0,Sv._f)(S)),l&&wv.M_.dispatch((0,Sv.Uh)(!0)),wv.M_.dispatch((0,Sv.hG)());const V="function"===typeof a&&a?a:console.log,q="function"===typeof r&&r?r:()=>{},H="function"===typeof o&&o?o:()=>{},W="function"===typeof i&&i?i:()=>{},K="function"===typeof c&&c?c:void 0,$=()=>{wv.M_.dispatch((0,Ov.ZZ)()),wv.M_.dispatch(zv.PG.util.resetApiState()),wv.M_.dispatch(Pv.A1.util.resetApiState()),wv.M_.dispatch(Dv.i.util.resetApiState()),U.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===s||void 0===s||s()};window.OrangeDAMContentBrowser._onAssetAction=q,window.OrangeDAMContentBrowser._onAssetSelected=H,window.OrangeDAMContentBrowser._onImageSelected=W,window.OrangeDAMContentBrowser._onError=V,window.OrangeDAMContentBrowser._onClose=$,U.render((0,yv.jsx)(t.Kq,{store:wv.M_,children:(0,yv.jsx)(Tv.t.Provider,{value:{allowedExtensions:p,allowedFolders:f,availableDocTypes:x,availableRepresentativeSubtypes:w,ctaText:null!==_&&void 0!==_?_:"Insert",displayInfo:C,lastLocationMode:void 0===A||!!A,persistMode:!!P,pluginInfo:{publicApplicationName:null!==D&&void 0!==D?D:"",pluginName:null!==z&&void 0!==z?z:"OrangeDAM Content Browser"},isContentBrowserPopedup:!k,showCollections:!!R,showFavoriteFolder:!!j,showVersions:!!N,useSession:I,allowPin:!!g,allowLogout:void 0===v||!!v,allowTracking:void 0===y||!!y,allowProxy:void 0===b||!!b,allowFavorites:!!m,defaultGridView:null!==M&&void 0!==M?M:""},children:(0,yv.jsx)(Av,{containerId:k,extraFields:E,loadExternalFonts:T,multiSelect:!!O,onError:V,onAssetAction:q,onAssetSelected:H,onImageSelected:W,onClose:$,onConnectClicked:u,onTokenChanged:K,onSiteUrlChanged:d})})}))},close:()=>{var e,t;null===(e=(t=window.OrangeDAMContentBrowser)._onClose)||void 0===e||e.call(t)},fetchAssets:e=>Nv.fetchAssets(e),fetchFolders:e=>Nv.fetchFolders(e),previewAsset:e=>{wv.M_.dispatch((0,Ov.DM)(e))}};window.OrangeDAMContentBrowser=Iv;const Mv=Iv})(),r=r.default})()));
11480
+ `,Av=e=>{let{extraFields:t=[],containerId:r,loadExternalFonts:o=!0,multiSelect:i,onClose:a,onError:s,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onConnectClicked:d,onTokenChanged:h,onSiteUrlChanged:p}=e;const f=(0,wv.GV)(Sv.Hb),m=(0,wv.GV)(Sv.KL),[g,v]=(0,pv.useState)(!0);(0,pv.useEffect)((()=>{o?gv().load({google:{families:["Fira Code","Fira Mono","Fira Sans","Fira Sans Condensed","Fira Sans Extra Condensed"]}}):Promise.resolve().then(n.bind(n,4781))}),[o]),(0,pv.useEffect)((()=>{h&&h(null!==f&&void 0!==f?f:"")}),[f,h]),(0,pv.useEffect)((()=>{p&&m&&p(m)}),[m,p]);const b=(0,pv.useCallback)((()=>{v(!1),null===a||void 0===a||a()}),[a]),y=(0,pv.useMemo)((()=>({extraFields:t,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onError:s,onClose:b,onConnectClicked:d})),[t,b,l,c,s,u,d]);return(0,yv.jsx)(vv.B.Provider,{value:y,children:r?(0,yv.jsx)(Cv,{multiSelect:i}):(0,yv.jsx)(Ev,{open:g,children:(0,yv.jsx)(Cv,{multiSelect:i})})})};var Tv=n(5650),Ov=n(5873),Pv=n(3943),zv=n(9063),Dv=n(5029),Rv=n(4413);class jv{static getInstance(){return jv.instance||(jv.instance=new jv),jv.instance}async fetchAssets(e){const t=await wv.M_.dispatch(zv.PG.endpoints.getAssets.initiate(e,{forceRefetch:!0}));return"data"in t?t.data:{facets:[],items:[],totalCount:0}}async fetchFolders(e){var t;const n=await wv.M_.dispatch(zv.PG.endpoints.getFolders.initiate({...e,pageSize:null!==(t=e.pageSize)&&void 0!==t?t:Rv.VH},{forceRefetch:!0}));return"data"in n?n.data:{items:[],totalCount:0}}}jv.instance=void 0;const Nv=jv.getInstance(),Iv={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 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 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 });")},open:async n=>{let{onAssetAction:r,onAssetSelected:o,onImageSelected:i,onError:a,onClose:s,onRequestToken:l,onTokenChanged:c,onConnectClicked:u,onSiteUrlChanged:d,customStorage:h,allowedExtensions:p,allowedFolders:f,allowFavorites:m,allowPin:g,allowLogout:v,allowProxy:b,allowTracking:y,availableDocTypes:x,availableRepresentativeSubtypes:w,baseUrl:S,containerId:k,ctaText:_,displayInfo:C={title:!0,dimension:!0,fileSize:!1,tags:!1},extraFields:E,lastLocationMode:A,loadExternalFonts:T,multiSelect:O,persistMode:P,pluginName:z,publicApplicationName:D,showCollections:R,showFavoriteFolder:j,showVersions:N,useSession:I,defaultGridView:M}=n;const L="object"===typeof h&&h&&"function"===typeof h.delete&&h.delete&&"function"===typeof h.get&&h.get&&"function"===typeof h.set&&h.set?h:void 0;window.OrangeDAMContentBrowser._customStorage=L;let F=k&&document.getElementById(k);if(k){if(!F)return void console.error(`Container with id ${k} is not found`)}else F=document.body;let B=F.querySelector("#cortex-asset-picker-root");B||(B=document.createElement("div"),B.id="cortex-asset-picker-root",B.style.width="100%",B.style.height="100%",B.style.display="flex",B.style.alignItems="center",B.style.justifyContent="center",B.style.position="relative",F.appendChild(B));const U=(0,e.createRoot)(B);l&&(window.OrangeDAMContentBrowser._onRequestToken=()=>l().then((e=>({token:e,siteUrl:S})))),S&&wv.M_.dispatch((0,Sv._f)(S)),l&&wv.M_.dispatch((0,Sv.Uh)(!0)),wv.M_.dispatch((0,Sv.hG)());const V="function"===typeof a&&a?a:console.log,q="function"===typeof r&&r?r:()=>{},H="function"===typeof o&&o?o:()=>{},W="function"===typeof i&&i?i:()=>{},K="function"===typeof c&&c?c:void 0,$=()=>{wv.M_.dispatch((0,Ov.ZZ)()),wv.M_.dispatch(zv.PG.util.resetApiState()),wv.M_.dispatch(Pv.A1.util.resetApiState()),wv.M_.dispatch(Dv.i.util.resetApiState()),U.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===s||void 0===s||s()};window.OrangeDAMContentBrowser._onAssetAction=q,window.OrangeDAMContentBrowser._onAssetSelected=H,window.OrangeDAMContentBrowser._onImageSelected=W,window.OrangeDAMContentBrowser._onError=V,window.OrangeDAMContentBrowser._onClose=$,U.render((0,yv.jsx)(t.Kq,{store:wv.M_,children:(0,yv.jsx)(Tv.t.Provider,{value:{allowedExtensions:p,allowedFolders:f,availableDocTypes:x,availableRepresentativeSubtypes:w,ctaText:null!==_&&void 0!==_?_:"Insert",displayInfo:C,lastLocationMode:void 0===A||!!A,persistMode:!!P,pluginInfo:{publicApplicationName:null!==D&&void 0!==D?D:"",pluginName:null!==z&&void 0!==z?z:"OrangeDAM Content Browser"},isContentBrowserPopedup:!k,showCollections:!!R,showFavoriteFolder:!!j,showVersions:!!N,useSession:I,allowPin:!!g,allowLogout:void 0===v||!!v,allowTracking:void 0===y||!!y,allowProxy:void 0===b||!!b,allowFavorites:!!m,defaultGridView:null!==M&&void 0!==M?M:""},children:(0,yv.jsx)(Av,{containerId:k,extraFields:E,loadExternalFonts:T,multiSelect:!!O,onError:V,onAssetAction:q,onAssetSelected:H,onImageSelected:W,onClose:$,onConnectClicked:u,onTokenChanged:K,onSiteUrlChanged:d})})}))},close:()=>{var e,t;null===(e=(t=window.OrangeDAMContentBrowser)._onClose)||void 0===e||e.call(t)},fetchAssets:e=>Nv.fetchAssets(e),fetchFolders:e=>Nv.fetchFolders(e),previewAsset:e=>{wv.M_.dispatch((0,Ov.DM)(e))}};window.OrangeDAMContentBrowser=Iv;const Mv=Iv})(),r=r.default})()));
11481
11481
  //# sourceMappingURL=OrangeDAMContentBrowserSDK.min.js.map