@scaleflex/asset-picker 0.1.0 → 0.2.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +21 -5
  2. package/README.md +20 -10
  3. package/dist/{asset-picker-BA876lMW.js → asset-picker-CSsp_Huy.js} +2246 -1972
  4. package/dist/{asset-picker-BbEOZw7O.cjs → asset-picker-DBOWNXd-.cjs} +898 -723
  5. package/dist/asset-picker.d.ts +26 -1
  6. package/dist/asset-picker.d.ts.map +1 -1
  7. package/dist/components/filters/ap-filter-metadata.d.ts.map +1 -1
  8. package/dist/components/filters/ap-filter-size.d.ts.map +1 -1
  9. package/dist/components/filters/ap-filters-bar.d.ts +1 -0
  10. package/dist/components/filters/ap-filters-bar.d.ts.map +1 -1
  11. package/dist/components/filters/shared/filter-styles.d.ts.map +1 -1
  12. package/dist/components/header/ap-header.d.ts.map +1 -1
  13. package/dist/components/header/ap-regional-settings.d.ts.map +1 -1
  14. package/dist/components/modal/ap-modal.d.ts.map +1 -1
  15. package/dist/components/preview/ap-preview-panel.d.ts +1 -0
  16. package/dist/components/preview/ap-preview-panel.d.ts.map +1 -1
  17. package/dist/components/selection/ap-selection-bar.d.ts +0 -1
  18. package/dist/components/selection/ap-selection-bar.d.ts.map +1 -1
  19. package/dist/components/shared/ap-checkbox.d.ts +2 -0
  20. package/dist/components/shared/ap-checkbox.d.ts.map +1 -1
  21. package/dist/components/shared/ap-dropdown.d.ts.map +1 -1
  22. package/dist/components/shared/ap-icon.d.ts.map +1 -1
  23. package/dist/components/toolbar/ap-content-toolbar.d.ts +2 -0
  24. package/dist/components/toolbar/ap-content-toolbar.d.ts.map +1 -1
  25. package/dist/components/views/ap-asset-card.d.ts.map +1 -1
  26. package/dist/components/views/ap-asset-row.d.ts.map +1 -1
  27. package/dist/components/views/ap-list-view.d.ts.map +1 -1
  28. package/dist/define.cjs +1 -1
  29. package/dist/define.js +2 -2
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/react.cjs +1 -1
  35. package/dist/react.js +5 -5
  36. package/dist/services/filters.service.d.ts.map +1 -1
  37. package/dist/types/config.types.d.ts +55 -0
  38. package/dist/types/config.types.d.ts.map +1 -1
  39. package/dist/utils/brand-color.d.ts.map +1 -1
  40. package/package.json +7 -2
  41. package/dist/controllers/keyboard.controller.d.ts +0 -10
  42. package/dist/controllers/keyboard.controller.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("lit"),c=require("lit/decorators.js");class ys{constructor(e){this.listeners=new Set,this._notifying=!1,this._pendingState=null,this.state=e}getState(){return this.state}setState(e){if(this._notifying){this._pendingState={...this._pendingState||{},...e};return}const s=this.state;this.state={...s,...e},this._notifying=!0;try{this.listeners.forEach(a=>a(this.state,s))}finally{this._notifying=!1}if(this._pendingState){const a=this._pendingState;this._pendingState=null,this.setState(a)}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.listeners.clear()}}function xs(){return new ys({config:null,projectToken:"",sassKey:"",brandColor:"",isOpen:!1,activeTab:"assets",viewMode:"grid",searchQuery:"",sortBy:"modified_at",sortDirection:"desc",previewAsset:null,isPreviewOpen:!1,assets:[],folders:[],folderPreviews:{},labels:[],tags:[],currentFolder:null,currentFolderPath:"/",breadcrumb:[],offset:0,limit:100,totalCount:0,totalFolderCount:0,isLoading:!1,isSelectingAll:!1,hasMore:!1,filters:{metadata:{pinned:[],visible:[],applied:{}},pinned:[],visible:[],applied:{}},metadataFields:[],regionalVariantGroups:[],regionalFilters:{},selectedAssets:new Map})}class $s{constructor(e,s){this.host=e,this.store=s,e.addController(this)}get state(){return this.store.getState()}setState(e){this.store.setState(e)}hostConnected(){this.unsubscribe=this.store.subscribe(()=>{this.host.requestUpdate()})}hostDisconnected(){var e;(e=this.unsubscribe)==null||e.call(this)}}class ws{constructor(e,s){this.lastClickedIndex=-1,this.host=e,this.store=s,e.addController(this)}hostConnected(){}hostDisconnected(){}handleSelect(e,s,a){var d,h;const i=this.store.getState(),r=new Map(i.selectedAssets);if(!(((d=i.config)==null?void 0:d.multiSelect)??!0)){r.clear(),r.set(e.uuid,e),this.store.setState({selectedAssets:r}),this.lastClickedIndex=s;return}if(a.shiftKey&&this.lastClickedIndex>=0){const u=Math.min(this.lastClickedIndex,s),g=Math.max(this.lastClickedIndex,s),p=i.assets;for(let f=u;f<=g;f++)p[f]&&r.set(p[f].uuid,p[f])}else a.metaKey||a.ctrlKey?r.has(e.uuid)?r.delete(e.uuid):r.set(e.uuid,e):(r.clear(),r.set(e.uuid,e));const l=(h=i.config)==null?void 0:h.maxSelections;l&&r.size>l||(this.lastClickedIndex=s,this.store.setState({selectedAssets:r}))}isSelected(e){return this.store.getState().selectedAssets.has(e)}resetRange(){this.lastClickedIndex=-1}selectAll(e){var n;const a=(n=this.store.getState().config)==null?void 0:n.maxSelections,i=new Map,r=a?Math.min(e.length,a):e.length;for(let l=0;l<r;l++)i.set(e[l].uuid,e[l]);return this.store.setState({selectedAssets:i}),this.lastClickedIndex=-1,i.size}clearSelection(){this.store.setState({selectedAssets:new Map}),this.lastClickedIndex=-1}getSelectedAssets(){return Array.from(this.store.getState().selectedAssets.values())}}class Ss{constructor(e,s){this.host=e,this.onLoadMore=s,e.addController(this)}hostConnected(){}hostDisconnected(){this.disconnect()}observe(e,s){this.disconnect(),this.sentinel=e,this.observer=new IntersectionObserver(a=>{var i;(i=a[0])!=null&&i.isIntersecting&&this.onLoadMore()},{root:s??null,rootMargin:"200px"}),this.observer.observe(e)}disconnect(){this.observer&&this.sentinel&&(this.observer.unobserve(this.sentinel),this.observer.disconnect()),this.observer=void 0,this.sentinel=void 0}}const Nt=5,Ce=40,jt=15;class Cs{constructor(e,s){this.startX=0,this.startY=0,this.startClientX=0,this.startClientY=0,this.preMarqueeSelection=new Map,this._dragging=!1,this._scrollRAF=null,this._lastMouseEvent=null,this.isActive=!1,this.rect={x:0,y:0,width:0,height:0},this.handleMouseDown=a=>this.onMouseDown(a),this.handleMouseMove=a=>this.onMouseMove(a),this.handleMouseUp=()=>this.onMouseUp(),this.host=e,this.store=s,e.addController(this)}hostConnected(){}hostDisconnected(){this.detach()}attach(e){this.detach(),this.container=e,e.addEventListener("mousedown",this.handleMouseDown)}detach(){this.container&&this.container.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.stopAutoScroll(),this._lastMouseEvent=null}isInteractiveTarget(e){return e.composedPath().some(a=>{if(!(a instanceof HTMLElement))return!1;if(a instanceof HTMLButtonElement||a instanceof HTMLInputElement)return!0;const i=a.tagName.toLowerCase();return!!(i.startsWith("ap-asset-")||i.startsWith("ap-folder-")||a.classList.contains("check")||a.classList.contains("check-box"))})}onMouseDown(e){if(e.button!==0||this.isInteractiveTarget(e))return;const s=this.container.getBoundingClientRect();this.startX=e.clientX-s.left+this.container.scrollLeft,this.startY=e.clientY-s.top+this.container.scrollTop,this.startClientX=e.clientX,this.startClientY=e.clientY,this._dragging=!1,this.isActive=!1,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}onMouseMove(e){if(this.container){if(!this._dragging){const s=Math.abs(e.clientX-this.startClientX),a=Math.abs(e.clientY-this.startClientY);if(s<Nt&&a<Nt)return;this._dragging=!0,this.isActive=!0,this.preMarqueeSelection=new Map(this.store.getState().selectedAssets)}this._lastMouseEvent=e,this.updateMarqueeRect(e),this.startAutoScroll(e)}}updateMarqueeRect(e){if(!this.container)return;const s=this.container.getBoundingClientRect(),a=e.clientX-s.left+this.container.scrollLeft,i=e.clientY-s.top+this.container.scrollTop;this.rect={x:Math.min(this.startX,a),y:Math.min(this.startY,i),width:Math.abs(a-this.startX),height:Math.abs(i-this.startY)},this.host.requestUpdate(),this.selectIntersecting()}startAutoScroll(e){if(!this.container)return;const s=this.container.getBoundingClientRect(),a=e.clientY-s.top,i=s.bottom-e.clientY,r=a<Ce||i<Ce;r&&!this._scrollRAF?this._scrollRAF=requestAnimationFrame(()=>this.autoScrollTick()):r||this.stopAutoScroll()}autoScrollTick(){if(this._scrollRAF=null,!this.container||!this._dragging||!this._lastMouseEvent)return;const e=this.container.getBoundingClientRect(),s=this._lastMouseEvent,a=s.clientY-e.top,i=e.bottom-s.clientY;let r=0;a<Ce?r=-jt*(1-a/Ce):i<Ce&&(r=jt*(1-i/Ce)),r!==0&&(this.container.scrollTop+=r,this.updateMarqueeRect(s),this._scrollRAF=requestAnimationFrame(()=>this.autoScrollTick()))}stopAutoScroll(){this._scrollRAF&&(cancelAnimationFrame(this._scrollRAF),this._scrollRAF=null)}onMouseUp(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.stopAutoScroll(),this._lastMouseEvent=null,this._dragging&&(this.isActive=!1,this._dragging=!1,this.rect={x:0,y:0,width:0,height:0},this.host.requestUpdate())}queryCards(){for(const e of Array.from(this.container.children))if(e.shadowRoot){const s=e.shadowRoot.querySelectorAll("[data-asset-uuid]");if(s.length>0)return s}return this.container.querySelectorAll("[data-asset-uuid]")}selectIntersecting(){var i;if(!this.container)return;const e=this.queryCards(),s=new Map(this.preMarqueeSelection);e.forEach(r=>{const n=r.getBoundingClientRect(),l=this.container.getBoundingClientRect(),d={x:n.left-l.left+this.container.scrollLeft,y:n.top-l.top+this.container.scrollTop,width:n.width,height:n.height},h=this.rect.x<d.x+d.width&&this.rect.x+this.rect.width>d.x&&this.rect.y<d.y+d.height&&this.rect.y+this.rect.height>d.y,u=r.dataset.assetUuid;if(h){const g=this.store.getState().assets.find(p=>p.uuid===u);g&&s.set(u,g)}});const a=(i=this.store.getState().config)==null?void 0:i.maxSelections;if(a&&s.size>a){const r=Array.from(s.entries()).slice(0,a);this.store.setState({selectedAssets:new Map(r)})}else this.store.setState({selectedAssets:s})}}class ks{constructor(e,s){this.auth=e;const a=e.projectToken;this.baseUrl=s||`https://api.filerobot.com/${a}/v5`}setSassKey(e){this.sassKey=e}getSecurityTemplateKey(){if(this.auth.mode==="securityTemplate")return this.auth.securityTemplateKey}async request(e,s){const a=new URL(`${this.baseUrl}${e}`);s&&Object.entries(s).forEach(([l,d])=>{d!=null&&(Array.isArray(d)?a.searchParams.set(l,d.join(",")):a.searchParams.set(l,String(d)))});const i={};if(this.auth.mode==="session"){const l=this.auth;i["X-Session-Token"]=l.sessionToken,i["X-Company-Token"]=l.companyToken,i["X-Project-Token"]=l.projectToken}else{const l=this.auth;this.sassKey?i["X-Filerobot-Key"]=this.sassKey:i["X-Filerobot-Key"]=l.securityTemplateKey}const r=new AbortController,n=setTimeout(()=>r.abort(),3e4);try{const l=await fetch(a.toString(),{headers:i,signal:r.signal});if(clearTimeout(n),!l.ok){let h=`API error: ${l.status} ${l.statusText}`;try{const u=await l.json();u.msg&&(h=`API error: ${l.status} - ${u.msg}`)}catch{}throw new Error(h)}const d=await l.json();if(d.status==="error")throw new Error(`API error: ${d.msg||"Unknown error"}`);return d}catch(l){throw clearTimeout(n),l instanceof DOMException&&l.name==="AbortError"?new Error("API request timed out"):l}}async post(e,s){const a=new URL(`${this.baseUrl}${e}`),i={"Content-Type":"application/json"};if(this.auth.mode==="session"){const l=this.auth;i["X-Session-Token"]=l.sessionToken,i["X-Company-Token"]=l.companyToken,i["X-Project-Token"]=l.projectToken}else{const l=this.auth;this.sassKey?i["X-Filerobot-Key"]=this.sassKey:i["X-Filerobot-Key"]=l.securityTemplateKey}const r=new AbortController,n=setTimeout(()=>r.abort(),3e4);try{const l=await fetch(a.toString(),{method:"POST",headers:i,body:JSON.stringify(s),signal:r.signal});if(clearTimeout(n),!l.ok){let h=`API error: ${l.status} ${l.statusText}`;try{const u=await l.json();u.msg&&(h=`API error: ${l.status} - ${u.msg}`)}catch{}throw new Error(h)}const d=await l.json();if(d.status==="error")throw new Error(`API error: ${d.msg||"Unknown error"}`);return d}catch(l){throw clearTimeout(n),l instanceof DOMException&&l.name==="AbortError"?new Error("API request timed out"):l}}}function Es(t){const e={offset:t.offset??0,limit:t.limit??100,format:"json,regvar:api,select:internal",preview:2301,recursive:t.recursive??1},s=t.sort_by??"created_at",a=t.sort_direction??"desc",i={created_at:"created_at",modified_at:"modified_at",name:"name",size:"size",type:"type"};e.sort=`${i[s]||s}:${a}`,t.folder&&(e.folder=t.folder);const r=[];return t.search&&r.push(t.search),t.q&&r.push(t.q),r.length>0&&(e.q=r.join(" ")),e}async function We(t,e){const s=Es(e);return t.request("/files",s)}async function Bt(t,e){const s={folder:e.folder,recursive:e.recursive??1},a=[];return e.search&&a.push(e.search),e.q&&a.push(e.q),a.length>0&&(s.q=a.join(" ")),t.request("/files/stats",s)}async function Fs(t,e){const s={recursive:(e==null?void 0:e.recursive)??0,folder:(e==null?void 0:e.folderPath)??"/",limit:(e==null?void 0:e.limit)??1e3,offset:(e==null?void 0:e.offset)??0};e!=null&&e.q&&(s.q=e.q);const a=(e==null?void 0:e.sort_by)??"created_at",i=(e==null?void 0:e.sort_direction)??"asc",r={created_at:"created_at",modified_at:"modified_at",name:"name"};return s.sort=`${r[a]||a}:${i}`,await t.request("/folders",s)}async function As(t,e){return e.length===0?{}:(await t.post("/folders/previews",{folders:e})).folders||{}}async function Ts(t){return await t.request("/labels")}async function Ms(t){return((await t.request("/tags")).tags||[]).map(a=>({...a,label:a.names.en||Object.values(a.names)[0]||""})).filter(a=>a.label).sort((a,i)=>a.label.localeCompare(i.label))}async function Os(t){const e=t.getSecurityTemplateKey();if(!e)throw new Error("Security template key is required for SASS key exchange");return(await t.request(`/key/${e}`)).key}const m={TYPE:"type",MIME_TYPE:"mimetype",METADATA:"metadata",DATE:"date",APPROVAL:"approval",SIZE:"size",LICENSE_EXPIRY:"asset_expiration",TAGS:"tags",IMAGE:"image",LABELS:"labels",PRODUCT_REF:"product_ref",FACES:"faces",COLOR:"color"},R={STATUS:"approval_status",APPROVER:"task_approver",REQUESTOR:"task_requester",DUE_DATE:"task_duedate"},b={IS:":",RANGE:"..",IS_NOT:":-",IS_EXACT:":=",CONTAINS:"~",CONTAINS_IN_TEXT:"~~~",GREATER_THAN_OR_EQUAL:">=",LESS_THAN_OR_EQUAL:"<="},Ls={AND:"AND"},x={NUMERIC:"numeric",SELECT_ONE:"select-one",MULTI_SELECT:"multi-select",TEXT_AREA:"textarea",TEXT:"text",SUPERTAGS:"tags",DATE:"date",BOOLEAN:"boolean",ATTACHMENTS_ASSETS:"attachments-assets",ATTACHMENT_URI:"attachment-uri",GEO_POINT:"geopoint",DECIMAL2:"decimal2",INTEGER_LIST:"integer-list"},dt={[x.DATE]:"date_",[x.BOOLEAN]:"bool_",[x.NUMERIC]:"num_",[x.DECIMAL2]:"dec_",[x.ATTACHMENTS_ASSETS]:"attach_",[x.ATTACHMENT_URI]:"uri_",[x.SELECT_ONE]:"one_",[x.MULTI_SELECT]:"multi_",[x.SUPERTAGS]:"tags_",[x.TEXT]:"text_",[x.TEXT_AREA]:"area_",[x.GEO_POINT]:"geo_",[x.INTEGER_LIST]:"intlist_"};Object.fromEntries(Object.entries(dt).map(([t,e])=>[e,t]));const Zt=Object.values(dt),De={PRESET:"preset",AFTER:"after",BEFORE:"before",BETWEEN:"between",SPECIFIC:"specific"},Vt={EMPTY:"empty",NOT_EMPTY:"non-empty"},B="empty",V="non-empty",he="specific",mt=10,vt=10,ke=10,Jt="filters:pinned:",es="metadata:pinned:",qt=[m.DATE,m.TYPE],ts=b.IS,Ze="20",Je="1",Ps=0,Is=[{key:m.DATE,label:"Date",icon:"calendar-days",type:"date"},{key:m.TYPE,label:"Format",icon:"file-type",type:"string"},{key:m.SIZE,label:"Size",icon:"scaling",type:"string"},{key:m.LICENSE_EXPIRY,label:"License expiry",icon:"history",type:"date"},{key:m.TAGS,label:"Tags",icon:"hash",type:"string"},{key:m.LABELS,label:"Labels",icon:"tag",type:"string"},{key:m.PRODUCT_REF,label:"Products",icon:"box",type:"string"},{key:m.IMAGE,label:"Image",icon:"image",type:"string"},{key:m.COLOR,label:"Color",icon:"swatch-book",type:"string"}],Ds={key:m.METADATA,label:"Metadata",icon:"file-text",type:"string"},zs={key:m.APPROVAL,label:"Approval",icon:"badge-check",type:"string"},Ut=[Ds,...Is,zs],Ee={[m.TYPE]:"Format",[m.DATE]:"Date",[m.SIZE]:"Size",[m.LICENSE_EXPIRY]:"License expiry",[m.TAGS]:"Tags",[m.LABELS]:"Labels",[m.PRODUCT_REF]:"Products",[m.IMAGE]:"Image",[m.COLOR]:"Color",[m.METADATA]:"Metadata",[m.APPROVAL]:"Approval"},ie={IMAGE:"image",VIDEO:"video",AUDIO:"audio",DOCUMENT:"document",ARCHIVE:"archive",DESIGN_TEMPLATE:"template_fdt",OTHER:"other",FONTS:"font"},ss=[{value:ie.IMAGE,label:"Image",icon:"image"},{value:ie.VIDEO,label:"Video",icon:"clapperboard"},{value:ie.AUDIO,label:"Audio",icon:"music"},{value:ie.DOCUMENT,label:"Document",icon:"document"},{value:ie.ARCHIVE,label:"Archive",icon:"archive"},{value:ie.DESIGN_TEMPLATE,label:"Design template",icon:"layout-template"},{value:ie.FONTS,label:"Fonts",icon:"text"},{value:ie.OTHER,label:"Other",icon:"layout-grid"}],bt={RESOLUTION:0,ORIENTATION:1,FACES:2},Rs=[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],Ns=[{value:"portrait",label:"Portrait"},{value:"landscape",label:"Landscape"},{value:"square",label:"Square"},{value:"panorama",label:"Panorama"}],js=[{value:"none",label:"None"},{value:"1",label:"1"},{value:"2",label:"2"},{value:"3..",label:"3+"}],is=[{value:"created",label:"Created at"},{value:"updated",label:"Updated at"}],Ft=[{value:"today",label:"Today"},{value:"before",label:"Before date"},{value:"last_week",label:"Last week"},{value:"after",label:"After date"},{value:"last_month",label:"Last month"},{value:"between",label:"Between dates"},{value:"last_year",label:"Last year"}],as=[{value:"today",label:"Today"},{value:"before",label:"Before date"},{value:"within_week",label:"Within week"},{value:"after",label:"After date"},{value:"within_month",label:"Within month"},{value:"between",label:"Between dates"},{value:"within_year",label:"Within year"},{value:"specific",label:"Specific date"}],Bs=[{value:"today",label:"Today"},{value:"before",label:"Before date"},{value:"within_week",label:"Within week"},{value:"after",label:"After date"},{value:"within_month",label:"Within month"},{value:"between",label:"Between dates"},{value:"within_year",label:"Within year"},{value:"specific",label:"Specific date"}],Vs=["#ffffff","#99a1af","#000000","#894b00","#e7000b","#ff8904","#fdc700","#9ae600","#008236","#00bcff","#1447e6","#7f22fe","#e60076"],qs=[{label:"None (Exact)",value:"0"},{label:"Small",value:"1"},{label:"Medium",value:"2"},{label:"Large",value:"4"}],_t=[{label:"Is",value:b.IS},{label:"Contains",value:b.CONTAINS_IN_TEXT}],X=[{label:"Is",value:b.IS},{label:"Is not",value:b.IS_NOT}],yt=[{label:"Is",value:b.IS_EXACT},{label:"Contains",value:b.IS},{label:"Does not contain",value:b.IS_NOT}],xt=[{label:"Is",value:b.IS},{label:"Greater than",value:b.GREATER_THAN_OR_EQUAL},{label:"Is not",value:b.IS_NOT},{label:"Less than",value:b.LESS_THAN_OR_EQUAL},{label:"Between",value:b.RANGE}],Us=[{label:"Is",value:b.IS_EXACT},{label:"Is not",value:b.IS_NOT}],Ht=[{label:"Contains",value:b.CONTAINS},{label:"Does not contain",value:b.IS_NOT}],Hs=[{value:"APPROVED",label:"Approved",icon:"circle-check-big",iconColor:"var(--ap-success, #22c55e)"},{value:"PENDING",label:"Pending",icon:"clock",iconColor:"var(--ap-warning, #eab308)"},{value:"REJECTED",label:"Rejected",icon:"x-circle",iconColor:"var(--ap-destructive, #ef4444)"},{value:"CANCELLED",label:"Cancelled",icon:"ban",iconColor:"var(--ap-muted-foreground, #71717a)"}],fe=[{label:"Empty",value:B},{label:"Not empty",value:V}],$t=[...fe,{label:"Specific",value:he}],Ks=[{label:"Empty",value:B},{label:"Not empty",value:V},{label:"True",value:"true"},{label:"False",value:"false"}],Gs={[x.TEXT]:"text",[x.TEXT_AREA]:"text",[x.NUMERIC]:"number",[x.DECIMAL2]:"number",[x.BOOLEAN]:"boolean",[x.SELECT_ONE]:"select-one",[x.MULTI_SELECT]:"multi-select",[x.SUPERTAGS]:"tags",[x.DATE]:"date",[x.GEO_POINT]:"geo",[x.ATTACHMENTS_ASSETS]:"attachment",[x.ATTACHMENT_URI]:"attachment",[x.INTEGER_LIST]:"attachment"};async function Ys(t){var v,F,_,I;const e=await t.request("/settings"),s=e.settings??e,a=(s==null?void 0:s.metadata)??e.metadata,r=((a==null?void 0:a.model)??[])[Ps],n=a==null?void 0:a.store,d=((n==null?void 0:n.regional_variants_groups)??[]).map($=>({uuid:$.uuid,label:$.label??$.name??"",variants:($.variants??[]).map(w=>({api_value:w.api_value??w.value??"",internal_unique_value:w.internal_unique_value??w.api_value??"",label:w.label??w.name??""}))})).filter($=>$.variants.length>1),h={};for(const $ of d)h[$.uuid]=((v=$.variants[0])==null?void 0:v.api_value)??"";const u=(s==null?void 0:s.project_branding)??((F=e.settings)==null?void 0:F.project_branding),g=u==null?void 0:u.brandColor;if(!r)return{fields:[],regionalVariantGroups:d,regionalFilters:h,brandColor:g};const p=r.groups??[],f=[];for(const $ of p){const w=($.fields??[]).find(S=>S.type==="select-one"||S.type==="multi-select");if(w){console.log("[ap-debug] raw select field:",JSON.stringify(w));break}}for(const $ of p){const w=((_=$.name)==null?void 0:_.toLowerCase())==="products"||((I=$.name)==null?void 0:I.toLowerCase())==="product fields";for(const S of $.fields??[]){const A=S.possible_values,L=A==null?void 0:A.map(k=>({api_value:k.api_value??k.value??"",internal_unique_value:k.internal_unique_value??k.api_value??"",label:k.label??k.name??k.api_value??""}));f.push({key:S.key??S.ckey,label:S.title??S.label??S.key??"",type:S.type??"text",slug:S.slug,ckey:S.ckey,possible_values:L,group:w?"product":"root",regionalVariantsGroupUuid:S.regional_variants_group_uuid})}}return{fields:f,regionalVariantGroups:d,regionalFilters:h,brandColor:g}}function ue(t){return t.toLocaleDateString("en-CA")}function Qe(){return ue(new Date)}function rs(t){const e=new Date;switch(t){case"today":return{from:Qe(),to:null};case"last_week":{const s=new Date(e);return s.setDate(s.getDate()-7),{from:ue(s),to:null}}case"within_week":{const s=new Date(e);return s.setDate(s.getDate()+7),{from:Qe(),to:ue(s)}}case"last_month":{const s=new Date(e);return s.setDate(s.getDate()-30),{from:ue(s),to:null}}case"within_month":{const s=new Date(e);return s.setDate(s.getDate()+30),{from:Qe(),to:ue(s)}}case"last_year":{const s=new Date(e);return s.setDate(s.getDate()-365),{from:ue(s),to:null}}case"within_year":{const s=new Date(e);return s.setDate(s.getDate()+365),{from:Qe(),to:ue(s)}}default:return null}}function Kt(t,e){return e?e.type==="date"?Xs(e):e.type==="string"?Ws(e):!0:!1}function Xs(t){return!(!t.kind&&!t.preset||t.kind==="preset"&&!t.preset||t.kind==="between"&&!t.from&&!t.to||t.kind==="after"&&!t.from||t.kind==="before"&&!t.to||t.kind==="specific"&&!t.from||t.from&&t.to&&new Date(t.from)>new Date(t.to))}function Ws(t){return!t.values||!Array.isArray(t.values)?!1:t.values.filter(Boolean).length>0}function Qs(t,e={}){const s=[];for(const[a,i]of Object.entries(t)){if(!i||!Kt(a,i))continue;const r=Js(a,i);s.push(...r)}for(const[a,i]of Object.entries(e)){if(!i||!Kt(a,i))continue;const r=ai(a,i);s.push(...r)}return Zs(s)}function Zs(t){const e=[],s=[],a=[];for(const i of t)i.startsWith("type:")||i.startsWith("type=")?e.push(i):i.startsWith("mimetype:")||i.startsWith("mimetype=")?s.push(i):a.push(i);if(e.length>0&&s.length>0){const i=[...e,...s].join(" , ");a.push(i)}else a.push(...e,...s);return a}function Js(t,e){if(e.type==="date")return os(t,e);if(t===m.IMAGE)return ii(e);const s=e,{operator:a=ts,values:i=[],logic:r}=s;if(i.length===0)return[];switch(t){case m.SIZE:return ei(t,i,"..");case m.FACES:return ti(t,a,i);case m.TAGS:return ge(t,a,Yt(i),",",r);case m.LABELS:return ge(t,a,Yt(i),",",r);case m.COLOR:return si(a,i,r);case m.TYPE:return Gt(t,i,a);case m.MIME_TYPE:return Gt(t,i,a);case m.PRODUCT_REF:return ge(t,"=%",i,",",r);default:return ge(t,a,i,",",r)}}function os(t,e){const s=e.field||"created";if(e.kind===De.PRESET&&e.preset){if(e.preset===Vt.EMPTY)return[`${s}:"empty"`];if(e.preset===Vt.NOT_EMPTY)return[`${s}:"non-empty"`];const a=rs(e.preset);return a?a.to===null?[`${s}>"${a.from}"`]:[`${s}:"${a.from}..${a.to}"`]:[]}if(e.kind===De.AFTER&&e.from)return[`${s}:>"${e.from}"`];if(e.kind===De.BEFORE&&e.to)return[`${s}:<"${e.to}"`];if(e.kind===De.BETWEEN){if(e.from&&e.to)return[`${s}:"${e.from}..${e.to}"`];if(e.from&&!e.to)return[`${s}:>"${e.from}"`];if(!e.from&&e.to)return[`${s}:<"${e.to}"`]}return e.kind===De.SPECIFIC&&e.from?[`${s}:"${e.from}"`]:[]}function ei(t,e,s){return e.length===0?[]:[`${t}:"${e.join(s)}"`]}function ti(t,e,s){return s.length===0?[]:[`${t}${e}"${s.join(",")}"`]}function ge(t,e,s,a,i){if(s.length===0)return[];if(i===Ls.AND)return s.map(n=>`${t}${e}"${n}"`);const r=s.map(n=>`"${n}"`).join(a);return[`${t}${e}${r}`]}function si(t,e,s){const a=[],i=ge("color_search",t,e,",",s);return a.push(...i),a.push('color_operator:"AND"'),a}function Gt(t,e,s,a){if(e.length===0)return[];const i=e.map(r=>`"${r}"`).join(",");return[`${t}${s}${i}`]}function ii(t){const e=[];if(typeof t=="object"&&t!==null&&!Array.isArray(t)){const n=t,l=n.resolution,d=n.orientation,h=n.faces;return l!=null&&l.length&&e.push(`resolution:"${l.join(",")}"`),d!=null&&d.length&&e.push(`orientation:"${d.join(",")}"`),h!=null&&h.length&&e.push(`faces:"${h.join(",")}"`),e}const s=t,a=s[bt.RESOLUTION],i=s[bt.ORIENTATION],r=s[bt.FACES];return a&&e.push(`resolution:"${a}"`),i&&e.push(`orientation:"${i}"`),r&&e.push(`faces:"${r}"`),e}function ai(t,e){const s=ni(t),a=oi(t);if(e.type==="date")return ri(s,e,a);const i=e,{operator:r=ts,values:n=[],logic:l,metadataType:d}=i;if(n.length===0)return[];if(n.length===1&&(n[0]===B||n[0]===V)){const h=d===x.GEO_POINT?b.IS+"~":b.IS;return[`${s}${h}"${n[0]}"`]}if((d===x.NUMERIC||d===x.DECIMAL2)&&r===b.RANGE)return[`${s}${b.IS}"${n.join('","')}"`];if(d===x.GEO_POINT){const h=n.map(u=>{const g=u.indexOf("..");if(g===-1)return`(${u})`;const p=u.slice(0,g),f=u.slice(g);return`(${p})${f}`});return ge(s,r+"~",h,",",l)}return ge(s,r,n,",",l)}function ri(t,e,s){const a=os(t,e);return!s||a.length===0?a:a.map(i=>{const r=i.search(/[^a-zA-Z0-9_]/);if(r===-1)return`"${i}"`;const n=i.slice(0,r),d=i.slice(r).replace(/"/g,"");return`"${n}${d}"`})}function oi(t){return t.startsWith("date_")}function ni(t){for(const e of Zt)if(t.startsWith(e))return t.slice(e.length);return t}function Yt(t){return t.map(e=>e.replace(/#/g,""))}const li=new Set([m.DATE,m.LICENSE_EXPIRY,R.DUE_DATE]);function ze(t){if(!t)return{};const e={};for(const[s,a]of Object.entries(t))a&&(e[s]=ci(s,a));return e}function ci(t,e){return e.type==="string"||e.type==="date"?e:li.has(t)?{type:"date",field:e.field??"created",kind:e.kind??null,preset:e.preset??null,from:e.from??null,to:e.to??null}:{type:"string",values:e.values,...e.operator!==void 0&&{operator:e.operator},...e.logic!==void 0&&{logic:e.logic}}}function di(t){const e=localStorage.getItem(Jt+t),s=localStorage.getItem(es+t);let a;try{a=e?JSON.parse(e):[...qt]}catch{a=[...qt]}let i;try{i=s?JSON.parse(s):[]}catch{i=[]}return{pinnedFilters:a,pinnedMetadata:i}}function pi(t,e){localStorage.setItem(Jt+t,JSON.stringify(e))}function hi(t,e){localStorage.setItem(es+t,JSON.stringify(e))}const ns="sort-by",ls="sort-order";function Xt(t,e){try{localStorage.setItem(ns,t),localStorage.setItem(ls,e)}catch{}}function ui(){try{const t=localStorage.getItem(ns),e=localStorage.getItem(ls);return{sortBy:t,sortDirection:e}}catch{return{sortBy:null,sortDirection:null}}}const cs="ap-last-folder",ds="ap-last-view";function Wt(t){try{localStorage.setItem(cs,t)}catch{}}function fi(){try{return localStorage.getItem(cs)}catch{return null}}function gi(t){try{localStorage.setItem(ds,t)}catch{}}function mi(){try{return localStorage.getItem(ds)}catch{return null}}function vi(t){const e=t.replace("#",""),s=e.length===3?e[0]+e[0]+e[1]+e[1]+e[2]+e[2]:e,a=parseInt(s.slice(0,2),16)/255,i=parseInt(s.slice(2,4),16)/255,r=parseInt(s.slice(4,6),16)/255;return[a,i,r]}function wt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bi(t,e,s){const a=wt(t),i=wt(e),r=wt(s),n=.4122214708*a+.5363325363*i+.0514459929*r,l=.2119034982*a+.6806995451*i+.1073969566*r,d=.0883024619*a+.2817188376*i+.6299787005*r,h=Math.cbrt(n),u=Math.cbrt(l),g=Math.cbrt(d),p=.2104542553*h+.793617785*u-.0040720468*g,f=1.9779984951*h-2.428592205*u+.4505937099*g,v=.0259040371*h+.7827717662*u-.808675766*g,F=Math.sqrt(f*f+v*v);let _=Math.atan2(v,f)*(180/Math.PI);return _<0&&(_+=360),[p,F,_]}function _i(t){return t>.7}function yi(t,e){const s=["--ap-primary","--ap-primary-foreground","--ap-primary-10","--ap-primary-20","--ap-ring","--ap-selection-bg"];if(!e){for(const g of s)t.style.removeProperty(g);return}const[a,i,r]=vi(e),[n,l,d]=bi(a,i,r),h=`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)})`,u=_i(n)?"#000":"#fff";t.style.setProperty("--ap-primary",h),t.style.setProperty("--ap-primary-foreground",u),t.style.setProperty("--ap-primary-10",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.1)`),t.style.setProperty("--ap-primary-20",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.2)`),t.style.setProperty("--ap-ring",h),t.style.setProperty("--ap-selection-bg",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.08)`)}const At=[{value:"name",label:"Name"},{value:"created_at",label:"Uploaded"},{value:"modified_at",label:"Modified"},{value:"size",label:"Size"},{value:"type",label:"Format"}],xi=[{value:"relevance",label:"Relevance"},...At],$i=[{value:"name",label:"Name"},{value:"created_at",label:"Uploaded"},{value:"modified_at",label:"Modified"},{value:"files_count_recursive",label:"Assets count"},{value:"files_size_recursive",label:"Assets size"}];var wi=Object.defineProperty,Si=Object.getOwnPropertyDescriptor,Tt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Si(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&wi(e,s,i),i};let Ne=class extends o.LitElement{constructor(){super(...arguments),this.open=!1}updated(t){var e;super.updated(t),t.has("open")&&(this.open?this.dialog&&!this.dialog.open&&this.dialog.showModal():(e=this.dialog)!=null&&e.open&&this._animateClose())}_animateClose(){const t=this.dialog;if(t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t.close();return}t.classList.add("closing"),t.addEventListener("animationend",()=>{t.classList.remove("closing"),t.close()},{once:!0})}}_handleBackdropClick(t){t.target===this.dialog&&this.dispatchEvent(new CustomEvent("ap-cancel",{detail:{reason:"backdrop"},bubbles:!0,composed:!0}))}_handleCancel(t){t.preventDefault(),this.dispatchEvent(new CustomEvent("ap-cancel",{detail:{reason:"escape"},bubbles:!0,composed:!0}))}render(){return o.html`
1
+ "use strict";var ws=Object.create;var jt=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Ss=Object.getOwnPropertyNames;var Cs=Object.getPrototypeOf,Es=Object.prototype.hasOwnProperty;var Fs=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ss(e))!Es.call(t,i)&&i!==s&&jt(t,i,{get:()=>e[i],enumerable:!(a=ks(e,i))||a.enumerable});return t};var As=(t,e,s)=>(s=t!=null?ws(Cs(t)):{},Fs(e||!t||!t.__esModule?jt(s,"default",{value:t,enumerable:!0}):s,t));const o=require("lit"),c=require("lit/decorators.js");class Ts{constructor(e){this.listeners=new Set,this._notifying=!1,this._pendingState=null,this.state=e}getState(){return this.state}setState(e){if(this._notifying){this._pendingState={...this._pendingState||{},...e};return}const s=this.state;this.state={...s,...e},this._notifying=!0;try{this.listeners.forEach(a=>a(this.state,s))}finally{this._notifying=!1}if(this._pendingState){const a=this._pendingState;this._pendingState=null,this.setState(a)}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.listeners.clear()}}function Os(){return new Ts({config:null,projectToken:"",sassKey:"",brandColor:"",isOpen:!1,activeTab:"assets",viewMode:"grid",searchQuery:"",sortBy:"modified_at",sortDirection:"desc",previewAsset:null,isPreviewOpen:!1,assets:[],folders:[],folderPreviews:{},labels:[],tags:[],currentFolder:null,currentFolderPath:"/",breadcrumb:[],offset:0,limit:100,totalCount:0,totalFolderCount:0,isLoading:!1,isSelectingAll:!1,hasMore:!1,filters:{metadata:{pinned:[],visible:[],applied:{}},pinned:[],visible:[],applied:{}},metadataFields:[],regionalVariantGroups:[],regionalFilters:{},selectedAssets:new Map})}class Ms{constructor(e,s){this.host=e,this.store=s,e.addController(this)}get state(){return this.store.getState()}setState(e){this.store.setState(e)}hostConnected(){this.unsubscribe=this.store.subscribe(()=>{this.host.requestUpdate()})}hostDisconnected(){var e;(e=this.unsubscribe)==null||e.call(this)}}class Ps{constructor(e,s){this.lastClickedIndex=-1,this.host=e,this.store=s,e.addController(this)}hostConnected(){}hostDisconnected(){}handleSelect(e,s,a){var d,h;const i=this.store.getState(),r=new Map(i.selectedAssets);if(!(((d=i.config)==null?void 0:d.multiSelect)??!0)){r.clear(),r.set(e.uuid,e),this.store.setState({selectedAssets:r}),this.lastClickedIndex=s;return}if(a.shiftKey&&this.lastClickedIndex>=0){const u=Math.min(this.lastClickedIndex,s),f=Math.max(this.lastClickedIndex,s),p=i.assets;for(let g=u;g<=f;g++)p[g]&&r.set(p[g].uuid,p[g])}else a.metaKey||a.ctrlKey?r.has(e.uuid)?r.delete(e.uuid):r.set(e.uuid,e):(r.clear(),r.set(e.uuid,e));const l=(h=i.config)==null?void 0:h.maxSelections;l&&r.size>l||(this.lastClickedIndex=s,this.store.setState({selectedAssets:r}))}isSelected(e){return this.store.getState().selectedAssets.has(e)}resetRange(){this.lastClickedIndex=-1}selectAll(e){var n;const a=(n=this.store.getState().config)==null?void 0:n.maxSelections,i=new Map,r=a?Math.min(e.length,a):e.length;for(let l=0;l<r;l++)i.set(e[l].uuid,e[l]);return this.store.setState({selectedAssets:i}),this.lastClickedIndex=-1,i.size}clearSelection(){this.store.setState({selectedAssets:new Map}),this.lastClickedIndex=-1}getSelectedAssets(){return Array.from(this.store.getState().selectedAssets.values())}}class Ls{constructor(e,s){this.host=e,this.onLoadMore=s,e.addController(this)}hostConnected(){}hostDisconnected(){this.disconnect()}observe(e,s){this.disconnect(),this.sentinel=e,this.observer=new IntersectionObserver(a=>{var i;(i=a[0])!=null&&i.isIntersecting&&this.onLoadMore()},{root:s??null,rootMargin:"200px"}),this.observer.observe(e)}disconnect(){this.observer&&this.sentinel&&(this.observer.unobserve(this.sentinel),this.observer.disconnect()),this.observer=void 0,this.sentinel=void 0}}const Nt=5,we=40,Bt=15;class Is{constructor(e,s){this.startX=0,this.startY=0,this.startClientX=0,this.startClientY=0,this.preMarqueeSelection=new Map,this._dragging=!1,this._scrollRAF=null,this._lastMouseEvent=null,this.isActive=!1,this.rect={x:0,y:0,width:0,height:0},this.handleMouseDown=a=>this.onMouseDown(a),this.handleMouseMove=a=>this.onMouseMove(a),this.handleMouseUp=()=>this.onMouseUp(),this.host=e,this.store=s,e.addController(this)}hostConnected(){}hostDisconnected(){this.detach()}attach(e){this.detach(),this.container=e,e.addEventListener("mousedown",this.handleMouseDown)}detach(){this.container&&this.container.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.stopAutoScroll(),this._lastMouseEvent=null}isInteractiveTarget(e){return e.composedPath().some(a=>{if(!(a instanceof HTMLElement))return!1;if(a instanceof HTMLButtonElement||a instanceof HTMLInputElement)return!0;const i=a.tagName.toLowerCase();return!!(i.startsWith("ap-asset-")||i.startsWith("ap-folder-")||a.classList.contains("check")||a.classList.contains("check-box"))})}onMouseDown(e){if(e.button!==0||this.isInteractiveTarget(e))return;const s=this.container.getBoundingClientRect();this.startX=e.clientX-s.left+this.container.scrollLeft,this.startY=e.clientY-s.top+this.container.scrollTop,this.startClientX=e.clientX,this.startClientY=e.clientY,this._dragging=!1,this.isActive=!1,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}onMouseMove(e){if(this.container){if(!this._dragging){const s=Math.abs(e.clientX-this.startClientX),a=Math.abs(e.clientY-this.startClientY);if(s<Nt&&a<Nt)return;this._dragging=!0,this.isActive=!0,this.preMarqueeSelection=new Map(this.store.getState().selectedAssets)}this._lastMouseEvent=e,this.updateMarqueeRect(e),this.startAutoScroll(e)}}updateMarqueeRect(e){if(!this.container)return;const s=this.container.getBoundingClientRect(),a=e.clientX-s.left+this.container.scrollLeft,i=e.clientY-s.top+this.container.scrollTop;this.rect={x:Math.min(this.startX,a),y:Math.min(this.startY,i),width:Math.abs(a-this.startX),height:Math.abs(i-this.startY)},this.host.requestUpdate(),this.selectIntersecting()}startAutoScroll(e){if(!this.container)return;const s=this.container.getBoundingClientRect(),a=e.clientY-s.top,i=s.bottom-e.clientY,r=a<we||i<we;r&&!this._scrollRAF?this._scrollRAF=requestAnimationFrame(()=>this.autoScrollTick()):r||this.stopAutoScroll()}autoScrollTick(){if(this._scrollRAF=null,!this.container||!this._dragging||!this._lastMouseEvent)return;const e=this.container.getBoundingClientRect(),s=this._lastMouseEvent,a=s.clientY-e.top,i=e.bottom-s.clientY;let r=0;a<we?r=-Bt*(1-a/we):i<we&&(r=Bt*(1-i/we)),r!==0&&(this.container.scrollTop+=r,this.updateMarqueeRect(s),this._scrollRAF=requestAnimationFrame(()=>this.autoScrollTick()))}stopAutoScroll(){this._scrollRAF&&(cancelAnimationFrame(this._scrollRAF),this._scrollRAF=null)}onMouseUp(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.stopAutoScroll(),this._lastMouseEvent=null,this._dragging&&(this.isActive=!1,this._dragging=!1,this.rect={x:0,y:0,width:0,height:0},this.host.requestUpdate())}queryCards(){for(const e of Array.from(this.container.children))if(e.shadowRoot){const s=e.shadowRoot.querySelectorAll("[data-asset-uuid]");if(s.length>0)return s}return this.container.querySelectorAll("[data-asset-uuid]")}selectIntersecting(){var i;if(!this.container)return;const e=this.queryCards(),s=new Map(this.preMarqueeSelection);e.forEach(r=>{const n=r.getBoundingClientRect(),l=this.container.getBoundingClientRect(),d={x:n.left-l.left+this.container.scrollLeft,y:n.top-l.top+this.container.scrollTop,width:n.width,height:n.height},h=this.rect.x<d.x+d.width&&this.rect.x+this.rect.width>d.x&&this.rect.y<d.y+d.height&&this.rect.y+this.rect.height>d.y,u=r.dataset.assetUuid;if(h){const f=this.store.getState().assets.find(p=>p.uuid===u);f&&s.set(u,f)}});const a=(i=this.store.getState().config)==null?void 0:i.maxSelections;if(a&&s.size>a){const r=Array.from(s.entries()).slice(0,a);this.store.setState({selectedAssets:new Map(r)})}else this.store.setState({selectedAssets:s})}}class Ds{constructor(e,s){this.auth=e;const a=e.projectToken;this.baseUrl=s||`https://api.filerobot.com/${a}/v5`}setSassKey(e){this.sassKey=e}getSecurityTemplateKey(){if(this.auth.mode==="securityTemplate")return this.auth.securityTemplateKey}async request(e,s){const a=new URL(`${this.baseUrl}${e}`);s&&Object.entries(s).forEach(([l,d])=>{d!=null&&(Array.isArray(d)?a.searchParams.set(l,d.join(",")):a.searchParams.set(l,String(d)))});const i={};if(this.auth.mode==="session"){const l=this.auth;i["X-Session-Token"]=l.sessionToken,i["X-Company-Token"]=l.companyToken,i["X-Project-Token"]=l.projectToken}else{const l=this.auth;this.sassKey?i["X-Filerobot-Key"]=this.sassKey:i["X-Filerobot-Key"]=l.securityTemplateKey}const r=new AbortController,n=setTimeout(()=>r.abort(),3e4);try{const l=await fetch(a.toString(),{headers:i,signal:r.signal});if(clearTimeout(n),!l.ok){let h=`API error: ${l.status} ${l.statusText}`;try{const u=await l.json();u.msg&&(h=`API error: ${l.status} - ${u.msg}`)}catch{}throw new Error(h)}const d=await l.json();if(d.status==="error")throw new Error(`API error: ${d.msg||"Unknown error"}`);return d}catch(l){throw clearTimeout(n),l instanceof DOMException&&l.name==="AbortError"?new Error("API request timed out"):l}}async post(e,s){const a=new URL(`${this.baseUrl}${e}`),i={"Content-Type":"application/json"};if(this.auth.mode==="session"){const l=this.auth;i["X-Session-Token"]=l.sessionToken,i["X-Company-Token"]=l.companyToken,i["X-Project-Token"]=l.projectToken}else{const l=this.auth;this.sassKey?i["X-Filerobot-Key"]=this.sassKey:i["X-Filerobot-Key"]=l.securityTemplateKey}const r=new AbortController,n=setTimeout(()=>r.abort(),3e4);try{const l=await fetch(a.toString(),{method:"POST",headers:i,body:JSON.stringify(s),signal:r.signal});if(clearTimeout(n),!l.ok){let h=`API error: ${l.status} ${l.statusText}`;try{const u=await l.json();u.msg&&(h=`API error: ${l.status} - ${u.msg}`)}catch{}throw new Error(h)}const d=await l.json();if(d.status==="error")throw new Error(`API error: ${d.msg||"Unknown error"}`);return d}catch(l){throw clearTimeout(n),l instanceof DOMException&&l.name==="AbortError"?new Error("API request timed out"):l}}}function zs(t){const e={offset:t.offset??0,limit:t.limit??100,format:"json,regvar:api,select:internal",preview:2301,recursive:t.recursive??1},s=t.sort_by??"created_at",a=t.sort_direction??"desc",i={created_at:"created_at",modified_at:"modified_at",name:"name",size:"size",type:"type"};e.sort=`${i[s]||s}:${a}`,t.folder&&(e.folder=t.folder);const r=[];return t.search&&r.push(t.search),t.q&&r.push(t.q),r.length>0&&(e.q=r.join(" ")),e}async function Ye(t,e){const s=zs(e);return t.request("/files",s)}async function Ut(t,e){const s={folder:e.folder,recursive:e.recursive??1},a=[];return e.search&&a.push(e.search),e.q&&a.push(e.q),a.length>0&&(s.q=a.join(" ")),t.request("/files/stats",s)}async function Rs(t,e){const s={recursive:(e==null?void 0:e.recursive)??0,folder:(e==null?void 0:e.folderPath)??"/",limit:(e==null?void 0:e.limit)??1e3,offset:(e==null?void 0:e.offset)??0};e!=null&&e.q&&(s.q=e.q);const a=(e==null?void 0:e.sort_by)??"created_at",i=(e==null?void 0:e.sort_direction)??"asc",r={created_at:"created_at",modified_at:"modified_at",name:"name"};return s.sort=`${r[a]||a}:${i}`,await t.request("/folders",s)}async function js(t,e){return e.length===0?{}:(await t.post("/folders/previews",{folders:e})).folders||{}}async function Ns(t){return await t.request("/labels")}async function Bs(t){return((await t.request("/tags")).tags||[]).map(a=>({...a,label:a.names.en||Object.values(a.names)[0]||""})).filter(a=>a.label).sort((a,i)=>a.label.localeCompare(i.label))}async function Us(t){const e=t.getSecurityTemplateKey();if(!e)throw new Error("Security template key is required for SASS key exchange");return(await t.request(`/key/${e}`)).key}const m={TYPE:"type",MIME_TYPE:"mimetype",METADATA:"metadata",DATE:"date",APPROVAL:"approval",SIZE:"size",LICENSE_EXPIRY:"asset_expiration",TAGS:"tags",IMAGE:"image",LABELS:"labels",PRODUCT_REF:"product_ref",FACES:"faces",COLOR:"color"},R={STATUS:"approval_status",APPROVER:"task_approver",REQUESTOR:"task_requester",DUE_DATE:"task_duedate"},_={IS:":",RANGE:"..",IS_NOT:":-",IS_EXACT:":=",CONTAINS:"~",CONTAINS_IN_TEXT:"~~~",GREATER_THAN_OR_EQUAL:">=",LESS_THAN_OR_EQUAL:"<="},Vs={AND:"AND"},x={NUMERIC:"numeric",SELECT_ONE:"select-one",MULTI_SELECT:"multi-select",TEXT_AREA:"textarea",TEXT:"text",SUPERTAGS:"tags",DATE:"date",BOOLEAN:"boolean",ATTACHMENTS_ASSETS:"attachments-assets",ATTACHMENT_URI:"attachment-uri",GEO_POINT:"geopoint",DECIMAL2:"decimal2",INTEGER_LIST:"integer-list"},ct={[x.DATE]:"date_",[x.BOOLEAN]:"bool_",[x.NUMERIC]:"num_",[x.DECIMAL2]:"dec_",[x.ATTACHMENTS_ASSETS]:"attach_",[x.ATTACHMENT_URI]:"uri_",[x.SELECT_ONE]:"one_",[x.MULTI_SELECT]:"multi_",[x.SUPERTAGS]:"tags_",[x.TEXT]:"text_",[x.TEXT_AREA]:"area_",[x.GEO_POINT]:"geo_",[x.INTEGER_LIST]:"intlist_"};Object.fromEntries(Object.entries(ct).map(([t,e])=>[e,t]));const Zt=Object.values(ct),Ie={PRESET:"preset",AFTER:"after",BEFORE:"before",BETWEEN:"between",SPECIFIC:"specific"},Vt={EMPTY:"empty",NOT_EMPTY:"non-empty"},B="empty",U="non-empty",he="specific",gt=10,ft=10,Xe=10,Jt="filters:pinned:",es="metadata:pinned:",qt=[m.DATE,m.TYPE],ts=_.IS,Qe="20",Ze="1",qs=0,Hs=[{key:m.DATE,label:"Date",icon:"calendar",type:"date"},{key:m.TYPE,label:"Format",icon:"file-type",type:"string"},{key:m.SIZE,label:"Size",icon:"scaling",type:"string"},{key:m.LICENSE_EXPIRY,label:"License expiry",icon:"history",type:"date"},{key:m.TAGS,label:"Tags",icon:"hash",type:"string"},{key:m.LABELS,label:"Labels",icon:"tag",type:"string"},{key:m.PRODUCT_REF,label:"Products",icon:"box",type:"string"},{key:m.IMAGE,label:"Image",icon:"image",type:"string"},{key:m.COLOR,label:"Color",icon:"swatch-book",type:"string"}],Ks={key:m.METADATA,label:"Metadata",icon:"file-text",type:"string"},Gs={key:m.APPROVAL,label:"Approval",icon:"badge-check",type:"string"},St=[Ks,...Hs,Gs],ke={[m.TYPE]:"Format",[m.DATE]:"Date",[m.SIZE]:"Size",[m.LICENSE_EXPIRY]:"License expiry",[m.TAGS]:"Tags",[m.LABELS]:"Labels",[m.PRODUCT_REF]:"Products",[m.IMAGE]:"Image",[m.COLOR]:"Color",[m.METADATA]:"Metadata",[m.APPROVAL]:"Approval"},ie={IMAGE:"image",VIDEO:"video",AUDIO:"audio",DOCUMENT:"document",ARCHIVE:"archive",DESIGN_TEMPLATE:"template_fdt",OTHER:"other",FONTS:"font"},ss=[{value:ie.IMAGE,label:"Image",icon:"image"},{value:ie.VIDEO,label:"Video",icon:"clapperboard"},{value:ie.AUDIO,label:"Audio",icon:"music"},{value:ie.DOCUMENT,label:"Document",icon:"document"},{value:ie.ARCHIVE,label:"Archive",icon:"archive"},{value:ie.DESIGN_TEMPLATE,label:"Design template",icon:"layout-template"},{value:ie.FONTS,label:"Fonts",icon:"text"},{value:ie.OTHER,label:"Other",icon:"layout-grid"}],mt={RESOLUTION:0,ORIENTATION:1,FACES:2},Ys=[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],Xs=[{value:"portrait",label:"Portrait"},{value:"landscape",label:"Landscape"},{value:"square",label:"Square"},{value:"panorama",label:"Panorama"}],Ws=[{value:"none",label:"None"},{value:"1",label:"1"},{value:"2",label:"2"},{value:"3..",label:"3+"}],is=[{value:"created",label:"Created at"},{value:"updated",label:"Updated at"}],Et=[{value:"today",label:"Today"},{value:"before",label:"Before date"},{value:"last_week",label:"Last week"},{value:"after",label:"After date"},{value:"last_month",label:"Last month"},{value:"between",label:"Between dates"},{value:"last_year",label:"Last year"}],as=[{value:"today",label:"Today"},{value:"before",label:"Before date"},{value:"within_week",label:"Within week"},{value:"after",label:"After date"},{value:"within_month",label:"Within month"},{value:"between",label:"Between dates"},{value:"within_year",label:"Within year"},{value:"specific",label:"Specific date"}],Qs=[{value:"today",label:"Today"},{value:"before",label:"Before date"},{value:"within_week",label:"Within week"},{value:"after",label:"After date"},{value:"within_month",label:"Within month"},{value:"between",label:"Between dates"},{value:"within_year",label:"Within year"},{value:"specific",label:"Specific date"}],Zs=["#ffffff","#99a1af","#000000","#894b00","#e7000b","#ff8904","#fdc700","#9ae600","#008236","#00bcff","#1447e6","#7f22fe","#e60076"],Js=[{label:"None (Exact)",value:"0"},{label:"Small",value:"1"},{label:"Medium",value:"2"},{label:"Large",value:"4"}],vt=[{label:"Is",value:_.IS},{label:"Contains",value:_.CONTAINS_IN_TEXT}],X=[{label:"Is",value:_.IS},{label:"Is not",value:_.IS_NOT}],bt=[{label:"Is",value:_.IS_EXACT},{label:"Contains",value:_.IS},{label:"Does not contain",value:_.IS_NOT}],_t=[{label:"Is",value:_.IS},{label:"Greater than",value:_.GREATER_THAN_OR_EQUAL},{label:"Is not",value:_.IS_NOT},{label:"Less than",value:_.LESS_THAN_OR_EQUAL},{label:"Between",value:_.RANGE}],ei=[{label:"Is",value:_.IS_EXACT},{label:"Is not",value:_.IS_NOT}],Ht=[{label:"Contains",value:_.CONTAINS},{label:"Does not contain",value:_.IS_NOT}],ti=[{value:"APPROVED",label:"Approved",icon:"circle-check-big",iconColor:"var(--ap-success, oklch(0.637 0.17 151.295))"},{value:"PENDING",label:"Pending",icon:"clock",iconColor:"var(--ap-warning, oklch(0.734 0.157 69.419))"},{value:"REJECTED",label:"Rejected",icon:"x-circle",iconColor:"var(--ap-destructive, oklch(0.577 0.215 27.325))"},{value:"CANCELLED",label:"Cancelled",icon:"ban",iconColor:"var(--ap-muted-foreground, oklch(0.685 0.033 249.82))"}],ge=[{label:"Empty",value:B},{label:"Not empty",value:U}],yt=[...ge,{label:"Specific",value:he}],si=[{label:"Empty",value:B},{label:"Not empty",value:U},{label:"True",value:"true"},{label:"False",value:"false"}],ii={[x.TEXT]:"text",[x.TEXT_AREA]:"text",[x.NUMERIC]:"number",[x.DECIMAL2]:"number",[x.BOOLEAN]:"boolean",[x.SELECT_ONE]:"select-one",[x.MULTI_SELECT]:"multi-select",[x.SUPERTAGS]:"tags",[x.DATE]:"date",[x.GEO_POINT]:"geo",[x.ATTACHMENTS_ASSETS]:"attachment",[x.ATTACHMENT_URI]:"attachment",[x.INTEGER_LIST]:"attachment"};async function ai(t){var v,w,b,O;const e=await t.request("/settings"),s=e.settings??e,a=(s==null?void 0:s.metadata)??e.metadata,r=((a==null?void 0:a.model)??[])[qs],n=a==null?void 0:a.store,d=((n==null?void 0:n.regional_variants_groups)??[]).map($=>({uuid:$.uuid,label:$.label??$.name??"",variants:($.variants??[]).map(k=>({api_value:k.api_value??k.value??"",internal_unique_value:k.internal_unique_value??k.api_value??"",label:k.label??k.name??""}))})).filter($=>$.variants.length>1),h={};for(const $ of d)h[$.uuid]=((v=$.variants[0])==null?void 0:v.api_value)??"";const u=(s==null?void 0:s.project_branding)??((w=e.settings)==null?void 0:w.project_branding),f=u==null?void 0:u.brandColor;if(!r)return{fields:[],regionalVariantGroups:d,regionalFilters:h,brandColor:f};const p=r.groups??[],g=[];for(const $ of p){const k=((b=$.name)==null?void 0:b.toLowerCase())==="products"||((O=$.name)==null?void 0:O.toLowerCase())==="product fields";for(const A of $.fields??[]){const T=A.possible_values,L=T==null?void 0:T.map(C=>({api_value:C.api_value??C.value??"",internal_unique_value:C.internal_unique_value??C.api_value??"",label:C.label??C.name??C.api_value??""}));g.push({key:A.key??A.ckey,label:A.title??A.label??A.key??"",type:A.type??"text",slug:A.slug,ckey:A.ckey,possible_values:L,group:k?"product":"root",regionalVariantsGroupUuid:A.regional_variants_group_uuid})}}return{fields:g,regionalVariantGroups:d,regionalFilters:h,brandColor:f}}function ue(t){return t.toLocaleDateString("en-CA")}function We(){return ue(new Date)}function rs(t){const e=new Date;switch(t){case"today":return{from:We(),to:null};case"last_week":{const s=new Date(e);return s.setDate(s.getDate()-7),{from:ue(s),to:null}}case"within_week":{const s=new Date(e);return s.setDate(s.getDate()+7),{from:We(),to:ue(s)}}case"last_month":{const s=new Date(e);return s.setDate(s.getDate()-30),{from:ue(s),to:null}}case"within_month":{const s=new Date(e);return s.setDate(s.getDate()+30),{from:We(),to:ue(s)}}case"last_year":{const s=new Date(e);return s.setDate(s.getDate()-365),{from:ue(s),to:null}}case"within_year":{const s=new Date(e);return s.setDate(s.getDate()+365),{from:We(),to:ue(s)}}default:return null}}function Kt(t,e){return e?e.type==="date"?ri(e):e.type==="string"?oi(e):!0:!1}function ri(t){return!(!t.kind&&!t.preset||t.kind==="preset"&&!t.preset||t.kind==="between"&&!t.from&&!t.to||t.kind==="after"&&!t.from||t.kind==="before"&&!t.to||t.kind==="specific"&&!t.from||t.from&&t.to&&new Date(t.from)>new Date(t.to))}function oi(t){return!t.values||!Array.isArray(t.values)?!1:t.values.filter(Boolean).length>0}function ni(t,e={}){const s=[];for(const[a,i]of Object.entries(t)){if(!i||!Kt(a,i))continue;const r=ci(a,i);s.push(...r)}for(const[a,i]of Object.entries(e)){if(!i||!Kt(a,i))continue;const r=gi(a,i);s.push(...r)}return li(s)}function li(t){const e=[],s=[],a=[];for(const i of t)i.startsWith("type:")||i.startsWith("type=")?e.push(i):i.startsWith("mimetype:")||i.startsWith("mimetype=")?s.push(i):a.push(i);if(e.length>0&&s.length>0){const i=[...e,...s].join(" , ");a.push(i)}else a.push(...e,...s);return a}function ci(t,e){if(e.type==="date")return os(t,e);if(t===m.IMAGE)return ui(e);const s=e,{operator:a=ts,values:i=[],logic:r}=s;if(i.length===0)return[];switch(t){case m.SIZE:return di(t,i,"..");case m.FACES:return pi(t,a,i);case m.TAGS:return fe(t,a,Yt(i),",",r);case m.LABELS:return fe(t,a,Yt(i),",",r);case m.COLOR:return hi(a,i,r);case m.TYPE:return Gt(t,i,a);case m.MIME_TYPE:return Gt(t,i,a);case m.PRODUCT_REF:return fe(t,"=%",i,",",r);default:return fe(t,a,i,",",r)}}function os(t,e){const s=e.field||"created";if(e.kind===Ie.PRESET&&e.preset){if(e.preset===Vt.EMPTY)return[`${s}:"empty"`];if(e.preset===Vt.NOT_EMPTY)return[`${s}:"non-empty"`];const a=rs(e.preset);return a?a.to===null?[`${s}>"${a.from}"`]:[`${s}:"${a.from}..${a.to}"`]:[]}if(e.kind===Ie.AFTER&&e.from)return[`${s}:>"${e.from}"`];if(e.kind===Ie.BEFORE&&e.to)return[`${s}:<"${e.to}"`];if(e.kind===Ie.BETWEEN){if(e.from&&e.to)return[`${s}:"${e.from}..${e.to}"`];if(e.from&&!e.to)return[`${s}:>"${e.from}"`];if(!e.from&&e.to)return[`${s}:<"${e.to}"`]}return e.kind===Ie.SPECIFIC&&e.from?[`${s}:"${e.from}"`]:[]}function di(t,e,s){return e.length===0?[]:[`${t}:"${e.join(s)}"`]}function pi(t,e,s){return s.length===0?[]:[`${t}${e}"${s.join(",")}"`]}function fe(t,e,s,a,i){if(s.length===0)return[];if(i===Vs.AND)return s.map(n=>`${t}${e}"${n}"`);const r=s.map(n=>`"${n}"`).join(a);return[`${t}${e}${r}`]}function hi(t,e,s){const a=[],i=fe("color_search",t,e,",",s);return a.push(...i),a.push('color_operator:"AND"'),a}function Gt(t,e,s,a){if(e.length===0)return[];const i=e.map(r=>`"${r}"`).join(",");return[`${t}${s}${i}`]}function ui(t){const e=[];if(typeof t=="object"&&t!==null&&!Array.isArray(t)){const n=t,l=n.resolution,d=n.orientation,h=n.faces;return l!=null&&l.length&&e.push(`resolution:"${l.join(",")}"`),d!=null&&d.length&&e.push(`orientation:"${d.join(",")}"`),h!=null&&h.length&&e.push(`faces:"${h.join(",")}"`),e}const s=t,a=s[mt.RESOLUTION],i=s[mt.ORIENTATION],r=s[mt.FACES];return a&&e.push(`resolution:"${a}"`),i&&e.push(`orientation:"${i}"`),r&&e.push(`faces:"${r}"`),e}function gi(t,e){const s=vi(t),a=mi(t);if(e.type==="date")return fi(s,e,a);const i=e,{operator:r=ts,values:n=[],logic:l,metadataType:d}=i;if(n.length===0)return[];if(n.length===1&&(n[0]===B||n[0]===U)){const h=d===x.GEO_POINT?_.IS+"~":_.IS;return[`${s}${h}"${n[0]}"`]}if((d===x.NUMERIC||d===x.DECIMAL2)&&r===_.RANGE)return[`${s}${_.IS}"${n.join('","')}"`];if(d===x.GEO_POINT){const h=n.map(u=>{const f=u.indexOf("..");if(f===-1)return`(${u})`;const p=u.slice(0,f),g=u.slice(f);return`(${p})${g}`});return fe(s,r+"~",h,",",l)}return fe(s,r,n,",",l)}function fi(t,e,s){const a=os(t,e);return!s||a.length===0?a:a.map(i=>{const r=i.search(/[^a-zA-Z0-9_]/);if(r===-1)return`"${i}"`;const n=i.slice(0,r),d=i.slice(r).replace(/"/g,"");return`"${n}${d}"`})}function mi(t){return t.startsWith("date_")}function vi(t){for(const e of Zt)if(t.startsWith(e))return t.slice(e.length);return t}function Yt(t){return t.map(e=>e.replace(/#/g,""))}const bi=new Set([m.DATE,m.LICENSE_EXPIRY,R.DUE_DATE]);function De(t){if(!t)return{};const e={};for(const[s,a]of Object.entries(t))a&&(e[s]=_i(s,a));return e}function _i(t,e){return e.type==="string"||e.type==="date"?e:bi.has(t)?{type:"date",field:e.field??"created",kind:e.kind??null,preset:e.preset??null,from:e.from??null,to:e.to??null}:{type:"string",values:e.values,...e.operator!==void 0&&{operator:e.operator},...e.logic!==void 0&&{logic:e.logic}}}function yi(t){const e=localStorage.getItem(Jt+t),s=localStorage.getItem(es+t);let a;try{a=e?JSON.parse(e):[...qt]}catch{a=[...qt]}let i;try{i=s?JSON.parse(s):[]}catch{i=[]}return{pinnedFilters:a,pinnedMetadata:i}}function xi(t,e){localStorage.setItem(Jt+t,JSON.stringify(e))}function $i(t,e){localStorage.setItem(es+t,JSON.stringify(e))}const ns="sort-by",ls="sort-order";function Xt(t,e){try{localStorage.setItem(ns,t),localStorage.setItem(ls,e)}catch{}}function wi(){try{const t=localStorage.getItem(ns),e=localStorage.getItem(ls);return{sortBy:t,sortDirection:e}}catch{return{sortBy:null,sortDirection:null}}}const cs="ap-last-folder",ds="ap-last-view";function Wt(t){try{localStorage.setItem(cs,t)}catch{}}function ki(){try{return localStorage.getItem(cs)}catch{return null}}function Si(t){try{localStorage.setItem(ds,t)}catch{}}function Ci(){try{return localStorage.getItem(ds)}catch{return null}}function Ei(t){const e=t.replace("#",""),s=e.length===3?e[0]+e[0]+e[1]+e[1]+e[2]+e[2]:e,a=parseInt(s.slice(0,2),16)/255,i=parseInt(s.slice(2,4),16)/255,r=parseInt(s.slice(4,6),16)/255;return[a,i,r]}function xt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Fi(t,e,s){const a=xt(t),i=xt(e),r=xt(s),n=.4122214708*a+.5363325363*i+.0514459929*r,l=.2119034982*a+.6806995451*i+.1073969566*r,d=.0883024619*a+.2817188376*i+.6299787005*r,h=Math.cbrt(n),u=Math.cbrt(l),f=Math.cbrt(d),p=.2104542553*h+.793617785*u-.0040720468*f,g=1.9779984951*h-2.428592205*u+.4505937099*f,v=.0259040371*h+.7827717662*u-.808675766*f,w=Math.sqrt(g*g+v*v);let b=Math.atan2(v,g)*(180/Math.PI);return b<0&&(b+=360),[p,w,b]}function Ai(t){return t>.7}function Ti(t,e){const s=["--ap-primary","--ap-primary-foreground","--ap-primary-10","--ap-primary-20","--ap-accent","--ap-accent-foreground","--ap-ring","--ap-selection-bg"];if(!e){for(const f of s)t.style.removeProperty(f);return}const[a,i,r]=Ei(e),[n,l,d]=Fi(a,i,r),h=`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)})`,u=Ai(n)?"#000":"#fff";t.style.setProperty("--ap-primary",h),t.style.setProperty("--ap-primary-foreground",u),t.style.setProperty("--ap-primary-10",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.1)`),t.style.setProperty("--ap-primary-20",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.2)`),t.style.setProperty("--ap-accent",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.07)`),t.style.setProperty("--ap-accent-foreground",h),t.style.setProperty("--ap-ring",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.7)`),t.style.setProperty("--ap-selection-bg",`oklch(${n.toFixed(3)} ${l.toFixed(3)} ${d.toFixed(1)} / 0.08)`)}const Ft=[{value:"name",label:"Name"},{value:"created_at",label:"Uploaded"},{value:"modified_at",label:"Modified"},{value:"size",label:"Size"},{value:"type",label:"Format"}],Oi=[{value:"relevance",label:"Relevance"},...Ft],Mi=[{value:"name",label:"Name"},{value:"created_at",label:"Uploaded"},{value:"modified_at",label:"Modified"},{value:"files_count_recursive",label:"Assets count"},{value:"files_size_recursive",label:"Assets size"}];var Pi=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,At=(t,e,s,a)=>{for(var i=a>1?void 0:a?Li(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Pi(e,s,i),i};let Re=class extends o.LitElement{constructor(){super(...arguments),this.open=!1}updated(t){var e;super.updated(t),t.has("open")&&(this.open?this.dialog&&!this.dialog.open&&this.dialog.showModal():(e=this.dialog)!=null&&e.open&&this._animateClose())}_animateClose(){const t=this.dialog;if(t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t.close();return}t.classList.add("closing"),t.addEventListener("animationend",()=>{t.classList.remove("closing"),t.close()},{once:!0})}}_handleBackdropClick(t){t.target===this.dialog&&this.dispatchEvent(new CustomEvent("ap-cancel",{detail:{reason:"backdrop"},bubbles:!0,composed:!0}))}_handleCancel(t){t.preventDefault(),this.dispatchEvent(new CustomEvent("ap-cancel",{detail:{reason:"escape"},bubbles:!0,composed:!0}))}render(){return o.html`
2
2
  <dialog
3
3
  @click=${this._handleBackdropClick}
4
4
  @cancel=${this._handleCancel}
@@ -15,7 +15,7 @@
15
15
  </div>
16
16
  </div>
17
17
  </dialog>
18
- `}};Ne.styles=o.css`
18
+ `}};Re.styles=o.css`
19
19
  :host {
20
20
  display: contents;
21
21
  }
@@ -34,12 +34,12 @@
34
34
  border: none;
35
35
  border-radius: var(--ap-modal-radius, 12px);
36
36
  box-shadow: var(--ap-modal-shadow, 0 25px 50px -12px rgb(0 0 0 / 0.25));
37
- background: var(--ap-background, #fff);
37
+ background: var(--ap-background, oklch(1 0 0));
38
38
  overflow: hidden;
39
39
  display: flex;
40
40
  flex-direction: column;
41
41
  font-family: var(--ap-font-family, system-ui, -apple-system, sans-serif);
42
- color: var(--ap-foreground, #09090b);
42
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
43
43
  }
44
44
  dialog[open] {
45
45
  animation: ap-modal-in 200ms ease-out;
@@ -72,7 +72,6 @@
72
72
  }
73
73
  .modal-header {
74
74
  flex-shrink: 0;
75
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
76
75
  }
77
76
  .modal-content {
78
77
  flex: 1;
@@ -89,11 +88,11 @@
89
88
  animation: none;
90
89
  }
91
90
  }
92
- `;Tt([c.property({type:Boolean})],Ne.prototype,"open",2);Tt([c.query("dialog")],Ne.prototype,"dialog",2);Ne=Tt([c.customElement("ap-modal")],Ne);function Ci(t,e){let s;const a=((...i)=>{clearTimeout(s),s=setTimeout(()=>t(...i),e)});return a.cancel=()=>clearTimeout(s),a}const J=o.css`
91
+ `;At([c.property({type:Boolean})],Re.prototype,"open",2);At([c.query("dialog")],Re.prototype,"dialog",2);Re=At([c.customElement("ap-modal")],Re);function Ii(t,e){let s;const a=((...i)=>{clearTimeout(s),s=setTimeout(()=>t(...i),e)});return a.cancel=()=>clearTimeout(s),a}const J=o.css`
93
92
  *, *::before, *::after {
94
93
  box-sizing: border-box;
95
94
  }
96
- `;var ki=Object.defineProperty,Ei=Object.getOwnPropertyDescriptor,pt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ei(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ki(e,s,i),i};let Fe=class extends o.LitElement{constructor(){super(...arguments),this.groups=[],this.selectedFilters={},this._open=!1,this._handleOutsideClick=t=>{this._open&&!t.composedPath().includes(this)&&(this._open=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_selectVariant(t,e){this.dispatchEvent(new CustomEvent("regional-change",{detail:{groupUuid:t,value:e},bubbles:!0,composed:!0}))}render(){const t=this.groups.length>0;return o.html`
95
+ `;var Di=Object.defineProperty,zi=Object.getOwnPropertyDescriptor,dt=(t,e,s,a)=>{for(var i=a>1?void 0:a?zi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Di(e,s,i),i};let Ce=class extends o.LitElement{constructor(){super(...arguments),this.groups=[],this.selectedFilters={},this._open=!1,this._handleOutsideClick=t=>{this._open&&!t.composedPath().includes(this)&&(this._open=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_selectVariant(t,e){this.dispatchEvent(new CustomEvent("regional-change",{detail:{groupUuid:t,value:e},bubbles:!0,composed:!0}))}render(){const t=this.groups.length>0;return o.html`
97
96
  <button
98
97
  class="trigger ${this._open?"active":""}"
99
98
  @click=${()=>this._open=!this._open}
@@ -103,9 +102,8 @@
103
102
  <ap-icon name="globe" .size=${18}></ap-icon>
104
103
  </button>
105
104
  <div class="popover ${this._open?"open":""}">
106
- <div class="popover-title">Regional settings</div>
107
105
  ${t?o.nothing:o.html`
108
- <div style="padding: 12px 12px; font-size: 0.8125rem; color: var(--ap-muted-foreground, #71717a);">
106
+ <div style="padding: 12px 12px; font-size: 0.8125rem; color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));">
109
107
  No regional settings configured
110
108
  </div>
111
109
  `}
@@ -118,14 +116,14 @@
118
116
  ?data-selected=${a}
119
117
  @click=${()=>this._selectVariant(e.uuid,s.api_value)}
120
118
  >
119
+ <span class="variant-label">${s.label}</span>
121
120
  <span class="check-mark">${a?o.html`<ap-icon name="check" .size=${14}></ap-icon>`:""}</span>
122
- ${s.label}
123
121
  </button>
124
122
  `})}
125
123
  </div>
126
124
  `)}
127
125
  </div>
128
- `}};Fe.styles=o.css`
126
+ `}};Ce.styles=o.css`
129
127
  :host {
130
128
  position: relative;
131
129
  display: inline-block;
@@ -139,15 +137,15 @@
139
137
  border: 1px solid transparent;
140
138
  border-radius: var(--ap-radius-sm, 6px);
141
139
  background: none;
142
- color: var(--ap-muted-foreground, #71717a);
140
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
143
141
  cursor: pointer;
144
142
  }
145
143
  .trigger:hover {
146
- background: var(--ap-muted, #f4f4f5);
147
- color: var(--ap-foreground, #09090b);
144
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
145
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
148
146
  }
149
147
  .trigger.active {
150
- color: var(--ap-primary, oklch(0.65 0.19 258));
148
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
151
149
  }
152
150
  .popover {
153
151
  display: none;
@@ -158,62 +156,59 @@
158
156
  min-width: 220px;
159
157
  max-height: 320px;
160
158
  overflow-y: auto;
161
- background: var(--ap-card, #fff);
162
- border: 1px solid var(--ap-border, #e4e4e7);
159
+ background: var(--ap-card, oklch(1 0 0));
160
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
163
161
  border-radius: var(--ap-radius, 8px);
164
162
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
165
- padding: 8px 0;
163
+ padding: 0;
166
164
  }
167
165
  .popover.open {
168
166
  display: block;
169
167
  }
170
- .popover-title {
171
- padding: 8px 12px 4px;
172
- font-size: 0.75rem;
173
- font-weight: 600;
174
- color: var(--ap-muted-foreground, #71717a);
175
- text-transform: uppercase;
176
- letter-spacing: 0.05em;
177
- }
178
168
  .group {
179
169
  padding: 4px 0;
180
170
  }
181
171
  .group + .group {
182
- border-top: 1px solid var(--ap-border, #e4e4e7);
172
+ border-top: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
183
173
  }
184
174
  .group-label {
185
- padding: 6px 12px 2px;
186
- font-size: 0.75rem;
187
- font-weight: 500;
188
- color: var(--ap-muted-foreground, #71717a);
175
+ padding: 6px 12px 8px;
176
+ font-size: 0.875rem;
177
+ font-weight: 400;
178
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
189
179
  }
190
180
  .variant-option {
191
181
  display: flex;
192
182
  align-items: center;
183
+ justify-content: space-between;
193
184
  gap: 8px;
194
185
  width: 100%;
195
- padding: 6px 12px;
186
+ padding: 6px 16px 6px 24px;
196
187
  border: none;
197
188
  background: none;
198
- color: var(--ap-foreground, #09090b);
189
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
199
190
  font-size: var(--ap-font-size-sm, 0.875rem);
200
191
  font-family: inherit;
201
192
  text-align: left;
202
193
  cursor: pointer;
203
194
  border-radius: 0;
204
195
  }
196
+ .variant-label {
197
+ flex: 1;
198
+ }
205
199
  .variant-option:hover {
206
- background: var(--ap-muted, #f4f4f5);
200
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
207
201
  }
208
202
  .variant-option[data-selected] {
209
- color: var(--ap-primary, oklch(0.65 0.19 258));
210
- font-weight: 500;
203
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
204
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
205
+ font-weight: 400;
211
206
  }
212
207
  .check-mark {
213
208
  width: 16px;
214
209
  flex-shrink: 0;
215
210
  }
216
- `;pt([c.property({type:Array})],Fe.prototype,"groups",2);pt([c.property({type:Object})],Fe.prototype,"selectedFilters",2);pt([c.state()],Fe.prototype,"_open",2);Fe=pt([c.customElement("ap-regional-settings")],Fe);var Fi=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,ee=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ai(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Fi(e,s,i),i};const Ti=[{value:"assets",label:"Assets",icon:"gallery-vertical-end"},{value:"folders",label:"Folders",icon:"folder-open"}];let H=class extends o.LitElement{constructor(){super(...arguments),this.activeTab="assets",this.tabs=["assets","folders"],this.viewMode="grid",this.searchQuery="",this.regionalGroups=[],this.regionalFilters={},this.hideClose=!1,this._localSearch="",this._debouncedSearch=Ci(t=>{(t.length===0||t.length>=3)&&this.dispatchEvent(new CustomEvent("search-change",{detail:{value:t},bubbles:!0,composed:!0}))},300)}disconnectedCallback(){super.disconnectedCallback(),this._debouncedSearch.cancel()}willUpdate(t){t.has("searchQuery")&&(this._localSearch=this.searchQuery)}_handleInput(t){const e=t.target.value;this._localSearch=e,this._debouncedSearch(e)}_clearSearch(){this._localSearch="",this._debouncedSearch.cancel(),this.dispatchEvent(new CustomEvent("search-change",{detail:{value:""},bubbles:!0,composed:!0}))}_toggleView(){const t=this.viewMode==="grid"?"list":"grid";this.dispatchEvent(new CustomEvent("view-change",{detail:{mode:t},bubbles:!0,composed:!0}))}_handleTabChange(t){this.dispatchEvent(new CustomEvent("tab-change",{detail:{tab:t.detail.value},bubbles:!0,composed:!0}))}_handleRegionalChange(t){this.dispatchEvent(new CustomEvent("regional-change",{detail:t.detail,bubbles:!0,composed:!0}))}_handleClose(){this.dispatchEvent(new CustomEvent("ap-close",{bubbles:!0,composed:!0}))}render(){var e,s;const t=Ti.filter(a=>this.tabs.includes(a.value));return((e=t.find(a=>a.value===this.activeTab))==null?void 0:e.label)??((s=t[0])==null||s.label),o.html`
211
+ `;dt([c.property({type:Array})],Ce.prototype,"groups",2);dt([c.property({type:Object})],Ce.prototype,"selectedFilters",2);dt([c.state()],Ce.prototype,"_open",2);Ce=dt([c.customElement("ap-regional-settings")],Ce);var Ri=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,ee=(t,e,s,a)=>{for(var i=a>1?void 0:a?ji(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ri(e,s,i),i};const Ni=[{value:"assets",label:"Assets",icon:"gallery-vertical-end"},{value:"folders",label:"Folders",icon:"folder-open"}];let H=class extends o.LitElement{constructor(){super(...arguments),this.activeTab="assets",this.tabs=["assets","folders"],this.viewMode="grid",this.searchQuery="",this.regionalGroups=[],this.regionalFilters={},this.hideClose=!1,this._localSearch="",this._debouncedSearch=Ii(t=>{(t.length===0||t.length>=3)&&this.dispatchEvent(new CustomEvent("search-change",{detail:{value:t},bubbles:!0,composed:!0}))},300)}disconnectedCallback(){super.disconnectedCallback(),this._debouncedSearch.cancel()}willUpdate(t){t.has("searchQuery")&&(this._localSearch=this.searchQuery)}_handleInput(t){const e=t.target.value;this._localSearch=e,this._debouncedSearch(e)}_clearSearch(){this._localSearch="",this._debouncedSearch.cancel(),this.dispatchEvent(new CustomEvent("search-change",{detail:{value:""},bubbles:!0,composed:!0}))}_toggleView(){const t=this.viewMode==="grid"?"list":"grid";this.dispatchEvent(new CustomEvent("view-change",{detail:{mode:t},bubbles:!0,composed:!0}))}_handleTabChange(t){this.dispatchEvent(new CustomEvent("tab-change",{detail:{tab:t.detail.value},bubbles:!0,composed:!0}))}_handleRegionalChange(t){this.dispatchEvent(new CustomEvent("regional-change",{detail:t.detail,bubbles:!0,composed:!0}))}_handleClose(){this.dispatchEvent(new CustomEvent("ap-close",{bubbles:!0,composed:!0}))}render(){var e,s;const t=Ni.filter(a=>this.tabs.includes(a.value));return((e=t.find(a=>a.value===this.activeTab))==null?void 0:e.label)??((s=t[0])==null||s.label),o.html`
217
212
  <div class="header-row">
218
213
  ${t.length>1?o.html`<ap-dropdown
219
214
  .value=${this.activeTab}
@@ -234,30 +229,33 @@
234
229
  </button>
235
230
  `:""}
236
231
  </div>
237
- <ap-regional-settings
238
- .groups=${this.regionalGroups}
239
- .selectedFilters=${this.regionalFilters}
240
- @regional-change=${this._handleRegionalChange}
241
- ></ap-regional-settings>
242
- <button
243
- class="icon-btn"
244
- @click=${this._toggleView}
245
- aria-label=${this.viewMode==="grid"?"Switch to list view":"Switch to grid view"}
246
- title=${this.viewMode==="grid"?"List view":"Grid view"}
247
- >
248
- <ap-icon name=${this.viewMode==="grid"?"list":"grid"} .size=${18}></ap-icon>
249
- </button>
250
- ${this.hideClose?o.nothing:o.html`
251
- <div class="divider"></div>
252
- <button class="icon-btn" @click=${this._handleClose} aria-label="Close">
253
- <ap-icon name="close" .size=${18}></ap-icon>
232
+ <div class="actions">
233
+ <ap-regional-settings
234
+ .groups=${this.regionalGroups}
235
+ .selectedFilters=${this.regionalFilters}
236
+ @regional-change=${this._handleRegionalChange}
237
+ ></ap-regional-settings>
238
+ <button
239
+ class="icon-btn"
240
+ @click=${this._toggleView}
241
+ aria-label=${this.viewMode==="grid"?"Switch to list view":"Switch to grid view"}
242
+ title=${this.viewMode==="grid"?"List view":"Grid view"}
243
+ >
244
+ <ap-icon name=${this.viewMode==="grid"?"list":"layout-grid"} .size=${18}></ap-icon>
254
245
  </button>
255
- `}
246
+ ${this.hideClose?o.nothing:o.html`
247
+ <div class="divider"></div>
248
+ <button class="icon-btn" style="color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82))" @click=${this._handleClose} aria-label="Close">
249
+ <ap-icon name="close" .size=${18}></ap-icon>
250
+ </button>
251
+ `}
252
+ </div>
256
253
  </div>
257
254
  `}};H.styles=[J,o.css`
258
255
  :host {
259
256
  display: block;
260
257
  padding: 16px 20px;
258
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
261
259
  }
262
260
  .header-row {
263
261
  display: flex;
@@ -266,6 +264,7 @@
266
264
  }
267
265
  .search-wrapper {
268
266
  flex: 1;
267
+ max-width: 548px;
269
268
  position: relative;
270
269
  }
271
270
  .search-icon {
@@ -273,29 +272,31 @@
273
272
  left: 12px;
274
273
  top: 50%;
275
274
  transform: translateY(-50%);
276
- color: var(--ap-muted-foreground, #71717a);
275
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
277
276
  pointer-events: none;
278
277
  }
279
278
  input {
280
279
  width: 100%;
281
- padding: 8px 32px 8px 38px;
282
- border: 1px solid var(--ap-border, #e4e4e7);
283
- border-radius: var(--ap-radius, 8px);
280
+ height: 36px;
281
+ box-sizing: border-box;
282
+ padding: 0 32px 0 38px;
283
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
284
+ border-radius: var(--ap-radius-sm, 6px);
284
285
  font-size: var(--ap-font-size-sm, 0.875rem);
285
286
  font-family: var(--ap-font-family, system-ui, sans-serif);
286
- color: var(--ap-foreground, #09090b);
287
- background: var(--ap-background, #fff);
287
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
288
+ background: var(--ap-background, oklch(1 0 0));
288
289
  outline: none;
289
290
  }
290
291
  input:focus {
291
- border-color: var(--ap-ring, oklch(0.65 0.19 258));
292
- box-shadow: 0 0 0 2px var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
292
+ border-color: var(--ap-ring, oklch(0.578 0.198 268.129 / 0.7));
293
+ box-shadow: 0 0 0 2px var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
293
294
  }
294
295
  input:focus-visible {
295
296
  outline: none; /* already has focus ring via border-color + box-shadow */
296
297
  }
297
298
  input::placeholder {
298
- color: var(--ap-muted-foreground, #71717a);
299
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
299
300
  }
300
301
  .clear-btn {
301
302
  position: absolute;
@@ -310,13 +311,13 @@
310
311
  border: none;
311
312
  border-radius: var(--ap-radius-sm, 6px);
312
313
  background: none;
313
- color: var(--ap-muted-foreground, #71717a);
314
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
314
315
  cursor: pointer;
315
316
  padding: 0;
316
317
  }
317
318
  .clear-btn:hover {
318
- color: var(--ap-foreground, #09090b);
319
- background: var(--ap-muted, #f4f4f5);
319
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
320
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
320
321
  }
321
322
  .icon-btn {
322
323
  display: flex;
@@ -327,30 +328,36 @@
327
328
  border: 1px solid transparent;
328
329
  border-radius: var(--ap-radius-sm, 6px);
329
330
  background: none;
330
- color: var(--ap-muted-foreground, #71717a);
331
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
331
332
  cursor: pointer;
332
333
  }
333
334
  .icon-btn:hover {
334
- background: var(--ap-muted, #f4f4f5);
335
- color: var(--ap-foreground, #09090b);
335
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
336
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
336
337
  }
337
338
  .icon-btn:focus-visible {
338
- outline: 2px solid var(--ap-ring, oklch(0.65 0.19 258));
339
+ outline: 2px solid var(--ap-ring, oklch(0.578 0.198 268.129 / 0.7));
339
340
  outline-offset: -2px;
340
341
  }
341
342
  .tab-label {
342
343
  font-size: var(--ap-font-size-sm, 0.875rem);
343
344
  font-weight: 500;
344
- color: var(--ap-foreground, #09090b);
345
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
345
346
  padding: 0 4px;
346
347
  white-space: nowrap;
347
348
  }
349
+ .actions {
350
+ display: flex;
351
+ align-items: center;
352
+ gap: 12px;
353
+ margin-left: auto;
354
+ }
348
355
  .divider {
349
356
  width: 1px;
350
357
  height: 24px;
351
- background: var(--ap-border, #e4e4e7);
358
+ background: var(--ap-border, oklch(92.86% 0.009 247.92));
352
359
  }
353
- `];ee([c.property()],H.prototype,"activeTab",2);ee([c.property({type:Array})],H.prototype,"tabs",2);ee([c.property()],H.prototype,"viewMode",2);ee([c.property()],H.prototype,"searchQuery",2);ee([c.property({type:Array})],H.prototype,"regionalGroups",2);ee([c.property({type:Object})],H.prototype,"regionalFilters",2);ee([c.property({type:Boolean})],H.prototype,"hideClose",2);ee([c.state()],H.prototype,"_localSearch",2);H=ee([c.customElement("ap-header")],H);var Mi=Object.defineProperty,Oi=Object.getOwnPropertyDescriptor,ps=(t,e,s,a)=>{for(var i=a>1?void 0:a?Oi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Mi(e,s,i),i};let et=class extends o.LitElement{constructor(){super(...arguments),this.items=[]}_navigate(t){this.dispatchEvent(new CustomEvent("breadcrumb-navigate",{detail:{uuid:t},bubbles:!0,composed:!0}))}render(){return this.items.length===0?o.html``:o.html`
360
+ `];ee([c.property()],H.prototype,"activeTab",2);ee([c.property({type:Array})],H.prototype,"tabs",2);ee([c.property()],H.prototype,"viewMode",2);ee([c.property()],H.prototype,"searchQuery",2);ee([c.property({type:Array})],H.prototype,"regionalGroups",2);ee([c.property({type:Object})],H.prototype,"regionalFilters",2);ee([c.property({type:Boolean})],H.prototype,"hideClose",2);ee([c.state()],H.prototype,"_localSearch",2);H=ee([c.customElement("ap-header")],H);var Bi=Object.defineProperty,Ui=Object.getOwnPropertyDescriptor,ps=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ui(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Bi(e,s,i),i};let Je=class extends o.LitElement{constructor(){super(...arguments),this.items=[]}_navigate(t){this.dispatchEvent(new CustomEvent("breadcrumb-navigate",{detail:{uuid:t},bubbles:!0,composed:!0}))}render(){return this.items.length===0?o.html``:o.html`
354
361
  <nav class="breadcrumb" aria-label="Breadcrumb">
355
362
  <button @click=${()=>this._navigate("")}>Root</button>
356
363
  ${this.items.map((t,e)=>o.html`
@@ -358,7 +365,7 @@
358
365
  ${e<this.items.length-1?o.html`<button @click=${()=>this._navigate(t.uuid)}>${t.name}</button>`:o.html`<span class="current">${t.name}</span>`}
359
366
  `)}
360
367
  </nav>
361
- `}};et.styles=o.css`
368
+ `}};Je.styles=o.css`
362
369
  :host {
363
370
  display: block;
364
371
  padding: 8px 20px;
@@ -372,7 +379,7 @@
372
379
  button {
373
380
  border: none;
374
381
  background: none;
375
- color: var(--ap-muted-foreground, #71717a);
382
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
376
383
  cursor: pointer;
377
384
  padding: 4px 6px;
378
385
  border-radius: 4px;
@@ -380,18 +387,18 @@
380
387
  font-size: var(--ap-font-size-sm, 0.875rem);
381
388
  }
382
389
  button:hover {
383
- background: var(--ap-muted, #f4f4f5);
384
- color: var(--ap-foreground, #09090b);
390
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
391
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
385
392
  }
386
393
  .current {
387
- color: var(--ap-foreground, #09090b);
394
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
388
395
  font-weight: 500;
389
396
  padding: 4px 6px;
390
397
  }
391
398
  ap-icon {
392
- color: var(--ap-muted-foreground, #71717a);
399
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
393
400
  }
394
- `;ps([c.property({type:Array})],et.prototype,"items",2);et=ps([c.customElement("ap-breadcrumb")],et);var Li=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,Mt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Pi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Li(e,s,i),i};let je=class extends o.LitElement{constructor(){super(...arguments),this.title="",this.open=!1}render(){return this.open?o.html`
401
+ `;ps([c.property({type:Array})],Je.prototype,"items",2);Je=ps([c.customElement("ap-breadcrumb")],Je);var Vi=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Tt=(t,e,s,a)=>{for(var i=a>1?void 0:a?qi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Vi(e,s,i),i};let je=class extends o.LitElement{constructor(){super(...arguments),this.title="",this.open=!1}render(){return this.open?o.html`
395
402
  <div class="popover">
396
403
  ${this.title?o.html`<div class="title">${this.title}</div>`:""}
397
404
  <slot></slot>
@@ -409,8 +416,8 @@
409
416
  max-height: 400px;
410
417
  overflow-y: auto;
411
418
  overscroll-behavior: contain;
412
- background: var(--ap-card, #fff);
413
- border: 1px solid var(--ap-border, #e4e4e7);
419
+ background: var(--ap-card, oklch(1 0 0));
420
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
414
421
  border-radius: var(--ap-radius, 8px);
415
422
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
416
423
  padding: 12px;
@@ -418,10 +425,10 @@
418
425
  .title {
419
426
  font-size: var(--ap-font-size-sm, 0.875rem);
420
427
  font-weight: 600;
421
- color: var(--ap-foreground, #09090b);
428
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
422
429
  margin-bottom: 12px;
423
430
  }
424
- `;Mt([c.property()],je.prototype,"title",2);Mt([c.property({type:Boolean})],je.prototype,"open",2);je=Mt([c.customElement("ap-filter-popover")],je);var Ii=Object.defineProperty,Di=Object.getOwnPropertyDescriptor,hs=(t,e,s,a)=>{for(var i=a>1?void 0:a?Di(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ii(e,s,i),i};let tt=class extends o.LitElement{constructor(){super(...arguments),this.selected=[]}_toggle(t){const e=this.selected.includes(t)?this.selected.filter(s=>s!==t):[...this.selected,t];this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.TYPE,values:e,operator:b.IS},bubbles:!0,composed:!0}))}render(){return o.html`
431
+ `;Tt([c.property()],je.prototype,"title",2);Tt([c.property({type:Boolean})],je.prototype,"open",2);je=Tt([c.customElement("ap-filter-popover")],je);var Hi=Object.defineProperty,Ki=Object.getOwnPropertyDescriptor,hs=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ki(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Hi(e,s,i),i};let et=class extends o.LitElement{constructor(){super(...arguments),this.selected=[]}_toggle(t){const e=this.selected.includes(t)?this.selected.filter(s=>s!==t):[...this.selected,t];this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.TYPE,values:e,operator:_.IS},bubbles:!0,composed:!0}))}render(){return o.html`
425
432
  <div class="options">
426
433
  <span class="section-label">Formats</span>
427
434
  ${ss.map(t=>o.html`
@@ -437,7 +444,7 @@
437
444
  </div>
438
445
  `)}
439
446
  </div>
440
- `}};tt.styles=o.css`
447
+ `}};et.styles=o.css`
441
448
  :host {
442
449
  display: block;
443
450
  }
@@ -445,8 +452,8 @@
445
452
  .section-label {
446
453
  display: block;
447
454
  font-size: var(--ap-font-size-sm, 0.875rem);
448
- font-weight: 600;
449
- color: var(--ap-foreground, #09090b);
455
+ font-weight: 400;
456
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
450
457
  margin-bottom: 8px;
451
458
  cursor: default;
452
459
  }
@@ -460,7 +467,7 @@
460
467
  .option {
461
468
  display: flex;
462
469
  align-items: center;
463
- gap: 8px;
470
+ gap: 12px;
464
471
  padding: 6px 8px;
465
472
  border-radius: var(--ap-radius-sm, 6px);
466
473
  cursor: pointer;
@@ -468,23 +475,23 @@
468
475
  }
469
476
 
470
477
  .option:hover {
471
- background: var(--ap-muted, #f4f4f5);
478
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
472
479
  }
473
480
 
474
481
  .option-label {
475
482
  font-size: var(--ap-font-size-sm, 0.875rem);
476
- color: var(--ap-foreground, #09090b);
483
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
477
484
  }
478
485
 
479
486
  ap-icon {
480
- color: var(--ap-muted-foreground, #71717a);
487
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
481
488
  flex-shrink: 0;
482
489
  }
483
490
 
484
491
  .option.selected ap-icon {
485
- color: var(--ap-primary, #3b82f6);
492
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
486
493
  }
487
- `;hs([c.property({type:Array})],tt.prototype,"selected",2);tt=hs([c.customElement("ap-filter-type")],tt);const te=o.css`
494
+ `;hs([c.property({type:Array})],et.prototype,"selected",2);et=hs([c.customElement("ap-filter-type")],et);const te=o.css`
488
495
  :host {
489
496
  display: block;
490
497
  }
@@ -505,7 +512,7 @@
505
512
  background: none;
506
513
  font-size: var(--ap-font-size-sm, 0.875rem);
507
514
  font-family: inherit;
508
- color: var(--ap-primary, oklch(0.65 0.19 258));
515
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
509
516
  cursor: pointer;
510
517
  opacity: 0.9;
511
518
  }
@@ -522,8 +529,8 @@
522
529
  .section-label {
523
530
  display: block;
524
531
  font-size: var(--ap-font-size-sm, 0.875rem);
525
- font-weight: 600;
526
- color: var(--ap-foreground, #09090b);
532
+ font-weight: 400;
533
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
527
534
  margin-bottom: 8px;
528
535
  cursor: default;
529
536
  }
@@ -554,7 +561,7 @@
554
561
  /* ── Separator ── */
555
562
  .separator {
556
563
  height: 1px;
557
- background: var(--ap-border, #e4e4e7);
564
+ background: var(--ap-border, oklch(92.86% 0.009 247.92));
558
565
  margin: 16px 0;
559
566
  }
560
567
 
@@ -563,10 +570,10 @@
563
570
  display: flex;
564
571
  gap: 8px;
565
572
  padding: 10px 12px;
566
- background: var(--ap-muted, #f4f4f5);
573
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
567
574
  border-radius: var(--ap-radius-sm, 6px);
568
575
  font-size: 0.8125rem;
569
- color: var(--ap-muted-foreground, #71717a);
576
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
570
577
  line-height: 1.4;
571
578
  margin-top: 16px;
572
579
  }
@@ -577,27 +584,28 @@
577
584
 
578
585
  /* ── Text/Number inputs ── */
579
586
  .filter-input {
587
+ box-sizing: border-box;
580
588
  width: 100%;
581
589
  height: 36px;
582
590
  padding: 0 10px;
583
- border: 1px solid var(--ap-border, #e4e4e7);
591
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
584
592
  border-radius: var(--ap-radius-sm, 6px);
585
593
  font-size: var(--ap-font-size-sm, 0.875rem);
586
594
  font-family: inherit;
587
- color: var(--ap-foreground, #09090b);
588
- background: var(--ap-background, #fff);
595
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
596
+ background: var(--ap-background, oklch(1 0 0));
589
597
  outline: none;
590
598
  transition: border-color 150ms;
591
599
  }
592
600
  .filter-input:focus {
593
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
601
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
594
602
  }
595
603
  .filter-input:disabled {
596
604
  opacity: 0.5;
597
605
  cursor: default;
598
606
  }
599
607
  .filter-input::placeholder {
600
- color: var(--ap-muted-foreground, #71717a);
608
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
601
609
  }
602
610
 
603
611
  textarea.filter-input {
@@ -610,7 +618,7 @@
610
618
  display: block;
611
619
  font-size: var(--ap-font-size-sm, 0.875rem);
612
620
  font-weight: 500;
613
- color: var(--ap-foreground, #09090b);
621
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
614
622
  margin-bottom: 4px;
615
623
  }
616
624
  .input-label[aria-disabled="true"] {
@@ -635,11 +643,11 @@
635
643
  align-items: center;
636
644
  gap: 4px;
637
645
  padding: 2px 8px;
638
- border: 1px solid var(--ap-border, #e4e4e7);
646
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
639
647
  border-radius: 9999px;
640
648
  font-size: 0.8125rem;
641
- color: var(--ap-foreground, #09090b);
642
- background: var(--ap-background, #fff);
649
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
650
+ background: var(--ap-background, oklch(1 0 0));
643
651
  max-width: 200px;
644
652
  }
645
653
  .chip-label {
@@ -655,13 +663,13 @@
655
663
  height: 14px;
656
664
  border: none;
657
665
  background: none;
658
- color: var(--ap-muted-foreground, #71717a);
666
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
659
667
  cursor: pointer;
660
668
  padding: 0;
661
669
  flex-shrink: 0;
662
670
  }
663
671
  .chip-remove:hover {
664
- color: var(--ap-foreground, #09090b);
672
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
665
673
  }
666
674
  .chips-wrap {
667
675
  display: flex;
@@ -672,7 +680,7 @@
672
680
  /* ── Error text ── */
673
681
  .error-text {
674
682
  font-size: 0.8125rem;
675
- color: var(--ap-destructive, #ef4444);
683
+ color: var(--ap-destructive, oklch(0.577 0.215 27.325));
676
684
  margin-top: 4px;
677
685
  }
678
686
 
@@ -681,23 +689,23 @@
681
689
  position: sticky;
682
690
  top: -10px;
683
691
  z-index: 2;
684
- background: var(--ap-card, #fff);
692
+ background: var(--ap-card, oklch(1 0 0));
685
693
  margin: -10px -8px 10px;
686
694
  }
687
695
  .search-input {
688
696
  width: 100%;
689
697
  padding: 8px 32px 8px 10px;
690
698
  border: none;
691
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
699
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
692
700
  border-radius: 0;
693
701
  font-size: var(--ap-font-size-sm, 0.875rem);
694
702
  font-family: inherit;
695
- color: var(--ap-foreground, #09090b);
703
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
696
704
  background: transparent;
697
705
  outline: none;
698
706
  }
699
707
  .search-input::placeholder {
700
- color: var(--ap-muted-foreground, #71717a);
708
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
701
709
  }
702
710
  .search-clear {
703
711
  position: absolute;
@@ -711,12 +719,12 @@
711
719
  height: 20px;
712
720
  border: none;
713
721
  background: none;
714
- color: var(--ap-muted-foreground, #71717a);
722
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
715
723
  cursor: pointer;
716
724
  padding: 0;
717
725
  }
718
726
  .search-clear:hover {
719
- color: var(--ap-foreground, #09090b);
727
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
720
728
  }
721
729
 
722
730
  /* ── Options list (checkbox-based) ── */
@@ -733,9 +741,9 @@
733
741
  padding: 12px;
734
742
  text-align: center;
735
743
  font-size: var(--ap-font-size-sm, 0.875rem);
736
- color: var(--ap-muted-foreground, #71717a);
744
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
737
745
  }
738
- `;var zi=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,xe=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ri(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&zi(e,s,i),i};function St(t){return t.toISOString().split("T")[0]}let W=class extends o.LitElement{constructor(){super(...arguments),this.filterKey=m.DATE,this.field="created",this.kind=null,this.preset="",this.from="",this.to=""}get _isLicenseExpiry(){return this.filterKey===m.LICENSE_EXPIRY}get _rangeOptions(){return this._isLicenseExpiry?as:Ft}get _todayStr(){return St(new Date)}get _hasFilter(){return!!(this.kind||this.preset||this.from||this.to)}_kindFromValue(t){return["before","after","between","specific"].includes(t)?t:"preset"}_selectField(t){this.field=t,this._dispatchChange()}_selectPreset(t){const e=this._kindFromValue(t);if(this.kind=e,this.preset=t,["before","after","between","specific"].includes(t)){this.from="",this.to="",this.requestUpdate();return}const s=rs(t);s&&(this.from=s.from,this.to=s.to??""),this._dispatchChange()}_clearAll(){this.field="created",this.kind=null,this.preset="",this.from="",this.to="",this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:{field:this.field,kind:this.kind,preset:this.preset,from:this.from,to:this.to}},bubbles:!0,composed:!0}))}_handleDateInput(t,e){const s=e.target.value,a=s?new Date(s+"T00:00:00").toISOString():"";if(t==="from"?this.from=a:this.to=a,this.preset==="specific"&&t==="from"&&a){const i=new Date(s+"T23:59:59");this.to=i.toISOString()}this.preset==="after"&&t==="from"&&a&&(this.to=new Date().toISOString()),this.preset==="before"&&t==="to"&&a&&(this.from=new Date(0).toISOString()),this._dispatchChange()}_renderDateTypeSection(){return this._isLicenseExpiry?o.nothing:o.html`
746
+ `;var Gi=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor,_e=(t,e,s,a)=>{for(var i=a>1?void 0:a?Yi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Gi(e,s,i),i};function $t(t){return t.toISOString().split("T")[0]}let W=class extends o.LitElement{constructor(){super(...arguments),this.filterKey=m.DATE,this.field="created",this.kind=null,this.preset="",this.from="",this.to=""}get _isLicenseExpiry(){return this.filterKey===m.LICENSE_EXPIRY}get _rangeOptions(){return this._isLicenseExpiry?as:Et}get _todayStr(){return $t(new Date)}get _hasFilter(){return!!(this.kind||this.preset||this.from||this.to)}_kindFromValue(t){return["before","after","between","specific"].includes(t)?t:"preset"}_selectField(t){this.field=t,this._dispatchChange()}_selectPreset(t){const e=this._kindFromValue(t);if(this.kind=e,this.preset=t,["before","after","between","specific"].includes(t)){this.from="",this.to="",this.requestUpdate();return}const s=rs(t);s&&(this.from=s.from,this.to=s.to??""),this._dispatchChange()}_clearAll(){this.field="created",this.kind=null,this.preset="",this.from="",this.to="",this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:{field:this.field,kind:this.kind,preset:this.preset,from:this.from,to:this.to}},bubbles:!0,composed:!0}))}_handleDateInput(t,e){const s=e.target.value,a=s?new Date(s+"T00:00:00").toISOString():"";if(t==="from"?this.from=a:this.to=a,this.preset==="specific"&&t==="from"&&a){const i=new Date(s+"T23:59:59");this.to=i.toISOString()}this.preset==="after"&&t==="from"&&a&&(this.to=new Date().toISOString()),this.preset==="before"&&t==="to"&&a&&(this.from=new Date(0).toISOString()),this._dispatchChange()}_renderDateTypeSection(){return this._isLicenseExpiry?o.nothing:o.html`
739
747
  <div class="filter-section">
740
748
  <span class="section-label">Date type</span>
741
749
  <ap-radio-group
@@ -754,7 +762,7 @@
754
762
  @ap-change=${t=>this._selectPreset(t.detail.value)}
755
763
  ></ap-radio-group>
756
764
  </div>
757
- `}_renderDateInputs(){const t=this.preset;if(!["before","after","between","specific"].includes(t))return o.nothing;const e=this.from?St(new Date(this.from)):"",s=this.to?St(new Date(this.to)):"",a=this._todayStr;return t==="specific"?o.html`
765
+ `}_renderDateInputs(){const t=this.preset;if(!["before","after","between","specific"].includes(t))return o.nothing;const e=this.from?$t(new Date(this.from)):"",s=this.to?$t(new Date(this.to)):"",a=this._todayStr;return t==="specific"?o.html`
758
766
  <div class="filter-section date-inputs">
759
767
  <div>
760
768
  <span class="input-label">Date</span>
@@ -834,10 +842,10 @@
834
842
  .date-inputs {
835
843
  margin-top: 4px;
836
844
  }
837
- `];xe([c.property()],W.prototype,"filterKey",2);xe([c.property()],W.prototype,"field",2);xe([c.property()],W.prototype,"kind",2);xe([c.property()],W.prototype,"preset",2);xe([c.property()],W.prototype,"from",2);xe([c.property()],W.prototype,"to",2);W=xe([c.customElement("ap-filter-date")],W);var Ni=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,Oe=(t,e,s,a)=>{for(var i=a>1?void 0:a?ji(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ni(e,s,i),i};let ae=class extends o.LitElement{constructor(){super(...arguments),this.tags=[],this.selected=[],this.filterKey=m.TAGS,this._search=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;return(t=this._searchInput)==null?void 0:t.focus()})}get _suggestedTags(){return this.tags.filter(t=>t.primary)}get _otherTags(){return this.tags.filter(t=>!t.primary)}get _atLimit(){return this.selected.length>=mt}get _isSearching(){return this._search.trim().length>0}_toggle(t){const e=this.selected.includes(t);if(!e&&this._atLimit)return;const s=e?this.selected.filter(a=>a!==t):[...this.selected,t];this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:s,operator:b.IS},bubbles:!0,composed:!0}))}_remove(t){const e=this.selected.filter(s=>s!==t);this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:e,operator:b.IS},bubbles:!0,composed:!0}))}_clearAll(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:[],operator:b.IS},bubbles:!0,composed:!0}))}_onSearchInput(t){this._search=t.target.value}_clearSearch(){this._search=""}_getTagBySid(t){return this.tags.find(e=>e.sid===t)}_renderTagItem(t){const e=this.selected.includes(t.sid),s=!e&&this._atLimit;return o.html`
845
+ `];_e([c.property()],W.prototype,"filterKey",2);_e([c.property()],W.prototype,"field",2);_e([c.property()],W.prototype,"kind",2);_e([c.property()],W.prototype,"preset",2);_e([c.property()],W.prototype,"from",2);_e([c.property()],W.prototype,"to",2);W=_e([c.customElement("ap-filter-date")],W);var Xi=Object.defineProperty,Wi=Object.getOwnPropertyDescriptor,Oe=(t,e,s,a)=>{for(var i=a>1?void 0:a?Wi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Xi(e,s,i),i};let ae=class extends o.LitElement{constructor(){super(...arguments),this.tags=[],this.selected=[],this.filterKey=m.TAGS,this._search=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;return(t=this._searchInput)==null?void 0:t.focus()})}get _suggestedTags(){return this.tags.filter(t=>t.primary)}get _otherTags(){return this.tags.filter(t=>!t.primary)}get _atLimit(){return this.selected.length>=gt}get _isSearching(){return this._search.trim().length>0}_toggle(t){const e=this.selected.includes(t);if(!e&&this._atLimit)return;const s=e?this.selected.filter(a=>a!==t):[...this.selected,t];this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:s,operator:_.IS},bubbles:!0,composed:!0}))}_remove(t){const e=this.selected.filter(s=>s!==t);this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:e,operator:_.IS},bubbles:!0,composed:!0}))}_clearAll(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:this.filterKey,values:[],operator:_.IS},bubbles:!0,composed:!0}))}_onSearchInput(t){this._search=t.target.value}_clearSearch(){this._search=""}_getTagBySid(t){return this.tags.find(e=>e.sid===t)}_renderTagItem(t){const e=this.selected.includes(t.sid),s=!e&&this._atLimit;return o.html`
838
846
  <div
839
847
  class="tag-item ${s?"disabled":""}"
840
- title=${s?`You can select up to ${mt} tags`:o.nothing}
848
+ title=${s?`You can select up to ${gt} tags`:o.nothing}
841
849
  @click=${()=>!s&&this._toggle(t.sid)}
842
850
  >
843
851
  <ap-checkbox ?checked=${e}></ap-checkbox>
@@ -882,7 +890,7 @@
882
890
  ${this._atLimit?o.html`
883
891
  <div class="info-alert">
884
892
  <ap-icon name="info" .size=${14}></ap-icon>
885
- <span>You can select up to ${mt} tags.</span>
893
+ <span>You can select up to ${gt} tags.</span>
886
894
  </div>
887
895
  `:o.nothing}
888
896
  </div>
@@ -942,7 +950,7 @@
942
950
  .tag-item {
943
951
  display: flex;
944
952
  align-items: center;
945
- gap: 8px;
953
+ gap: 12px;
946
954
  padding: 6px 8px;
947
955
  border-radius: var(--ap-radius-sm, 6px);
948
956
  cursor: pointer;
@@ -950,7 +958,7 @@
950
958
  }
951
959
 
952
960
  .tag-item:hover:not(.disabled) {
953
- background: var(--ap-muted, #f4f4f5);
961
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
954
962
  }
955
963
 
956
964
  .tag-item.disabled {
@@ -964,7 +972,7 @@
964
972
 
965
973
  .tag-name {
966
974
  font-size: var(--ap-font-size-sm, 0.875rem);
967
- color: var(--ap-foreground, #09090b);
975
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
968
976
  flex: 1;
969
977
  min-width: 0;
970
978
  overflow: hidden;
@@ -974,7 +982,7 @@
974
982
 
975
983
  .hint-message {
976
984
  font-size: 0.8125rem;
977
- color: var(--ap-muted-foreground, #71717a);
985
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
978
986
  padding: 8px 0;
979
987
  }
980
988
 
@@ -983,7 +991,7 @@
983
991
  position: sticky;
984
992
  top: -10px;
985
993
  z-index: 1;
986
- background: var(--ap-card, #fff);
994
+ background: var(--ap-card, oklch(1 0 0));
987
995
  margin: -10px -8px 10px;
988
996
  }
989
997
 
@@ -991,16 +999,16 @@
991
999
  width: 100%;
992
1000
  padding: 8px 10px;
993
1001
  border: none;
994
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
1002
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
995
1003
  font-size: var(--ap-font-size-sm, 0.875rem);
996
- color: var(--ap-foreground, #09090b);
1004
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
997
1005
  background: transparent;
998
1006
  outline: none;
999
1007
  font-family: var(--ap-font-family, system-ui, sans-serif);
1000
1008
  }
1001
1009
 
1002
1010
  .tag-search::placeholder {
1003
- color: var(--ap-muted-foreground, #71717a);
1011
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1004
1012
  }
1005
1013
 
1006
1014
  .search-clear {
@@ -1012,10 +1020,10 @@
1012
1020
  max-height: none;
1013
1021
  overflow-y: visible;
1014
1022
  }
1015
- `];Oe([c.property({type:Array})],ae.prototype,"tags",2);Oe([c.property({type:Array})],ae.prototype,"selected",2);Oe([c.property()],ae.prototype,"filterKey",2);Oe([c.query(".tag-search")],ae.prototype,"_searchInput",2);Oe([c.state()],ae.prototype,"_search",2);ae=Oe([c.customElement("ap-filter-tags")],ae);var Bi=Object.defineProperty,Vi=Object.getOwnPropertyDescriptor,He=(t,e,s,a)=>{for(var i=a>1?void 0:a?Vi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Bi(e,s,i),i};let ve=class extends o.LitElement{constructor(){super(...arguments),this.labels=[],this.selected=[],this._search=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;return(t=this._searchInput)==null?void 0:t.focus()})}get _atLimit(){return this.selected.length>=vt}get _isSearching(){return this._search.trim().length>0}_toggle(t){const e=this.selected.includes(t);if(!e&&this._atLimit)return;const s=e?this.selected.filter(a=>a!==t):[...this.selected,t];this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.LABELS,values:s,operator:b.IS},bubbles:!0,composed:!0}))}_remove(t){const e=this.selected.filter(s=>s!==t);this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.LABELS,values:e,operator:b.IS},bubbles:!0,composed:!0}))}_clearAll(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.LABELS,values:[],operator:b.IS},bubbles:!0,composed:!0}))}_onSearchInput(t){this._search=t.target.value}_clearSearch(){this._search=""}_getLabelBySid(t){return this.labels.find(e=>e.sid===t)}_renderLabelItem(t){const e=this.selected.includes(t.sid),s=!e&&this._atLimit;return o.html`
1023
+ `];Oe([c.property({type:Array})],ae.prototype,"tags",2);Oe([c.property({type:Array})],ae.prototype,"selected",2);Oe([c.property()],ae.prototype,"filterKey",2);Oe([c.query(".tag-search")],ae.prototype,"_searchInput",2);Oe([c.state()],ae.prototype,"_search",2);ae=Oe([c.customElement("ap-filter-tags")],ae);var Qi=Object.defineProperty,Zi=Object.getOwnPropertyDescriptor,qe=(t,e,s,a)=>{for(var i=a>1?void 0:a?Zi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Qi(e,s,i),i};let me=class extends o.LitElement{constructor(){super(...arguments),this.labels=[],this.selected=[],this._search=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;return(t=this._searchInput)==null?void 0:t.focus()})}get _atLimit(){return this.selected.length>=ft}get _isSearching(){return this._search.trim().length>0}_toggle(t){const e=this.selected.includes(t);if(!e&&this._atLimit)return;const s=e?this.selected.filter(a=>a!==t):[...this.selected,t];this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.LABELS,values:s,operator:_.IS},bubbles:!0,composed:!0}))}_remove(t){const e=this.selected.filter(s=>s!==t);this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.LABELS,values:e,operator:_.IS},bubbles:!0,composed:!0}))}_clearAll(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.LABELS,values:[],operator:_.IS},bubbles:!0,composed:!0}))}_onSearchInput(t){this._search=t.target.value}_clearSearch(){this._search=""}_getLabelBySid(t){return this.labels.find(e=>e.sid===t)}_renderLabelItem(t){const e=this.selected.includes(t.sid),s=!e&&this._atLimit;return o.html`
1016
1024
  <div
1017
1025
  class="label-item ${s?"disabled":""}"
1018
- title=${s?`You can select up to ${vt} labels`:o.nothing}
1026
+ title=${s?`You can select up to ${ft} labels`:o.nothing}
1019
1027
  @click=${()=>!s&&this._toggle(t.sid)}
1020
1028
  >
1021
1029
  <ap-checkbox ?checked=${e}></ap-checkbox>
@@ -1081,15 +1089,15 @@
1081
1089
  ${this._atLimit?o.html`
1082
1090
  <div class="info-alert">
1083
1091
  <ap-icon name="info" .size=${14}></ap-icon>
1084
- <span>You can select up to ${vt} labels.</span>
1092
+ <span>You can select up to ${ft} labels.</span>
1085
1093
  </div>
1086
1094
  `:o.nothing}
1087
1095
  </div>
1088
- `}};ve.styles=[te,o.css`
1096
+ `}};me.styles=[te,o.css`
1089
1097
  .label-item {
1090
1098
  display: flex;
1091
1099
  align-items: center;
1092
- gap: 8px;
1100
+ gap: 12px;
1093
1101
  padding: 6px 8px;
1094
1102
  border-radius: var(--ap-radius-sm, 6px);
1095
1103
  cursor: pointer;
@@ -1097,7 +1105,7 @@
1097
1105
  }
1098
1106
 
1099
1107
  .label-item:hover:not(.disabled) {
1100
- background: var(--ap-muted, #f4f4f5);
1108
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
1101
1109
  }
1102
1110
 
1103
1111
  .label-item.disabled {
@@ -1116,7 +1124,7 @@
1116
1124
 
1117
1125
  .label-name {
1118
1126
  font-size: var(--ap-font-size-sm, 0.875rem);
1119
- color: var(--ap-foreground, #09090b);
1127
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
1120
1128
  flex: 1;
1121
1129
  min-width: 0;
1122
1130
  overflow: hidden;
@@ -1126,7 +1134,7 @@
1126
1134
 
1127
1135
  .count {
1128
1136
  font-size: 0.75rem;
1129
- color: var(--ap-muted-foreground, #71717a);
1137
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1130
1138
  flex-shrink: 0;
1131
1139
  }
1132
1140
 
@@ -1134,9 +1142,9 @@
1134
1142
  flex-shrink: 0;
1135
1143
  line-height: 0;
1136
1144
  }
1137
- `];He([c.property({type:Array})],ve.prototype,"labels",2);He([c.property({type:Array})],ve.prototype,"selected",2);He([c.query(".search-input")],ve.prototype,"_searchInput",2);He([c.state()],ve.prototype,"_search",2);ve=He([c.customElement("ap-filter-labels")],ve);var qi=Object.defineProperty,Ui=Object.getOwnPropertyDescriptor,Le=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ui(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&qi(e,s,i),i};const Ct=3,Et=/^#[0-9A-Fa-f]{6}$/;function Hi(t){const e=t.trim().split(/\s+/);return e.length<1||!Et.test(e[0])?null:{hex:e[0],tolerance:e[1]||Je,coverage:e[3]||Ze}}let re=class extends o.LitElement{constructor(){super(...arguments),this.values=[],this._colors=[],this._advanced=!1,this._showPalette=!1,this._initialized=!1}get _hasSelection(){return this._colors.length>0}get _selectedHexes(){return new Set(this._colors.map(t=>t.hex))}willUpdate(t){if(t.has("values")){const e=[];for(const s of this.values){const a=Hi(s);a&&e.push(a)}(!this._initialized||this.values.length===0&&this._colors.length>0)&&(this._colors=e,e.length>0&&(this._advanced=e.some(s=>s.tolerance!==Je||s.coverage!==Ze)),this._initialized=!0)}}_selectColor(t){if(!Et.test(t))return;const e=this._colors.findIndex(s=>s.hex.toLowerCase()===t.toLowerCase());if(e>=0){this._removeColor(e);return}this._colors.length>=Ct||(this._colors=[...this._colors,{hex:t,tolerance:Je,coverage:Ze}],this._showPalette=!1,this._dispatchChange())}_removeColor(t){this._colors=this._colors.filter((e,s)=>s!==t),this._dispatchChange()}_clearAll(){this._colors=[],this._showPalette=!1,this._dispatchChange()}_toggleAdvanced(){this._advanced=!this._advanced,this._colors.length>0&&this._dispatchChange()}_handleHexInput(t,e){let a=e.target.value.trim();if(a.startsWith("#")||(a="#"+a),!Et.test(a)||this._colors.some((n,l)=>l!==t&&n.hex.toLowerCase()===a.toLowerCase()))return;const r=[...this._colors];r[t]={...r[t],hex:a},this._colors=r,this._dispatchChange()}_handleToleranceChange(t,e){const s=[...this._colors];s[t]={...s[t],tolerance:e.detail.value},this._colors=s,this._dispatchChange()}_handleCoverageInput(t,e){const s=e.target.value,a=parseInt(s,10);if(!isNaN(a)&&a>=1&&a<=100){const i=[...this._colors];i[t]={...i[t],coverage:String(a)},this._colors=i,this._dispatchChange()}}_showAddPalette(){this._showPalette=!0}_dispatchChange(){if(this._colors.length===0){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:"color",values:"",operator:":"},bubbles:!0,composed:!0}));return}const t=this._colors.map(e=>{const s=this._advanced?e.tolerance:Je,a=this._advanced?e.coverage:Ze;return`${e.hex} ${s} ${s} ${a}`});this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:"color",values:t,operator:":"},bubbles:!0,composed:!0}))}_renderPalette(){const t=this._selectedHexes,e=this._colors.length>=Ct;return o.html`
1145
+ `];qe([c.property({type:Array})],me.prototype,"labels",2);qe([c.property({type:Array})],me.prototype,"selected",2);qe([c.query(".search-input")],me.prototype,"_searchInput",2);qe([c.state()],me.prototype,"_search",2);me=qe([c.customElement("ap-filter-labels")],me);var Ji=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,Me=(t,e,s,a)=>{for(var i=a>1?void 0:a?ea(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ji(e,s,i),i};const wt=3,Ct=/^#[0-9A-Fa-f]{6}$/;function ta(t){const e=t.trim().split(/\s+/);return e.length<1||!Ct.test(e[0])?null:{hex:e[0],tolerance:e[1]||Ze,coverage:e[3]||Qe}}let re=class extends o.LitElement{constructor(){super(...arguments),this.values=[],this._colors=[],this._advanced=!1,this._showPalette=!1,this._initialized=!1}get _hasSelection(){return this._colors.length>0}get _selectedHexes(){return new Set(this._colors.map(t=>t.hex))}willUpdate(t){if(t.has("values")){const e=[];for(const s of this.values){const a=ta(s);a&&e.push(a)}(!this._initialized||this.values.length===0&&this._colors.length>0)&&(this._colors=e,e.length>0&&(this._advanced=e.some(s=>s.tolerance!==Ze||s.coverage!==Qe)),this._initialized=!0)}}_selectColor(t){if(!Ct.test(t))return;const e=this._colors.findIndex(s=>s.hex.toLowerCase()===t.toLowerCase());if(e>=0){this._removeColor(e);return}this._colors.length>=wt||(this._colors=[...this._colors,{hex:t,tolerance:Ze,coverage:Qe}],this._showPalette=!1,this._dispatchChange())}_removeColor(t){this._colors=this._colors.filter((e,s)=>s!==t),this._dispatchChange()}_clearAll(){this._colors=[],this._showPalette=!1,this._dispatchChange()}_toggleAdvanced(){this._advanced=!this._advanced,this._colors.length>0&&this._dispatchChange()}_handleHexInput(t,e){let a=e.target.value.trim();if(a.startsWith("#")||(a="#"+a),!Ct.test(a)||this._colors.some((n,l)=>l!==t&&n.hex.toLowerCase()===a.toLowerCase()))return;const r=[...this._colors];r[t]={...r[t],hex:a},this._colors=r,this._dispatchChange()}_handleToleranceChange(t,e){const s=[...this._colors];s[t]={...s[t],tolerance:e.detail.value},this._colors=s,this._dispatchChange()}_handleCoverageInput(t,e){const s=e.target.value,a=parseInt(s,10);if(!isNaN(a)&&a>=1&&a<=100){const i=[...this._colors];i[t]={...i[t],coverage:String(a)},this._colors=i,this._dispatchChange()}}_showAddPalette(){this._showPalette=!0}_dispatchChange(){if(this._colors.length===0){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:"color",values:"",operator:":"},bubbles:!0,composed:!0}));return}const t=this._colors.map(e=>{const s=this._advanced?e.tolerance:Ze,a=this._advanced?e.coverage:Qe;return`${e.hex} ${s} ${s} ${a}`});this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:"color",values:t,operator:":"},bubbles:!0,composed:!0}))}_renderPalette(){const t=this._selectedHexes,e=this._colors.length>=wt;return o.html`
1138
1146
  <div class="palette">
1139
- ${Vs.map(s=>{const a=t.has(s),i=e&&!a;return o.html`
1147
+ ${Zs.map(s=>{const a=t.has(s),i=e&&!a;return o.html`
1140
1148
  <button
1141
1149
  class="swatch ${a?"selected":""} ${i?"disabled":""}"
1142
1150
  style="background:${s};${s==="#ffffff"?" border: 1px solid #e4e4e7;":""}"
@@ -1165,7 +1173,7 @@
1165
1173
  <span class="adv-field-label">Difference</span>
1166
1174
  <ap-dropdown
1167
1175
  .value=${t.tolerance}
1168
- .options=${qs}
1176
+ .options=${Js}
1169
1177
  @ap-change=${s=>this._handleToleranceChange(e,s)}
1170
1178
  ></ap-dropdown>
1171
1179
  </div>
@@ -1201,7 +1209,7 @@
1201
1209
  <ap-icon name="close" .size=${14}></ap-icon>
1202
1210
  </button>
1203
1211
  </div>
1204
- `}render(){const t=this._colors.length===0||this._showPalette,e=this._colors.length<Ct&&!this._showPalette;return o.html`
1212
+ `}render(){const t=this._colors.length===0||this._showPalette,e=this._colors.length<wt&&!this._showPalette;return o.html`
1205
1213
  <div class="filter-content">
1206
1214
  <button
1207
1215
  class="clear-btn"
@@ -1270,8 +1278,8 @@
1270
1278
  }
1271
1279
 
1272
1280
  .swatch.selected {
1273
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
1274
- box-shadow: 0 0 0 2px var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
1281
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
1282
+ box-shadow: 0 0 0 2px var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
1275
1283
  }
1276
1284
 
1277
1285
  .swatch.disabled {
@@ -1295,7 +1303,7 @@
1295
1303
  align-items: center;
1296
1304
  gap: 8px;
1297
1305
  font-size: var(--ap-font-size-sm, 0.875rem);
1298
- color: var(--ap-foreground, #09090b);
1306
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
1299
1307
  cursor: pointer;
1300
1308
  user-select: none;
1301
1309
  }
@@ -1305,13 +1313,13 @@
1305
1313
  width: 32px;
1306
1314
  height: 18px;
1307
1315
  border-radius: 9px;
1308
- background: var(--ap-border, #d4d4d8);
1316
+ background: var(--ap-border, oklch(92.86% 0.009 247.92));
1309
1317
  transition: background 150ms;
1310
1318
  flex-shrink: 0;
1311
1319
  }
1312
1320
 
1313
1321
  .toggle-track.on {
1314
- background: var(--ap-primary, oklch(0.65 0.19 258));
1322
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
1315
1323
  }
1316
1324
 
1317
1325
  .toggle-thumb {
@@ -1348,25 +1356,25 @@
1348
1356
  width: 36px;
1349
1357
  height: 36px;
1350
1358
  border-radius: var(--ap-radius-sm, 6px);
1351
- border: 1px solid var(--ap-border, #e4e4e7);
1359
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
1352
1360
  flex-shrink: 0;
1353
1361
  }
1354
1362
 
1355
1363
  .color-hex-input {
1356
1364
  height: 36px;
1357
1365
  padding: 0 8px;
1358
- border: 1px solid var(--ap-border, #e4e4e7);
1366
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
1359
1367
  border-radius: var(--ap-radius-sm, 6px);
1360
1368
  font-size: var(--ap-font-size-sm, 0.875rem);
1361
- color: var(--ap-foreground, #09090b);
1369
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
1362
1370
  font-family: var(--ap-font-family, system-ui, sans-serif);
1363
- background: var(--ap-background, #fff);
1371
+ background: var(--ap-background, oklch(1 0 0));
1364
1372
  min-width: 0;
1365
1373
  }
1366
1374
 
1367
1375
  .color-hex-input:focus {
1368
1376
  outline: none;
1369
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
1377
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
1370
1378
  }
1371
1379
 
1372
1380
  /* Normal mode: hex input takes remaining space */
@@ -1382,7 +1390,7 @@
1382
1390
  height: 20px;
1383
1391
  border: none;
1384
1392
  background: none;
1385
- color: var(--ap-muted-foreground, #71717a);
1393
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1386
1394
  cursor: pointer;
1387
1395
  padding: 0;
1388
1396
  flex-shrink: 0;
@@ -1390,8 +1398,8 @@
1390
1398
  }
1391
1399
 
1392
1400
  .remove-btn:hover {
1393
- color: var(--ap-destructive, #ef4444);
1394
- background: var(--ap-muted, #f4f4f5);
1401
+ color: var(--ap-destructive, oklch(0.577 0.215 27.325));
1402
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
1395
1403
  }
1396
1404
 
1397
1405
  /* ── Advanced layout: full-width grid ── */
@@ -1411,7 +1419,7 @@
1411
1419
 
1412
1420
  .adv-field-label {
1413
1421
  font-size: 0.6875rem;
1414
- color: var(--ap-muted-foreground, #71717a);
1422
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1415
1423
  line-height: 1;
1416
1424
  }
1417
1425
 
@@ -1419,19 +1427,19 @@
1419
1427
  display: flex;
1420
1428
  align-items: center;
1421
1429
  height: 36px;
1422
- border: 1px solid var(--ap-border, #e4e4e7);
1430
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
1423
1431
  border-radius: var(--ap-radius-sm, 6px);
1424
- background: var(--ap-background, #fff);
1432
+ background: var(--ap-background, oklch(1 0 0));
1425
1433
  overflow: hidden;
1426
1434
  }
1427
1435
 
1428
1436
  .coverage-wrap:focus-within {
1429
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
1437
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
1430
1438
  }
1431
1439
 
1432
1440
  .coverage-unit {
1433
1441
  font-size: var(--ap-font-size-sm, 0.875rem);
1434
- color: var(--ap-muted-foreground, #71717a);
1442
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1435
1443
  padding-left: 8px;
1436
1444
  flex-shrink: 0;
1437
1445
  line-height: 36px;
@@ -1444,7 +1452,7 @@
1444
1452
  padding: 0 6px 0 2px;
1445
1453
  border: none;
1446
1454
  font-size: var(--ap-font-size-sm, 0.875rem);
1447
- color: var(--ap-foreground, #09090b);
1455
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
1448
1456
  font-family: var(--ap-font-family, system-ui, sans-serif);
1449
1457
  background: transparent;
1450
1458
  outline: none;
@@ -1466,21 +1474,21 @@
1466
1474
  align-items: center;
1467
1475
  gap: 4px;
1468
1476
  padding: 6px 12px;
1469
- border: 1px dashed var(--ap-border, #e4e4e7);
1477
+ border: 1px dashed var(--ap-border, oklch(92.86% 0.009 247.92));
1470
1478
  border-radius: var(--ap-radius-sm, 6px);
1471
1479
  background: none;
1472
1480
  font-size: var(--ap-font-size-sm, 0.875rem);
1473
1481
  font-family: inherit;
1474
- color: var(--ap-muted-foreground, #71717a);
1482
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1475
1483
  cursor: pointer;
1476
1484
  transition: border-color 150ms, color 150ms;
1477
1485
  }
1478
1486
 
1479
1487
  .add-color-btn:hover {
1480
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
1481
- color: var(--ap-primary, oklch(0.65 0.19 258));
1488
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
1489
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
1482
1490
  }
1483
- `];Le([c.property({type:Array})],re.prototype,"values",2);Le([c.state()],re.prototype,"_colors",2);Le([c.state()],re.prototype,"_advanced",2);Le([c.state()],re.prototype,"_showPalette",2);Le([c.state()],re.prototype,"_initialized",2);re=Le([c.customElement("ap-filter-color")],re);var Ki=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,$e=(t,e,s,a)=>{for(var i=a>1?void 0:a?Gi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ki(e,s,i),i};const Yi={KB:1/1e3,MB:1,GB:1e3},Xi=[{value:"MB",label:"MB"},{value:"GB",label:"GB"}];let Q=class extends o.LitElement{constructor(){super(...arguments),this.min=0,this.max=0,this._minVal="",this._maxVal="",this._unit="MB",this._initialized=!1}willUpdate(t){!this._initialized&&(t.has("min")||t.has("max"))&&(this._initialized=!0,this.min>0&&(this._minVal=String(this.min)),this.max>0&&(this._maxVal=String(this.max)))}get _hasFilter(){return this._minVal!==""||this._maxVal!==""}_clearAll(){this._minVal="",this._maxVal="",this._emitChange()}_setUnit(t){this._unit=t.detail.value,this._emitChange()}_emitChange(){const t=Yi[this._unit],e=this._minVal!==""?parseFloat((parseFloat(this._minVal)*t).toFixed(2)).toString():null,s=this._maxVal!==""?parseFloat((parseFloat(this._maxVal)*t).toFixed(2)).toString():null;let a;if(e!==null&&s!==null)a=`${e}..${s}`;else if(e!==null)a=`${e}..`;else if(s!==null)a=`..${s}`;else{this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.SIZE,values:[],operator:b.RANGE},bubbles:!0,composed:!0}));return}this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.SIZE,values:[a],operator:b.RANGE},bubbles:!0,composed:!0}))}_onMinInput(t){this._minVal=t.target.value,this._emitChange()}_onMaxInput(t){this._maxVal=t.target.value,this._emitChange()}render(){return o.html`
1491
+ `];Me([c.property({type:Array})],re.prototype,"values",2);Me([c.state()],re.prototype,"_colors",2);Me([c.state()],re.prototype,"_advanced",2);Me([c.state()],re.prototype,"_showPalette",2);Me([c.state()],re.prototype,"_initialized",2);re=Me([c.customElement("ap-filter-color")],re);var sa=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,ye=(t,e,s,a)=>{for(var i=a>1?void 0:a?ia(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&sa(e,s,i),i};const aa={KB:1/1e3,MB:1,GB:1e3},ra=[{value:"MB",label:"MB"},{value:"GB",label:"GB"}];let Q=class extends o.LitElement{constructor(){super(...arguments),this.min=0,this.max=0,this._minVal="",this._maxVal="",this._unit="MB",this._initialized=!1}willUpdate(t){!this._initialized&&(t.has("min")||t.has("max"))&&(this._initialized=!0,this.min>0&&(this._minVal=String(this.min)),this.max>0&&(this._maxVal=String(this.max)))}get _hasFilter(){return this._minVal!==""||this._maxVal!==""}_clearAll(){this._minVal="",this._maxVal="",this._emitChange()}_setUnit(t){this._unit=t.detail.value,this._emitChange()}_emitChange(){const t=aa[this._unit],e=this._minVal!==""?parseFloat((parseFloat(this._minVal)*t).toFixed(2)).toString():null,s=this._maxVal!==""?parseFloat((parseFloat(this._maxVal)*t).toFixed(2)).toString():null;let a;if(e!==null&&s!==null)a=`${e}..${s}`;else if(e!==null)a=`${e}..`;else if(s!==null)a=`..${s}`;else{this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.SIZE,values:[],operator:_.RANGE},bubbles:!0,composed:!0}));return}this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.SIZE,values:[a],operator:_.RANGE},bubbles:!0,composed:!0}))}_onMinInput(t){this._minVal=t.target.value,this._emitChange()}_onMaxInput(t){this._maxVal=t.target.value,this._emitChange()}render(){return o.html`
1484
1492
  <div class="filter-content">
1485
1493
  <span class="section-label">Size</span>
1486
1494
  <button
@@ -1517,7 +1525,7 @@
1517
1525
  <div>
1518
1526
  <span class="input-label">Unit</span>
1519
1527
  <ap-dropdown
1520
- .options=${Xi}
1528
+ .options=${ra}
1521
1529
  .value=${this._unit}
1522
1530
  @ap-change=${this._setUnit}
1523
1531
  ></ap-dropdown>
@@ -1536,22 +1544,26 @@
1536
1544
  }
1537
1545
  .size-grid {
1538
1546
  display: grid;
1539
- grid-template-columns: auto auto 1fr;
1547
+ grid-template-columns: 1fr 1fr auto;
1540
1548
  gap: 12px;
1541
1549
  }
1542
- `];$e([c.property({type:Number})],Q.prototype,"min",2);$e([c.property({type:Number})],Q.prototype,"max",2);$e([c.state()],Q.prototype,"_minVal",2);$e([c.state()],Q.prototype,"_maxVal",2);$e([c.state()],Q.prototype,"_unit",2);$e([c.state()],Q.prototype,"_initialized",2);Q=$e([c.customElement("ap-filter-size")],Q);var Wi=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,ht=(t,e,s,a)=>{for(var i=a>1?void 0:a?Qi(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Wi(e,s,i),i};const Zi=o.svg`
1550
+ .size-grid ap-dropdown {
1551
+ display: block;
1552
+ width: 100%;
1553
+ }
1554
+ `];ye([c.property({type:Number})],Q.prototype,"min",2);ye([c.property({type:Number})],Q.prototype,"max",2);ye([c.state()],Q.prototype,"_minVal",2);ye([c.state()],Q.prototype,"_maxVal",2);ye([c.state()],Q.prototype,"_unit",2);ye([c.state()],Q.prototype,"_initialized",2);Q=ye([c.customElement("ap-filter-size")],Q);var oa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,pt=(t,e,s,a)=>{for(var i=a>1?void 0:a?na(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&oa(e,s,i),i};const la=o.svg`
1543
1555
  <svg width="20" height="20" viewBox="0 0 12 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1544
1556
  <path d="M2.66666 1.9987C2.29847 1.9987 1.99999 2.29717 1.99999 2.66536L1.99999 13.332C1.99999 13.7002 2.29847 13.9987 2.66666 13.9987L9.33332 13.9987C9.70151 13.9987 9.99999 13.7002 9.99999 13.332L9.99999 2.66536C9.99999 2.29717 9.70151 1.9987 9.33332 1.9987L2.66666 1.9987ZM9.33332 0.665364C10.4379 0.665364 11.3333 1.56079 11.3333 2.66536L11.3333 13.332C11.3333 14.4366 10.4379 15.332 9.33332 15.332L2.66666 15.332C1.56209 15.332 0.666656 14.4366 0.666656 13.332L0.666656 2.66536C0.666656 1.56079 1.56209 0.665364 2.66666 0.665364L9.33332 0.665364Z" fill="#9747FF"/>
1545
1557
  <path d="M5.33332 4.65885C5.33332 4.29066 5.6318 3.99219 5.99999 3.99219C6.36818 3.99219 6.66666 4.29066 6.66666 4.65885L6.66666 4.66536C6.66666 5.03355 6.36818 5.33203 5.99999 5.33203C5.6318 5.33203 5.33332 5.03355 5.33332 4.66536L5.33332 4.65885Z" fill="#9747FF"/>
1546
1558
  <path d="M5.33332 11.3255C5.33332 10.9573 5.6318 10.6589 5.99999 10.6589C6.36818 10.6589 6.66666 10.9573 6.66666 11.3255L6.66666 11.332C6.66666 11.7002 6.36818 11.9987 5.99999 11.9987C5.6318 11.9987 5.33332 11.7002 5.33332 11.332L5.33332 11.3255Z" fill="#9747FF"/>
1547
1559
  </svg>
1548
- `,Ji=o.svg`
1560
+ `,ca=o.svg`
1549
1561
  <svg width="20" height="20" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
1550
1562
  <path d="M14 2.66797C14 2.29978 13.7015 2.0013 13.3333 2.0013H2.66666C2.29847 2.0013 1.99999 2.29978 1.99999 2.66797V9.33463C1.99999 9.70282 2.29847 10.0013 2.66666 10.0013H13.3333C13.7015 10.0013 14 9.70282 14 9.33463V2.66797ZM15.3333 9.33463C15.3333 10.4392 14.4379 11.3346 13.3333 11.3346H2.66666C1.56209 11.3346 0.666656 10.4392 0.666656 9.33463V2.66797C0.666656 1.5634 1.56209 0.667969 2.66666 0.667969H13.3333C14.4379 0.667969 15.3333 1.5634 15.3333 2.66797V9.33463Z" fill="#65A30D"/>
1551
1563
  <path d="M11.3398 5.33464C11.708 5.33464 12.0065 5.63311 12.0065 6.0013C12.0065 6.36949 11.708 6.66797 11.3398 6.66797H11.3333C10.9651 6.66797 10.6667 6.36949 10.6667 6.0013C10.6667 5.63311 10.9651 5.33464 11.3333 5.33464H11.3398Z" fill="#65A30D"/>
1552
1564
  <path d="M4.67317 5.33464C5.04136 5.33464 5.33983 5.63311 5.33983 6.0013C5.33983 6.36949 5.04136 6.66797 4.67317 6.66797H4.66666C4.29847 6.66797 3.99999 6.36949 3.99999 6.0013C3.99999 5.63311 4.29847 5.33464 4.66666 5.33464H4.67317Z" fill="#65A30D"/>
1553
1565
  </svg>
1554
- `,ea=o.svg`
1566
+ `,da=o.svg`
1555
1567
  <svg width="20" height="20" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
1556
1568
  <path d="M12.3333 2.33203C12.3333 1.96384 12.0349 1.66536 11.6667 1.66536H2.33334C1.96515 1.66536 1.66668 1.96384 1.66668 2.33203V11.6654C1.66668 12.0336 1.96515 12.332 2.33334 12.332H11.6667C12.0349 12.332 12.3333 12.0336 12.3333 11.6654V2.33203ZM13.6667 11.6654C13.6667 12.7699 12.7712 13.6654 11.6667 13.6654H2.33334C1.22877 13.6654 0.333344 12.7699 0.333344 11.6654V2.33203C0.333344 1.22746 1.22877 0.332031 2.33334 0.332031H11.6667C12.7712 0.332031 13.6667 1.22746 13.6667 2.33203V11.6654Z" fill="#6366F1"/>
1557
1569
  <path d="M9.67319 3.66536C10.0414 3.66536 10.3399 3.96384 10.3399 4.33203C10.3399 4.70022 10.0414 4.9987 9.67319 4.9987H9.66668C9.29849 4.9987 9.00001 4.70022 9.00001 4.33203C9.00001 3.96384 9.29849 3.66536 9.66668 3.66536H9.67319Z" fill="#6366F1"/>
@@ -1559,13 +1571,13 @@
1559
1571
  <path d="M4.33985 8.9987C4.70804 8.9987 5.00652 9.29718 5.00652 9.66537C5.00652 10.0336 4.70804 10.332 4.33985 10.332H4.33334C3.96515 10.332 3.66668 10.0336 3.66668 9.66537C3.66668 9.29718 3.96515 8.9987 4.33334 8.9987H4.33985Z" fill="#6366F1"/>
1560
1572
  <path d="M9.67319 8.9987C10.0414 8.9987 10.3399 9.29718 10.3399 9.66537C10.3399 10.0336 10.0414 10.332 9.67319 10.332H9.66668C9.29849 10.332 9.00001 10.0336 9.00001 9.66537C9.00001 9.29718 9.29849 8.9987 9.66668 8.9987H9.67319Z" fill="#6366F1"/>
1561
1573
  </svg>
1562
- `,ta=o.svg`
1574
+ `,pa=o.svg`
1563
1575
  <svg width="20" height="20" viewBox="0 0 16 8" fill="none" xmlns="http://www.w3.org/2000/svg">
1564
1576
  <path d="M14 2.33203C14 1.96384 13.7015 1.66536 13.3333 1.66536H2.66666C2.29847 1.66536 1.99999 1.96384 1.99999 2.33203V5.66536C1.99999 6.03355 2.29847 6.33203 2.66666 6.33203H13.3333C13.7015 6.33203 14 6.03355 14 5.66536V2.33203ZM15.3333 5.66536C15.3333 6.76993 14.4379 7.66536 13.3333 7.66536H2.66666C1.56209 7.66536 0.666656 6.76993 0.666656 5.66536V2.33203C0.666656 1.22746 1.56209 0.332031 2.66666 0.332031H13.3333C14.4379 0.332031 15.3333 1.22746 15.3333 2.33203V5.66536Z" fill="#4BA3AD"/>
1565
1577
  <path d="M11.3398 3.33203C11.708 3.33203 12.0065 3.63051 12.0065 3.9987C12.0065 4.36689 11.708 4.66536 11.3398 4.66536H11.3333C10.9651 4.66536 10.6667 4.36689 10.6667 3.9987C10.6667 3.63051 10.9651 3.33203 11.3333 3.33203H11.3398Z" fill="#4BA3AD"/>
1566
1578
  <path d="M4.67317 3.33203C5.04136 3.33203 5.33983 3.63051 5.33983 3.9987C5.33983 4.36689 5.04136 4.66536 4.67317 4.66536H4.66666C4.29847 4.66536 3.99999 4.36689 3.99999 3.9987C3.99999 3.63051 4.29847 3.33203 4.66666 3.33203H4.67317Z" fill="#4BA3AD"/>
1567
1579
  </svg>
1568
- `,sa={portrait:Zi,landscape:Ji,square:ea,panorama:ta};let Ae=class extends o.LitElement{constructor(){super(...arguments),this.selectedResolution=[],this.selectedOrientation=[],this.selectedFaces=[]}get _hasSelection(){return this.selectedResolution.length>0||this.selectedOrientation.length>0||this.selectedFaces.length>0}_toggle(t,e){return t.includes(e)?t.filter(s=>s!==e):[...t,e]}_toggleResolution(t){this.selectedResolution=this._toggle(this.selectedResolution,t),this._dispatchChange()}_toggleOrientation(t){this.selectedOrientation=this._toggle(this.selectedOrientation,t),this._dispatchChange()}_toggleFaces(t){this.selectedFaces=this._toggle(this.selectedFaces,t),this._dispatchChange()}_clearAll(){this.selectedResolution=[],this.selectedOrientation=[],this.selectedFaces=[],this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:"image",values:{resolution:this.selectedResolution,orientation:this.selectedOrientation,faces:this.selectedFaces}},bubbles:!0,composed:!0}))}render(){return o.html`
1580
+ `,ha={portrait:la,landscape:ca,square:da,panorama:pa};let Ee=class extends o.LitElement{constructor(){super(...arguments),this.selectedResolution=[],this.selectedOrientation=[],this.selectedFaces=[]}get _hasSelection(){return this.selectedResolution.length>0||this.selectedOrientation.length>0||this.selectedFaces.length>0}_toggle(t,e){return t.includes(e)?t.filter(s=>s!==e):[...t,e]}_toggleResolution(t){this.selectedResolution=this._toggle(this.selectedResolution,t),this._dispatchChange()}_toggleOrientation(t){this.selectedOrientation=this._toggle(this.selectedOrientation,t),this._dispatchChange()}_toggleFaces(t){this.selectedFaces=this._toggle(this.selectedFaces,t),this._dispatchChange()}_clearAll(){this.selectedResolution=[],this.selectedOrientation=[],this.selectedFaces=[],this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:"image",values:{resolution:this.selectedResolution,orientation:this.selectedOrientation,faces:this.selectedFaces}},bubbles:!0,composed:!0}))}render(){return o.html`
1569
1581
  <div class="filter-content">
1570
1582
  <button
1571
1583
  class="clear-btn"
@@ -1576,7 +1588,7 @@
1576
1588
  <div class="filter-section">
1577
1589
  <span class="section-label">Resolution</span>
1578
1590
  <div class="options-horizontal">
1579
- ${Rs.map(t=>o.html`
1591
+ ${Ys.map(t=>o.html`
1580
1592
  <ap-checkbox
1581
1593
  ?checked=${this.selectedResolution.includes(t.value)}
1582
1594
  @ap-toggle=${()=>{this._toggleResolution(t.value)}}
@@ -1588,11 +1600,11 @@
1588
1600
  <div class="filter-section">
1589
1601
  <span class="section-label">Orientation</span>
1590
1602
  <div class="options-vertical">
1591
- ${Ns.map(t=>o.html`
1603
+ ${Xs.map(t=>o.html`
1592
1604
  <ap-checkbox
1593
1605
  ?checked=${this.selectedOrientation.includes(t.value)}
1594
1606
  @ap-toggle=${()=>{this._toggleOrientation(t.value)}}
1595
- ><span class="orientation-label">${sa[t.value]}${t.label}</span></ap-checkbox>
1607
+ ><span class="orientation-label">${ha[t.value]}${t.label}</span></ap-checkbox>
1596
1608
  `)}
1597
1609
  </div>
1598
1610
  </div>
@@ -1600,7 +1612,7 @@
1600
1612
  <div class="filter-section">
1601
1613
  <span class="section-label">Faces</span>
1602
1614
  <div class="options-horizontal">
1603
- ${js.map(t=>o.html`
1615
+ ${Ws.map(t=>o.html`
1604
1616
  <ap-checkbox
1605
1617
  ?checked=${this.selectedFaces.includes(t.value)}
1606
1618
  @ap-toggle=${()=>{this._toggleFaces(t.value)}}
@@ -1614,7 +1626,7 @@
1614
1626
  <span>Some images might not have been processed, so they won't be displayed.</span>
1615
1627
  </div>
1616
1628
  </div>
1617
- `}};Ae.styles=[te,o.css`
1629
+ `}};Ee.styles=[te,o.css`
1618
1630
  .options-horizontal {
1619
1631
  display: flex;
1620
1632
  gap: 28px;
@@ -1632,7 +1644,7 @@
1632
1644
  .orientation-label svg {
1633
1645
  flex-shrink: 0;
1634
1646
  }
1635
- `];ht([c.property({type:Array})],Ae.prototype,"selectedResolution",2);ht([c.property({type:Array})],Ae.prototype,"selectedOrientation",2);ht([c.property({type:Array})],Ae.prototype,"selectedFaces",2);Ae=ht([c.customElement("ap-filter-image")],Ae);var ia=Object.defineProperty,aa=Object.getOwnPropertyDescriptor,M=(t,e,s,a)=>{for(var i=a>1?void 0:a?aa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ia(e,s,i),i};function y(t){return`${dt[t.type]||""}${t.key}`}let E=class extends o.LitElement{constructor(){super(...arguments),this.fields=[],this.appliedFilters={},this.visibleFields=[],this.mode="full",this.activeFieldKey="",this.pinnedFields=[],this.appliedMetadata={},this._showFieldSelection=!1,this._fieldSearch="",this._collapsedFields=new Set,this._tagInputs={},this._tagSuggestions={},this._tagLoading={},this._datePresets={},this._dateFroms={},this._dateTos={},this._specificModeFields=new Set,this._selectSearches={},this._tagDebounceTimers={}}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>this._focusSearch())}disconnectedCallback(){super.disconnectedCallback();for(const t of Object.values(this._tagDebounceTimers))clearTimeout(t)}_focusSearch(){const t=this.renderRoot.querySelector(".field-search, .search-input");t==null||t.focus()}get _atFieldLimit(){return this.visibleFields.length>=ke}_getField(t){return this.fields.find(e=>y(e)===t)}_getUIType(t){return Gs[t.type]}_getApplied(t){return this.appliedMetadata[t]||this.appliedFilters[t]||{}}_isSpecialValue(t){return!t||t.length!==1?!1:t[0]===B||t[0]===V}_getContentMode(t){var s,a;const e=this._getApplied(t);return((s=e.values)==null?void 0:s[0])===B?B:((a=e.values)==null?void 0:a[0])===V?V:this._specificModeFields.has(t)||e.values&&e.values.length>0?he:""}_emitFilterChange(t,e,s){const a=y(t);this.dispatchEvent(new CustomEvent("metadata-filter-change",{detail:{fieldKey:a,operator:e,values:s,metadataType:t.type},bubbles:!0,composed:!0}))}_emitFieldToggle(t,e){const s=y(t);this.dispatchEvent(new CustomEvent("metadata-field-toggle",{detail:{fieldKey:s,visible:e},bubbles:!0,composed:!0}))}_emitFieldSelect(t){const e=y(t);!this.visibleFields.includes(e)&&this._atFieldLimit||(this.visibleFields.includes(e)||this._emitFieldToggle(t,!0),this.dispatchEvent(new CustomEvent("metadata-field-select",{detail:{fieldKey:e},bubbles:!0,composed:!0})))}_emitPin(t,e){this.dispatchEvent(new CustomEvent("metadata-pin",{detail:{fieldKey:t,pinned:e},bubbles:!0,composed:!0}))}_openFieldSelection(){this._showFieldSelection=!0,this._fieldSearch=""}_closeFieldSelection(){this._showFieldSelection=!1,this._fieldSearch=""}_addField(t){if(this._atFieldLimit)return;const e=y(t);this.visibleFields.includes(e)||this._emitFieldToggle(t,!0)}_removeField(t){this._emitFieldToggle(t,!1),this._emitFilterChange(t,void 0,[])}_toggleCollapse(t){const e=new Set(this._collapsedFields);e.has(t)?e.delete(t):e.add(t),this._collapsedFields=e}_onOperatorChange(t,e){const a=this._getApplied(y(t)).values||[];this._emitFilterChange(t,e,a)}_onContentModeChange(t,e){const s=y(t);if(e===he){const a=new Set(this._specificModeFields);a.add(s),this._specificModeFields=a;const i=this._getApplied(s);this._isSpecialValue(i.values)&&this._emitFilterChange(t,i.operator,[])}else{if(this._specificModeFields.has(s)){const a=new Set(this._specificModeFields);a.delete(s),this._specificModeFields=a}this._onEmptyOption(t,e)}}_clearFieldFilter(t){const e=y(t);if(this._specificModeFields.has(e)){const p=new Set(this._specificModeFields);p.delete(e),this._specificModeFields=p}const{[e]:s,...a}=this._datePresets;this._datePresets=a;const{[e]:i,...r}=this._dateFroms;this._dateFroms=r;const{[e]:n,...l}=this._dateTos;this._dateTos=l;const{[e]:d,...h}=this._selectSearches;this._selectSearches=h;const{[e]:u,...g}=this._tagInputs;this._tagInputs=g,this._emitFilterChange(t,void 0,[])}_onTextInput(t,e){const s=e.target.value,i=this._getApplied(y(t)).operator||_t[0].value;this._emitFilterChange(t,i,s?[s]:[])}_onNumberInput(t,e,s){const a=e.target.value,i=y(t),r=this._getApplied(i),n=r.operator||xt[0].value,l=[...r.values||[]];s===0?l[0]=a:l[1]=a;const d=l.filter(h=>h!==""&&h!==void 0);if(d.length>0){const h=t.type===x.DECIMAL2;if(!d.every(g=>h?!isNaN(parseFloat(g)):/^-?\d+$/.test(g)))return}this._emitFilterChange(t,n,l)}_onBooleanSelect(t,e){var i;const s=this._getApplied(y(t));((i=s.values)==null?void 0:i[0])===e?this._emitFilterChange(t,void 0,[]):this._emitFilterChange(t,s.operator,[e])}_onSelectOneToggle(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||X[0].value,r=a.values||[];r.length===1&&r[0]===e?this._emitFilterChange(t,i,[]):this._emitFilterChange(t,i,[e])}_onMultiSelectToggle(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||yt[0].value,r=a.values||[],n=r.includes(e)?r.filter(l=>l!==e):[...r,e];this._emitFilterChange(t,i,n)}_onTagKeydown(t,e){const s=y(t);(e.key==="Enter"||e.key===",")&&(e.preventDefault(),this._commitTagInput(t,s))}_onTagInput(t,e,s){const a=s.target.value;if(a.includes(",")){const i=a.replace(/,/g,"").trim();i&&(this._tagInputs={...this._tagInputs,[e]:i},this._commitTagInput(t,e));return}this._tagInputs={...this._tagInputs,[e]:a},this._fetchTagSuggestions(t,e,a.trim())}_selectTagSuggestion(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||X[0].value,r=a.values||[];r.includes(e)||this._emitFilterChange(t,i,[...r,e]),this._tagInputs={...this._tagInputs,[s]:""},this._tagSuggestions={...this._tagSuggestions,[s]:[]}}_fetchTagSuggestions(t,e,s){if(this._tagDebounceTimers[e]&&clearTimeout(this._tagDebounceTimers[e]),!s||!this.apiClient){this._tagSuggestions={...this._tagSuggestions,[e]:[]},this._tagLoading={...this._tagLoading,[e]:!1};return}this._tagDebounceTimers[e]=setTimeout(async()=>{this._tagLoading={...this._tagLoading,[e]:!0};try{const a=`_${t.ckey||t.key}`,i=await this.apiClient.request("/metadata/autocomplete",{q:s,meta_key:a});(this._tagInputs[e]||"").trim()===s&&(this._tagSuggestions={...this._tagSuggestions,[e]:(i.tags||[]).map(r=>r.tag)})}catch{this._tagSuggestions={...this._tagSuggestions,[e]:[]}}finally{this._tagLoading={...this._tagLoading,[e]:!1}}},300)}_commitTagInput(t,e){const s=(this._tagInputs[e]||"").trim();if(!s)return;const a=this._getApplied(e),i=a.operator||X[0].value,r=a.values||[];r.includes(s)||this._emitFilterChange(t,i,[...r,s]),this._tagInputs={...this._tagInputs,[e]:""},this._tagSuggestions={...this._tagSuggestions,[e]:[]}}_removeTag(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||X[0].value,r=a.values||[];this._emitFilterChange(t,i,r.filter(n=>n!==e))}_onTagOperatorChange(t,e){const s=y(t),i=this._getApplied(s).values||[];this._emitFilterChange(t,e,i)}_onDatePreset(t,e){const s=y(t);if(this._datePresets={...this._datePresets,[s]:e},["before","after","between"].includes(e)){this._dateFroms={...this._dateFroms,[s]:""},this._dateTos={...this._dateTos,[s]:""};return}if(e==="empty"||e==="non-empty"){this._emitFilterChange(t,void 0,[e]);return}const a=new Date;let i="",r="";switch(e){case"today":{const n=new Date(a);n.setHours(0,0,0,0),i=n.toISOString(),r=a.toISOString();break}case"last_week":{const n=new Date(a),l=n.getDay();n.setDate(n.getDate()-(l===0?6:l-1)),n.setHours(0,0,0,0);const d=new Date(n);d.setDate(d.getDate()-7),i=d.toISOString(),r=n.toISOString();break}case"last_month":{const n=new Date(a.getFullYear(),a.getMonth(),1),l=new Date(n);l.setMonth(l.getMonth()-1),i=l.toISOString(),r=n.toISOString();break}case"last_year":{const n=new Date(a.getFullYear(),0,1),l=new Date(n);l.setFullYear(l.getFullYear()-1),i=l.toISOString(),r=n.toISOString();break}}i&&r&&(this._dateFroms={...this._dateFroms,[s]:i},this._dateTos={...this._dateTos,[s]:r},this._emitFilterChange(t,"..",[i,r]))}_onDateInput(t,e,s){const a=s.target.value,i=y(t),r=this._datePresets[i]||"",n=a?new Date(a+"T00:00:00").toISOString():"";e==="from"?this._dateFroms={...this._dateFroms,[i]:n}:this._dateTos={...this._dateTos,[i]:n};let l=this._dateFroms[i]||"",d=this._dateTos[i]||"";r==="after"&&l&&(d=new Date().toISOString(),this._dateTos={...this._dateTos,[i]:d}),r==="before"&&d&&(l=new Date(0).toISOString(),this._dateFroms={...this._dateFroms,[i]:l}),l&&d&&this._emitFilterChange(t,"..",[l,d])}_onGeoLocationInput(t,e){var g;const s=e.target.value.trim(),a=y(t),i=(g=this.shadowRoot)==null?void 0:g.querySelector(`[data-geo-radius="${a}"]`),r=(i==null?void 0:i.value)||"";if(!s){this._emitFilterChange(t,void 0,[]);return}const n=s.split(",").map(p=>p.trim());if(n.length!==2||n.some(p=>isNaN(Number(p))||p===""))return;const[l,d]=n;let u=`${l},${d}..${r||"0"}`;this._emitFilterChange(t,b.IS,[u])}_onGeoRadiusInput(t,e){var d;const s=e.target.value,a=y(t),i=this._getApplied(a);if(!((d=i.values)!=null&&d[0]))return;const r=i.values[0],[n]=r.split("..");let l=n;s&&(l+=`..${s}`),this._emitFilterChange(t,b.IS,[l])}_onEmptyOption(t,e){var i;const s=this._getApplied(y(t));((i=s.values)==null?void 0:i[0])===e?this._emitFilterChange(t,s.operator,[]):this._emitFilterChange(t,s.operator,[e])}_renderFieldSelection(){const t=this._fieldSearch.toLowerCase(),e=this.fields.filter(r=>r.label.toLowerCase().includes(t)),s=e.filter(r=>!r.group||r.group==="root"),a=e.filter(r=>r.group==="product"),i=(r,n)=>n.length===0?o.nothing:o.html`
1647
+ `];pt([c.property({type:Array})],Ee.prototype,"selectedResolution",2);pt([c.property({type:Array})],Ee.prototype,"selectedOrientation",2);pt([c.property({type:Array})],Ee.prototype,"selectedFaces",2);Ee=pt([c.customElement("ap-filter-image")],Ee);var ua=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,M=(t,e,s,a)=>{for(var i=a>1?void 0:a?ga(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ua(e,s,i),i};function y(t){return`${ct[t.type]||""}${t.key}`}let E=class extends o.LitElement{constructor(){super(...arguments),this.fields=[],this.appliedFilters={},this.visibleFields=[],this.mode="full",this.activeFieldKey="",this.pinnedFields=[],this.appliedMetadata={},this._showFieldSelection=!1,this._fieldSearch="",this._collapsedFields=new Set,this._tagInputs={},this._tagSuggestions={},this._tagLoading={},this._datePresets={},this._dateFroms={},this._dateTos={},this._specificModeFields=new Set,this._selectSearches={},this._tagDebounceTimers={}}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>this._focusSearch())}disconnectedCallback(){super.disconnectedCallback();for(const t of Object.values(this._tagDebounceTimers))clearTimeout(t)}_focusSearch(){const t=this.renderRoot.querySelector(".field-search, .search-input");t==null||t.focus()}get _atFieldLimit(){return this.visibleFields.length>=Xe}_getField(t){return this.fields.find(e=>y(e)===t)}_getUIType(t){return ii[t.type]}_getApplied(t){return this.appliedMetadata[t]||this.appliedFilters[t]||{}}_isSpecialValue(t){return!t||t.length!==1?!1:t[0]===B||t[0]===U}_getContentMode(t){var s,a;const e=this._getApplied(t);return((s=e.values)==null?void 0:s[0])===B?B:((a=e.values)==null?void 0:a[0])===U?U:this._specificModeFields.has(t)||e.values&&e.values.length>0?he:""}_emitFilterChange(t,e,s){const a=y(t);this.dispatchEvent(new CustomEvent("metadata-filter-change",{detail:{fieldKey:a,operator:e,values:s,metadataType:t.type},bubbles:!0,composed:!0}))}_emitFieldToggle(t,e){const s=y(t);this.dispatchEvent(new CustomEvent("metadata-field-toggle",{detail:{fieldKey:s,visible:e},bubbles:!0,composed:!0}))}_emitFieldSelect(t){const e=y(t);!this.visibleFields.includes(e)&&this._atFieldLimit||(this.visibleFields.includes(e)||this._emitFieldToggle(t,!0),this.dispatchEvent(new CustomEvent("metadata-field-select",{detail:{fieldKey:e},bubbles:!0,composed:!0})))}_emitPin(t,e){this.dispatchEvent(new CustomEvent("metadata-pin",{detail:{fieldKey:t,pinned:e},bubbles:!0,composed:!0}))}_openFieldSelection(){this._showFieldSelection=!0,this._fieldSearch=""}_closeFieldSelection(){this._showFieldSelection=!1,this._fieldSearch=""}_addField(t){if(this._atFieldLimit)return;const e=y(t);this.visibleFields.includes(e)||this._emitFieldToggle(t,!0)}_removeField(t){this._emitFieldToggle(t,!1),this._emitFilterChange(t,void 0,[])}_toggleCollapse(t){const e=new Set(this._collapsedFields);e.has(t)?e.delete(t):e.add(t),this._collapsedFields=e}_onOperatorChange(t,e){const a=this._getApplied(y(t)).values||[];this._emitFilterChange(t,e,a)}_onContentModeChange(t,e){const s=y(t);if(e===he){const a=new Set(this._specificModeFields);a.add(s),this._specificModeFields=a;const i=this._getApplied(s);this._isSpecialValue(i.values)&&this._emitFilterChange(t,i.operator,[])}else{if(this._specificModeFields.has(s)){const a=new Set(this._specificModeFields);a.delete(s),this._specificModeFields=a}this._onEmptyOption(t,e)}}_clearFieldFilter(t){const e=y(t);if(this._specificModeFields.has(e)){const p=new Set(this._specificModeFields);p.delete(e),this._specificModeFields=p}const{[e]:s,...a}=this._datePresets;this._datePresets=a;const{[e]:i,...r}=this._dateFroms;this._dateFroms=r;const{[e]:n,...l}=this._dateTos;this._dateTos=l;const{[e]:d,...h}=this._selectSearches;this._selectSearches=h;const{[e]:u,...f}=this._tagInputs;this._tagInputs=f,this._emitFilterChange(t,void 0,[])}_onTextInput(t,e){const s=e.target.value,i=this._getApplied(y(t)).operator||vt[0].value;this._emitFilterChange(t,i,s?[s]:[])}_onNumberInput(t,e,s){const a=e.target.value,i=y(t),r=this._getApplied(i),n=r.operator||_t[0].value,l=[...r.values||[]];s===0?l[0]=a:l[1]=a;const d=l.filter(h=>h!==""&&h!==void 0);if(d.length>0){const h=t.type===x.DECIMAL2;if(!d.every(f=>h?!isNaN(parseFloat(f)):/^-?\d+$/.test(f)))return}this._emitFilterChange(t,n,l)}_onBooleanSelect(t,e){var i;const s=this._getApplied(y(t));((i=s.values)==null?void 0:i[0])===e?this._emitFilterChange(t,void 0,[]):this._emitFilterChange(t,s.operator,[e])}_onSelectOneToggle(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||X[0].value,r=a.values||[];r.length===1&&r[0]===e?this._emitFilterChange(t,i,[]):this._emitFilterChange(t,i,[e])}_onMultiSelectToggle(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||bt[0].value,r=a.values||[],n=r.includes(e)?r.filter(l=>l!==e):[...r,e];this._emitFilterChange(t,i,n)}_onTagKeydown(t,e){const s=y(t);(e.key==="Enter"||e.key===",")&&(e.preventDefault(),this._commitTagInput(t,s))}_onTagInput(t,e,s){const a=s.target.value;if(a.includes(",")){const i=a.replace(/,/g,"").trim();i&&(this._tagInputs={...this._tagInputs,[e]:i},this._commitTagInput(t,e));return}this._tagInputs={...this._tagInputs,[e]:a},this._fetchTagSuggestions(t,e,a.trim())}_selectTagSuggestion(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||X[0].value,r=a.values||[];r.includes(e)||this._emitFilterChange(t,i,[...r,e]),this._tagInputs={...this._tagInputs,[s]:""},this._tagSuggestions={...this._tagSuggestions,[s]:[]}}_fetchTagSuggestions(t,e,s){if(this._tagDebounceTimers[e]&&clearTimeout(this._tagDebounceTimers[e]),!s||!this.apiClient){this._tagSuggestions={...this._tagSuggestions,[e]:[]},this._tagLoading={...this._tagLoading,[e]:!1};return}this._tagDebounceTimers[e]=setTimeout(async()=>{this._tagLoading={...this._tagLoading,[e]:!0};try{const a=`_${t.ckey||t.key}`,i=await this.apiClient.request("/metadata/autocomplete",{q:s,meta_key:a});(this._tagInputs[e]||"").trim()===s&&(this._tagSuggestions={...this._tagSuggestions,[e]:(i.tags||[]).map(r=>r.tag)})}catch{this._tagSuggestions={...this._tagSuggestions,[e]:[]}}finally{this._tagLoading={...this._tagLoading,[e]:!1}}},300)}_commitTagInput(t,e){const s=(this._tagInputs[e]||"").trim();if(!s)return;const a=this._getApplied(e),i=a.operator||X[0].value,r=a.values||[];r.includes(s)||this._emitFilterChange(t,i,[...r,s]),this._tagInputs={...this._tagInputs,[e]:""},this._tagSuggestions={...this._tagSuggestions,[e]:[]}}_removeTag(t,e){const s=y(t),a=this._getApplied(s),i=a.operator||X[0].value,r=a.values||[];this._emitFilterChange(t,i,r.filter(n=>n!==e))}_onTagOperatorChange(t,e){const s=y(t),i=this._getApplied(s).values||[];this._emitFilterChange(t,e,i)}_onDatePreset(t,e){const s=y(t);if(this._datePresets={...this._datePresets,[s]:e},["before","after","between"].includes(e)){this._dateFroms={...this._dateFroms,[s]:""},this._dateTos={...this._dateTos,[s]:""};return}if(e==="empty"||e==="non-empty"){this._emitFilterChange(t,void 0,[e]);return}const a=new Date;let i="",r="";switch(e){case"today":{const n=new Date(a);n.setHours(0,0,0,0),i=n.toISOString(),r=a.toISOString();break}case"last_week":{const n=new Date(a),l=n.getDay();n.setDate(n.getDate()-(l===0?6:l-1)),n.setHours(0,0,0,0);const d=new Date(n);d.setDate(d.getDate()-7),i=d.toISOString(),r=n.toISOString();break}case"last_month":{const n=new Date(a.getFullYear(),a.getMonth(),1),l=new Date(n);l.setMonth(l.getMonth()-1),i=l.toISOString(),r=n.toISOString();break}case"last_year":{const n=new Date(a.getFullYear(),0,1),l=new Date(n);l.setFullYear(l.getFullYear()-1),i=l.toISOString(),r=n.toISOString();break}}i&&r&&(this._dateFroms={...this._dateFroms,[s]:i},this._dateTos={...this._dateTos,[s]:r},this._emitFilterChange(t,"..",[i,r]))}_onDateInput(t,e,s){const a=s.target.value,i=y(t),r=this._datePresets[i]||"",n=a?new Date(a+"T00:00:00").toISOString():"";e==="from"?this._dateFroms={...this._dateFroms,[i]:n}:this._dateTos={...this._dateTos,[i]:n};let l=this._dateFroms[i]||"",d=this._dateTos[i]||"";r==="after"&&l&&(d=new Date().toISOString(),this._dateTos={...this._dateTos,[i]:d}),r==="before"&&d&&(l=new Date(0).toISOString(),this._dateFroms={...this._dateFroms,[i]:l}),l&&d&&this._emitFilterChange(t,"..",[l,d])}_onGeoLocationInput(t,e){var f;const s=e.target.value.trim(),a=y(t),i=(f=this.shadowRoot)==null?void 0:f.querySelector(`[data-geo-radius="${a}"]`),r=(i==null?void 0:i.value)||"";if(!s){this._emitFilterChange(t,void 0,[]);return}const n=s.split(",").map(p=>p.trim());if(n.length!==2||n.some(p=>isNaN(Number(p))||p===""))return;const[l,d]=n;let u=`${l},${d}..${r||"0"}`;this._emitFilterChange(t,_.IS,[u])}_onGeoRadiusInput(t,e){var d;const s=e.target.value,a=y(t),i=this._getApplied(a);if(!((d=i.values)!=null&&d[0]))return;const r=i.values[0],[n]=r.split("..");let l=n;s&&(l+=`..${s}`),this._emitFilterChange(t,_.IS,[l])}_onEmptyOption(t,e){var i;const s=this._getApplied(y(t));((i=s.values)==null?void 0:i[0])===e?this._emitFilterChange(t,s.operator,[]):this._emitFilterChange(t,s.operator,[e])}_renderFieldSelection(){const t=this._fieldSearch.toLowerCase(),e=this.fields.filter(r=>r.label.toLowerCase().includes(t)),s=e.filter(r=>!r.group||r.group==="root"),a=e.filter(r=>r.group==="product"),i=(r,n)=>n.length===0?o.nothing:o.html`
1636
1648
  <div class="field-group-label">${r}</div>
1637
1649
  ${n.map(l=>{const d=y(l),h=this.visibleFields.includes(d),u=!h&&this._atFieldLimit;return o.html`
1638
1650
  <div
@@ -1667,15 +1679,8 @@
1667
1679
  ${i("Product fields",a)}
1668
1680
  `}
1669
1681
  </div>
1670
- ${this.visibleFields.length>0?o.html`
1671
- <div
1672
- class="limit-note ${this._atFieldLimit?"at-limit":""}"
1673
- >
1674
- ${this.visibleFields.length} / ${ke} fields selected
1675
- </div>
1676
- `:o.nothing}
1677
1682
  </div>
1678
- `}_renderTextFilter(t){var h,u;const e=y(t),s=this._getApplied(e),i=this._isSpecialValue(s.values)?"":((h=s.values)==null?void 0:h[0])||"",r=this._getContentMode(e),n=r===B||r===V,l=s.operator||_t[0].value,d=t.type===x.TEXT_AREA;return o.html`
1683
+ `}_renderTextFilter(t){var h,u;const e=y(t),s=this._getApplied(e),i=this._isSpecialValue(s.values)?"":((h=s.values)==null?void 0:h[0])||"",r=this._getContentMode(e),n=r===B||r===U,l=s.operator||vt[0].value,d=t.type===x.TEXT_AREA;return o.html`
1679
1684
  <div class="filter-content" style="position: relative;">
1680
1685
  <button
1681
1686
  class="clear-btn"
@@ -1687,19 +1692,19 @@
1687
1692
  <span class="section-label">Operator</span>
1688
1693
  <ap-radio-group
1689
1694
  direction="horizontal"
1690
- .options=${_t}
1695
+ .options=${vt}
1691
1696
  .value=${l}
1692
1697
  ?disabled=${n}
1693
- @ap-change=${g=>this._onOperatorChange(t,g.detail.value)}
1698
+ @ap-change=${f=>this._onOperatorChange(t,f.detail.value)}
1694
1699
  ></ap-radio-group>
1695
1700
  </div>
1696
1701
 
1697
1702
  <div class="filter-section">
1698
1703
  <span class="section-label">Content</span>
1699
1704
  <ap-radio-group
1700
- .options=${$t}
1705
+ .options=${yt}
1701
1706
  .value=${r}
1702
- @ap-change=${g=>this._onContentModeChange(t,g.detail.value)}
1707
+ @ap-change=${f=>this._onContentModeChange(t,f.detail.value)}
1703
1708
  ></ap-radio-group>
1704
1709
  </div>
1705
1710
 
@@ -1711,7 +1716,7 @@
1711
1716
  class="filter-input"
1712
1717
  placeholder="Enter value..."
1713
1718
  .value=${i}
1714
- @change=${g=>this._onTextInput(t,g)}
1719
+ @change=${f=>this._onTextInput(t,f)}
1715
1720
  ></textarea>
1716
1721
  `:o.html`
1717
1722
  <input
@@ -1719,18 +1724,18 @@
1719
1724
  type="text"
1720
1725
  placeholder="Enter value..."
1721
1726
  .value=${i}
1722
- @change=${g=>this._onTextInput(t,g)}
1723
- @keydown=${g=>{g.key==="Enter"&&g.preventDefault()}}
1727
+ @change=${f=>this._onTextInput(t,f)}
1728
+ @keydown=${f=>{f.key==="Enter"&&f.preventDefault()}}
1724
1729
  />
1725
1730
  `}
1726
1731
  </div>
1727
1732
  `:o.nothing}
1728
1733
  </div>
1729
- `}_renderNumberFilter(t){var $,w,S;const e=y(t),s=this._getApplied(e),a=s.operator||xt[0].value,i=this._isSpecialValue(s.values),r=this._getContentMode(e),n=r===B||r===V,l=a===b.RANGE,d=a===b.GREATER_THAN_OR_EQUAL,h=a===b.LESS_THAN_OR_EQUAL,u=t.type===x.DECIMAL2,g=u?"0.01":"1",p=u?"0.00":"0",f=i?"":(($=s.values)==null?void 0:$[0])||"",v=i?"":((w=s.values)==null?void 0:w[1])||"",F=l||d||h,_=l||d||h?"Min":"Value";return o.html`
1734
+ `}_renderNumberFilter(t){var $,k,A;const e=y(t),s=this._getApplied(e),a=s.operator||_t[0].value,i=this._isSpecialValue(s.values),r=this._getContentMode(e),n=r===B||r===U,l=a===_.RANGE,d=a===_.GREATER_THAN_OR_EQUAL,h=a===_.LESS_THAN_OR_EQUAL,u=t.type===x.DECIMAL2,f=u?"0.01":"1",p=u?"0.00":"0",g=i?"":(($=s.values)==null?void 0:$[0])||"",v=i?"":((k=s.values)==null?void 0:k[1])||"",w=l||d||h,b=l||d||h?"Min":"Value";return o.html`
1730
1735
  <div class="filter-content" style="position: relative;">
1731
1736
  <button
1732
1737
  class="clear-btn"
1733
- ?disabled=${!((S=s.values)!=null&&S.length)&&!s.operator}
1738
+ ?disabled=${!((A=s.values)!=null&&A.length)&&!s.operator}
1734
1739
  @click=${()=>this._clearFieldFilter(t)}
1735
1740
  >Clear all</button>
1736
1741
 
@@ -1738,19 +1743,19 @@
1738
1743
  <span class="section-label">Condition</span>
1739
1744
  <ap-radio-group
1740
1745
  columns="2"
1741
- .options=${xt}
1746
+ .options=${_t}
1742
1747
  .value=${a}
1743
1748
  ?disabled=${n}
1744
- @ap-change=${A=>this._onOperatorChange(t,A.detail.value)}
1749
+ @ap-change=${T=>this._onOperatorChange(t,T.detail.value)}
1745
1750
  ></ap-radio-group>
1746
1751
  </div>
1747
1752
 
1748
1753
  <div class="filter-section">
1749
1754
  <span class="section-label">Content</span>
1750
1755
  <ap-radio-group
1751
- .options=${$t}
1756
+ .options=${yt}
1752
1757
  .value=${r}
1753
- @ap-change=${A=>this._onContentModeChange(t,A.detail.value)}
1758
+ @ap-change=${T=>this._onContentModeChange(t,T.detail.value)}
1754
1759
  ></ap-radio-group>
1755
1760
  </div>
1756
1761
 
@@ -1758,28 +1763,28 @@
1758
1763
  <div class="filter-section">
1759
1764
  <div class="grid-2">
1760
1765
  <div>
1761
- <span class="input-label" aria-disabled=${h?"true":o.nothing}>${_}</span>
1766
+ <span class="input-label" aria-disabled=${h?"true":o.nothing}>${b}</span>
1762
1767
  <input
1763
1768
  class="filter-input"
1764
1769
  type="number"
1765
- step=${g}
1770
+ step=${f}
1766
1771
  placeholder=${p}
1767
- .value=${f}
1772
+ .value=${g}
1768
1773
  ?disabled=${h}
1769
- @change=${A=>this._onNumberInput(t,A,0)}
1774
+ @change=${T=>this._onNumberInput(t,T,0)}
1770
1775
  />
1771
1776
  </div>
1772
- ${F?o.html`
1777
+ ${w?o.html`
1773
1778
  <div>
1774
1779
  <span class="input-label" aria-disabled=${d?"true":o.nothing}>${"Max"}</span>
1775
1780
  <input
1776
1781
  class="filter-input"
1777
1782
  type="number"
1778
- step=${g}
1783
+ step=${f}
1779
1784
  placeholder=${p}
1780
1785
  .value=${v}
1781
1786
  ?disabled=${d}
1782
- @change=${A=>this._onNumberInput(t,A,1)}
1787
+ @change=${T=>this._onNumberInput(t,T,1)}
1783
1788
  />
1784
1789
  </div>
1785
1790
  `:o.nothing}
@@ -1798,13 +1803,13 @@
1798
1803
  <div class="filter-section">
1799
1804
  <span class="section-label">Value</span>
1800
1805
  <ap-radio-group
1801
- .options=${Ks}
1806
+ .options=${si}
1802
1807
  .value=${s}
1803
1808
  @ap-change=${r=>this._onBooleanSelect(t,r.detail.value)}
1804
1809
  ></ap-radio-group>
1805
1810
  </div>
1806
1811
  </div>
1807
- `}_renderSelectOneFilter(t){const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=a?[]:s.values||[],r=t.possible_values||[],n=s.operator||X[0].value,l=(this._selectSearches[e]||"").toLowerCase(),d=l.length>0,h=i.length>0||a,u=l?r.filter(p=>p.label.toLowerCase().includes(l)):r,g=i.length>=ke;return o.html`
1812
+ `}_renderSelectOneFilter(t){const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=a?[]:s.values||[],r=t.possible_values||[],n=s.operator||X[0].value,l=(this._selectSearches[e]||"").toLowerCase(),d=l.length>0,h=i.length>0||a,u=l?r.filter(p=>p.label.toLowerCase().includes(l)):r,f=i.length>=Xe;return o.html`
1808
1813
  <div class="filter-content">
1809
1814
  <!-- Search input -->
1810
1815
  <div class="search-wrapper">
@@ -1854,9 +1859,9 @@
1854
1859
  ${i.length>0?o.html`
1855
1860
  <div class="filter-section">
1856
1861
  <div class="chips-wrap">
1857
- ${i.map(p=>{const f=r.find(v=>v.api_value===p);return o.html`
1862
+ ${i.map(p=>{const g=r.find(v=>v.api_value===p);return o.html`
1858
1863
  <div class="chip">
1859
- <span class="chip-label">${(f==null?void 0:f.label)||p}</span>
1864
+ <span class="chip-label">${(g==null?void 0:g.label)||p}</span>
1860
1865
  <button class="chip-remove" @click=${()=>this._onSelectOneToggle(t,p)}>
1861
1866
  <ap-icon name="close" .size=${10}></ap-icon>
1862
1867
  </button>
@@ -1873,12 +1878,12 @@
1873
1878
 
1874
1879
  <!-- Empty/Not empty checkboxes -->
1875
1880
  <div class="options-list short">
1876
- ${fe.map(p=>{var f;return o.html`
1881
+ ${ge.map(p=>{var g;return o.html`
1877
1882
  <div
1878
1883
  class="option-item"
1879
1884
  @click=${()=>this._onEmptyOption(t,p.value)}
1880
1885
  >
1881
- <ap-checkbox ?checked=${((f=s.values)==null?void 0:f[0])===p.value}></ap-checkbox>
1886
+ <ap-checkbox ?checked=${((g=s.values)==null?void 0:g[0])===p.value}></ap-checkbox>
1882
1887
  <span>${p.label}</span>
1883
1888
  </div>
1884
1889
  `})}
@@ -1888,19 +1893,19 @@
1888
1893
 
1889
1894
  <!-- Regular options -->
1890
1895
  <div class="options-list">
1891
- ${u.length===0?o.html`<div class="no-results">No options found</div>`:u.map(p=>{const f=i.includes(p.api_value),v=!f&&g;return o.html`
1896
+ ${u.length===0?o.html`<div class="no-results">No options found</div>`:u.map(p=>{const g=i.includes(p.api_value),v=!g&&f;return o.html`
1892
1897
  <div
1893
1898
  class="option-item ${v?"disabled":""}"
1894
1899
  @click=${()=>!v&&this._onSelectOneToggle(t,p.api_value)}
1895
1900
  >
1896
- <ap-checkbox ?checked=${f}></ap-checkbox>
1901
+ <ap-checkbox ?checked=${g}></ap-checkbox>
1897
1902
  <span>${p.label}</span>
1898
1903
  </div>
1899
1904
  `})}
1900
1905
  </div>
1901
1906
  </div>
1902
1907
  </div>
1903
- `}_renderMultiSelectFilter(t){const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=a?[]:s.values||[],r=t.possible_values||[],n=s.operator||yt[0].value,l=(this._selectSearches[e]||"").toLowerCase(),d=l.length>0,h=i.length>0||a,u=l?r.filter(p=>p.label.toLowerCase().includes(l)):r,g=i.length>=ke;return o.html`
1908
+ `}_renderMultiSelectFilter(t){const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=a?[]:s.values||[],r=t.possible_values||[],n=s.operator||bt[0].value,l=(this._selectSearches[e]||"").toLowerCase(),d=l.length>0,h=i.length>0||a,u=l?r.filter(p=>p.label.toLowerCase().includes(l)):r,f=i.length>=Xe;return o.html`
1904
1909
  <div class="filter-content">
1905
1910
  <!-- Search input -->
1906
1911
  <div class="search-wrapper">
@@ -1940,7 +1945,7 @@
1940
1945
  </div>
1941
1946
  <ap-radio-group
1942
1947
  direction="horizontal"
1943
- .options=${yt}
1948
+ .options=${bt}
1944
1949
  .value=${n}
1945
1950
  @ap-change=${p=>this._onOperatorChange(t,p.detail.value)}
1946
1951
  ></ap-radio-group>
@@ -1950,9 +1955,9 @@
1950
1955
  ${i.length>0?o.html`
1951
1956
  <div class="filter-section">
1952
1957
  <div class="chips-wrap">
1953
- ${i.map(p=>{const f=r.find(v=>v.api_value===p);return o.html`
1958
+ ${i.map(p=>{const g=r.find(v=>v.api_value===p);return o.html`
1954
1959
  <div class="chip">
1955
- <span class="chip-label">${(f==null?void 0:f.label)||p}</span>
1960
+ <span class="chip-label">${(g==null?void 0:g.label)||p}</span>
1956
1961
  <button class="chip-remove" @click=${()=>this._onMultiSelectToggle(t,p)}>
1957
1962
  <ap-icon name="close" .size=${10}></ap-icon>
1958
1963
  </button>
@@ -1969,12 +1974,12 @@
1969
1974
 
1970
1975
  <!-- Empty/Not empty checkboxes -->
1971
1976
  <div class="options-list short">
1972
- ${fe.map(p=>{var f;return o.html`
1977
+ ${ge.map(p=>{var g;return o.html`
1973
1978
  <div
1974
1979
  class="option-item"
1975
1980
  @click=${()=>this._onEmptyOption(t,p.value)}
1976
1981
  >
1977
- <ap-checkbox ?checked=${((f=s.values)==null?void 0:f[0])===p.value}></ap-checkbox>
1982
+ <ap-checkbox ?checked=${((g=s.values)==null?void 0:g[0])===p.value}></ap-checkbox>
1978
1983
  <span>${p.label}</span>
1979
1984
  </div>
1980
1985
  `})}
@@ -1984,19 +1989,19 @@
1984
1989
 
1985
1990
  <!-- Regular options -->
1986
1991
  <div class="options-list">
1987
- ${u.length===0?o.html`<div class="no-results">No options found</div>`:u.map(p=>{const f=i.includes(p.api_value),v=!f&&g;return o.html`
1992
+ ${u.length===0?o.html`<div class="no-results">No options found</div>`:u.map(p=>{const g=i.includes(p.api_value),v=!g&&f;return o.html`
1988
1993
  <div
1989
1994
  class="option-item ${v?"disabled":""}"
1990
1995
  @click=${()=>!v&&this._onMultiSelectToggle(t,p.api_value)}
1991
1996
  >
1992
- <ap-checkbox ?checked=${f}></ap-checkbox>
1997
+ <ap-checkbox ?checked=${g}></ap-checkbox>
1993
1998
  <span>${p.label}</span>
1994
1999
  </div>
1995
2000
  `})}
1996
2001
  </div>
1997
2002
  </div>
1998
2003
  </div>
1999
- `}_renderTagsFilter(t){const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=a?[]:s.values||[],r=this._tagInputs[e]||"",n=s.operator||X[0].value,l=i.length>0||a,d=this._tagSuggestions[e]||[],h=this._tagLoading[e]||!1,u=r.trim().length>0,g=i.length>=ke;return o.html`
2004
+ `}_renderTagsFilter(t){const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=a?[]:s.values||[],r=this._tagInputs[e]||"",n=s.operator||X[0].value,l=i.length>0||a,d=this._tagSuggestions[e]||[],h=this._tagLoading[e]||!1,u=r.trim().length>0,f=i.length>=Xe;return o.html`
2000
2005
  <div class="filter-content">
2001
2006
  <!-- Search input -->
2002
2007
  <div class="search-wrapper">
@@ -2064,12 +2069,12 @@
2064
2069
  <div class="filter-section">
2065
2070
  <span class="section-label">All options</span>
2066
2071
  <div class="options-list short">
2067
- ${fe.map(p=>{var f;return o.html`
2072
+ ${ge.map(p=>{var g;return o.html`
2068
2073
  <div
2069
2074
  class="option-item"
2070
2075
  @click=${()=>this._onEmptyOption(t,p.value)}
2071
2076
  >
2072
- <ap-checkbox ?checked=${((f=s.values)==null?void 0:f[0])===p.value}></ap-checkbox>
2077
+ <ap-checkbox ?checked=${((g=s.values)==null?void 0:g[0])===p.value}></ap-checkbox>
2073
2078
  <span>${p.label}</span>
2074
2079
  </div>
2075
2080
  `})}
@@ -2081,12 +2086,12 @@
2081
2086
  ${u?o.html`
2082
2087
  <div class="filter-section">
2083
2088
  <div class="options-list">
2084
- ${h?o.html`<div class="option-item disabled"><span>Loading...</span></div>`:d.length>0?d.map(p=>{const f=i.includes(p),v=!f&&g;return o.html`
2089
+ ${h?o.html`<div class="option-item disabled"><span>Loading...</span></div>`:d.length>0?d.map(p=>{const g=i.includes(p),v=!g&&f;return o.html`
2085
2090
  <div
2086
2091
  class="option-item ${v?"disabled":""}"
2087
- @click=${()=>!v&&(f?this._removeTag(t,p):this._selectTagSuggestion(t,p))}
2092
+ @click=${()=>!v&&(g?this._removeTag(t,p):this._selectTagSuggestion(t,p))}
2088
2093
  >
2089
- <ap-checkbox ?checked=${f}></ap-checkbox>
2094
+ <ap-checkbox ?checked=${g}></ap-checkbox>
2090
2095
  <span>${p}</span>
2091
2096
  </div>
2092
2097
  `}):o.html`<div class="option-item disabled"><span>No results</span></div>`}
@@ -2094,11 +2099,11 @@
2094
2099
  </div>
2095
2100
  `:o.nothing}
2096
2101
  </div>
2097
- `}_renderDateFilter(t){var u,g;const e=y(t),s=this._datePresets[e]||"",a=this._getApplied(e),r=this._isSpecialValue(a.values)?((u=a.values)==null?void 0:u[0])||"":s,n=[{value:"empty",label:"Empty"},{value:"non-empty",label:"Not empty"}],l=this._dateFroms[e]?new Date(this._dateFroms[e]).toISOString().split("T")[0]:"",d=this._dateTos[e]?new Date(this._dateTos[e]).toISOString().split("T")[0]:"",h=["before","after","between"].includes(r);return o.html`
2102
+ `}_renderDateFilter(t){var u,f;const e=y(t),s=this._datePresets[e]||"",a=this._getApplied(e),r=this._isSpecialValue(a.values)?((u=a.values)==null?void 0:u[0])||"":s,n=[{value:"empty",label:"Empty"},{value:"non-empty",label:"Not empty"}],l=this._dateFroms[e]?new Date(this._dateFroms[e]).toISOString().split("T")[0]:"",d=this._dateTos[e]?new Date(this._dateTos[e]).toISOString().split("T")[0]:"",h=["before","after","between"].includes(r);return o.html`
2098
2103
  <div class="filter-content" style="position: relative;">
2099
2104
  <button
2100
2105
  class="clear-btn"
2101
- ?disabled=${!r&&!((g=a.values)!=null&&g.length)}
2106
+ ?disabled=${!r&&!((f=a.values)!=null&&f.length)}
2102
2107
  @click=${()=>this._clearFieldFilter(t)}
2103
2108
  >Clear all</button>
2104
2109
 
@@ -2113,7 +2118,7 @@
2113
2118
 
2114
2119
  <ap-radio-group
2115
2120
  columns="2"
2116
- .options=${Ft}
2121
+ .options=${Et}
2117
2122
  .value=${r!=="empty"&&r!=="non-empty"?r:""}
2118
2123
  @ap-change=${p=>this._onDatePreset(t,p.detail.value)}
2119
2124
  ></ap-radio-group>
@@ -2166,18 +2171,18 @@
2166
2171
  </div>
2167
2172
  `:o.nothing}
2168
2173
  </div>
2169
- `}_renderGeoFilter(t){var u,g;const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=this._getContentMode(e);let r="",n="";if(!a&&((u=s.values)!=null&&u[0])){const p=s.values[0],[f,v]=p.split("..");r=f||"",n=v||""}const l=r.length>0,d=r.split(",").map(p=>p.trim()),h=!l||d.length===2&&d.every(p=>!isNaN(Number(p))&&p!=="");return o.html`
2174
+ `}_renderGeoFilter(t){var u,f;const e=y(t),s=this._getApplied(e),a=this._isSpecialValue(s.values),i=this._getContentMode(e);let r="",n="";if(!a&&((u=s.values)!=null&&u[0])){const p=s.values[0],[g,v]=p.split("..");r=g||"",n=v||""}const l=r.length>0,d=r.split(",").map(p=>p.trim()),h=!l||d.length===2&&d.every(p=>!isNaN(Number(p))&&p!=="");return o.html`
2170
2175
  <div class="filter-content" style="position: relative;">
2171
2176
  <button
2172
2177
  class="clear-btn"
2173
- ?disabled=${!((g=s.values)!=null&&g.length)}
2178
+ ?disabled=${!((f=s.values)!=null&&f.length)}
2174
2179
  @click=${()=>this._clearFieldFilter(t)}
2175
2180
  >Clear all</button>
2176
2181
 
2177
2182
  <div class="filter-section">
2178
2183
  <span class="section-label">Content</span>
2179
2184
  <ap-radio-group
2180
- .options=${$t}
2185
+ .options=${yt}
2181
2186
  .value=${i}
2182
2187
  @ap-change=${p=>this._onContentModeChange(t,p.detail.value)}
2183
2188
  ></ap-radio-group>
@@ -2222,13 +2227,13 @@
2222
2227
 
2223
2228
  <div class="filter-section">
2224
2229
  <ap-radio-group
2225
- .options=${fe}
2230
+ .options=${ge}
2226
2231
  .value=${s}
2227
2232
  @ap-change=${r=>this._onEmptyOption(t,r.detail.value)}
2228
2233
  ></ap-radio-group>
2229
2234
  </div>
2230
2235
  </div>
2231
- `}_renderFaceMatcherFilter(t){const e=y(t),s=this._getApplied(e),a=s.values||[],i=s.operator||b.IS;return o.html`
2236
+ `}_renderFaceMatcherFilter(t){const e=y(t),s=this._getApplied(e),a=s.values||[],i=s.operator||_.IS;return o.html`
2232
2237
  <div class="filter-content" style="position: relative;">
2233
2238
  <button
2234
2239
  class="clear-btn"
@@ -2283,20 +2288,20 @@
2283
2288
  </div>
2284
2289
  `}_renderSelectorMode(){const t=this._fieldSearch.toLowerCase(),e=this.fields.filter(r=>r.label.toLowerCase().includes(t)),s=e.filter(r=>!r.group||r.group==="root"),a=e.filter(r=>r.group==="product"),i=(r,n)=>n.length===0?o.nothing:o.html`
2285
2290
  <div class="field-group-label">${r}</div>
2286
- ${n.map(l=>{const d=y(l),h=this.visibleFields.includes(d),u=!!this.appliedMetadata[d]||!!this.appliedFilters[d],g=this.pinnedFields.includes(d),p=!h&&this._atFieldLimit;return o.html`
2291
+ ${n.map(l=>{const d=y(l),h=this.visibleFields.includes(d),u=!!this.appliedMetadata[d]||!!this.appliedFilters[d],f=this.pinnedFields.includes(d),p=!h&&this._atFieldLimit;return o.html`
2287
2292
  <div
2288
2293
  class="field-item ${u?"has-filter":""} ${p?"disabled":""}"
2289
2294
  @click=${()=>!p&&this._emitFieldSelect(l)}
2290
2295
  >
2291
2296
  <span class="field-item-label">${l.label}</span>
2292
- ${u?o.html`<span class="field-item-dot"></span>`:o.nothing}
2293
2297
  <button
2294
- class="field-item-pin ${g?"pinned":""}"
2295
- @click=${f=>{f.stopPropagation(),this._emitPin(d,!g)}}
2296
- title=${g?"Unpin field":"Pin field"}
2298
+ class="field-item-pin ${f?"pinned":""}"
2299
+ @click=${g=>{g.stopPropagation(),this._emitPin(d,!f)}}
2300
+ title=${f?"Unpin field":"Pin field"}
2297
2301
  >
2298
- <ap-icon name=${g?"pin-off":"pin"} .size=${12}></ap-icon>
2302
+ <ap-icon name="pin" .size=${12}></ap-icon>
2299
2303
  </button>
2304
+ ${u?o.html`<ap-icon name="check" .size=${14}></ap-icon>`:o.nothing}
2300
2305
  </div>
2301
2306
  `})}
2302
2307
  `;return o.html`
@@ -2314,13 +2319,6 @@
2314
2319
  ${i("Product fields",a)}
2315
2320
  `}
2316
2321
  </div>
2317
- ${this.visibleFields.length>0?o.html`
2318
- <div
2319
- class="limit-note ${this._atFieldLimit?"at-limit":""}"
2320
- >
2321
- ${this.visibleFields.length} / ${ke} fields selected
2322
- </div>
2323
- `:o.nothing}
2324
2322
  </div>
2325
2323
  `}_renderFieldMode(){const t=this._getField(this.activeFieldKey);return t?this._renderFieldControl(t):o.html`<div class="empty-msg">Field not found</div>`}render(){if(this.mode==="selector")return this._renderSelectorMode();if(this.mode==="field")return this._renderFieldMode();const t=this.visibleFields.length>0;return o.html`
2326
2324
  ${this._showFieldSelection||!t?this._renderFieldSelection():o.nothing}
@@ -2349,11 +2347,11 @@
2349
2347
  align-items: center;
2350
2348
  gap: 6px;
2351
2349
  padding: 6px 12px;
2352
- border: 1px dashed var(--ap-border, #e4e4e7);
2350
+ border: 1px dashed var(--ap-border, oklch(92.86% 0.009 247.92));
2353
2351
  border-radius: var(--ap-radius-sm, 6px);
2354
2352
  background: none;
2355
2353
  font-size: var(--ap-font-size-sm, 0.875rem);
2356
- color: var(--ap-muted-foreground, #71717a);
2354
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2357
2355
  cursor: pointer;
2358
2356
  width: 100%;
2359
2357
  font-family: var(--ap-font-family, system-ui, sans-serif);
@@ -2361,14 +2359,14 @@
2361
2359
  }
2362
2360
 
2363
2361
  .add-field-btn:hover {
2364
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
2365
- color: var(--ap-primary, oklch(0.65 0.19 258));
2362
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
2363
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
2366
2364
  }
2367
2365
 
2368
2366
  .field-selection {
2369
- border: 1px solid var(--ap-border, #e4e4e7);
2367
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
2370
2368
  border-radius: var(--ap-radius-sm, 6px);
2371
- background: var(--ap-background, #fff);
2369
+ background: var(--ap-background, oklch(1 0 0));
2372
2370
  margin-bottom: 12px;
2373
2371
  }
2374
2372
 
@@ -2377,78 +2375,78 @@
2377
2375
  align-items: center;
2378
2376
  justify-content: space-between;
2379
2377
  padding: 8px 12px;
2380
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
2378
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
2381
2379
  }
2382
2380
 
2383
2381
  .field-selection-title {
2384
2382
  font-size: var(--ap-font-size-sm, 0.875rem);
2385
2383
  font-weight: 500;
2386
- color: var(--ap-foreground, #09090b);
2384
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2387
2385
  }
2388
2386
 
2389
2387
  .field-selection-close {
2390
2388
  background: none;
2391
2389
  border: none;
2392
2390
  cursor: pointer;
2393
- color: var(--ap-muted-foreground, #71717a);
2391
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2394
2392
  padding: 2px;
2395
2393
  display: flex;
2396
2394
  align-items: center;
2397
2395
  }
2398
2396
 
2399
2397
  .field-selection-close:hover {
2400
- color: var(--ap-foreground, #09090b);
2398
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2401
2399
  }
2402
2400
 
2403
2401
  .selector-wrap {
2404
- margin: -10px -8px;
2402
+ margin: 0;
2405
2403
  }
2406
2404
 
2407
2405
  .field-search {
2408
2406
  position: sticky;
2409
- top: -12px;
2407
+ top: 0;
2410
2408
  z-index: 2;
2411
2409
  width: 100%;
2412
- padding: 8px 12px;
2410
+ height: 34px;
2411
+ padding: 0 20px;
2412
+ box-sizing: border-box;
2413
2413
  border: none;
2414
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
2414
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
2415
2415
  font-size: var(--ap-font-size-sm, 0.875rem);
2416
- color: var(--ap-foreground, #09090b);
2417
- background: var(--ap-card, #fff);
2416
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2417
+ background: var(--ap-card, oklch(1 0 0));
2418
2418
  outline: none;
2419
2419
  font-family: var(--ap-font-family, system-ui, sans-serif);
2420
2420
  }
2421
2421
 
2422
2422
  .field-search::placeholder {
2423
- color: var(--ap-muted-foreground, #71717a);
2423
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2424
2424
  }
2425
2425
 
2426
2426
  .field-list {
2427
- padding: 4px 0;
2427
+ padding: 12px 0;
2428
2428
  }
2429
2429
 
2430
2430
  .field-group-label {
2431
2431
  padding: 6px 12px 4px;
2432
- font-size: 0.6875rem;
2433
- font-weight: 600;
2434
- text-transform: uppercase;
2435
- letter-spacing: 0.05em;
2436
- color: var(--ap-muted-foreground, #71717a);
2432
+ font-size: 0.875rem;
2433
+ font-weight: 400;
2434
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2437
2435
  }
2438
2436
 
2439
2437
  .field-item {
2440
2438
  display: flex;
2441
2439
  align-items: center;
2442
2440
  gap: 8px;
2443
- padding: 6px 12px;
2441
+ padding: 6px 16px 6px 24px;
2444
2442
  cursor: pointer;
2445
2443
  font-size: var(--ap-font-size-sm, 0.875rem);
2446
- color: var(--ap-foreground, #09090b);
2444
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2447
2445
  transition: background 100ms;
2448
2446
  }
2449
2447
 
2450
2448
  .field-item:hover {
2451
- background: var(--ap-muted, #f4f4f5);
2449
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
2452
2450
  }
2453
2451
 
2454
2452
  .field-item.disabled {
@@ -2457,24 +2455,24 @@
2457
2455
  }
2458
2456
 
2459
2457
  .field-item.selected {
2460
- color: var(--ap-primary, oklch(0.65 0.19 258));
2458
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
2461
2459
  }
2462
2460
 
2463
2461
  .limit-note {
2464
- padding: 8px 12px;
2462
+ padding: 8px 16px 8px 24px;
2465
2463
  font-size: 0.75rem;
2466
- color: var(--ap-muted-foreground, #71717a);
2464
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2467
2465
  text-align: center;
2468
2466
  }
2469
2467
 
2470
2468
  .limit-note.at-limit {
2471
- color: var(--ap-destructive, #ef4444);
2469
+ color: var(--ap-destructive, oklch(0.577 0.215 27.325));
2472
2470
  }
2473
2471
 
2474
2472
  .empty-msg {
2475
- padding: 16px 12px;
2473
+ padding: 16px 16px 16px 24px;
2476
2474
  font-size: var(--ap-font-size-sm, 0.875rem);
2477
- color: var(--ap-muted-foreground, #71717a);
2475
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2478
2476
  text-align: center;
2479
2477
  }
2480
2478
 
@@ -2487,7 +2485,7 @@
2487
2485
  }
2488
2486
 
2489
2487
  .field-section {
2490
- border: 1px solid var(--ap-border, #e4e4e7);
2488
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
2491
2489
  border-radius: var(--ap-radius-sm, 6px);
2492
2490
  overflow: hidden;
2493
2491
  }
@@ -2497,7 +2495,7 @@
2497
2495
  align-items: center;
2498
2496
  justify-content: space-between;
2499
2497
  padding: 8px 12px;
2500
- background: var(--ap-muted, #f4f4f5);
2498
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
2501
2499
  cursor: pointer;
2502
2500
  user-select: none;
2503
2501
  }
@@ -2508,7 +2506,7 @@
2508
2506
  gap: 6px;
2509
2507
  font-size: var(--ap-font-size-sm, 0.875rem);
2510
2508
  font-weight: 500;
2511
- color: var(--ap-foreground, #09090b);
2509
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2512
2510
  }
2513
2511
 
2514
2512
  .field-header-actions {
@@ -2521,7 +2519,7 @@
2521
2519
  background: none;
2522
2520
  border: none;
2523
2521
  cursor: pointer;
2524
- color: var(--ap-muted-foreground, #71717a);
2522
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2525
2523
  padding: 2px;
2526
2524
  display: flex;
2527
2525
  align-items: center;
@@ -2530,12 +2528,12 @@
2530
2528
  }
2531
2529
 
2532
2530
  .icon-btn:hover {
2533
- color: var(--ap-foreground, #09090b);
2534
- background: var(--ap-border, #e4e4e7);
2531
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2532
+ background: var(--ap-border, oklch(92.86% 0.009 247.92));
2535
2533
  }
2536
2534
 
2537
2535
  .icon-btn.remove:hover {
2538
- color: var(--ap-destructive, #ef4444);
2536
+ color: var(--ap-destructive, oklch(0.577 0.215 27.325));
2539
2537
  }
2540
2538
 
2541
2539
  .field-body {
@@ -2556,7 +2554,7 @@
2556
2554
  flex-wrap: wrap;
2557
2555
  gap: 6px;
2558
2556
  padding: 6px;
2559
- border: 1px solid var(--ap-border, #e4e4e7);
2557
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
2560
2558
  border-radius: var(--ap-radius-sm, 6px);
2561
2559
  min-height: 36px;
2562
2560
  align-items: center;
@@ -2569,8 +2567,8 @@
2569
2567
  padding: 2px 8px;
2570
2568
  border-radius: 9999px;
2571
2569
  font-size: 0.8125rem;
2572
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
2573
- color: var(--ap-primary, oklch(0.65 0.19 258));
2570
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
2571
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
2574
2572
  }
2575
2573
 
2576
2574
  .tag-chip-remove {
@@ -2594,13 +2592,13 @@
2594
2592
  font-size: var(--ap-font-size-sm, 0.875rem);
2595
2593
  flex: 1;
2596
2594
  min-width: 80px;
2597
- color: var(--ap-foreground, #09090b);
2595
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2598
2596
  background: transparent;
2599
2597
  font-family: var(--ap-font-family, system-ui, sans-serif);
2600
2598
  }
2601
2599
 
2602
2600
  .tag-input::placeholder {
2603
- color: var(--ap-muted-foreground, #71717a);
2601
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2604
2602
  }
2605
2603
 
2606
2604
  /* ── Geo inputs ─────────────────────────────────────── */
@@ -2628,12 +2626,12 @@
2628
2626
  border-radius: var(--ap-radius-sm, 6px);
2629
2627
  cursor: pointer;
2630
2628
  font-size: var(--ap-font-size-sm, 0.875rem);
2631
- color: var(--ap-foreground, #09090b);
2629
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
2632
2630
  transition: background 150ms;
2633
2631
  }
2634
2632
 
2635
2633
  .option-item:hover:not(.disabled) {
2636
- background: var(--ap-muted, #f4f4f5);
2634
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
2637
2635
  }
2638
2636
 
2639
2637
  .option-item.disabled {
@@ -2665,7 +2663,7 @@
2665
2663
  width: 6px;
2666
2664
  height: 6px;
2667
2665
  border-radius: 50%;
2668
- background: var(--ap-primary, oklch(0.65 0.19 258));
2666
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
2669
2667
  flex-shrink: 0;
2670
2668
  }
2671
2669
 
@@ -2679,7 +2677,7 @@
2679
2677
  background: none;
2680
2678
  cursor: pointer;
2681
2679
  padding: 0;
2682
- color: var(--ap-muted-foreground, #71717a);
2680
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2683
2681
  border-radius: 4px;
2684
2682
  flex-shrink: 0;
2685
2683
  margin-left: auto;
@@ -2693,18 +2691,19 @@
2693
2691
  }
2694
2692
 
2695
2693
  .field-item-pin:hover {
2696
- color: var(--ap-primary, oklch(0.65 0.19 258));
2697
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.08));
2694
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
2695
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
2698
2696
  }
2699
2697
 
2700
2698
  .field-item-pin.pinned {
2701
- color: var(--ap-primary, oklch(0.65 0.19 258));
2699
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
2702
2700
  }
2703
2701
 
2704
2702
  .field-item.has-filter {
2705
- color: var(--ap-primary, oklch(0.65 0.19 258));
2703
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
2704
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
2706
2705
  }
2707
- `];M([c.property({type:Array})],E.prototype,"fields",2);M([c.property({type:Object})],E.prototype,"appliedFilters",2);M([c.property({type:Array})],E.prototype,"visibleFields",2);M([c.property()],E.prototype,"mode",2);M([c.property()],E.prototype,"activeFieldKey",2);M([c.property({type:Array})],E.prototype,"pinnedFields",2);M([c.property({type:Object})],E.prototype,"appliedMetadata",2);M([c.property({attribute:!1})],E.prototype,"apiClient",2);M([c.state()],E.prototype,"_showFieldSelection",2);M([c.state()],E.prototype,"_fieldSearch",2);M([c.state()],E.prototype,"_collapsedFields",2);M([c.state()],E.prototype,"_tagInputs",2);M([c.state()],E.prototype,"_tagSuggestions",2);M([c.state()],E.prototype,"_tagLoading",2);M([c.state()],E.prototype,"_datePresets",2);M([c.state()],E.prototype,"_dateFroms",2);M([c.state()],E.prototype,"_dateTos",2);M([c.state()],E.prototype,"_specificModeFields",2);M([c.state()],E.prototype,"_selectSearches",2);E=M([c.customElement("ap-filter-metadata")],E);var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,G=(t,e,s,a)=>{for(var i=a>1?void 0:a?oa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ra(e,s,i),i};let q=class extends o.LitElement{constructor(){super(...arguments),this.selectedStatus=[],this.statusOperator=":=",this.approverValue="",this.approverOperator="~",this.requesterValue="",this.requesterOperator="~",this.dueDatePreset="",this.dueDateFrom="",this.dueDateTo=""}get _hasAnySelection(){return this.selectedStatus.length>0||!!this.approverValue||!!this.requesterValue||!!this.dueDatePreset||!!this.dueDateFrom||!!this.dueDateTo}get _statusHasEmptyValue(){return this.selectedStatus.includes(B)||this.selectedStatus.includes(V)}get _statusHasOnlyEmptyValues(){return this.selectedStatus.length>0&&this.selectedStatus.every(t=>t===B||t===V)}get _dueDateNeedsInputs(){return["before","after","between","specific"].includes(this.dueDatePreset)}_toggleStatus(t){const e=this.selectedStatus.includes(t)?this.selectedStatus.filter(s=>s!==t):[...this.selectedStatus,t];this._emitChange(R.STATUS,e,this.statusOperator)}_handleStatusOperator(t){const e=t.detail.value;this._emitChange(R.STATUS,this.selectedStatus,e)}_clearStatus(){this._emitChange(R.STATUS,[],this.statusOperator)}_handleApproverInput(t){const e=t.target.value;this._emitChange(R.APPROVER,e?[e]:[],this.approverOperator)}_handleApproverOperator(t){const e=t.detail.value;this._emitChange(R.APPROVER,this.approverValue?[this.approverValue]:[],e)}_clearApprover(){this._emitChange(R.APPROVER,[],this.approverOperator)}_handleRequesterInput(t){const e=t.target.value;this._emitChange(R.REQUESTOR,e?[e]:[],this.requesterOperator)}_handleRequesterOperator(t){const e=t.detail.value;this._emitChange(R.REQUESTOR,this.requesterValue?[this.requesterValue]:[],e)}_clearRequester(){this._emitChange(R.REQUESTOR,[],this.requesterOperator)}_handleDueDatePreset(t){const e=t.detail.value,s=this.dueDatePreset===e?"":e;this._emitChange(R.DUE_DATE,s?[s]:[],":")}_handleDueDateFrom(t){const e=t.target.value;this._emitDateChange(e,this.dueDateTo)}_handleDueDateTo(t){const e=t.target.value;this._emitDateChange(this.dueDateFrom,e)}_clearDueDate(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:R.DUE_DATE,values:[],operator:":"},bubbles:!0,composed:!0}))}_emitDateChange(t,e){const s=[];t&&s.push(t),e&&s.push(e),this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:R.DUE_DATE,values:s,operator:t&&e?"..":t?">=":"<="},bubbles:!0,composed:!0}))}_emitChange(t,e,s){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:t,values:e,operator:s},bubbles:!0,composed:!0}))}_renderStatusSection(){const t=this.selectedStatus.length>0;return o.html`
2706
+ `];M([c.property({type:Array})],E.prototype,"fields",2);M([c.property({type:Object})],E.prototype,"appliedFilters",2);M([c.property({type:Array})],E.prototype,"visibleFields",2);M([c.property()],E.prototype,"mode",2);M([c.property()],E.prototype,"activeFieldKey",2);M([c.property({type:Array})],E.prototype,"pinnedFields",2);M([c.property({type:Object})],E.prototype,"appliedMetadata",2);M([c.property({attribute:!1})],E.prototype,"apiClient",2);M([c.state()],E.prototype,"_showFieldSelection",2);M([c.state()],E.prototype,"_fieldSearch",2);M([c.state()],E.prototype,"_collapsedFields",2);M([c.state()],E.prototype,"_tagInputs",2);M([c.state()],E.prototype,"_tagSuggestions",2);M([c.state()],E.prototype,"_tagLoading",2);M([c.state()],E.prototype,"_datePresets",2);M([c.state()],E.prototype,"_dateFroms",2);M([c.state()],E.prototype,"_dateTos",2);M([c.state()],E.prototype,"_specificModeFields",2);M([c.state()],E.prototype,"_selectSearches",2);E=M([c.customElement("ap-filter-metadata")],E);var fa=Object.defineProperty,ma=Object.getOwnPropertyDescriptor,G=(t,e,s,a)=>{for(var i=a>1?void 0:a?ma(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&fa(e,s,i),i};let V=class extends o.LitElement{constructor(){super(...arguments),this.selectedStatus=[],this.statusOperator=":=",this.approverValue="",this.approverOperator="~",this.requesterValue="",this.requesterOperator="~",this.dueDatePreset="",this.dueDateFrom="",this.dueDateTo=""}get _hasAnySelection(){return this.selectedStatus.length>0||!!this.approverValue||!!this.requesterValue||!!this.dueDatePreset||!!this.dueDateFrom||!!this.dueDateTo}get _statusHasEmptyValue(){return this.selectedStatus.includes(B)||this.selectedStatus.includes(U)}get _statusHasOnlyEmptyValues(){return this.selectedStatus.length>0&&this.selectedStatus.every(t=>t===B||t===U)}get _dueDateNeedsInputs(){return["before","after","between","specific"].includes(this.dueDatePreset)}_toggleStatus(t){const e=this.selectedStatus.includes(t)?this.selectedStatus.filter(s=>s!==t):[...this.selectedStatus,t];this._emitChange(R.STATUS,e,this.statusOperator)}_handleStatusOperator(t){const e=t.detail.value;this._emitChange(R.STATUS,this.selectedStatus,e)}_clearStatus(){this._emitChange(R.STATUS,[],this.statusOperator)}_handleApproverInput(t){const e=t.target.value;this._emitChange(R.APPROVER,e?[e]:[],this.approverOperator)}_handleApproverOperator(t){const e=t.detail.value;this._emitChange(R.APPROVER,this.approverValue?[this.approverValue]:[],e)}_clearApprover(){this._emitChange(R.APPROVER,[],this.approverOperator)}_handleRequesterInput(t){const e=t.target.value;this._emitChange(R.REQUESTOR,e?[e]:[],this.requesterOperator)}_handleRequesterOperator(t){const e=t.detail.value;this._emitChange(R.REQUESTOR,this.requesterValue?[this.requesterValue]:[],e)}_clearRequester(){this._emitChange(R.REQUESTOR,[],this.requesterOperator)}_handleDueDatePreset(t){const e=t.detail.value,s=this.dueDatePreset===e?"":e;this._emitChange(R.DUE_DATE,s?[s]:[],":")}_handleDueDateFrom(t){const e=t.target.value;this._emitDateChange(e,this.dueDateTo)}_handleDueDateTo(t){const e=t.target.value;this._emitDateChange(this.dueDateFrom,e)}_clearDueDate(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:R.DUE_DATE,values:[],operator:":"},bubbles:!0,composed:!0}))}_emitDateChange(t,e){const s=[];t&&s.push(t),e&&s.push(e),this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:R.DUE_DATE,values:s,operator:t&&e?"..":t?">=":"<="},bubbles:!0,composed:!0}))}_emitChange(t,e,s){this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:t,values:e,operator:s},bubbles:!0,composed:!0}))}_renderStatusSection(){const t=this.selectedStatus.length>0;return o.html`
2708
2707
  <div class="filter-section">
2709
2708
  <button
2710
2709
  class="clear-btn"
@@ -2718,7 +2717,7 @@
2718
2717
  <span class="section-label condition-label">Condition</span>
2719
2718
  <ap-radio-group
2720
2719
  direction="horizontal"
2721
- .options=${Us}
2720
+ .options=${ei}
2722
2721
  .value=${this.statusOperator}
2723
2722
  ?disabled=${this._statusHasOnlyEmptyValues}
2724
2723
  @ap-change=${this._handleStatusOperator}
@@ -2726,7 +2725,7 @@
2726
2725
 
2727
2726
  <!-- Empty / Not empty checkboxes -->
2728
2727
  <div class="options-list short mt-12">
2729
- ${fe.map(e=>o.html`
2728
+ ${ge.map(e=>o.html`
2730
2729
  <ap-checkbox
2731
2730
  ?checked=${this.selectedStatus.includes(e.value)}
2732
2731
  @ap-toggle=${()=>this._toggleStatus(e.value)}
@@ -2738,7 +2737,7 @@
2738
2737
 
2739
2738
  <!-- Status options -->
2740
2739
  <div class="options-list short">
2741
- ${Hs.map(e=>o.html`
2740
+ ${ti.map(e=>o.html`
2742
2741
  <ap-checkbox
2743
2742
  ?checked=${this.selectedStatus.includes(e.value)}
2744
2743
  @ap-toggle=${()=>this._toggleStatus(e.value)}
@@ -2817,8 +2816,8 @@
2817
2816
 
2818
2817
  <!-- Empty / Not empty radio buttons -->
2819
2818
  <ap-radio-group
2820
- .options=${fe}
2821
- .value=${this.dueDatePreset===B||this.dueDatePreset===V?this.dueDatePreset:""}
2819
+ .options=${ge}
2820
+ .value=${this.dueDatePreset===B||this.dueDatePreset===U?this.dueDatePreset:""}
2822
2821
  @ap-change=${this._handleDueDatePreset}
2823
2822
  ></ap-radio-group>
2824
2823
 
@@ -2827,8 +2826,8 @@
2827
2826
  <!-- Date range options -->
2828
2827
  <ap-radio-group
2829
2828
  columns="2"
2830
- .options=${Bs}
2831
- .value=${this.dueDatePreset!==B&&this.dueDatePreset!==V?this.dueDatePreset:""}
2829
+ .options=${Qs}
2830
+ .value=${this.dueDatePreset!==B&&this.dueDatePreset!==U?this.dueDatePreset:""}
2832
2831
  @ap-change=${this._handleDueDatePreset}
2833
2832
  ></ap-radio-group>
2834
2833
 
@@ -2870,7 +2869,7 @@
2870
2869
  <div class="separator"></div>
2871
2870
  ${this._renderDueDateSection()}
2872
2871
  </div>
2873
- `}};q.styles=[J,te,o.css`
2872
+ `}};V.styles=[J,te,o.css`
2874
2873
  .options-list.short {
2875
2874
  max-height: none;
2876
2875
  }
@@ -2889,7 +2888,7 @@
2889
2888
  .mt-12 {
2890
2889
  margin-top: 12px;
2891
2890
  }
2892
- `];G([c.property({type:Array})],q.prototype,"selectedStatus",2);G([c.property()],q.prototype,"statusOperator",2);G([c.property()],q.prototype,"approverValue",2);G([c.property()],q.prototype,"approverOperator",2);G([c.property()],q.prototype,"requesterValue",2);G([c.property()],q.prototype,"requesterOperator",2);G([c.property()],q.prototype,"dueDatePreset",2);G([c.property()],q.prototype,"dueDateFrom",2);G([c.property()],q.prototype,"dueDateTo",2);q=G([c.customElement("ap-filter-approval")],q);var na=Object.defineProperty,la=Object.getOwnPropertyDescriptor,Y=(t,e,s,a)=>{for(var i=a>1?void 0:a?la(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&na(e,s,i),i};const ca=300;function da(t){return t.filter(e=>e.toLowerCase().includes("*")||!t.some(s=>s.toLowerCase().includes("*")&&e.toLowerCase().startsWith(s.slice(0,-1).toLowerCase())))}let U=class extends o.LitElement{constructor(){super(...arguments),this.selected=[],this._search="",this._debouncedSearch="",this._products=[],this._isLoading=!1,this._showAddList=!1,this._addListText=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;return(t=this._searchInput)==null?void 0:t.focus()})}disconnectedCallback(){super.disconnectedCallback(),this._debounceTimer&&clearTimeout(this._debounceTimer)}get _isSearching(){return this._debouncedSearch.length>0}_emit(t){const e=da(t);this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.PRODUCT_REF,values:e,operator:b.IS},bubbles:!0,composed:!0}))}_toggle(t){const s=this.selected.includes(t)?this.selected.filter(a=>a!==t):[...this.selected,t];this._emit(s)}_remove(t){this._emit(this.selected.filter(e=>e!==t))}_clearAll(){this._emit([]),this._search="",this._debouncedSearch="",this._products=[]}_onSearchInput(t){const e=t.target.value;this._search=e,this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{const s=e.trim().toLowerCase();this._debouncedSearch=s,s?this._fetchProducts(s):(this._products=[],this._isLoading=!1)},ca)}_clearSearch(){this._search="",this._debouncedSearch="",this._products=[],this._isLoading=!1,this._debounceTimer&&clearTimeout(this._debounceTimer)}async _fetchProducts(t){if(this.apiClient){this._isLoading=!0;try{const e=await this.apiClient.request("/products",{q:`reference~^${t}`});this._debouncedSearch===t&&(this._products=e.products??[])}catch{this._debouncedSearch===t&&(this._products=[])}finally{this._debouncedSearch===t&&(this._isLoading=!1)}}}_openAddList(){this._showAddList=!0,this._addListText=""}_closeAddList(){this._showAddList=!1,this._addListText=""}_onAddListInput(t){this._addListText=t.target.value}_onAddListKeydown(t){t.key==="Enter"&&!t.shiftKey&&t.stopPropagation()}_submitAddList(){const t=this._addListText.split(`
2891
+ `];G([c.property({type:Array})],V.prototype,"selectedStatus",2);G([c.property()],V.prototype,"statusOperator",2);G([c.property()],V.prototype,"approverValue",2);G([c.property()],V.prototype,"approverOperator",2);G([c.property()],V.prototype,"requesterValue",2);G([c.property()],V.prototype,"requesterOperator",2);G([c.property()],V.prototype,"dueDatePreset",2);G([c.property()],V.prototype,"dueDateFrom",2);G([c.property()],V.prototype,"dueDateTo",2);V=G([c.customElement("ap-filter-approval")],V);var va=Object.defineProperty,ba=Object.getOwnPropertyDescriptor,Y=(t,e,s,a)=>{for(var i=a>1?void 0:a?ba(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&va(e,s,i),i};const _a=300;function ya(t){return t.filter(e=>e.toLowerCase().includes("*")||!t.some(s=>s.toLowerCase().includes("*")&&e.toLowerCase().startsWith(s.slice(0,-1).toLowerCase())))}let q=class extends o.LitElement{constructor(){super(...arguments),this.selected=[],this._search="",this._debouncedSearch="",this._products=[],this._isLoading=!1,this._showAddList=!1,this._addListText=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;return(t=this._searchInput)==null?void 0:t.focus()})}disconnectedCallback(){super.disconnectedCallback(),this._debounceTimer&&clearTimeout(this._debounceTimer)}get _isSearching(){return this._debouncedSearch.length>0}_emit(t){const e=ya(t);this.dispatchEvent(new CustomEvent("filter-change",{detail:{key:m.PRODUCT_REF,values:e,operator:_.IS},bubbles:!0,composed:!0}))}_toggle(t){const s=this.selected.includes(t)?this.selected.filter(a=>a!==t):[...this.selected,t];this._emit(s)}_remove(t){this._emit(this.selected.filter(e=>e!==t))}_clearAll(){this._emit([]),this._search="",this._debouncedSearch="",this._products=[]}_onSearchInput(t){const e=t.target.value;this._search=e,this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{const s=e.trim().toLowerCase();this._debouncedSearch=s,s?this._fetchProducts(s):(this._products=[],this._isLoading=!1)},_a)}_clearSearch(){this._search="",this._debouncedSearch="",this._products=[],this._isLoading=!1,this._debounceTimer&&clearTimeout(this._debounceTimer)}async _fetchProducts(t){if(this.apiClient){this._isLoading=!0;try{const e=await this.apiClient.request("/products",{q:`reference~^${t}`});this._debouncedSearch===t&&(this._products=e.products??[])}catch{this._debouncedSearch===t&&(this._products=[])}finally{this._debouncedSearch===t&&(this._isLoading=!1)}}}_openAddList(){this._showAddList=!0,this._addListText=""}_closeAddList(){this._showAddList=!1,this._addListText=""}_onAddListInput(t){this._addListText=t.target.value}_onAddListKeydown(t){t.key==="Enter"&&!t.shiftKey&&t.stopPropagation()}_submitAddList(){const t=this._addListText.split(`
2893
2892
  `).map(e=>e.trim()).filter(e=>e!=="");if(t.length>0){const e=new Set(this.selected),s=[...this.selected,...t.filter(a=>!e.has(a))];this._emit(s)}this._closeAddList()}_renderProductItem(t){const e=this.selected.includes(t);return o.html`
2894
2893
  <div
2895
2894
  class="product-item"
@@ -2959,7 +2958,7 @@
2959
2958
  <!-- Placeholder (when not searching) -->
2960
2959
  ${this._isSearching?o.nothing:o.html`
2961
2960
  <div class="placeholder">
2962
- ${t?o.html`<ap-icon name="box" .size=${40} style="color: var(--ap-border, #e4e4e7); margin-bottom: 4px;"></ap-icon>`:o.nothing}
2961
+ ${t?o.html`<ap-icon name="box" .size=${40} style="color: var(--ap-border, oklch(92.86% 0.009 247.92)); margin-bottom: 4px;"></ap-icon>`:o.nothing}
2963
2962
  <div class="placeholder-title">Find product reference</div>
2964
2963
  <div class="placeholder-text">By using the search or pressing the button below to import the product references list.</div>
2965
2964
  <button class="add-list-btn" @click=${this._openAddList}>
@@ -3008,7 +3007,7 @@
3008
3007
  </div>
3009
3008
  </div>
3010
3009
  `:o.nothing}
3011
- `}};U.styles=[J,te,o.css`
3010
+ `}};q.styles=[J,te,o.css`
3012
3011
  .product-item {
3013
3012
  display: flex;
3014
3013
  align-items: center;
@@ -3020,12 +3019,12 @@
3020
3019
  }
3021
3020
 
3022
3021
  .product-item:hover {
3023
- background: var(--ap-muted, #f4f4f5);
3022
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
3024
3023
  }
3025
3024
 
3026
3025
  .product-name {
3027
3026
  font-size: var(--ap-font-size-sm, 0.875rem);
3028
- color: var(--ap-foreground, #09090b);
3027
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3029
3028
  flex: 1;
3030
3029
  min-width: 0;
3031
3030
  overflow: hidden;
@@ -3038,7 +3037,7 @@
3038
3037
  position: sticky;
3039
3038
  top: -10px;
3040
3039
  z-index: 2;
3041
- background: var(--ap-card, #fff);
3040
+ background: var(--ap-card, oklch(1 0 0));
3042
3041
  margin: -10px -8px 10px;
3043
3042
  }
3044
3043
 
@@ -3046,16 +3045,16 @@
3046
3045
  width: 100%;
3047
3046
  padding: 8px 10px;
3048
3047
  border: none;
3049
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
3048
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3050
3049
  font-size: var(--ap-font-size-sm, 0.875rem);
3051
- color: var(--ap-foreground, #09090b);
3050
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3052
3051
  background: transparent;
3053
3052
  outline: none;
3054
3053
  font-family: var(--ap-font-family, system-ui, sans-serif);
3055
3054
  }
3056
3055
 
3057
3056
  .product-search::placeholder {
3058
- color: var(--ap-muted-foreground, #71717a);
3057
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3059
3058
  }
3060
3059
 
3061
3060
  .search-clear {
@@ -3080,12 +3079,12 @@
3080
3079
  .placeholder-title {
3081
3080
  font-size: var(--ap-font-size-sm, 0.875rem);
3082
3081
  font-weight: 500;
3083
- color: var(--ap-foreground, #09090b);
3082
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3084
3083
  }
3085
3084
 
3086
3085
  .placeholder-text {
3087
3086
  font-size: 0.8125rem;
3088
- color: var(--ap-muted-foreground, #71717a);
3087
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3089
3088
  }
3090
3089
 
3091
3090
  .add-list-btn {
@@ -3099,13 +3098,13 @@
3099
3098
  font-size: var(--ap-font-size-sm, 0.875rem);
3100
3099
  font-family: inherit;
3101
3100
  background: none;
3102
- color: var(--ap-primary, oklch(0.65 0.19 258));
3101
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3103
3102
  cursor: pointer;
3104
3103
  transition: background 150ms;
3105
3104
  }
3106
3105
 
3107
3106
  .add-list-btn:hover {
3108
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.08));
3107
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
3109
3108
  }
3110
3109
 
3111
3110
  /* Add list dialog overlay */
@@ -3120,7 +3119,7 @@
3120
3119
  }
3121
3120
 
3122
3121
  .dialog {
3123
- background: var(--ap-card, #fff);
3122
+ background: var(--ap-card, oklch(1 0 0));
3124
3123
  border-radius: var(--ap-radius, 8px);
3125
3124
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
3126
3125
  width: 420px;
@@ -3132,8 +3131,8 @@
3132
3131
  padding: 16px 20px;
3133
3132
  font-size: 1rem;
3134
3133
  font-weight: 600;
3135
- color: var(--ap-foreground, #09090b);
3136
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
3134
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3135
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3137
3136
  }
3138
3137
 
3139
3138
  .dialog-body {
@@ -3148,22 +3147,22 @@
3148
3147
  min-height: 150px;
3149
3148
  max-height: 300px;
3150
3149
  padding: 8px 10px;
3151
- border: 1px solid var(--ap-border, #e4e4e7);
3150
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3152
3151
  border-radius: var(--ap-radius-sm, 6px);
3153
3152
  font-size: var(--ap-font-size-sm, 0.875rem);
3154
3153
  font-family: inherit;
3155
- color: var(--ap-foreground, #09090b);
3156
- background: var(--ap-background, #fff);
3154
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3155
+ background: var(--ap-background, oklch(1 0 0));
3157
3156
  resize: vertical;
3158
3157
  outline: none;
3159
3158
  }
3160
3159
 
3161
3160
  .dialog-textarea:focus {
3162
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
3161
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
3163
3162
  }
3164
3163
 
3165
3164
  .dialog-textarea::placeholder {
3166
- color: var(--ap-muted-foreground, #71717a);
3165
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3167
3166
  }
3168
3167
 
3169
3168
  .dialog-footer {
@@ -3171,7 +3170,7 @@
3171
3170
  justify-content: flex-end;
3172
3171
  gap: 8px;
3173
3172
  padding: 12px 20px;
3174
- border-top: 1px solid var(--ap-border, #e4e4e7);
3173
+ border-top: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3175
3174
  }
3176
3175
 
3177
3176
  .dialog-btn {
@@ -3184,19 +3183,19 @@
3184
3183
  }
3185
3184
 
3186
3185
  .dialog-btn-cancel {
3187
- border: 1px solid var(--ap-border, #e4e4e7);
3188
- background: var(--ap-background, #fff);
3189
- color: var(--ap-foreground, #09090b);
3186
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3187
+ background: var(--ap-background, oklch(1 0 0));
3188
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3190
3189
  }
3191
3190
 
3192
3191
  .dialog-btn-cancel:hover {
3193
- background: var(--ap-muted, #f4f4f5);
3192
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
3194
3193
  }
3195
3194
 
3196
3195
  .dialog-btn-primary {
3197
3196
  border: none;
3198
- background: var(--ap-primary, oklch(0.65 0.19 258));
3199
- color: var(--ap-primary-foreground, #fff);
3197
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
3198
+ color: var(--ap-primary-foreground, oklch(1 0 0));
3200
3199
  }
3201
3200
 
3202
3201
  .dialog-btn-primary:hover {
@@ -3213,7 +3212,7 @@
3213
3212
  .skeleton-item {
3214
3213
  height: 32px;
3215
3214
  border-radius: var(--ap-radius-sm, 6px);
3216
- background: linear-gradient(90deg, var(--ap-muted, #f4f4f5) 25%, #e8e8ea 50%, var(--ap-muted, #f4f4f5) 75%);
3215
+ background: linear-gradient(90deg, var(--ap-muted, oklch(0.974 0.006 239.819)) 25%, #e8e8ea 50%, var(--ap-muted, oklch(0.974 0.006 239.819)) 75%);
3217
3216
  background-size: 200% 100%;
3218
3217
  animation: shimmer 1.5s infinite;
3219
3218
  }
@@ -3229,10 +3228,10 @@
3229
3228
 
3230
3229
  .wildcard-tooltip {
3231
3230
  font-size: 0.75rem;
3232
- color: var(--ap-muted-foreground, #71717a);
3231
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3233
3232
  margin-left: 4px;
3234
3233
  }
3235
- `];Y([c.property({type:Array})],U.prototype,"selected",2);Y([c.property({attribute:!1})],U.prototype,"apiClient",2);Y([c.query(".product-search")],U.prototype,"_searchInput",2);Y([c.state()],U.prototype,"_search",2);Y([c.state()],U.prototype,"_debouncedSearch",2);Y([c.state()],U.prototype,"_products",2);Y([c.state()],U.prototype,"_isLoading",2);Y([c.state()],U.prototype,"_showAddList",2);Y([c.state()],U.prototype,"_addListText",2);U=Y([c.customElement("ap-filter-product-ref")],U);var pa=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,T=(t,e,s,a)=>{for(var i=a>1?void 0:a?ha(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&pa(e,s,i),i};let C=class extends o.LitElement{constructor(){super(...arguments),this.totalCount=0,this.totalFolderCount=0,this.isLoading=!1,this.sortBy="created_at",this.sortDirection="desc",this.sortOptions=At,this.filters={metadata:{pinned:[],visible:[],applied:{}},pinned:[],visible:[],applied:{}},this.labels=[],this.tags=[],this.metadataFields=[],this.pinnedFilters=[],this.forcedFilterKeys=[],this._showDropdown=!1,this._showMetadataSelector=!1,this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null,this._outsideClickHandler=t=>{const e=t.composedPath();if(this._externalTrigger&&e.some(r=>{var n;return r instanceof HTMLElement&&r.classList.contains("chip")&&((n=r.closest)==null?void 0:n.call(r,"ap-filters-bar"))}))return;const s=this._openFilter&&e.some(i=>i instanceof HTMLElement?i.classList.contains("popover-anchor")||i.classList.contains("popover-panel"):!1),a=(this._showDropdown||this._showMetadataSelector)&&e.some(i=>i instanceof HTMLElement&&(i.classList.contains("dropdown-menu")||i.classList.contains("filter-dropdown")));s||a||(this._openFilter&&(this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null),(this._showDropdown||this._showMetadataSelector)&&(this._showDropdown=!1,this._showMetadataSelector=!1))}}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this._outsideClickHandler)}updated(t){if((t.has("_openFilter")||t.has("_externalTrigger")||t.has("_openMetadataField"))&&this.dispatchEvent(new CustomEvent("filter-panel-change",{detail:{key:this._externalTrigger?this._openFilter:null,metadataFieldKey:this._externalTrigger?this._openMetadataField:null},bubbles:!0,composed:!0})),this._externalTrigger&&this._externalLeft!=null&&(t.has("_openFilter")||t.has("_externalLeft")||t.has("_openMetadataField"))){const e=this.renderRoot.querySelector(".popover-panel");if(e){const s=e.closest(".popover-anchor"),a=s?s.offsetWidth:this.offsetWidth,i=e.offsetWidth;this._externalLeft+i>a-8&&(e.style.left=`${Math.max(8,a-i-8)}px`)}}}_closeAllDropdowns(){var t;this._showDropdown=!1,this._showMetadataSelector=!1,this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null,(t=this._sortDropdown)==null||t.close()}_toggleDropdown(){const t=this._showDropdown;this._closeAllDropdowns(),this._showDropdown=!t}_toggleMetadataSelector(){this._showMetadataSelector=!this._showMetadataSelector,this._showDropdown=!1}closeFilterPanel(){this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null}openFilterPanel(t,e=!1,s){if(e&&this._externalTrigger&&this._openFilter===t&&!this._openMetadataField){this.closeFilterPanel();return}if(!e&&!this._isFilterActive(t)){this._showDropdown=!1,this.dispatchEvent(new CustomEvent("filter-pending",{detail:{key:t},bubbles:!0,composed:!0}));return}this._showDropdown=!1,this._openFilter=t,this._openMetadataField=null,this._externalTrigger=e,this._externalLeft=s??null}_handleSortOpen(){this._showDropdown=!1,this._openFilter=null,this._openMetadataField=null}_handleSort(t){this.dispatchEvent(new CustomEvent("sort-change",{detail:t.detail,bubbles:!0,composed:!0}))}_toggleSortDirection(){const t=this.sortDirection==="asc"?"desc":"asc";this.dispatchEvent(new CustomEvent("sort-direction-change",{detail:{value:t},bubbles:!0,composed:!0}))}_isFilterActive(t){return t in this.filters.applied&&this.filters.applied[t]!==void 0}_handleFilterChange(t){t.stopPropagation();const{key:e,values:s,operator:a}=t.detail;this.dispatchEvent(new CustomEvent("filter-update",{detail:{key:e,values:s,operator:a},bubbles:!0,composed:!0}))}_handleMetadataFilterChange(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("metadata-filter-change",{detail:t.detail,bubbles:!0,composed:!0}))}_handleMetadataFieldToggle(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("metadata-field-toggle",{detail:t.detail,bubbles:!0,composed:!0}))}_handleMetadataFieldSelect(t){t.stopPropagation(),this._openMetadataField=t.detail.fieldKey}_handleMetadataSelectorFieldSelect(t){var s;t.stopPropagation();const e=t.detail.fieldKey;if(this._showMetadataSelector=!1,!(e in(((s=this.filters.metadata)==null?void 0:s.applied)||{}))){this.dispatchEvent(new CustomEvent("filter-pending",{detail:{metadataFieldKey:e},bubbles:!0,composed:!0}));return}this._openFilter="metadata",this._openMetadataField=e}_handleMetadataPin(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("metadata-pin",{detail:t.detail,bubbles:!0,composed:!0}))}openMetadataFieldPanel(t,e=!1,s){if(e&&this._externalTrigger&&this._openMetadataField===t){this.closeFilterPanel();return}this._showDropdown=!1,this._openFilter="metadata",this._openMetadataField=t,this._externalTrigger=e,this._externalLeft=s??null}_getMetadataFieldLabel(t){for(const e of this.metadataFields)if(`${dt[e.type]||""}${e.key}`===t)return e.label;return t}_togglePin(t,e){e.stopPropagation();const s=this.pinnedFilters.includes(t);this.dispatchEvent(new CustomEvent("filter-pin",{detail:{key:t,pinned:!s},bubbles:!0,composed:!0}))}_getFilterIcon(t){const e=Ut.find(s=>s.key===t);return(e==null?void 0:e.icon)||"filter"}_renderFilterContent(t){var s,a,i;const e=this.filters.applied;switch(t){case"type":{const r=e.type;return o.html`<ap-filter-type
3234
+ `];Y([c.property({type:Array})],q.prototype,"selected",2);Y([c.property({attribute:!1})],q.prototype,"apiClient",2);Y([c.query(".product-search")],q.prototype,"_searchInput",2);Y([c.state()],q.prototype,"_search",2);Y([c.state()],q.prototype,"_debouncedSearch",2);Y([c.state()],q.prototype,"_products",2);Y([c.state()],q.prototype,"_isLoading",2);Y([c.state()],q.prototype,"_showAddList",2);Y([c.state()],q.prototype,"_addListText",2);q=Y([c.customElement("ap-filter-product-ref")],q);var xa=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,F=(t,e,s,a)=>{for(var i=a>1?void 0:a?$a(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&xa(e,s,i),i};let S=class extends o.LitElement{constructor(){super(...arguments),this.totalCount=0,this.totalFolderCount=0,this.isLoading=!1,this.showUpload=!1,this.sortBy="created_at",this.sortDirection="desc",this.sortOptions=Ft,this.filters={metadata:{pinned:[],visible:[],applied:{}},pinned:[],visible:[],applied:{}},this.labels=[],this.tags=[],this.metadataFields=[],this.pinnedFilters=[],this.forcedFilterKeys=[],this._showDropdown=!1,this._showMetadataSelector=!1,this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null,this._outsideClickHandler=t=>{const e=t.composedPath();if(this._externalTrigger&&e.some(r=>{var n;return r instanceof HTMLElement&&r.classList.contains("chip")&&((n=r.closest)==null?void 0:n.call(r,"ap-filters-bar"))}))return;const s=this._openFilter&&e.some(i=>i instanceof HTMLElement?i.classList.contains("popover-anchor")||i.classList.contains("popover-panel"):!1),a=(this._showDropdown||this._showMetadataSelector)&&e.some(i=>i instanceof HTMLElement&&(i.classList.contains("dropdown-menu")||i.classList.contains("filter-dropdown")));s||a||(this._openFilter&&(this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null),(this._showDropdown||this._showMetadataSelector)&&(this._showDropdown=!1,this._showMetadataSelector=!1))}}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this._outsideClickHandler)}updated(t){if((t.has("_openFilter")||t.has("_externalTrigger")||t.has("_openMetadataField"))&&this.dispatchEvent(new CustomEvent("filter-panel-change",{detail:{key:this._externalTrigger?this._openFilter:null,metadataFieldKey:this._externalTrigger?this._openMetadataField:null},bubbles:!0,composed:!0})),this._externalTrigger&&this._externalLeft!=null&&(t.has("_openFilter")||t.has("_externalLeft")||t.has("_openMetadataField"))){const e=this.renderRoot.querySelector(".popover-panel");if(e){const s=e.closest(".popover-anchor"),a=s?s.offsetWidth:this.offsetWidth,i=e.offsetWidth;this._externalLeft+i>a-8&&(e.style.left=`${Math.max(8,a-i-8)}px`)}}}_closeAllDropdowns(){var t;this._showDropdown=!1,this._showMetadataSelector=!1,this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null,(t=this._sortDropdown)==null||t.close()}_handleUploadClick(){this.dispatchEvent(new CustomEvent("upload-click",{bubbles:!0,composed:!0}))}_toggleDropdown(){const t=this._showDropdown;this._closeAllDropdowns(),this._showDropdown=!t}_toggleMetadataSelector(){this._showMetadataSelector=!this._showMetadataSelector,this._showDropdown=!1}closeFilterPanel(){this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null}openFilterPanel(t,e=!1,s){if(e&&this._externalTrigger&&this._openFilter===t&&!this._openMetadataField){this.closeFilterPanel();return}if(!e&&!this._isFilterActive(t)){this._showDropdown=!1,this.dispatchEvent(new CustomEvent("filter-pending",{detail:{key:t},bubbles:!0,composed:!0}));return}this._showDropdown=!1,this._openFilter=t,this._openMetadataField=null,this._externalTrigger=e,this._externalLeft=s??null}_handleSortOpen(){this._showDropdown=!1,this._openFilter=null,this._openMetadataField=null}_handleSort(t){this.dispatchEvent(new CustomEvent("sort-change",{detail:t.detail,bubbles:!0,composed:!0}))}_toggleSortDirection(){const t=this.sortDirection==="asc"?"desc":"asc";this.dispatchEvent(new CustomEvent("sort-direction-change",{detail:{value:t},bubbles:!0,composed:!0}))}_isFilterActive(t){return t in this.filters.applied&&this.filters.applied[t]!==void 0}_handleFilterChange(t){t.stopPropagation();const{key:e,values:s,operator:a}=t.detail;this.dispatchEvent(new CustomEvent("filter-update",{detail:{key:e,values:s,operator:a},bubbles:!0,composed:!0}))}_handleMetadataFilterChange(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("metadata-filter-change",{detail:t.detail,bubbles:!0,composed:!0}))}_handleMetadataFieldToggle(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("metadata-field-toggle",{detail:t.detail,bubbles:!0,composed:!0}))}_handleMetadataFieldSelect(t){t.stopPropagation(),this._openMetadataField=t.detail.fieldKey}_handleMetadataSelectorFieldSelect(t){var s;t.stopPropagation();const e=t.detail.fieldKey;if(this._showMetadataSelector=!1,!(e in(((s=this.filters.metadata)==null?void 0:s.applied)||{}))){this.dispatchEvent(new CustomEvent("filter-pending",{detail:{metadataFieldKey:e},bubbles:!0,composed:!0}));return}this._openFilter="metadata",this._openMetadataField=e}_handleMetadataPin(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("metadata-pin",{detail:t.detail,bubbles:!0,composed:!0}))}openMetadataFieldPanel(t,e=!1,s){if(e&&this._externalTrigger&&this._openMetadataField===t){this.closeFilterPanel();return}this._showDropdown=!1,this._openFilter="metadata",this._openMetadataField=t,this._externalTrigger=e,this._externalLeft=s??null}_getMetadataFieldLabel(t){for(const e of this.metadataFields)if(`${ct[e.type]||""}${e.key}`===t)return e.label;return t}_togglePin(t,e){e.stopPropagation();const s=this.pinnedFilters.includes(t);this.dispatchEvent(new CustomEvent("filter-pin",{detail:{key:t,pinned:!s},bubbles:!0,composed:!0}))}_getFilterIcon(t){const e=St.find(s=>s.key===t);return(e==null?void 0:e.icon)||"filter"}_renderFilterContent(t){var s,a,i;const e=this.filters.applied;switch(t){case"type":{const r=e.type;return o.html`<ap-filter-type
3236
3235
  .selected=${(r==null?void 0:r.values)||[]}
3237
3236
  @filter-change=${this._handleFilterChange}
3238
3237
  ></ap-filter-type>`}case"tags":{const r=e.tags;return o.html`<ap-filter-tags
@@ -3309,7 +3308,7 @@
3309
3308
  @filter-change=${this._handleFilterChange}
3310
3309
  ></ap-filter-product-ref>`}default:return o.nothing}}_renderFilterButton(t){const e=t.key==="metadata",s=e?Object.keys(this.filters.metadata.applied).length>0:this._isFilterActive(t.key),a=this.pinnedFilters.includes(t.key);return o.html`
3311
3310
  <button
3312
- class="filter-btn ${s?"active":""}"
3311
+ class="filter-btn ${s?"active":""} ${a?"pinned":""}"
3313
3312
  @click=${()=>e?this._toggleMetadataSelector():this.openFilterPanel(t.key)}
3314
3313
  >
3315
3314
  <span class="filter-btn-icon">
@@ -3324,7 +3323,7 @@
3324
3323
  title=${a?"Unpin filter":"Pin filter"}
3325
3324
  @click=${i=>this._togglePin(t.key,i)}
3326
3325
  >
3327
- <ap-icon name=${a?"pin-off":"pin"} .size=${14}></ap-icon>
3326
+ <ap-icon name="pin" .size=${14}></ap-icon>
3328
3327
  </span>
3329
3328
  `}
3330
3329
  </button>
@@ -3341,7 +3340,7 @@
3341
3340
  </button>
3342
3341
  ${this._showDropdown?o.html`
3343
3342
  <div class="dropdown-menu">
3344
- ${Ut.filter(e=>!this.forcedFilterKeys.includes(e.key)).map(e=>this._renderFilterButton(e))}
3343
+ ${St.filter(e=>!this.forcedFilterKeys.includes(e.key)).map(e=>this._renderFilterButton(e))}
3345
3344
  </div>
3346
3345
  `:o.nothing}
3347
3346
  ${this._showMetadataSelector?o.html`
@@ -3359,7 +3358,6 @@
3359
3358
  </div>
3360
3359
  `:o.nothing}
3361
3360
  </div>
3362
- <div class="divider"></div>
3363
3361
  <ap-dropdown
3364
3362
  variant="borderless"
3365
3363
  label="Sort"
@@ -3376,6 +3374,12 @@
3376
3374
  >
3377
3375
  <ap-icon name=${this.sortDirection==="asc"?"sort-asc":"sort-desc"} .size=${18}></ap-icon>
3378
3376
  </button>
3377
+ ${this.showUpload?o.html`
3378
+ <button class="upload-btn" @click=${this._handleUploadClick}>
3379
+ <ap-icon name="upload" .size=${16}></ap-icon>
3380
+ Upload
3381
+ </button>
3382
+ `:o.nothing}
3379
3383
  </div>
3380
3384
  </div>
3381
3385
  ${this._openFilter?o.html`
@@ -3389,7 +3393,7 @@
3389
3393
  ${this._getMetadataFieldLabel(this._openMetadataField)}
3390
3394
  `:o.html`
3391
3395
  <ap-icon name=${this._getFilterIcon(this._openFilter)} .size=${16}></ap-icon>
3392
- ${Ee[this._openFilter]||this._openFilter}
3396
+ ${ke[this._openFilter]||this._openFilter}
3393
3397
  `}
3394
3398
  <button class="anchor-close" @click=${()=>{this._openFilter=null,this._openMetadataField=null,this._externalTrigger=!1,this._externalLeft=null}} title="Close">
3395
3399
  <ap-icon name="close" .size=${14}></ap-icon>
@@ -3401,10 +3405,10 @@
3401
3405
  </div>
3402
3406
  </div>
3403
3407
  `:o.nothing}
3404
- `}};C.styles=o.css`
3408
+ `}};S.styles=o.css`
3405
3409
  :host {
3406
3410
  display: block;
3407
- padding: 8px 20px 0;
3411
+ padding: 8px 20px 6px;
3408
3412
  }
3409
3413
  .toolbar-row {
3410
3414
  display: flex;
@@ -3413,7 +3417,7 @@
3413
3417
  }
3414
3418
  .count {
3415
3419
  font-size: 0.8125rem;
3416
- color: var(--ap-muted-foreground, #71717a);
3420
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
3417
3421
  white-space: nowrap;
3418
3422
  }
3419
3423
  .count-skeleton {
@@ -3421,7 +3425,7 @@
3421
3425
  width: 80px;
3422
3426
  height: 14px;
3423
3427
  border-radius: 4px;
3424
- background: linear-gradient(90deg, var(--ap-muted, #f4f4f5) 25%, #e8e8ea 50%, var(--ap-muted, #f4f4f5) 75%);
3428
+ background: linear-gradient(90deg, var(--ap-muted, oklch(0.974 0.006 239.819)) 25%, #e8e8ea 50%, var(--ap-muted, oklch(0.974 0.006 239.819)) 75%);
3425
3429
  background-size: 200% 100%;
3426
3430
  animation: shimmer 1.5s infinite;
3427
3431
  }
@@ -3450,19 +3454,20 @@
3450
3454
  display: inline-flex;
3451
3455
  align-items: center;
3452
3456
  gap: 6px;
3453
- padding: 6px 14px;
3457
+ height: 36px;
3458
+ padding: 0 14px;
3454
3459
  border: none;
3455
3460
  border-radius: 6px;
3456
3461
  font-size: 0.875rem;
3457
3462
  font-weight: 500;
3458
3463
  background: none;
3459
- color: var(--ap-primary, oklch(0.65 0.19 258));
3464
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3460
3465
  cursor: pointer;
3461
3466
  white-space: nowrap;
3462
3467
  transition: background 150ms;
3463
3468
  }
3464
3469
  .add-btn:hover {
3465
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.08));
3470
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
3466
3471
  }
3467
3472
  .add-btn ap-icon {
3468
3473
  transition: transform 200ms;
@@ -3478,8 +3483,8 @@
3478
3483
  height: 18px;
3479
3484
  padding: 0 5px;
3480
3485
  border-radius: 9px;
3481
- background: var(--ap-primary, oklch(0.65 0.19 258));
3482
- color: var(--ap-primary-foreground, #fff);
3486
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
3487
+ color: var(--ap-primary-foreground, oklch(1 0 0));
3483
3488
  font-size: 0.6875rem;
3484
3489
  font-weight: 600;
3485
3490
  line-height: 1;
@@ -3490,8 +3495,8 @@
3490
3495
  right: 0;
3491
3496
  z-index: 50;
3492
3497
  min-width: 480px;
3493
- background: var(--ap-card, #fff);
3494
- border: 1px solid var(--ap-border, #e4e4e7);
3498
+ background: var(--ap-card, oklch(1 0 0));
3499
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3495
3500
  border-radius: var(--ap-radius, 8px);
3496
3501
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
3497
3502
  padding: 16px;
@@ -3506,7 +3511,7 @@
3506
3511
  width: 280px;
3507
3512
  padding: 0;
3508
3513
  max-height: 400px;
3509
- overflow: hidden;
3514
+ overflow-y: auto;
3510
3515
  }
3511
3516
 
3512
3517
  /* Filter button in dropdown */
@@ -3515,10 +3520,10 @@
3515
3520
  align-items: center;
3516
3521
  gap: 8px;
3517
3522
  padding: 8px 12px;
3518
- border: 1px solid var(--ap-border, #e4e4e7);
3523
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3519
3524
  border-radius: var(--ap-radius, 8px);
3520
- background: var(--ap-background, #fff);
3521
- color: var(--ap-foreground, #09090b);
3525
+ background: var(--ap-background, oklch(1 0 0));
3526
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3522
3527
  font-size: 0.9375rem;
3523
3528
  cursor: pointer;
3524
3529
  transition: all 150ms;
@@ -3526,25 +3531,33 @@
3526
3531
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
3527
3532
  }
3528
3533
  .filter-btn:hover {
3529
- background: var(--ap-muted, #f4f4f5);
3530
- border-color: var(--ap-muted-foreground, #a1a1aa);
3534
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
3535
+ border-color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3531
3536
  }
3532
3537
  .filter-btn.active {
3533
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.08));
3534
- border-color: var(--ap-primary-20, oklch(0.65 0.19 258 / 0.25));
3535
- color: var(--ap-foreground, #09090b);
3538
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
3539
+ border-color: var(--ap-primary-20, oklch(0.578 0.198 268.129 / 0.2));
3540
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3536
3541
  }
3537
3542
  .filter-btn.active:hover {
3538
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.12));
3543
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.12));
3544
+ }
3545
+ .filter-btn.pinned {
3546
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
3547
+ border-color: var(--ap-primary-20, oklch(0.578 0.198 268.129 / 0.2));
3548
+ }
3549
+ .filter-btn.pinned:hover {
3550
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.12));
3539
3551
  }
3540
3552
  .filter-btn-icon {
3541
3553
  display: flex;
3542
3554
  align-items: center;
3543
- color: var(--ap-muted-foreground, #71717a);
3555
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3544
3556
  flex-shrink: 0;
3545
3557
  }
3546
- .filter-btn.active .filter-btn-icon {
3547
- color: var(--ap-primary, oklch(0.65 0.19 258));
3558
+ .filter-btn.active .filter-btn-icon,
3559
+ .filter-btn.pinned .filter-btn-icon {
3560
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3548
3561
  }
3549
3562
  .filter-btn-label {
3550
3563
  display: flex;
@@ -3554,7 +3567,7 @@
3554
3567
  min-width: 0;
3555
3568
  }
3556
3569
  .filter-btn-label ap-icon {
3557
- color: var(--ap-muted-foreground, #71717a);
3570
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3558
3571
  }
3559
3572
  .pin-btn {
3560
3573
  display: flex;
@@ -3566,7 +3579,7 @@
3566
3579
  background: none;
3567
3580
  cursor: pointer;
3568
3581
  padding: 0;
3569
- color: var(--ap-muted-foreground, #71717a);
3582
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3570
3583
  border-radius: 4px;
3571
3584
  flex-shrink: 0;
3572
3585
  margin-left: auto;
@@ -3578,23 +3591,23 @@
3578
3591
  opacity: 1;
3579
3592
  }
3580
3593
  .pin-btn:hover {
3581
- color: var(--ap-primary, oklch(0.65 0.19 258));
3582
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.08));
3594
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3595
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.08));
3583
3596
  }
3584
3597
  .pin-btn.pinned {
3585
- color: var(--ap-primary, oklch(0.65 0.19 258));
3598
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3586
3599
  }
3587
3600
  .submenu-chevron {
3588
3601
  display: flex;
3589
3602
  align-items: center;
3590
- color: var(--ap-muted-foreground, #71717a);
3603
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3591
3604
  margin-left: auto;
3592
3605
  }
3593
3606
 
3594
3607
  .divider {
3595
3608
  width: 1px;
3596
3609
  height: 24px;
3597
- background: var(--ap-border, #e4e4e7);
3610
+ background: var(--ap-border, oklch(92.86% 0.009 247.92));
3598
3611
  }
3599
3612
  .icon-btn {
3600
3613
  display: flex;
@@ -3605,17 +3618,40 @@
3605
3618
  border: 1px solid transparent;
3606
3619
  border-radius: var(--ap-radius-sm, 6px);
3607
3620
  background: none;
3608
- color: var(--ap-muted-foreground, #71717a);
3621
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
3609
3622
  cursor: pointer;
3610
3623
  }
3611
3624
  .icon-btn:hover {
3612
- background: var(--ap-muted, #f4f4f5);
3613
- color: var(--ap-foreground, #09090b);
3625
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
3626
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3614
3627
  }
3615
3628
  .icon-btn:focus-visible {
3616
- outline: 2px solid var(--ap-ring, oklch(0.65 0.19 258));
3629
+ outline: 2px solid var(--ap-ring, oklch(0.578 0.198 268.129 / 0.7));
3617
3630
  outline-offset: -2px;
3618
3631
  }
3632
+ .upload-btn {
3633
+ display: inline-flex;
3634
+ align-items: center;
3635
+ gap: 6px;
3636
+ margin-left: 4px;
3637
+ padding: 6px 14px;
3638
+ border: none;
3639
+ border-radius: 6px;
3640
+ font-size: 0.875rem;
3641
+ font-weight: 500;
3642
+ background: var(--ap-primary, oklch(0.65 0.19 258));
3643
+ color: var(--ap-primary-foreground, #fff);
3644
+ cursor: pointer;
3645
+ white-space: nowrap;
3646
+ transition: opacity 150ms;
3647
+ }
3648
+ .upload-btn:hover {
3649
+ opacity: 0.9;
3650
+ }
3651
+ .upload-btn:focus-visible {
3652
+ outline: 2px solid var(--ap-ring, oklch(0.65 0.19 258));
3653
+ outline-offset: 2px;
3654
+ }
3619
3655
 
3620
3656
  /* Popover anchor row */
3621
3657
  .popover-anchor {
@@ -3633,13 +3669,13 @@
3633
3669
  align-items: center;
3634
3670
  gap: 6px;
3635
3671
  padding: 6px 14px;
3636
- border: 1px solid var(--ap-border, #e4e4e7);
3637
- border-bottom: 1px solid var(--ap-card, #fff);
3672
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3673
+ border-bottom: 1px solid var(--ap-card, oklch(1 0 0));
3638
3674
  border-radius: 8px 8px 0 0;
3639
- background: var(--ap-card, #fff);
3675
+ background: var(--ap-card, oklch(1 0 0));
3640
3676
  font-size: 0.875rem;
3641
3677
  font-weight: 500;
3642
- color: var(--ap-primary, oklch(0.65 0.19 258));
3678
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3643
3679
  position: relative;
3644
3680
  z-index: 51;
3645
3681
  margin-bottom: -1px;
@@ -3651,11 +3687,11 @@
3651
3687
  border: none;
3652
3688
  cursor: pointer;
3653
3689
  padding: 0;
3654
- color: var(--ap-muted-foreground, #71717a);
3690
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3655
3691
  transition: color 150ms;
3656
3692
  }
3657
3693
  .anchor-close:hover {
3658
- color: var(--ap-foreground, #09090b);
3694
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3659
3695
  }
3660
3696
  .anchor-back {
3661
3697
  display: flex;
@@ -3664,11 +3700,11 @@
3664
3700
  border: none;
3665
3701
  cursor: pointer;
3666
3702
  padding: 0;
3667
- color: var(--ap-muted-foreground, #71717a);
3703
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3668
3704
  transition: color 150ms;
3669
3705
  }
3670
3706
  .anchor-back:hover {
3671
- color: var(--ap-foreground, #09090b);
3707
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3672
3708
  }
3673
3709
  .popover-panel {
3674
3710
  position: absolute;
@@ -3679,11 +3715,11 @@
3679
3715
  max-height: 400px;
3680
3716
  overflow-y: auto;
3681
3717
  overscroll-behavior: contain;
3682
- background: var(--ap-card, #fff);
3683
- border: 1px solid var(--ap-border, #e4e4e7);
3718
+ background: var(--ap-card, oklch(1 0 0));
3719
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3684
3720
  border-radius: 0 8px 8px 8px;
3685
3721
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
3686
- padding: 10px 8px;
3722
+ padding: 12px;
3687
3723
  }
3688
3724
  .popover-anchor.external {
3689
3725
  padding: 0;
@@ -3692,10 +3728,10 @@
3692
3728
  border-radius: 8px;
3693
3729
  top: 0;
3694
3730
  }
3695
- `;T([c.property({type:Number})],C.prototype,"totalCount",2);T([c.property({type:Number})],C.prototype,"totalFolderCount",2);T([c.property({type:Boolean})],C.prototype,"isLoading",2);T([c.property()],C.prototype,"sortBy",2);T([c.property()],C.prototype,"sortDirection",2);T([c.property({type:Array})],C.prototype,"sortOptions",2);T([c.property({type:Object})],C.prototype,"filters",2);T([c.property({type:Array})],C.prototype,"labels",2);T([c.property({type:Array})],C.prototype,"tags",2);T([c.property({type:Array})],C.prototype,"metadataFields",2);T([c.property({type:Array})],C.prototype,"pinnedFilters",2);T([c.property({type:Array})],C.prototype,"forcedFilterKeys",2);T([c.property({attribute:!1})],C.prototype,"apiClient",2);T([c.query("ap-dropdown")],C.prototype,"_sortDropdown",2);T([c.state()],C.prototype,"_showDropdown",2);T([c.state()],C.prototype,"_showMetadataSelector",2);T([c.state()],C.prototype,"_openFilter",2);T([c.state()],C.prototype,"_openMetadataField",2);T([c.state()],C.prototype,"_externalTrigger",2);T([c.state()],C.prototype,"_externalLeft",2);C=T([c.customElement("ap-content-toolbar")],C);var ua=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,N=(t,e,s,a)=>{for(var i=a>1?void 0:a?fa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ua(e,s,i),i};let D=class extends o.LitElement{constructor(){super(...arguments),this.appliedFilters={},this.appliedMetadata={},this.forcedFilters={},this.metadataFields=[],this.pinnedFilters=[],this.pinnedMetadataFields=[],this.tags=[],this.labels=[],this.activeFilter=null,this.activeMetadataField=null,this.pendingFilter=null,this.pendingMetadataField=null}_mapTypeLabel(t){var e;return((e=ss.find(s=>s.value===t))==null?void 0:e.label)||t}_getSizeSummary(t){if(t.values.length===0)return"";const e=t.values[0],[s,a]=e.split(".."),i=s?parseFloat(s):null,r=a?parseFloat(a):null,n=l=>l>=1e3?`${(l/1e3).toFixed(l%1e3===0?0:1)} GB`:`${l} MB`;return i!==null&&r!==null?`${n(i)} – ${n(r)}`:i!==null?`> ${n(i)}`:r!==null?`< ${n(r)}`:""}_getFilterSummary(t,e){if(t.type==="string"){const s=t;if(s.values.length===0)return"";if(e===m.SIZE)return this._getSizeSummary(s);if(e===m.COLOR){const i=s.values.map(r=>r.split(" ")[0]).filter(Boolean);return i.length===0?"":i.length===1?i[0]:`${i[0]} +${i.length-1}`}const a=e===m.TYPE?i=>this._mapTypeLabel(i):e===m.TAGS?i=>{var r;return((r=this.tags.find(n=>n.sid===i))==null?void 0:r.label)||i}:e===m.LABELS?i=>{var r;return((r=this.labels.find(n=>n.sid===i))==null?void 0:r.name)||i}:i=>i;return s.values.length===1?a(s.values[0]):`${a(s.values[0])} +${s.values.length-1}`}if(t.type==="date")return this._getDateSummary(t);if(typeof t=="object"&&"resolution"in t){const s=t,a=[...s.resolution,...s.orientation,...s.faces];return a.length===0?"":a.length===1?a[0]:`${a[0]} +${a.length-1}`}return""}_getDateSummary(t){var n,l;const e=((n=is.find(d=>d.value===t.field))==null?void 0:n.label)||t.field,s=[...Ft,...as],a=t.preset?((l=s.find(d=>d.value===t.preset))==null?void 0:l.label)||t.preset:"",i=d=>{try{return d.split("T")[0]}catch{return d}};let r="";switch(t.kind){case"preset":r=a;break;case"before":r=t.to?`Before ${i(t.to)}`:a;break;case"after":r=t.from?`After ${i(t.from)}`:a;break;case"between":t.from&&t.to?r=`${i(t.from)} – ${i(t.to)}`:t.from?r=`After ${i(t.from)}`:t.to&&(r=`Before ${i(t.to)}`);break;case"specific":r=t.from?i(t.from):"";break;default:r=a}return r?`${e}: ${r}`:""}_getMetadataLabel(t){const e=this._stripMetadataPrefix(t),s=this.metadataFields.find(a=>a.key===e);return(s==null?void 0:s.label)||e}_stripMetadataPrefix(t){for(const e of Zt)if(t.startsWith(e))return t.slice(e.length);return t}_removeFilter(t){this.dispatchEvent(new CustomEvent("filter-remove",{detail:{key:t},bubbles:!0,composed:!0}))}_removeMetadataFilter(t){this.dispatchEvent(new CustomEvent("metadata-filter-remove",{detail:{fieldKey:t},bubbles:!0,composed:!0}))}_clearAll(){this.dispatchEvent(new CustomEvent("filters-clear-all",{bubbles:!0,composed:!0}))}_openFilter(t,e){const a=e.currentTarget.getBoundingClientRect();this.dispatchEvent(new CustomEvent("filter-open",{detail:{key:t,chipRect:{left:a.left,right:a.right,bottom:a.bottom,width:a.width}},bubbles:!0,composed:!0}))}_openMetadataFilter(t,e){const a=e.currentTarget.getBoundingClientRect();this.dispatchEvent(new CustomEvent("metadata-filter-open",{detail:{fieldKey:t,chipRect:{left:a.left,right:a.right,bottom:a.bottom,width:a.width}},bubbles:!0,composed:!0}))}_renderForcedChip(t,e){const s=this._getFilterSummary(e,t),a=e.type==="date";return o.html`
3731
+ `;F([c.property({type:Number})],S.prototype,"totalCount",2);F([c.property({type:Number})],S.prototype,"totalFolderCount",2);F([c.property({type:Boolean})],S.prototype,"isLoading",2);F([c.property({type:Boolean})],S.prototype,"showUpload",2);F([c.property()],S.prototype,"sortBy",2);F([c.property()],S.prototype,"sortDirection",2);F([c.property({type:Array})],S.prototype,"sortOptions",2);F([c.property({type:Object})],S.prototype,"filters",2);F([c.property({type:Array})],S.prototype,"labels",2);F([c.property({type:Array})],S.prototype,"tags",2);F([c.property({type:Array})],S.prototype,"metadataFields",2);F([c.property({type:Array})],S.prototype,"pinnedFilters",2);F([c.property({type:Array})],S.prototype,"forcedFilterKeys",2);F([c.property({attribute:!1})],S.prototype,"apiClient",2);F([c.query("ap-dropdown")],S.prototype,"_sortDropdown",2);F([c.state()],S.prototype,"_showDropdown",2);F([c.state()],S.prototype,"_showMetadataSelector",2);F([c.state()],S.prototype,"_openFilter",2);F([c.state()],S.prototype,"_openMetadataField",2);F([c.state()],S.prototype,"_externalTrigger",2);F([c.state()],S.prototype,"_externalLeft",2);S=F([c.customElement("ap-content-toolbar")],S);var wa=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,j=(t,e,s,a)=>{for(var i=a>1?void 0:a?ka(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&wa(e,s,i),i};let D=class extends o.LitElement{constructor(){super(...arguments),this.appliedFilters={},this.appliedMetadata={},this.forcedFilters={},this.metadataFields=[],this.pinnedFilters=[],this.pinnedMetadataFields=[],this.tags=[],this.labels=[],this.activeFilter=null,this.activeMetadataField=null,this.pendingFilter=null,this.pendingMetadataField=null}_mapTypeLabel(t){var e;return((e=ss.find(s=>s.value===t))==null?void 0:e.label)||t}_getSizeSummary(t){if(t.values.length===0)return"";const e=t.values[0],[s,a]=e.split(".."),i=s?parseFloat(s):null,r=a?parseFloat(a):null,n=l=>l>=1e3?`${(l/1e3).toFixed(l%1e3===0?0:1)} GB`:`${l} MB`;return i!==null&&r!==null?`${n(i)} – ${n(r)}`:i!==null?`> ${n(i)}`:r!==null?`< ${n(r)}`:""}_getFilterSummary(t,e){if(t.type==="string"){const s=t;if(s.values.length===0)return"";if(e===m.SIZE)return this._getSizeSummary(s);if(e===m.COLOR){const i=s.values.map(r=>r.split(" ")[0]).filter(Boolean);return i.length===0?"":i.length===1?i[0]:`${i[0]} +${i.length-1}`}const a=e===m.TYPE?i=>this._mapTypeLabel(i):e===m.TAGS?i=>{var r;return((r=this.tags.find(n=>n.sid===i))==null?void 0:r.label)||i}:e===m.LABELS?i=>{var r;return((r=this.labels.find(n=>n.sid===i))==null?void 0:r.name)||i}:i=>i;return s.values.length===1?a(s.values[0]):`${a(s.values[0])} +${s.values.length-1}`}if(t.type==="date")return this._getDateSummary(t);if(typeof t=="object"&&"resolution"in t){const s=t,a=[...s.resolution,...s.orientation,...s.faces];return a.length===0?"":a.length===1?a[0]:`${a[0]} +${a.length-1}`}return""}_getDateSummary(t){var n,l;const e=((n=is.find(d=>d.value===t.field))==null?void 0:n.label)||t.field,s=[...Et,...as],a=t.preset?((l=s.find(d=>d.value===t.preset))==null?void 0:l.label)||t.preset:"",i=d=>{try{return d.split("T")[0]}catch{return d}};let r="";switch(t.kind){case"preset":r=a;break;case"before":r=t.to?`Before ${i(t.to)}`:a;break;case"after":r=t.from?`After ${i(t.from)}`:a;break;case"between":t.from&&t.to?r=`${i(t.from)} – ${i(t.to)}`:t.from?r=`After ${i(t.from)}`:t.to&&(r=`Before ${i(t.to)}`);break;case"specific":r=t.from?i(t.from):"";break;default:r=a}return r?`${e}: ${r}`:""}_getFilterIcon(t){var e;return((e=St.find(s=>s.key===t))==null?void 0:e.icon)||"filter"}_getMetadataLabel(t){const e=this._stripMetadataPrefix(t),s=this.metadataFields.find(a=>a.key===e);return(s==null?void 0:s.label)||e}_stripMetadataPrefix(t){for(const e of Zt)if(t.startsWith(e))return t.slice(e.length);return t}_removeFilter(t){this.dispatchEvent(new CustomEvent("filter-remove",{detail:{key:t},bubbles:!0,composed:!0}))}_removeMetadataFilter(t){this.dispatchEvent(new CustomEvent("metadata-filter-remove",{detail:{fieldKey:t},bubbles:!0,composed:!0}))}_clearAll(){this.dispatchEvent(new CustomEvent("filters-clear-all",{bubbles:!0,composed:!0}))}_openFilter(t,e){const a=e.currentTarget.getBoundingClientRect();this.dispatchEvent(new CustomEvent("filter-open",{detail:{key:t,chipRect:{left:a.left,right:a.right,bottom:a.bottom,width:a.width}},bubbles:!0,composed:!0}))}_openMetadataFilter(t,e){const a=e.currentTarget.getBoundingClientRect();this.dispatchEvent(new CustomEvent("metadata-filter-open",{detail:{fieldKey:t,chipRect:{left:a.left,right:a.right,bottom:a.bottom,width:a.width}},bubbles:!0,composed:!0}))}_renderForcedChip(t,e){const s=this._getFilterSummary(e,t),a=e.type==="date";return o.html`
3696
3732
  <span class="chip forced">
3697
3733
  ${(a||t===m.TYPE||t===m.SIZE)&&s?o.html`<span class="chip-label">${s}</span>`:o.html`
3698
- <span class="chip-label">${Ee[t]||t}</span>
3734
+ <span class="chip-label">${ke[t]||t}</span>
3699
3735
  ${s?o.html`<span class="chip-summary">${s}</span>`:o.nothing}
3700
3736
  `}
3701
3737
  <span class="chip-lock">
@@ -3704,12 +3740,16 @@
3704
3740
  </span>
3705
3741
  `}_renderFilterChip(t,e){if(!e)return o.html`
3706
3742
  <span class="chip pinned-empty ${t===this.activeFilter?"active":""}" @click=${i=>this._openFilter(t,i)}>
3707
- <span class="chip-label">${Ee[t]||t}</span>
3743
+ <span class="chip-icon"><ap-icon name=${this._getFilterIcon(t)} .size=${16}></ap-icon></span>
3744
+ <span class="chip-label">${ke[t]||t}</span>
3745
+ <span class="chip-chevron"><ap-icon name="chevron-down" .size=${14}></ap-icon></span>
3708
3746
  </span>
3709
3747
  `;const s=this._getFilterSummary(e,t),a=e.type==="date";return o.html`
3710
3748
  <span class="chip ${t===this.activeFilter?"active":""}" @click=${i=>this._openFilter(t,i)}>
3711
- ${(a||t===m.TYPE||t===m.SIZE)&&s?o.html`<span class="chip-label">${s}</span>`:o.html`
3712
- <span class="chip-label">${Ee[t]||t}</span>
3749
+ ${(a||t===m.TYPE||t===m.SIZE)&&s?o.html`
3750
+ <span class="chip-icon"><ap-icon name=${this._getFilterIcon(t)} .size=${16}></ap-icon></span>
3751
+ <span class="chip-label">${s}</span>`:o.html`
3752
+ <span class="chip-label">${ke[t]||t}</span>
3713
3753
  ${s?o.html`<span class="chip-summary">${s}</span>`:o.nothing}
3714
3754
  `}
3715
3755
  <button class="chip-remove" @click=${i=>{i.stopPropagation(),this._removeFilter(t)}} title="Remove filter">
@@ -3718,7 +3758,9 @@
3718
3758
  </span>
3719
3759
  `}_renderMetadataChip(t,e){if(!e){const i=this._getMetadataLabel(t);return o.html`
3720
3760
  <span class="chip pinned-empty ${t===this.activeMetadataField?"active":""}" @click=${r=>this._openMetadataFilter(t,r)}>
3761
+ <span class="chip-icon"><ap-icon name="file-text" .size=${16}></ap-icon></span>
3721
3762
  <span class="chip-label">${i}</span>
3763
+ <span class="chip-chevron"><ap-icon name="chevron-down" .size=${14}></ap-icon></span>
3722
3764
  </span>
3723
3765
  `}const s=this._getFilterSummary(e),a=this._getMetadataLabel(t);return o.html`
3724
3766
  <span class="chip ${t===this.activeMetadataField?"active":""}" @click=${i=>this._openMetadataFilter(t,i)}>
@@ -3728,26 +3770,30 @@
3728
3770
  <ap-icon name="close" .size=${12}></ap-icon>
3729
3771
  </button>
3730
3772
  </span>
3731
- `}render(){const t=ze(this.forcedFilters),e=new Set(Object.keys(t)),s=Object.keys(this.appliedFilters).filter(f=>!e.has(f)),a=Object.keys(this.appliedMetadata),i=new Set(this.pinnedFilters),r=new Set(this.pinnedMetadataFields),n=this.pinnedFilters.filter(f=>!e.has(f)),l=s.filter(f=>!i.has(f)),d=a.filter(f=>!r.has(f)),h=this.pendingFilter&&!i.has(this.pendingFilter)&&!(this.pendingFilter in this.appliedFilters),u=this.pendingMetadataField&&!r.has(this.pendingMetadataField)&&!(this.pendingMetadataField in this.appliedMetadata),g=s.length+a.length>0;return e.size+n.length+this.pinnedMetadataFields.length+l.length+d.length+(h?1:0)+(u?1:0)===0?o.nothing:o.html`
3773
+ `}render(){const t=De(this.forcedFilters),e=new Set(Object.keys(t)),s=Object.keys(this.appliedFilters).filter(g=>!e.has(g)),a=Object.keys(this.appliedMetadata),i=new Set(this.pinnedFilters),r=new Set(this.pinnedMetadataFields),n=this.pinnedFilters.filter(g=>!e.has(g)),l=s.filter(g=>!i.has(g)),d=a.filter(g=>!r.has(g)),h=this.pendingFilter&&!i.has(this.pendingFilter)&&!(this.pendingFilter in this.appliedFilters),u=this.pendingMetadataField&&!r.has(this.pendingMetadataField)&&!(this.pendingMetadataField in this.appliedMetadata),f=s.length+a.length>0;return e.size+n.length+this.pinnedMetadataFields.length+l.length+d.length+(h?1:0)+(u?1:0)===0?o.nothing:o.html`
3732
3774
  <div class="chips-row">
3733
3775
  <div class="chips">
3734
- ${[...e].map(f=>this._renderForcedChip(f,t[f]))}
3735
- ${n.map(f=>this._renderFilterChip(f,this.appliedFilters[f]))}
3736
- ${this.pinnedMetadataFields.map(f=>this._renderMetadataChip(f,this.appliedMetadata[f]))}
3737
- ${l.map(f=>this._renderFilterChip(f,this.appliedFilters[f]))}
3776
+ ${[...e].map(g=>this._renderForcedChip(g,t[g]))}
3777
+ ${n.map(g=>this._renderFilterChip(g,this.appliedFilters[g]))}
3778
+ ${this.pinnedMetadataFields.map(g=>this._renderMetadataChip(g,this.appliedMetadata[g]))}
3779
+ ${l.map(g=>this._renderFilterChip(g,this.appliedFilters[g]))}
3738
3780
  ${h?o.html`
3739
- <span class="chip pinned-empty active pending" @click=${f=>this._openFilter(this.pendingFilter,f)}>
3740
- <span class="chip-label">${Ee[this.pendingFilter]||this.pendingFilter}</span>
3781
+ <span class="chip pinned-empty active pending" @click=${g=>this._openFilter(this.pendingFilter,g)}>
3782
+ <span class="chip-icon"><ap-icon name=${this._getFilterIcon(this.pendingFilter)} .size=${16}></ap-icon></span>
3783
+ <span class="chip-label">${ke[this.pendingFilter]||this.pendingFilter}</span>
3784
+ <span class="chip-chevron"><ap-icon name="chevron-down" .size=${14}></ap-icon></span>
3741
3785
  </span>
3742
3786
  `:o.nothing}
3743
- ${d.map(f=>this._renderMetadataChip(f,this.appliedMetadata[f]))}
3787
+ ${d.map(g=>this._renderMetadataChip(g,this.appliedMetadata[g]))}
3744
3788
  ${u?o.html`
3745
- <span class="chip pinned-empty active pending" @click=${f=>this._openMetadataFilter(this.pendingMetadataField,f)}>
3789
+ <span class="chip pinned-empty active pending" @click=${g=>this._openMetadataFilter(this.pendingMetadataField,g)}>
3790
+ <span class="chip-icon"><ap-icon name="file-text" .size=${16}></ap-icon></span>
3746
3791
  <span class="chip-label">${this._getMetadataLabel(this.pendingMetadataField)}</span>
3792
+ <span class="chip-chevron"><ap-icon name="chevron-down" .size=${14}></ap-icon></span>
3747
3793
  </span>
3748
3794
  `:o.nothing}
3795
+ ${f?o.html`<button class="clear-all" @click=${this._clearAll}>Clear filters</button>`:o.nothing}
3749
3796
  </div>
3750
- ${g?o.html`<button class="clear-all" @click=${this._clearAll}>Clear filters</button>`:o.nothing}
3751
3797
  </div>
3752
3798
  `}};D.styles=o.css`
3753
3799
  :host {
@@ -3760,7 +3806,7 @@
3760
3806
  display: flex;
3761
3807
  align-items: center;
3762
3808
  gap: 8px;
3763
- padding: 0 20px 8px;
3809
+ padding: 0 20px 16px;
3764
3810
  }
3765
3811
  .chips {
3766
3812
  display: flex;
@@ -3778,21 +3824,22 @@
3778
3824
  display: inline-flex;
3779
3825
  align-items: center;
3780
3826
  gap: 4px;
3781
- padding: 4px 12px;
3782
- border: 1px solid var(--ap-primary-20, oklch(0.65 0.19 258 / 0.25));
3783
- border-radius: 9999px;
3827
+ height: 32px;
3828
+ padding: 0 12px;
3829
+ border: 1px solid var(--ap-primary-20, oklch(0.578 0.198 268.129 / 0.2));
3830
+ border-radius: 6px;
3784
3831
  font-size: 0.8125rem;
3785
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
3786
- color: var(--ap-primary, oklch(0.65 0.19 258));
3832
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
3833
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3787
3834
  cursor: pointer;
3788
3835
  white-space: nowrap;
3789
3836
  transition: all 150ms;
3790
3837
  }
3791
3838
  .chip:hover {
3792
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.15));
3839
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.15));
3793
3840
  }
3794
3841
  .chip.active {
3795
- background: var(--ap-primary-20, oklch(0.65 0.19 258 / 0.2));
3842
+ background: var(--ap-primary-20, oklch(0.578 0.198 268.129 / 0.2));
3796
3843
  }
3797
3844
  .chip-label {
3798
3845
  font-weight: 500;
@@ -3824,26 +3871,27 @@
3824
3871
  display: inline-flex;
3825
3872
  align-items: center;
3826
3873
  gap: 4px;
3827
- padding: 4px 10px;
3874
+ height: 34px;
3875
+ padding: 0 10px;
3828
3876
  border: none;
3829
3877
  border-radius: 6px;
3830
3878
  font-size: 0.8125rem;
3831
3879
  background: none;
3832
- color: var(--ap-muted-foreground, #71717a);
3880
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
3833
3881
  cursor: pointer;
3834
3882
  white-space: nowrap;
3835
3883
  transition: all 150ms;
3836
3884
  }
3837
3885
  .clear-all:hover {
3838
- background: var(--ap-muted, #f4f4f5);
3839
- color: var(--ap-foreground, #09090b);
3886
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
3887
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3840
3888
  }
3841
3889
  .chip.forced {
3842
3890
  cursor: default;
3843
3891
  opacity: 0.85;
3844
3892
  }
3845
3893
  .chip.forced:hover {
3846
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
3894
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
3847
3895
  }
3848
3896
  .chip-lock {
3849
3897
  display: flex;
@@ -3853,23 +3901,48 @@
3853
3901
  margin-left: 4px;
3854
3902
  }
3855
3903
  .chip.pinned-empty {
3856
- border-style: dashed;
3904
+ height: 32px;
3905
+ padding: 0 12px;
3906
+ gap: 6px;
3907
+ border-style: solid;
3908
+ border-radius: 6px;
3857
3909
  background: transparent;
3858
- color: var(--ap-muted-foreground, #71717a);
3859
- border-color: var(--ap-border, #e4e4e7);
3910
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3911
+ border-color: var(--ap-input, oklch(0.871 0.016 241.798));
3912
+ font-weight: 400;
3913
+ }
3914
+ .chip .chip-icon {
3915
+ display: flex;
3916
+ align-items: center;
3917
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3918
+ }
3919
+ .chip.pinned-empty .chip-icon {
3920
+ display: flex;
3921
+ align-items: center;
3922
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3860
3923
  }
3861
3924
  .chip.pinned-empty:hover {
3862
- background: var(--ap-muted, #f4f4f5);
3863
- color: var(--ap-foreground, #09090b);
3864
- border-color: var(--ap-muted-foreground, #a1a1aa);
3925
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
3926
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
3927
+ border-color: var(--ap-input, oklch(0.871 0.016 241.798));
3928
+ }
3929
+ .chip.pinned-empty:hover .chip-icon {
3930
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
3865
3931
  }
3866
3932
  .chip.pinned-empty.active {
3867
- border-style: solid;
3868
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
3869
- color: var(--ap-primary, oklch(0.65 0.19 258));
3870
- border-color: var(--ap-primary-20, oklch(0.65 0.19 258 / 0.25));
3933
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
3934
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3935
+ border-color: var(--ap-primary-20, oklch(0.578 0.198 268.129 / 0.2));
3936
+ }
3937
+ .chip.pinned-empty.active .chip-icon {
3938
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
3871
3939
  }
3872
- `;N([c.property({type:Object})],D.prototype,"appliedFilters",2);N([c.property({type:Object})],D.prototype,"appliedMetadata",2);N([c.property({type:Object})],D.prototype,"forcedFilters",2);N([c.property({type:Array})],D.prototype,"metadataFields",2);N([c.property({type:Array})],D.prototype,"pinnedFilters",2);N([c.property({type:Array})],D.prototype,"pinnedMetadataFields",2);N([c.property({type:Array})],D.prototype,"tags",2);N([c.property({type:Array})],D.prototype,"labels",2);N([c.property()],D.prototype,"activeFilter",2);N([c.property()],D.prototype,"activeMetadataField",2);N([c.property()],D.prototype,"pendingFilter",2);N([c.property()],D.prototype,"pendingMetadataField",2);D=N([c.customElement("ap-filters-bar")],D);var ga=Object.defineProperty,ma=Object.getOwnPropertyDescriptor,we=(t,e,s,a)=>{for(var i=a>1?void 0:a?ma(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ga(e,s,i),i};const va=6;let Z=class extends o.LitElement{constructor(){super(...arguments),this.assets=[],this.folders=[],this.folderPreviews={},this.selectedIds=[],this.isLoading=!1,this.multiSelect=!0,this._prevCount=0}willUpdate(t){if(t.has("assets")){const e=t.get("assets");e&&this.assets.length>e.length?this._prevCount=e.length:this._prevCount=0}}render(){return o.html`
3940
+ .chip-chevron {
3941
+ display: flex;
3942
+ align-items: center;
3943
+ opacity: 0.6;
3944
+ }
3945
+ `;j([c.property({type:Object})],D.prototype,"appliedFilters",2);j([c.property({type:Object})],D.prototype,"appliedMetadata",2);j([c.property({type:Object})],D.prototype,"forcedFilters",2);j([c.property({type:Array})],D.prototype,"metadataFields",2);j([c.property({type:Array})],D.prototype,"pinnedFilters",2);j([c.property({type:Array})],D.prototype,"pinnedMetadataFields",2);j([c.property({type:Array})],D.prototype,"tags",2);j([c.property({type:Array})],D.prototype,"labels",2);j([c.property()],D.prototype,"activeFilter",2);j([c.property()],D.prototype,"activeMetadataField",2);j([c.property()],D.prototype,"pendingFilter",2);j([c.property()],D.prototype,"pendingMetadataField",2);D=j([c.customElement("ap-filters-bar")],D);var Sa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,xe=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ca(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Sa(e,s,i),i};const Ea=6;let Z=class extends o.LitElement{constructor(){super(...arguments),this.assets=[],this.folders=[],this.folderPreviews={},this.selectedIds=[],this.isLoading=!1,this.multiSelect=!0,this._prevCount=0}willUpdate(t){if(t.has("assets")){const e=t.get("assets");e&&this.assets.length>e.length?this._prevCount=e.length:this._prevCount=0}}render(){return o.html`
3873
3946
  <div class="grid" role="list" aria-label="Assets">
3874
3947
  ${this.folders.map(t=>o.html`
3875
3948
  <ap-folder-card
@@ -3891,12 +3964,12 @@
3891
3964
  @asset-quick-select=${a=>this.dispatchEvent(new CustomEvent("asset-quick-select",{detail:a.detail,bubbles:!0,composed:!0}))}
3892
3965
  ></ap-asset-card>
3893
3966
  `})}
3894
- ${this.isLoading?Array.from({length:va},()=>o.html`<div class="ghost-card"></div>`):o.nothing}
3967
+ ${this.isLoading?Array.from({length:Ea},()=>o.html`<div class="ghost-card"></div>`):o.nothing}
3895
3968
  </div>
3896
3969
  `}};Z.styles=o.css`
3897
3970
  :host {
3898
3971
  display: block;
3899
- padding: 12px 20px 16px;
3972
+ padding: 0 20px 16px;
3900
3973
  }
3901
3974
  .grid {
3902
3975
  display: grid;
@@ -3908,9 +3981,9 @@
3908
3981
  border-radius: var(--ap-radius, 8px);
3909
3982
  background: linear-gradient(
3910
3983
  90deg,
3911
- var(--ap-muted, #f4f4f5) 25%,
3984
+ var(--ap-muted, oklch(0.974 0.006 239.819)) 25%,
3912
3985
  #e8e8ea 50%,
3913
- var(--ap-muted, #f4f4f5) 75%
3986
+ var(--ap-muted, oklch(0.974 0.006 239.819)) 75%
3914
3987
  );
3915
3988
  background-size: 200% 100%;
3916
3989
  animation: shimmer 1.5s infinite;
@@ -3922,14 +3995,14 @@
3922
3995
  @media (prefers-reduced-motion: reduce) {
3923
3996
  .ghost-card { animation: none; }
3924
3997
  }
3925
- `;we([c.property({type:Array})],Z.prototype,"assets",2);we([c.property({type:Array})],Z.prototype,"folders",2);we([c.property({type:Object})],Z.prototype,"folderPreviews",2);we([c.property({type:Array})],Z.prototype,"selectedIds",2);we([c.property({type:Boolean})],Z.prototype,"isLoading",2);we([c.property({type:Boolean})],Z.prototype,"multiSelect",2);Z=we([c.customElement("ap-grid-view")],Z);var ba=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,le=(t,e,s,a)=>{for(var i=a>1?void 0:a?_a(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ba(e,s,i),i};const ya=5;let K=class extends o.LitElement{constructor(){super(...arguments),this.assets=[],this.folders=[],this.selectedIds=[],this.isLoading=!1,this.multiSelect=!0,this.totalCount=0,this.isSelectingAll=!1}get _allVisibleSelected(){if(this.assets.length===0||this.selectedIds.length===0)return!1;const t=new Set(this.selectedIds);return this.assets.every(e=>t.has(e.uuid))}_handleHeaderCheckboxClick(){this.isSelectingAll||(this._allVisibleSelected&&this.selectedIds.length>=this.totalCount?this.dispatchEvent(new CustomEvent("selection-clear",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("select-all",{bubbles:!0,composed:!0})))}render(){const t=this._allVisibleSelected&&this.selectedIds.length>=this.totalCount;return o.html`
3998
+ `;xe([c.property({type:Array})],Z.prototype,"assets",2);xe([c.property({type:Array})],Z.prototype,"folders",2);xe([c.property({type:Object})],Z.prototype,"folderPreviews",2);xe([c.property({type:Array})],Z.prototype,"selectedIds",2);xe([c.property({type:Boolean})],Z.prototype,"isLoading",2);xe([c.property({type:Boolean})],Z.prototype,"multiSelect",2);Z=xe([c.customElement("ap-grid-view")],Z);var Fa=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,le=(t,e,s,a)=>{for(var i=a>1?void 0:a?Aa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Fa(e,s,i),i};const Ta=5;let K=class extends o.LitElement{constructor(){super(...arguments),this.assets=[],this.folders=[],this.selectedIds=[],this.isLoading=!1,this.multiSelect=!0,this.totalCount=0,this.isSelectingAll=!1}get _allVisibleSelected(){if(this.assets.length===0||this.selectedIds.length===0)return!1;const t=new Set(this.selectedIds);return this.assets.every(e=>t.has(e.uuid))}_handleHeaderCheckboxClick(){this.isSelectingAll||(this._allVisibleSelected&&this.selectedIds.length>=this.totalCount?this.dispatchEvent(new CustomEvent("selection-clear",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("select-all",{bubbles:!0,composed:!0})))}render(){const t=this._allVisibleSelected&&this.selectedIds.length>=this.totalCount;return o.html`
3926
3999
  <div class="list-header ${this.multiSelect?"has-checkbox":""}" role="row" aria-label="Column headers">
3927
4000
  ${this.multiSelect?o.html`<span class="header-checkbox" @click=${this._handleHeaderCheckboxClick}>
3928
4001
  <div class="header-check-box ${t?"checked":this.selectedIds.length>0?"indeterminate":""}">
3929
- <svg class="header-check-icon check" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
3930
- <path d="M4.5 12.75l6 6 9-13.5"></path>
4002
+ <svg class="header-check-icon check" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4003
+ <path d="M20 6 9 17l-5-5"></path>
3931
4004
  </svg>
3932
- <svg class="header-check-icon dash" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4005
+ <svg class="header-check-icon dash" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
3933
4006
  <path d="M5 12h14"></path>
3934
4007
  </svg>
3935
4008
  </div>
@@ -3959,7 +4032,7 @@
3959
4032
  @asset-preview=${a=>this.dispatchEvent(new CustomEvent("asset-preview",{detail:a.detail,bubbles:!0,composed:!0}))}
3960
4033
  ></ap-asset-row>
3961
4034
  `)}
3962
- ${this.isLoading?Array.from({length:ya},()=>o.html`<div class="ghost-row"></div>`):o.nothing}
4035
+ ${this.isLoading?Array.from({length:Ta},()=>o.html`<div class="ghost-row"></div>`):o.nothing}
3963
4036
  </div>
3964
4037
  `}};K.styles=o.css`
3965
4038
  :host {
@@ -3968,15 +4041,13 @@
3968
4041
  }
3969
4042
  .list-header {
3970
4043
  display: grid;
3971
- grid-template-columns: 28px 48px 1fr 100px 200px 120px 60px;
4044
+ grid-template-columns: 32px 48px 1fr 100px 200px 120px 60px;
3972
4045
  gap: 12px;
3973
4046
  padding: 8px 12px;
3974
- font-size: 0.75rem;
3975
- font-weight: 600;
3976
- color: var(--ap-muted-foreground, #71717a);
3977
- text-transform: uppercase;
3978
- letter-spacing: 0.05em;
3979
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
4047
+ font-size: 14px;
4048
+ font-weight: 400;
4049
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
4050
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
3980
4051
  }
3981
4052
  .list-header:not(.has-checkbox) {
3982
4053
  grid-template-columns: 48px 1fr 100px 200px 120px 60px;
@@ -3988,24 +4059,25 @@
3988
4059
  cursor: pointer;
3989
4060
  }
3990
4061
  .header-check-box {
3991
- width: 18px;
3992
- height: 18px;
3993
- border: 2px solid var(--ap-border, #e4e4e7);
4062
+ box-sizing: border-box;
4063
+ width: 22px;
4064
+ height: 22px;
4065
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
3994
4066
  border-radius: 4px;
3995
4067
  display: flex;
3996
4068
  align-items: center;
3997
4069
  justify-content: center;
3998
4070
  transition: all 150ms;
3999
- background: var(--ap-background, #fff);
4071
+ background: var(--ap-background, oklch(1 0 0));
4000
4072
  }
4001
4073
  .header-check-box.checked,
4002
4074
  .header-check-box.indeterminate {
4003
- background: var(--ap-primary, #3b82f6);
4004
- border-color: var(--ap-primary, #3b82f6);
4075
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
4076
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
4005
4077
  }
4006
4078
  .header-check-icon {
4007
4079
  display: none;
4008
- color: var(--ap-primary-foreground, #fff);
4080
+ color: var(--ap-primary-foreground, oklch(1 0 0));
4009
4081
  }
4010
4082
  .header-check-box.checked .header-check-icon.check {
4011
4083
  display: block;
@@ -4023,9 +4095,9 @@
4023
4095
  border-radius: 4px;
4024
4096
  background: linear-gradient(
4025
4097
  90deg,
4026
- var(--ap-muted, #f4f4f5) 25%,
4098
+ var(--ap-muted, oklch(0.974 0.006 239.819)) 25%,
4027
4099
  #e8e8ea 50%,
4028
- var(--ap-muted, #f4f4f5) 75%
4100
+ var(--ap-muted, oklch(0.974 0.006 239.819)) 75%
4029
4101
  );
4030
4102
  background-size: 200% 100%;
4031
4103
  animation: shimmer 1.5s infinite;
@@ -4037,7 +4109,7 @@
4037
4109
  @media (prefers-reduced-motion: reduce) {
4038
4110
  .ghost-row { animation: none; }
4039
4111
  }
4040
- `;le([c.property({type:Array})],K.prototype,"assets",2);le([c.property({type:Array})],K.prototype,"folders",2);le([c.property({type:Array})],K.prototype,"selectedIds",2);le([c.property({type:Boolean})],K.prototype,"isLoading",2);le([c.property({type:Boolean})],K.prototype,"multiSelect",2);le([c.property({type:Number})],K.prototype,"totalCount",2);le([c.property({type:Boolean})],K.prototype,"isSelectingAll",2);K=le([c.customElement("ap-list-view")],K);function Be(t){var a;const e=t.info,s=(e==null?void 0:e.video_thumbnail)||(e==null?void 0:e.image_thumbnail)||(e==null?void 0:e.thumbnail)||(e==null?void 0:e.preview)||((a=t.url)==null?void 0:a.cdn)||"";return Te(s)}function Ot(t){const e=t.info,s=(e==null?void 0:e.video_thumbnail)||(e==null?void 0:e.image_thumbnail)||(e==null?void 0:e.thumbnail)||"";return s?Te(s):""}function ut(t){var s,a;let e=Te(((s=t.url)==null?void 0:s.cdn)||((a=t.url)==null?void 0:a.public)||"");return e?(e=e.replace(/([?&])func=proxy&?/,"$1").replace(/[?&]$/,""),Re(e,{w:"200",force_format:"webp,jpeg",doc_page:"1",bypass_process_proxy:"1"})):""}function Re(t,e){try{const s=new URL(t);for(const[a,i]of Object.entries(e))s.searchParams.set(a,i);return s.toString()}catch{return t}}const Qt=/^(https:\/\/)([a-z0-9_-]+)\.filerobot\.com\//i;function Te(t,e){if(!t)return"";if(t.includes("assets.filerobot.com"))return t;const s=t.match(Qt);if(s){const a=s[2];return t.replace(Qt,`$1assets.filerobot.com/${a}/`)}if(e)try{const a=new URL(t);return`https://assets.filerobot.com/${e}${a.pathname}${a.search}`}catch{}return t}function Lt(t){if(t===0)return"0 B";const e=["B","KB","MB","GB","TB"],s=1024,a=Math.floor(Math.log(t)/Math.log(s));return`${(t/Math.pow(s,a)).toFixed(a===0?0:1)} ${e[a]}`}function st(t){if(!t)return"—";const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function xa(t,e){return!t||!e?"":`${t} x ${e}`}const $a=new Set(["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","tif","avif","heic","heif"]),wa=new Set([...$a,"pdf","psd","eps","ai","ttf","otf","woff","woff2","eot"]);function me(t){if(!t)return"other";const e={image:"image",video:"video",audio:"audio",application:"document",font:"font",text:"document"};return e[t]?e[t]:t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":t.startsWith("application/pdf")||t.startsWith("text/")||t.startsWith("application/msword")||t.startsWith("application/vnd.")?"document":t.startsWith("application/zip")||t.startsWith("application/x-rar")||t.startsWith("application/x-7z")||t.startsWith("application/gzip")?"archive":t.startsWith("font/")?"font":"other"}function Pt(t){const e=(t==null?void 0:t.toLowerCase().replace(".",""))||"";return wa.has(e)}const us="https://assets.filerobot.com/scaleflex/assets/file-types/v2/",Sa={png:"PNG",jpg:"JPG",jpeg:"JPG",gif:"GIF",bmp:"BMP",webp:"WEBP",svg:"SVG",tiff:"TIFF",tif:"TIFF",heic:"HEIC",avif:"AVIF",ico:"ICO",pdf:"PDF",doc:"DOC",docx:"DOCX",txt:"TXT",rtf:"RTF",xls:"XLS",xlsx:"XLSX",ppt:"PPT",pptx:"PPTX",csv:"CSV",odt:"ODT",ods:"ODS",odp:"ODP",mp4:"MP4",webm:"WEBM",mov:"MOV",avi:"AVI",mkv:"MKV",mpeg:"MPEG",mp3:"MP3",wav:"WAV",aac:"AAC",flac:"FLAC",ogg:"OGG",wma:"WMA",zip:"ZIP",rar:"RAR","7z":"7Z",tar:"TAR",gz:"GZ",ttf:"TTF",otf:"OTF",woff:"WOFF",woff2:"WOFF2",eot:"EOT",psd:"PSD",ai:"AI",dwg:"DWG",js:"JS",ts:"TS",css:"CSS",html:"HTML",json:"JSON",xml:"XML",php:"PHP",sh:"SH",exe:"EXE",iso:"ISO",bin:"BIN"};function Ke(t){const e=(t==null?void 0:t.toLowerCase().replace(".",""))||"",s=Sa[e];return`${us}${s||"DEFAULT"}.png`}function be(){return`${us}DEFAULT.png`}function kt(t){if(!t)return"";const e=t.split("/");return e.length>1?e[1]:e[0]}const Ca=new Set(["png","svg","webp","gif","avif"]);function ft(t){const e=(t==null?void 0:t.toLowerCase().replace(".",""))||"";return Ca.has(e)}var ka=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Ge=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ea(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ka(e,s,i),i};let _e=class extends o.LitElement{constructor(){super(...arguments),this.index=0,this.selected=!1,this.multiSelect=!0}_handleSelect(t){if(t.stopPropagation(),t.composedPath().some(a=>a instanceof HTMLElement&&(a.classList.contains("check")||a.classList.contains("check-box")))){this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:new MouseEvent("click",{ctrlKey:!0,metaKey:!0,shiftKey:t.shiftKey})},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:t},bubbles:!0}))}_handlePreview(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("asset-preview",{detail:{asset:this.asset},bubbles:!0}))}_formatDuration(t){const e=Math.floor(t/3600),s=Math.floor(t%3600/60),a=Math.floor(t%60),i=r=>String(r).padStart(2,"0");return e>0?`${e}:${i(s)}:${i(a)}`:`${s}:${i(a)}`}_handleQuickSelect(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("asset-quick-select",{detail:{asset:this.asset},bubbles:!0}))}render(){var d,h,u,g;const t=this.asset;if(!t)return o.html``;const s=me(t.type)==="video",a=((d=t.extension)==null?void 0:d.toLowerCase())==="pdf",i=Pt(t.extension||"");let r="";s?r=Ot(t):a?r=ut(t):i&&(r=Be(t));const n=Ke(t.extension||""),l=ft(t.extension||"");return o.html`
4112
+ `;le([c.property({type:Array})],K.prototype,"assets",2);le([c.property({type:Array})],K.prototype,"folders",2);le([c.property({type:Array})],K.prototype,"selectedIds",2);le([c.property({type:Boolean})],K.prototype,"isLoading",2);le([c.property({type:Boolean})],K.prototype,"multiSelect",2);le([c.property({type:Number})],K.prototype,"totalCount",2);le([c.property({type:Boolean})],K.prototype,"isSelectingAll",2);K=le([c.customElement("ap-list-view")],K);function tt(t){var a;const e=t.info,s=(e==null?void 0:e.video_thumbnail)||(e==null?void 0:e.image_thumbnail)||(e==null?void 0:e.thumbnail)||(e==null?void 0:e.preview)||((a=t.url)==null?void 0:a.cdn)||"";return Fe(s)}function us(t){const e=t.info,s=(e==null?void 0:e.video_thumbnail)||(e==null?void 0:e.image_thumbnail)||(e==null?void 0:e.thumbnail)||"";return s?Fe(s):""}function Ot(t){var s,a;let e=Fe(((s=t.url)==null?void 0:s.cdn)||((a=t.url)==null?void 0:a.public)||"");return e?(e=e.replace(/([?&])func=proxy&?/,"$1").replace(/[?&]$/,""),ze(e,{w:"200",force_format:"webp,jpeg",doc_page:"1",bypass_process_proxy:"1"})):""}function ze(t,e){try{const s=new URL(t);for(const[a,i]of Object.entries(e))s.searchParams.set(a,i);return s.toString()}catch{return t}}const Qt=/^(https:\/\/)([a-z0-9_-]+)\.filerobot\.com\//i;function Fe(t,e){if(!t)return"";if(t.includes("assets.filerobot.com"))return t;const s=t.match(Qt);if(s){const a=s[2];return t.replace(Qt,`$1assets.filerobot.com/${a}/`)}if(e)try{const a=new URL(t);return`https://assets.filerobot.com/${e}${a.pathname}${a.search}`}catch{}return t}function Mt(t){if(t===0)return"0 B";const e=["B","KB","MB","GB","TB"],s=1024,a=Math.floor(Math.log(t)/Math.log(s));return`${(t/Math.pow(s,a)).toFixed(a===0?0:1)} ${e[a]}`}function st(t){if(!t)return"—";const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function gs(t,e){return!t||!e?"":`${t} x ${e}`}const Oa=new Set(["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","tif","avif","heic","heif"]),Ma=new Set([...Oa,"pdf","psd","eps","ai","ttf","otf","woff","woff2","eot"]);function Se(t){if(!t)return"other";const e={image:"image",video:"video",audio:"audio",application:"document",font:"font",text:"document"};return e[t]?e[t]:t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":t.startsWith("application/pdf")||t.startsWith("text/")||t.startsWith("application/msword")||t.startsWith("application/vnd.")?"document":t.startsWith("application/zip")||t.startsWith("application/x-rar")||t.startsWith("application/x-7z")||t.startsWith("application/gzip")?"archive":t.startsWith("font/")?"font":"other"}function fs(t){const e=(t==null?void 0:t.toLowerCase().replace(".",""))||"";return Ma.has(e)}const ms="https://assets.filerobot.com/scaleflex/assets/file-types/v2/",Pa={png:"PNG",jpg:"JPG",jpeg:"JPG",gif:"GIF",bmp:"BMP",webp:"WEBP",svg:"SVG",tiff:"TIFF",tif:"TIFF",heic:"HEIC",avif:"AVIF",ico:"ICO",pdf:"PDF",doc:"DOC",docx:"DOCX",txt:"TXT",rtf:"RTF",xls:"XLS",xlsx:"XLSX",ppt:"PPT",pptx:"PPTX",csv:"CSV",odt:"ODT",ods:"ODS",odp:"ODP",mp4:"MP4",webm:"WEBM",mov:"MOV",avi:"AVI",mkv:"MKV",mpeg:"MPEG",mp3:"MP3",wav:"WAV",aac:"AAC",flac:"FLAC",ogg:"OGG",wma:"WMA",zip:"ZIP",rar:"RAR","7z":"7Z",tar:"TAR",gz:"GZ",ttf:"TTF",otf:"OTF",woff:"WOFF",woff2:"WOFF2",eot:"EOT",psd:"PSD",ai:"AI",dwg:"DWG",js:"JS",ts:"TS",css:"CSS",html:"HTML",json:"JSON",xml:"XML",php:"PHP",sh:"SH",exe:"EXE",iso:"ISO",bin:"BIN"};function ht(t){const e=(t==null?void 0:t.toLowerCase().replace(".",""))||"",s=Pa[e];return`${ms}${s||"DEFAULT"}.png`}function Ne(){return`${ms}DEFAULT.png`}function kt(t){if(!t)return"";const e=t.split("/");return e.length>1?e[1]:e[0]}const La=new Set(["png","svg","webp","gif","avif"]);function Pt(t){const e=(t==null?void 0:t.toLowerCase().replace(".",""))||"";return La.has(e)}var Ia=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,He=(t,e,s,a)=>{for(var i=a>1?void 0:a?Da(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ia(e,s,i),i};let ve=class extends o.LitElement{constructor(){super(...arguments),this.index=0,this.selected=!1,this.multiSelect=!0}_handleSelect(t){if(t.stopPropagation(),t.composedPath().some(a=>a instanceof HTMLElement&&(a.classList.contains("check")||a.classList.contains("check-box")))){this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:new MouseEvent("click",{ctrlKey:!0,metaKey:!0,shiftKey:t.shiftKey})},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:t},bubbles:!0}))}_handlePreview(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("asset-preview",{detail:{asset:this.asset},bubbles:!0}))}_formatDuration(t){const e=Math.floor(t/3600),s=Math.floor(t%3600/60),a=Math.floor(t%60),i=r=>String(r).padStart(2,"0");return e>0?`${e}:${i(s)}:${i(a)}`:`${s}:${i(a)}`}_handleQuickSelect(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("asset-quick-select",{detail:{asset:this.asset},bubbles:!0}))}render(){var d,h,u,f;const t=this.asset;if(!t)return o.html``;const s=Se(t.type)==="video",a=((d=t.extension)==null?void 0:d.toLowerCase())==="pdf",i=fs(t.extension||"");let r="";s?r=us(t):a?r=Ot(t):i&&(r=tt(t));const n=ht(t.extension||""),l=Pt(t.extension||"");return o.html`
4041
4113
  <div class="card" @click=${this._handleSelect}>
4042
4114
  <div class="thumbnail ${l&&r?"chess":""}">
4043
4115
  ${r?o.html`<img
@@ -4045,12 +4117,12 @@
4045
4117
  alt=${t.name}
4046
4118
  loading="lazy"
4047
4119
  class="thumb-img ${l?"transparent-asset":""}"
4048
- @error=${p=>{const f=p.target,v=be();f.src!==n&&f.src!==v?(f.src=n,f.classList.add("icon-fallback")):f.src!==v&&(f.src=v)}}
4120
+ @error=${p=>{const g=p.target,v=Ne();g.src!==n&&g.src!==v?(g.src=n,g.classList.add("icon-fallback")):g.src!==v&&(g.src=v)}}
4049
4121
  />`:o.html`<img
4050
4122
  src=${n}
4051
4123
  alt=${t.name}
4052
4124
  class="thumb-img icon-fallback"
4053
- @error=${p=>{const f=p.target,v=be();f.src!==v&&(f.src=v)}}
4125
+ @error=${p=>{const g=p.target,v=Ne();g.src!==v&&(g.src=v)}}
4054
4126
  />`}
4055
4127
  ${s&&((h=t.info)!=null&&h.duration)?o.html`<span class="duration">${this._formatDuration(t.info.duration)}</span>`:o.nothing}
4056
4128
  <div class="overlay">
@@ -4066,8 +4138,8 @@
4066
4138
  ${this.multiSelect?o.html`
4067
4139
  <div class="check">
4068
4140
  <div class="check-box">
4069
- <svg class="check-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4070
- <path d="M4.5 12.75l6 6 9-13.5"></path>
4141
+ <svg class="check-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4142
+ <path d="M20 6 9 17l-5-5"></path>
4071
4143
  </svg>
4072
4144
  </div>
4073
4145
  </div>
@@ -4075,10 +4147,10 @@
4075
4147
  </div>
4076
4148
  <div class="info">
4077
4149
  <div class="name" title=${t.name}>${t.name}</div>
4078
- <div class="meta">${(u=t.extension)==null?void 0:u.toUpperCase()} · ${Lt(((g=t.size)==null?void 0:g.bytes)||0)}</div>
4150
+ <div class="meta">${(u=t.extension)==null?void 0:u.toUpperCase()}${(()=>{var w,b,O,$;const p=((w=t.info)==null?void 0:w.img_w)||((b=t.info)==null?void 0:b.video_w),g=((O=t.info)==null?void 0:O.img_h)||(($=t.info)==null?void 0:$.video_h),v=gs(p,g);return v?` · ${v}`:""})()} · ${Mt(((f=t.size)==null?void 0:f.bytes)||0)}</div>
4079
4151
  </div>
4080
4152
  </div>
4081
- `}};_e.styles=o.css`
4153
+ `}};ve.styles=o.css`
4082
4154
  :host {
4083
4155
  display: block;
4084
4156
  animation: ap-card-in 300ms ease-out both;
@@ -4090,29 +4162,29 @@
4090
4162
  }
4091
4163
  .card {
4092
4164
  position: relative;
4093
- border: 1px solid var(--ap-border, #e4e4e7);
4165
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
4094
4166
  border-radius: var(--ap-radius, 8px);
4095
4167
  overflow: hidden;
4096
4168
  cursor: pointer;
4097
4169
  user-select: none;
4098
4170
  -webkit-user-drag: none;
4099
4171
  transition: box-shadow 150ms, border-color 150ms;
4100
- background: var(--ap-card, #fff);
4172
+ background: var(--ap-card, oklch(1 0 0));
4101
4173
  }
4102
4174
  .card:focus-visible {
4103
- outline: 2px solid var(--ap-ring, oklch(0.65 0.19 258));
4175
+ outline: 2px solid var(--ap-ring, oklch(0.578 0.198 268.129 / 0.7));
4104
4176
  outline-offset: 2px;
4105
4177
  }
4106
4178
  .card:hover {
4107
4179
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
4108
4180
  }
4109
4181
  :host([selected]) .card {
4110
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
4111
- box-shadow: 0 0 0 2px var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
4182
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
4183
+ box-shadow: 0 0 0 2px var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
4112
4184
  }
4113
4185
  .thumbnail {
4114
4186
  aspect-ratio: 6/4;
4115
- background: var(--ap-muted, #f4f4f5);
4187
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4116
4188
  overflow: hidden;
4117
4189
  position: relative;
4118
4190
  display: flex;
@@ -4163,8 +4235,9 @@
4163
4235
  min-width: 120px;
4164
4236
  border: none;
4165
4237
  border-radius: var(--ap-radius, 8px);
4166
- background: rgba(255, 255, 255, 0.9);
4167
- color: var(--ap-foreground, #09090b);
4238
+ background: var(--ap-card, rgba(255, 255, 255, 0.9));
4239
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4240
+ border: 1px solid var(--ap-border, transparent);
4168
4241
  cursor: pointer;
4169
4242
  transition: transform 100ms;
4170
4243
  font-size: 0.875rem;
@@ -4175,8 +4248,8 @@
4175
4248
  transform: scale(1.05);
4176
4249
  }
4177
4250
  .overlay-btn.select-btn {
4178
- background: var(--ap-primary, oklch(0.65 0.19 258));
4179
- color: var(--ap-primary-foreground, #fff);
4251
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
4252
+ color: var(--ap-primary-foreground, oklch(1 0 0));
4180
4253
  }
4181
4254
  .info {
4182
4255
  padding: 10px 12px;
@@ -4184,15 +4257,15 @@
4184
4257
  .name {
4185
4258
  font-size: var(--ap-font-size-sm, 0.875rem);
4186
4259
  font-weight: 500;
4187
- color: var(--ap-foreground, #09090b);
4260
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4188
4261
  white-space: nowrap;
4189
4262
  overflow: hidden;
4190
4263
  text-overflow: ellipsis;
4191
4264
  }
4192
4265
  .meta {
4193
4266
  font-size: 0.75rem;
4194
- color: var(--ap-muted-foreground, #71717a);
4195
- margin-top: 2px;
4267
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4268
+ margin-top: 6px;
4196
4269
  }
4197
4270
  .check {
4198
4271
  position: absolute;
@@ -4202,23 +4275,23 @@
4202
4275
  cursor: pointer;
4203
4276
  }
4204
4277
  .check-box {
4205
- width: 18px;
4206
- height: 18px;
4207
- border: 2px solid var(--ap-border, #e4e4e7);
4278
+ width: 22px;
4279
+ height: 22px;
4280
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
4208
4281
  border-radius: 4px;
4209
4282
  display: flex;
4210
4283
  align-items: center;
4211
4284
  justify-content: center;
4212
4285
  transition: all 150ms;
4213
- background: var(--ap-background, #fff);
4286
+ background: var(--ap-background, oklch(1 0 0));
4214
4287
  }
4215
4288
  :host([selected]) .check-box {
4216
- background: var(--ap-primary, #3b82f6);
4217
- border-color: var(--ap-primary, #3b82f6);
4289
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
4290
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
4218
4291
  }
4219
4292
  .check-icon {
4220
4293
  display: none;
4221
- color: var(--ap-primary-foreground, #fff);
4294
+ color: var(--ap-primary-foreground, oklch(1 0 0));
4222
4295
  }
4223
4296
  :host([selected]) .check-icon {
4224
4297
  display: block;
@@ -4233,7 +4306,7 @@
4233
4306
  justify-content: center;
4234
4307
  width: 100%;
4235
4308
  height: 100%;
4236
- color: var(--ap-muted-foreground, #71717a);
4309
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4237
4310
  }
4238
4311
  .duration {
4239
4312
  position: absolute;
@@ -4253,13 +4326,13 @@
4253
4326
  :host { animation: none; }
4254
4327
  .overlay { transition: none; }
4255
4328
  }
4256
- `;Ge([c.property({type:Object})],_e.prototype,"asset",2);Ge([c.property({type:Number})],_e.prototype,"index",2);Ge([c.property({type:Boolean,reflect:!0})],_e.prototype,"selected",2);Ge([c.property({type:Boolean})],_e.prototype,"multiSelect",2);_e=Ge([c.customElement("ap-asset-card")],_e);var Fa=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,Ye=(t,e,s,a)=>{for(var i=a>1?void 0:a?Aa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Fa(e,s,i),i};let ye=class extends o.LitElement{constructor(){super(...arguments),this.index=0,this.selected=!1,this.multiSelect=!0}_handleSelect(t){if(t.composedPath().some(a=>a instanceof HTMLElement&&(a.classList.contains("check")||a.classList.contains("check-box")))){this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:new MouseEvent("click",{ctrlKey:!0,metaKey:!0,shiftKey:t.shiftKey})},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:t},bubbles:!0}))}_handlePreview(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("asset-preview",{detail:{asset:this.asset},bubbles:!0}))}render(){var d,h,u;const t=this.asset;if(!t)return o.html``;const s=me(t.type)==="video",a=((d=t.extension)==null?void 0:d.toLowerCase())==="pdf",i=Pt(t.extension||"");let r="";s?r=Ot(t):a?r=ut(t):i&&(r=Be(t));const n=Ke(t.extension||""),l=ft(t.extension||"");return o.html`
4329
+ `;He([c.property({type:Object})],ve.prototype,"asset",2);He([c.property({type:Number})],ve.prototype,"index",2);He([c.property({type:Boolean,reflect:!0})],ve.prototype,"selected",2);He([c.property({type:Boolean})],ve.prototype,"multiSelect",2);ve=He([c.customElement("ap-asset-card")],ve);var za=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ke=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ra(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&za(e,s,i),i};let be=class extends o.LitElement{constructor(){super(...arguments),this.index=0,this.selected=!1,this.multiSelect=!0}_handleSelect(t){if(t.composedPath().some(a=>a instanceof HTMLElement&&(a.classList.contains("check")||a.classList.contains("check-box")))){this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:new MouseEvent("click",{ctrlKey:!0,metaKey:!0,shiftKey:t.shiftKey})},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:this.index,event:t},bubbles:!0}))}_handlePreview(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("asset-preview",{detail:{asset:this.asset},bubbles:!0}))}render(){var d,h,u;const t=this.asset;if(!t)return o.html``;const s=Se(t.type)==="video",a=((d=t.extension)==null?void 0:d.toLowerCase())==="pdf",i=fs(t.extension||"");let r="";s?r=us(t):a?r=Ot(t):i&&(r=tt(t));const n=ht(t.extension||""),l=Pt(t.extension||"");return o.html`
4257
4330
  <div class="row" @click=${this._handleSelect}>
4258
4331
  ${this.multiSelect?o.html`
4259
4332
  <div class="check">
4260
4333
  <div class="check-box">
4261
- <svg class="check-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4262
- <path d="M4.5 12.75l6 6 9-13.5"></path>
4334
+ <svg class="check-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4335
+ <path d="M20 6 9 17l-5-5"></path>
4263
4336
  </svg>
4264
4337
  </div>
4265
4338
  </div>
@@ -4270,17 +4343,17 @@
4270
4343
  alt=${t.name}
4271
4344
  class="${l?"transparent-asset":""}"
4272
4345
  loading="lazy"
4273
- @error=${g=>{const p=g.target,f=be();p.src!==n&&p.src!==f?(p.src=n,p.classList.add("icon-fallback")):p.src!==f&&(p.src=f)}}
4346
+ @error=${f=>{const p=f.target,g=Ne();p.src!==n&&p.src!==g?(p.src=n,p.classList.add("icon-fallback")):p.src!==g&&(p.src=g)}}
4274
4347
  />`:o.html`<img
4275
4348
  src=${n}
4276
4349
  alt=${t.name}
4277
4350
  class="icon-fallback"
4278
- @error=${g=>{const p=g.target,f=be();p.src!==f&&(p.src=f)}}
4351
+ @error=${f=>{const p=f.target,g=Ne();p.src!==g&&(p.src=g)}}
4279
4352
  />`}
4280
4353
  </div>
4281
4354
  <div class="name" title=${t.name}>${t.name}</div>
4282
4355
  <div class="type">${(h=t.extension)==null?void 0:h.toUpperCase()}</div>
4283
- <div class="desc">${Lt(((u=t.size)==null?void 0:u.bytes)||0)}</div>
4356
+ <div class="desc">${Mt(((u=t.size)==null?void 0:u.bytes)||0)}</div>
4284
4357
  <div class="date">${st(t.created_at||"")}</div>
4285
4358
  <div class="actions">
4286
4359
  <button class="icon-btn" @click=${this._handlePreview} aria-label="Preview">
@@ -4288,34 +4361,34 @@
4288
4361
  </button>
4289
4362
  </div>
4290
4363
  </div>
4291
- `}};ye.styles=o.css`
4364
+ `}};be.styles=o.css`
4292
4365
  :host {
4293
4366
  display: block;
4294
4367
  }
4295
4368
  .row {
4296
4369
  display: grid;
4297
- grid-template-columns: 28px 48px 1fr 100px 200px 120px 60px;
4370
+ grid-template-columns: 32px 48px 1fr 100px 200px 120px 60px;
4298
4371
  gap: 12px;
4299
4372
  padding: 8px 12px;
4300
4373
  align-items: center;
4301
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
4374
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
4302
4375
  cursor: pointer;
4303
4376
  user-select: none;
4304
4377
  -webkit-user-drag: none;
4305
4378
  transition: background 100ms;
4306
4379
  }
4307
4380
  .row:hover {
4308
- background: var(--ap-muted, #f4f4f5);
4381
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4309
4382
  }
4310
4383
  :host([selected]) .row {
4311
- background: var(--ap-selection-bg, oklch(0.65 0.19 258 / 0.08));
4384
+ background: var(--ap-selection-bg, oklch(0.578 0.198 268.129 / 0.08));
4312
4385
  }
4313
4386
  .thumb {
4314
4387
  width: 40px;
4315
4388
  height: 40px;
4316
4389
  border-radius: 4px;
4317
4390
  overflow: hidden;
4318
- background: var(--ap-muted, #f4f4f5);
4391
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4319
4392
  display: flex;
4320
4393
  align-items: center;
4321
4394
  justify-content: center;
@@ -4336,14 +4409,21 @@
4336
4409
  .name {
4337
4410
  font-size: var(--ap-font-size-sm, 0.875rem);
4338
4411
  font-weight: 500;
4339
- color: var(--ap-foreground, #09090b);
4412
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4340
4413
  white-space: nowrap;
4341
4414
  overflow: hidden;
4342
4415
  text-overflow: ellipsis;
4343
4416
  }
4344
- .type, .desc, .date {
4417
+ .type {
4345
4418
  font-size: 0.8125rem;
4346
- color: var(--ap-muted-foreground, #71717a);
4419
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4420
+ white-space: nowrap;
4421
+ overflow: hidden;
4422
+ text-overflow: ellipsis;
4423
+ }
4424
+ .desc, .date {
4425
+ font-size: 0.8125rem;
4426
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4347
4427
  white-space: nowrap;
4348
4428
  overflow: hidden;
4349
4429
  text-overflow: ellipsis;
@@ -4366,12 +4446,12 @@
4366
4446
  border: none;
4367
4447
  border-radius: 4px;
4368
4448
  background: none;
4369
- color: var(--ap-muted-foreground, #71717a);
4449
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4370
4450
  cursor: pointer;
4371
4451
  }
4372
4452
  .icon-btn:hover {
4373
- background: var(--ap-background, #fff);
4374
- color: var(--ap-foreground, #09090b);
4453
+ background: var(--ap-background, oklch(1 0 0));
4454
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4375
4455
  }
4376
4456
  .thumb.chess {
4377
4457
  background-image: conic-gradient(var(--ap-chess-a, #f0f0f0) 25%, var(--ap-chess-b, #fff) 25% 50%, var(--ap-chess-a, #f0f0f0) 50% 75%, var(--ap-chess-b, #fff) 75%);
@@ -4384,28 +4464,29 @@
4384
4464
  justify-content: center;
4385
4465
  }
4386
4466
  .check-box {
4387
- width: 18px;
4388
- height: 18px;
4389
- border: 2px solid var(--ap-border, #e4e4e7);
4467
+ box-sizing: border-box;
4468
+ width: 22px;
4469
+ height: 22px;
4470
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
4390
4471
  border-radius: 4px;
4391
4472
  display: flex;
4392
4473
  align-items: center;
4393
4474
  justify-content: center;
4394
4475
  transition: all 150ms;
4395
- background: var(--ap-background, #fff);
4476
+ background: var(--ap-background, oklch(1 0 0));
4396
4477
  }
4397
4478
  :host([selected]) .check-box {
4398
- background: var(--ap-primary, #3b82f6);
4399
- border-color: var(--ap-primary, #3b82f6);
4479
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
4480
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
4400
4481
  }
4401
4482
  .check-icon {
4402
4483
  display: none;
4403
- color: var(--ap-primary-foreground, #fff);
4484
+ color: var(--ap-primary-foreground, oklch(1 0 0));
4404
4485
  }
4405
4486
  :host([selected]) .check-icon {
4406
4487
  display: block;
4407
4488
  }
4408
- `;Ye([c.property({type:Object})],ye.prototype,"asset",2);Ye([c.property({type:Number})],ye.prototype,"index",2);Ye([c.property({type:Boolean,reflect:!0})],ye.prototype,"selected",2);Ye([c.property({type:Boolean})],ye.prototype,"multiSelect",2);ye=Ye([c.customElement("ap-asset-row")],ye);var Ta=Object.defineProperty,Ma=Object.getOwnPropertyDescriptor,It=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ma(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ta(e,s,i),i};let Ve=class extends o.LitElement{constructor(){super(...arguments),this.previews=[]}_handleOpen(){this.dispatchEvent(new CustomEvent("folder-open",{detail:{folder:this.folder},bubbles:!0,composed:!0}))}_isAlternativeDisplay(t){const e=kt(t).toLowerCase();return["svg","svg+xml","png","pdf"].includes(e)}_getPreviewUrl(t){const e=t.file_uri_cdn;if(!e)return"";let s=Te(e);const a=me(t.file_type),i=String(window.devicePixelRatio||1);return a==="video"?Re(s,{w:"200",dpr:i,force_format:"webp,jpeg"}):t.file_type==="application/pdf"||kt(t.file_type).toLowerCase()==="pdf"?(s=s.replace(/([?&])func=proxy&?/,"$1").replace(/[?&]$/,""),Re(s,{w:"200",dpr:i,force_format:"webp,jpeg",doc_page:"1",bypass_process_proxy:"1"})):Re(s,{w:"200",dpr:i})}_renderPreviewImg(t){const e=this._isAlternativeDisplay(t.file_type),s=this._getPreviewUrl(t),a=Ke(kt(t.file_type)),i=be();return o.html`<div class="preview-slot ${e?"icon-bg":""}">
4489
+ `;Ke([c.property({type:Object})],be.prototype,"asset",2);Ke([c.property({type:Number})],be.prototype,"index",2);Ke([c.property({type:Boolean,reflect:!0})],be.prototype,"selected",2);Ke([c.property({type:Boolean})],be.prototype,"multiSelect",2);be=Ke([c.customElement("ap-asset-row")],be);var ja=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,Lt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Na(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ja(e,s,i),i};let Be=class extends o.LitElement{constructor(){super(...arguments),this.previews=[]}_handleOpen(){this.dispatchEvent(new CustomEvent("folder-open",{detail:{folder:this.folder},bubbles:!0,composed:!0}))}_isAlternativeDisplay(t){const e=kt(t).toLowerCase();return["svg","svg+xml","png","pdf"].includes(e)}_getPreviewUrl(t){const e=t.file_uri_cdn;if(!e)return"";let s=Fe(e);const a=Se(t.file_type),i=String(window.devicePixelRatio||1);return a==="video"?ze(s,{w:"200",dpr:i,force_format:"webp,jpeg"}):t.file_type==="application/pdf"||kt(t.file_type).toLowerCase()==="pdf"?(s=s.replace(/([?&])func=proxy&?/,"$1").replace(/[?&]$/,""),ze(s,{w:"200",dpr:i,force_format:"webp,jpeg",doc_page:"1",bypass_process_proxy:"1"})):ze(s,{w:"200",dpr:i})}_renderPreviewImg(t){const e=this._isAlternativeDisplay(t.file_type),s=this._getPreviewUrl(t),a=ht(kt(t.file_type)),i=Ne();return o.html`<div class="preview-slot ${e?"icon-bg":""}">
4409
4490
  <img
4410
4491
  class="preview-img ${e?"icon-mode":""}"
4411
4492
  src="${s||a}"
@@ -4449,7 +4530,7 @@
4449
4530
  </div>
4450
4531
  </div>
4451
4532
  </div>
4452
- `}};Ve.styles=[J,o.css`
4533
+ `}};Be.styles=[J,o.css`
4453
4534
  :host {
4454
4535
  display: block;
4455
4536
  }
@@ -4531,10 +4612,10 @@
4531
4612
  .preview-slot {
4532
4613
  display: flex;
4533
4614
  position: relative;
4534
- background: var(--ap-muted, #f4f4f5);
4615
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4535
4616
  }
4536
4617
  .preview-slot.icon-bg {
4537
- background: var(--ap-card, #f3f7fa);
4618
+ background: var(--ap-card, oklch(1 0 0));
4538
4619
  }
4539
4620
  .preview-img {
4540
4621
  position: absolute;
@@ -4554,7 +4635,7 @@
4554
4635
  justify-content: center;
4555
4636
  width: 100%;
4556
4637
  height: 100%;
4557
- color: var(--ap-muted-foreground, #71717a);
4638
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4558
4639
  }
4559
4640
  .info {
4560
4641
  flex-shrink: 0;
@@ -4563,7 +4644,7 @@
4563
4644
  .name {
4564
4645
  font-size: var(--ap-font-size-sm, 0.875rem);
4565
4646
  font-weight: 400;
4566
- color: var(--ap-foreground, #09090b);
4647
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4567
4648
  white-space: nowrap;
4568
4649
  overflow: hidden;
4569
4650
  text-overflow: ellipsis;
@@ -4572,10 +4653,10 @@
4572
4653
  display: flex;
4573
4654
  justify-content: space-between;
4574
4655
  font-size: 0.75rem;
4575
- color: var(--ap-muted-foreground, #71717a);
4656
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4576
4657
  margin-top: 2px;
4577
4658
  }
4578
- `];It([c.property({type:Object})],Ve.prototype,"folder",2);It([c.property({type:Array})],Ve.prototype,"previews",2);Ve=It([c.customElement("ap-folder-card")],Ve);var Oa=Object.defineProperty,La=Object.getOwnPropertyDescriptor,fs=(t,e,s,a)=>{for(var i=a>1?void 0:a?La(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Oa(e,s,i),i};let it=class extends o.LitElement{_handleOpen(){this.dispatchEvent(new CustomEvent("folder-open",{detail:{folder:this.folder},bubbles:!0,composed:!0}))}render(){var e,s;const t=this.folder;return t?o.html`
4659
+ `];Lt([c.property({type:Object})],Be.prototype,"folder",2);Lt([c.property({type:Array})],Be.prototype,"previews",2);Be=Lt([c.customElement("ap-folder-card")],Be);var Ba=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,vs=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ua(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ba(e,s,i),i};let it=class extends o.LitElement{_handleOpen(){this.dispatchEvent(new CustomEvent("folder-open",{detail:{folder:this.folder},bubbles:!0,composed:!0}))}render(){var e,s;const t=this.folder;return t?o.html`
4579
4660
  <div class="row" @click=${this._handleOpen}>
4580
4661
  <div class="icon"><ap-icon name="folder" .size=${22}></ap-icon></div>
4581
4662
  <div class="name">${t.name}</div>
@@ -4594,15 +4675,15 @@
4594
4675
  gap: 12px;
4595
4676
  padding: 8px 12px;
4596
4677
  align-items: center;
4597
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
4678
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
4598
4679
  cursor: pointer;
4599
4680
  transition: background 100ms;
4600
4681
  }
4601
4682
  .row:hover {
4602
- background: var(--ap-muted, #f4f4f5);
4683
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4603
4684
  }
4604
4685
  .icon {
4605
- color: var(--ap-primary, oklch(0.65 0.19 258));
4686
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
4606
4687
  display: flex;
4607
4688
  align-items: center;
4608
4689
  justify-content: center;
@@ -4610,13 +4691,13 @@
4610
4691
  .name {
4611
4692
  font-size: var(--ap-font-size-sm, 0.875rem);
4612
4693
  font-weight: 500;
4613
- color: var(--ap-foreground, #09090b);
4694
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4614
4695
  }
4615
4696
  .meta {
4616
4697
  font-size: 0.8125rem;
4617
- color: var(--ap-muted-foreground, #71717a);
4698
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4618
4699
  }
4619
- `;fs([c.property({type:Object})],it.prototype,"folder",2);it=fs([c.customElement("ap-folder-row")],it);var Pa=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,gs=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ia(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Pa(e,s,i),i};let at=class extends o.LitElement{constructor(){super(...arguments),this.variant="grid"}render(){return this.variant==="grid"?o.html`
4700
+ `;vs([c.property({type:Object})],it.prototype,"folder",2);it=vs([c.customElement("ap-folder-row")],it);var Va=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,bs=(t,e,s,a)=>{for(var i=a>1?void 0:a?qa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Va(e,s,i),i};let at=class extends o.LitElement{constructor(){super(...arguments),this.variant="grid"}render(){return this.variant==="grid"?o.html`
4620
4701
  <div class="grid-skeleton">
4621
4702
  ${Array.from({length:18},()=>o.html`<div class="skeleton card-skel"></div>`)}
4622
4703
  </div>
@@ -4628,7 +4709,7 @@
4628
4709
  padding: 16px 20px;
4629
4710
  }
4630
4711
  .skeleton {
4631
- background: linear-gradient(90deg, var(--ap-muted, #f4f4f5) 25%, #e8e8ea 50%, var(--ap-muted, #f4f4f5) 75%);
4712
+ background: linear-gradient(90deg, var(--ap-muted, oklch(0.974 0.006 239.819)) 25%, #e8e8ea 50%, var(--ap-muted, oklch(0.974 0.006 239.819)) 75%);
4632
4713
  background-size: 200% 100%;
4633
4714
  animation: shimmer 1.5s infinite;
4634
4715
  border-radius: var(--ap-radius, 8px);
@@ -4654,7 +4735,7 @@
4654
4735
  @media (prefers-reduced-motion: reduce) {
4655
4736
  .skeleton { animation: none; }
4656
4737
  }
4657
- `;gs([c.property()],at.prototype,"variant",2);at=gs([c.customElement("ap-skeleton")],at);function Da(t){var i,r;const e=(i=t.info)==null?void 0:i.playlists;if(!(e!=null&&e.length))return null;const s=(r=e[0])==null?void 0:r.playlists;return s!=null&&s.length&&s[0]||null}var za=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,P=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ra(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&za(e,s,i),i};let O=class extends o.LitElement{constructor(){super(...arguments),this.asset=null,this.assets=[],this.selectedIds=[],this.containerToken="",this.showMetadata=!0,this.metadataFields=[],this.labels=[],this.regionalFilters={},this.multiSelect=!0,this._isFullscreen=!1,this._fsImageLoaded=!1,this._previewLoading=!1,this._openSections=new Set(["file-info","metadata"]),this._hls=null}connectedCallback(){super.connectedCallback(),this._onFullscreenChange=this._onFullscreenChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),document.addEventListener("fullscreenchange",this._onFullscreenChange),document.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("keydown",this._onKeyDown),this._destroyHls()}_onKeyDown(t){if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;const e=t.composedPath()[0];if(!e)return;const s=e.tagName;s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||e.getAttribute("role")==="radio"||e.getAttribute("role")==="listbox"||e.isContentEditable||(t.preventDefault(),t.key==="ArrowLeft"?this._prev():this._next())}_destroyHls(){this._hls&&(this._hls.destroy(),this._hls=null)}updated(t){if(super.updated(t),t.has("asset")&&(this._destroyHls(),this._previewLoading=!0,this.asset)){const e=me(this.asset.type);e==="video"&&this._setupHls(this.asset),e!=="image"&&e!=="video"&&(this._previewLoading=!1)}}async _setupHls(t){var a,i;const e=Da(t);if(!e||(await this.updateComplete,((a=this.asset)==null?void 0:a.uuid)!==t.uuid))return;const s=this._videoEl;if(s){if(s.canPlayType("application/vnd.apple.mpegurl")){s.src=e;return}try{const{default:r}=await Promise.resolve().then(()=>require("./hls.light-C3NKRmfw.cjs"));if(!r.isSupported()||((i=this.asset)==null?void 0:i.uuid)!==t.uuid||!this.isConnected)return;const n=new r;this._hls=n,n.loadSource(e),n.attachMedia(s),n.on(r.Events.ERROR,(l,d)=>{var h;d.fatal&&(this._destroyHls(),s.src=((h=t.url)==null?void 0:h.cdn)||"")})}catch{}}}_onFullscreenChange(){this._isFullscreen=!!document.fullscreenElement,this._isFullscreen&&(this._fsImageLoaded=!1)}_close(){this.dispatchEvent(new CustomEvent("preview-close",{bubbles:!0,composed:!0}))}_fullscreen(){var e,s,a,i,r,n;if(((s=(e=this.asset)==null?void 0:e.extension)==null?void 0:s.toLowerCase())==="pdf"&&((i=(a=this.asset)==null?void 0:a.url)!=null&&i.cdn)){window.open(this.asset.url.cdn,"_blank","noopener");return}this._fsImageLoaded=!1,(n=(r=this.previewArea)==null?void 0:r.requestFullscreen)==null||n.call(r)}_select(){if(!this.asset)return;if(!this.multiSelect){this.dispatchEvent(new CustomEvent("asset-quick-select",{detail:{asset:this.asset},bubbles:!0,composed:!0}));return}const t=this._getCurrentIndex();this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:t,event:new MouseEvent("click",{ctrlKey:!0,metaKey:!0})},bubbles:!0,composed:!0}))}_getCurrentIndex(){return!this.asset||this.assets.length===0?-1:this.assets.findIndex(t=>t.uuid===this.asset.uuid)}_navigateTo(t){this._fsImageLoaded=!1,this.dispatchEvent(new CustomEvent("preview-navigate",{detail:{asset:t},bubbles:!0,composed:!0}))}_supportsFullscreen(t){const e=me(t.type);return e==="image"||e==="video"||e==="audio"}_findNavTarget(t,e){const s=e===1?this.assets.length:-1;for(let a=t+e;a!==s;a+=e)if(!this._isFullscreen||this._supportsFullscreen(this.assets[a]))return a;return-1}_prev(){const t=this._getCurrentIndex();if(t<=0)return;const e=this._findNavTarget(t,-1);e>=0&&this._navigateTo(this.assets[e])}_next(){const t=this._getCurrentIndex();if(t<0||t>=this.assets.length-1)return;const e=this._findNavTarget(t,1);e>=0&&this._navigateTo(this.assets[e])}_getFullscreenImageUrl(t){var a,i;const e=(a=t.url)==null?void 0:a.cdn;if(!e)return Be(t)||"";if(((i=t.extension)==null?void 0:i.toLowerCase())==="svg")return e;const s=Te(e,this.containerToken);return Re(s,{w:String(window.screen.width),dpr:String(window.devicePixelRatio||1),org_if_sml:"1"})}_getBlurDimensions(t){var n,l;const e=(n=t.info)==null?void 0:n.img_w,s=(l=t.info)==null?void 0:l.img_h;if(!e||!s)return{width:"100vw",height:"100vh"};const a=window.innerWidth,i=window.innerHeight,r=Math.min(a/e,i/s,1);return{width:`${Math.round(e*r)}px`,height:`${Math.round(s*r)}px`}}_onFsImageLoad(){this._fsImageLoaded=!0}_getTagEntries(t){if(!t)return[];if(Array.isArray(t))return this._parseTagArray(t);const e=Object.values(t);if(e.length>0&&Array.isArray(e[0])){const s=e.flat(),a=new Set;return s.filter(i=>!i.label||a.has(i.sid)?!1:(a.add(i.sid),!0))}return e.map(s=>({label:s.label,sid:s.sid})).filter(s=>s.label)}_parseTagArray(t){return t.map(e=>{if(typeof e=="string")return{label:e,sid:e};const s=e;return{label:s.label||Object.values(s.names||{})[0]||"",sid:s.sid||""}}).filter(e=>e.label)}_applyTagFilter(t){this.dispatchEvent(new CustomEvent("filter-update",{detail:{key:m.TAGS,values:[t],operator:b.IS},bubbles:!0,composed:!0}))}_applyLabelFilter(t){this.dispatchEvent(new CustomEvent("filter-update",{detail:{key:m.LABELS,values:[t],operator:b.IS},bubbles:!0,composed:!0}))}_toggleSection(t){const e=new Set(this._openSections);e.has(t)?e.delete(t):e.add(t),this._openSections=e}_renderFileInfoSection(t){const e=this._getFileInfoRows(t);if(e.length===0)return o.nothing;const s=this._openSections.has("file-info");return o.html`
4738
+ `;bs([c.property()],at.prototype,"variant",2);at=bs([c.customElement("ap-skeleton")],at);function Ha(t){var i,r;const e=(i=t.info)==null?void 0:i.playlists;if(!(e!=null&&e.length))return null;const s=(r=e[0])==null?void 0:r.playlists;return s!=null&&s.length&&s[0]||null}var Ka=Object.defineProperty,Ga=Object.getOwnPropertyDescriptor,I=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ga(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ka(e,s,i),i};let P=class extends o.LitElement{constructor(){super(...arguments),this.asset=null,this.assets=[],this.selectedIds=[],this.containerToken="",this.showMetadata=!0,this.metadataFields=[],this.labels=[],this.regionalFilters={},this.multiSelect=!0,this._isFullscreen=!1,this._fsImageLoaded=!1,this._previewLoading=!1,this._openSections=new Set(["file-info","metadata"]),this._hls=null}connectedCallback(){super.connectedCallback(),this._onFullscreenChange=this._onFullscreenChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),document.addEventListener("fullscreenchange",this._onFullscreenChange),document.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("keydown",this._onKeyDown),this._destroyHls()}_onKeyDown(t){if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;const e=t.composedPath()[0];if(!e)return;const s=e.tagName;s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||e.getAttribute("role")==="radio"||e.getAttribute("role")==="listbox"||e.isContentEditable||(t.preventDefault(),t.key==="ArrowLeft"?this._prev():this._next())}_destroyHls(){this._hls&&(this._hls.destroy(),this._hls=null)}updated(t){if(super.updated(t),t.has("asset")&&(this._destroyHls(),this._previewLoading=!0,this.asset)){const e=Se(this.asset.type);e==="video"&&this._setupHls(this.asset),e!=="image"&&e!=="video"&&(this._previewLoading=!1)}}async _setupHls(t){var a,i;const e=Ha(t);if(!e||(await this.updateComplete,((a=this.asset)==null?void 0:a.uuid)!==t.uuid))return;const s=this._videoEl;if(s){if(s.canPlayType("application/vnd.apple.mpegurl")){s.src=e;return}try{const{default:r}=await Promise.resolve().then(()=>require("./hls.light-C3NKRmfw.cjs"));if(!r.isSupported()||((i=this.asset)==null?void 0:i.uuid)!==t.uuid||!this.isConnected)return;const n=new r;this._hls=n,n.loadSource(e),n.attachMedia(s),n.on(r.Events.ERROR,(l,d)=>{var h;d.fatal&&(this._destroyHls(),s.src=((h=t.url)==null?void 0:h.cdn)||"")})}catch{}}}_onFullscreenChange(){this._isFullscreen=!!document.fullscreenElement,this._isFullscreen&&(this._fsImageLoaded=!1)}_close(){this.dispatchEvent(new CustomEvent("preview-close",{bubbles:!0,composed:!0}))}_exitFullscreen(){var t;(t=document.exitFullscreen)==null||t.call(document)}_fullscreen(){var e,s,a,i,r,n;if(((s=(e=this.asset)==null?void 0:e.extension)==null?void 0:s.toLowerCase())==="pdf"&&((i=(a=this.asset)==null?void 0:a.url)!=null&&i.cdn)){window.open(this.asset.url.cdn,"_blank","noopener");return}this._fsImageLoaded=!1,(n=(r=this.previewArea)==null?void 0:r.requestFullscreen)==null||n.call(r)}_select(){if(!this.asset)return;if(!this.multiSelect){this.dispatchEvent(new CustomEvent("asset-quick-select",{detail:{asset:this.asset},bubbles:!0,composed:!0}));return}const t=this._getCurrentIndex();this.dispatchEvent(new CustomEvent("asset-select",{detail:{asset:this.asset,index:t,event:new MouseEvent("click",{ctrlKey:!0,metaKey:!0})},bubbles:!0,composed:!0}))}_getCurrentIndex(){return!this.asset||this.assets.length===0?-1:this.assets.findIndex(t=>t.uuid===this.asset.uuid)}_navigateTo(t){this._fsImageLoaded=!1,this.dispatchEvent(new CustomEvent("preview-navigate",{detail:{asset:t},bubbles:!0,composed:!0}))}_supportsFullscreen(t){const e=Se(t.type);return e==="image"||e==="video"||e==="audio"}_findNavTarget(t,e){const s=e===1?this.assets.length:-1;for(let a=t+e;a!==s;a+=e)if(!this._isFullscreen||this._supportsFullscreen(this.assets[a]))return a;return-1}_prev(){const t=this._getCurrentIndex();if(t<=0)return;const e=this._findNavTarget(t,-1);e>=0&&this._navigateTo(this.assets[e])}_next(){const t=this._getCurrentIndex();if(t<0||t>=this.assets.length-1)return;const e=this._findNavTarget(t,1);e>=0&&this._navigateTo(this.assets[e])}_getFullscreenImageUrl(t){var a,i;const e=(a=t.url)==null?void 0:a.cdn;if(!e)return tt(t)||"";if(((i=t.extension)==null?void 0:i.toLowerCase())==="svg")return e;const s=Fe(e,this.containerToken);return ze(s,{w:String(window.screen.width),dpr:String(window.devicePixelRatio||1),org_if_sml:"1"})}_getBlurDimensions(t){var n,l;const e=(n=t.info)==null?void 0:n.img_w,s=(l=t.info)==null?void 0:l.img_h;if(!e||!s)return{width:"100vw",height:"100vh"};const a=window.innerWidth,i=window.innerHeight,r=Math.min(a/e,i/s,1);return{width:`${Math.round(e*r)}px`,height:`${Math.round(s*r)}px`}}_onFsImageLoad(){this._fsImageLoaded=!0}_getTagEntries(t){if(!t)return[];if(Array.isArray(t))return this._parseTagArray(t);const e=Object.values(t);if(e.length>0&&Array.isArray(e[0])){const s=e.flat(),a=new Set;return s.filter(i=>!i.label||a.has(i.sid)?!1:(a.add(i.sid),!0))}return e.map(s=>({label:s.label,sid:s.sid})).filter(s=>s.label)}_parseTagArray(t){return t.map(e=>{if(typeof e=="string")return{label:e,sid:e};const s=e;return{label:s.label||Object.values(s.names||{})[0]||"",sid:s.sid||""}}).filter(e=>e.label)}_applyTagFilter(t){this.dispatchEvent(new CustomEvent("filter-update",{detail:{key:m.TAGS,values:[t],operator:_.IS},bubbles:!0,composed:!0}))}_applyLabelFilter(t){this.dispatchEvent(new CustomEvent("filter-update",{detail:{key:m.LABELS,values:[t],operator:_.IS},bubbles:!0,composed:!0}))}_toggleSection(t){const e=new Set(this._openSections);e.has(t)?e.delete(t):e.add(t),this._openSections=e}_renderFileInfoSection(t){const e=this._getFileInfoRows(t);if(e.length===0)return o.nothing;const s=this._openSections.has("file-info");return o.html`
4658
4739
  <div class="accordion">
4659
4740
  <button
4660
4741
  class="accordion-trigger"
@@ -4698,7 +4779,7 @@
4698
4779
  `)}
4699
4780
  </div>
4700
4781
  </div>
4701
- `}_getFileInfoRows(t){var s,a,i,r,n;const e=[];return e.push({label:"File name",value:t.name}),t.extension&&e.push({label:"Type",value:t.extension.toUpperCase()}),(s=t.size)!=null&&s.bytes&&e.push({label:"Size",value:Lt(t.size.bytes)}),(a=t.info)!=null&&a.img_w&&e.push({label:"Dimensions",value:xa(t.info.img_w,t.info.img_h)}),(i=t.info)!=null&&i.video_w&&e.push({label:"Video resolution",value:`${t.info.video_w} x ${t.info.video_h}`}),(r=t.info)!=null&&r.duration&&e.push({label:"Duration",value:`${Math.round(t.info.duration)}s`}),(n=t.info)!=null&&n.color_space&&e.push({label:"Color space",value:t.info.color_space}),t.created_at&&e.push({label:"Created",value:st(t.created_at)}),t.modified_at&&e.push({label:"Modified",value:st(t.modified_at)}),e}_buildFieldMap(){const t=new Map;for(const e of this.metadataFields)t.set(e.key,e),e.ckey&&t.set(e.ckey,e),e.slug&&t.set(e.slug,e);return t}_resolveSlug(t,e){var a;if(!((a=e.possible_values)!=null&&a.length)||!t.startsWith("@"))return t;const s=e.possible_values.find(i=>i.internal_unique_value===t||i.api_value===t);return(s==null?void 0:s.label)??t}_resolveFieldValue(t,e){var s;if(t==null||t==="")return"";if(e.regionalVariantsGroupUuid&&typeof t=="object"&&t!==null&&!Array.isArray(t)){const a=this.regionalFilters[e.regionalVariantsGroupUuid];if(a){const i=t[a];if(i!=null&&i!=="")return this._resolveFieldValue(i,{...e,regionalVariantsGroupUuid:void 0})}return""}if((s=e.possible_values)!=null&&s.length)return Array.isArray(t)?t.map(i=>this._resolveSlug(String(i),e)).filter(Boolean).join(", "):this._resolveSlug(String(t),e);if(Array.isArray(t))return t.join(", ");if(typeof t=="object"){const a=JSON.stringify(t);return a==="{}"||a==="[]"?"":a}return String(t)}_getAllMetadataRows(t){var r,n,l,d;const e=[],s=this._buildFieldMap(),a=new Set;if(this.metadataFields.length>0){const h=t;for(const u of this.metadataFields){const g=h[u.key]??((n=(r=t.info)==null?void 0:r.metadata)==null?void 0:n[u.key])??((l=t.meta)==null?void 0:l[u.key]),p=this._resolveFieldValue(g,u);if(!p)continue;a.add(u.key),u.slug&&a.add(u.slug);const f=p.length>50;e.push({label:u.label,value:p,wrap:f})}}if(t.meta)for(const[h,u]of Object.entries(t.meta)){if(a.has(h)||u==null||u==="")continue;const g=s.get(h);if(g){const p=this._resolveFieldValue(u,g);if(!p)continue;a.add(h);const f=p.length>50;e.push({label:g.label,value:p,wrap:f})}else{const p=typeof u=="object"?JSON.stringify(u):String(u);if(!p||p==="{}"||p==="[]")continue;a.add(h);const f=h.charAt(0).toUpperCase()+h.slice(1).replace(/_/g," "),v=p.length>50;e.push({label:f,value:p,wrap:v})}}const i=(d=t.info)==null?void 0:d.metadata;if(i&&typeof i=="object")for(const[h,u]of Object.entries(i)){if(a.has(h)||u==null||u==="")continue;const g=s.get(h);if(g){const p=this._resolveFieldValue(u,g);if(!p)continue;a.add(h);const f=p.length>50;e.push({label:g.label,value:p,wrap:f})}else{const p=typeof u=="object"?JSON.stringify(u):String(u);if(!p||p==="{}"||p==="[]")continue;a.add(h);const f=h.charAt(0).toUpperCase()+h.slice(1).replace(/_/g," "),v=p.length>50;e.push({label:f,value:p,wrap:v})}}return e}_getAssetLabels(t){return!t.labels||t.labels.length===0?[]:t.labels.map(e=>this.labels.find(s=>s.sid===e||s.uuid===e)).filter(e=>!!e)}_renderLabelsRow(t){const e=this._getAssetLabels(t);return e.length===0?o.nothing:o.html`
4782
+ `}_getFileInfoRows(t){var s,a,i,r,n;const e=[];return e.push({label:"File name",value:t.name}),t.extension&&e.push({label:"Type",value:t.extension.toUpperCase()}),(s=t.size)!=null&&s.bytes&&e.push({label:"Size",value:Mt(t.size.bytes)}),(a=t.info)!=null&&a.img_w&&e.push({label:"Dimensions",value:gs(t.info.img_w,t.info.img_h)}),(i=t.info)!=null&&i.video_w&&e.push({label:"Video resolution",value:`${t.info.video_w} x ${t.info.video_h}`}),(r=t.info)!=null&&r.duration&&e.push({label:"Duration",value:`${Math.round(t.info.duration)}s`}),(n=t.info)!=null&&n.color_space&&e.push({label:"Color space",value:t.info.color_space}),t.created_at&&e.push({label:"Created",value:st(t.created_at)}),t.modified_at&&e.push({label:"Modified",value:st(t.modified_at)}),e}_buildFieldMap(){const t=new Map;for(const e of this.metadataFields)t.set(e.key,e),e.ckey&&t.set(e.ckey,e),e.slug&&t.set(e.slug,e);return t}_resolveSlug(t,e){var a;if(!((a=e.possible_values)!=null&&a.length)||!t.startsWith("@"))return t;const s=e.possible_values.find(i=>i.internal_unique_value===t||i.api_value===t);return(s==null?void 0:s.label)??t}_resolveFieldValue(t,e){var s;if(t==null||t==="")return"";if(e.regionalVariantsGroupUuid&&typeof t=="object"&&t!==null&&!Array.isArray(t)){const a=this.regionalFilters[e.regionalVariantsGroupUuid];if(a){const i=t[a];if(i!=null&&i!=="")return this._resolveFieldValue(i,{...e,regionalVariantsGroupUuid:void 0})}return""}if((s=e.possible_values)!=null&&s.length)return Array.isArray(t)?t.map(i=>this._resolveSlug(String(i),e)).filter(Boolean).join(", "):this._resolveSlug(String(t),e);if(Array.isArray(t))return t.join(", ");if(typeof t=="object"){const a=JSON.stringify(t);return a==="{}"||a==="[]"?"":a}return String(t)}_getAllMetadataRows(t){var r,n,l,d;const e=[],s=this._buildFieldMap(),a=new Set;if(this.metadataFields.length>0){const h=t;for(const u of this.metadataFields){const f=h[u.key]??((n=(r=t.info)==null?void 0:r.metadata)==null?void 0:n[u.key])??((l=t.meta)==null?void 0:l[u.key]),p=this._resolveFieldValue(f,u);if(!p)continue;a.add(u.key),u.slug&&a.add(u.slug);const g=p.length>50;e.push({label:u.label,value:p,wrap:g})}}if(t.meta)for(const[h,u]of Object.entries(t.meta)){if(a.has(h)||u==null||u==="")continue;const f=s.get(h);if(f){const p=this._resolveFieldValue(u,f);if(!p)continue;a.add(h);const g=p.length>50;e.push({label:f.label,value:p,wrap:g})}else{const p=typeof u=="object"?JSON.stringify(u):String(u);if(!p||p==="{}"||p==="[]")continue;a.add(h);const g=h.charAt(0).toUpperCase()+h.slice(1).replace(/_/g," "),v=p.length>50;e.push({label:g,value:p,wrap:v})}}const i=(d=t.info)==null?void 0:d.metadata;if(i&&typeof i=="object")for(const[h,u]of Object.entries(i)){if(a.has(h)||u==null||u==="")continue;const f=s.get(h);if(f){const p=this._resolveFieldValue(u,f);if(!p)continue;a.add(h);const g=p.length>50;e.push({label:f.label,value:p,wrap:g})}else{const p=typeof u=="object"?JSON.stringify(u):String(u);if(!p||p==="{}"||p==="[]")continue;a.add(h);const g=h.charAt(0).toUpperCase()+h.slice(1).replace(/_/g," "),v=p.length>50;e.push({label:g,value:p,wrap:v})}}return e}_getAssetLabels(t){return!t.labels||t.labels.length===0?[]:t.labels.map(e=>this.labels.find(s=>s.sid===e||s.uuid===e)).filter(e=>!!e)}_renderLabelsRow(t){const e=this._getAssetLabels(t);return e.length===0?o.nothing:o.html`
4702
4783
  <div class="meta-row" style="flex-direction:column;gap:6px">
4703
4784
  <span class="meta-label">Labels</span>
4704
4785
  <div class="tags-list">
@@ -4721,7 +4802,7 @@
4721
4802
  `)}
4722
4803
  </div>
4723
4804
  </div>
4724
- `}render(){var S,A,L,k,se,ce,Se,Xe;const t=this.asset;if(!t)return o.nothing;const e=me(t.type),s=e==="image",a=e==="video",i=e==="audio",r=((S=t.extension)==null?void 0:S.toLowerCase())==="pdf",n=Ke(t.extension||""),l=ft(t.extension||""),d=((A=t.extension)==null?void 0:A.toLowerCase())==="svg",h=Be(t),u=s?d?((L=t.url)==null?void 0:L.cdn)||"":h||Te(((k=t.url)==null?void 0:k.cdn)||"",this.containerToken):"",g=s?this._getFullscreenImageUrl(t):"",p=s&&!d?this._getBlurDimensions(t):null,f=a&&((se=t.url)==null?void 0:se.cdn)||"",v=a&&(((ce=t.info)==null?void 0:ce.video_thumbnail)||((Se=t.info)==null?void 0:Se.preview))||"",F=r&&!s?ut(t):"",_=this._getCurrentIndex(),I=_>0&&this._findNavTarget(_,-1)>=0,$=_>=0&&this._findNavTarget(_,1)>=0,w=this.assets.length>1;return o.html`
4805
+ `}render(){var A,T,L,C,se,ce,$e,Ge;const t=this.asset;if(!t)return o.nothing;const e=Se(t.type),s=e==="image",a=e==="video",i=e==="audio",r=((A=t.extension)==null?void 0:A.toLowerCase())==="pdf",n=ht(t.extension||""),l=Pt(t.extension||""),d=((T=t.extension)==null?void 0:T.toLowerCase())==="svg",h=tt(t),u=s?d?((L=t.url)==null?void 0:L.cdn)||"":h||Fe(((C=t.url)==null?void 0:C.cdn)||"",this.containerToken):"",f=s?this._getFullscreenImageUrl(t):"",p=s&&!d?this._getBlurDimensions(t):null,g=a&&((se=t.url)==null?void 0:se.cdn)||"",v=a&&(((ce=t.info)==null?void 0:ce.video_thumbnail)||(($e=t.info)==null?void 0:$e.preview))||"",w=r&&!s?Ot(t):"",b=this._getCurrentIndex(),O=b>0&&this._findNavTarget(b,-1)>=0,$=b>=0&&this._findNavTarget(b,1)>=0,k=this.assets.length>1;return o.html`
4725
4806
  <div class="panel">
4726
4807
  <div class="panel-header">
4727
4808
  <span class="panel-title" title=${t.name}>${t.name}</span>
@@ -4739,14 +4820,19 @@
4739
4820
  </div>
4740
4821
 
4741
4822
  <div class="preview-area ${s&&l?"chess":""}">
4742
- ${w?o.html`
4743
- <button class="nav-btn prev" @click=${this._prev} ?disabled=${!I} aria-label="Previous">
4823
+ ${k?o.html`
4824
+ <button class="nav-btn prev" @click=${this._prev} ?disabled=${!O} aria-label="Previous">
4744
4825
  <ap-icon name="chevron-left" .size=${16}></ap-icon>
4745
4826
  </button>
4746
4827
  <button class="nav-btn next" @click=${this._next} ?disabled=${!$} aria-label="Next">
4747
4828
  <ap-icon name="chevron-right" .size=${16}></ap-icon>
4748
4829
  </button>
4749
4830
  `:o.nothing}
4831
+ ${this._isFullscreen?o.html`
4832
+ <button class="fs-close-btn" @click=${this._exitFullscreen} aria-label="Exit fullscreen">
4833
+ <ap-icon name="close" .size=${16}></ap-icon>
4834
+ </button>
4835
+ `:o.nothing}
4750
4836
  ${this._previewLoading?o.html`<div class="preview-loading"><div class="spinner"></div></div>`:o.nothing}
4751
4837
  ${s?o.html`
4752
4838
  <img
@@ -4766,20 +4852,20 @@
4766
4852
  `}
4767
4853
  <img
4768
4854
  class="fs-full ${d||this._fsImageLoaded?"loaded":""}"
4769
- src=${this._isFullscreen?g:""}
4855
+ src=${this._isFullscreen?f:""}
4770
4856
  alt=${t.name}
4771
4857
  style=${d?"width:100vw;height:100vh":""}
4772
4858
  @load=${this._onFsImageLoad}
4773
4859
  />
4774
4860
  </div>
4775
4861
  `:o.nothing}
4776
- ${a?o.html`<video src=${f} poster=${v||o.nothing} controls @loadeddata=${()=>{this._previewLoading=!1}} @error=${()=>{this._previewLoading=!1}}></video>`:o.nothing}
4777
- ${i?o.html`<audio src=${((Xe=t.url)==null?void 0:Xe.cdn)||""} controls></audio>`:o.nothing}
4862
+ ${a?o.html`<video src=${g} poster=${v||o.nothing} controls @loadeddata=${()=>{this._previewLoading=!1}} @error=${()=>{this._previewLoading=!1}}></video>`:o.nothing}
4863
+ ${i?o.html`<audio src=${((Ge=t.url)==null?void 0:Ge.cdn)||""} controls></audio>`:o.nothing}
4778
4864
  ${r&&!s?o.html`
4779
4865
  <img
4780
- src=${F||n}
4866
+ src=${w||n}
4781
4867
  alt=${t.name}
4782
- class=${F?"":"icon-fallback"}
4868
+ class=${w?"":"icon-fallback"}
4783
4869
  @error=${de=>{const pe=de.target;pe.src!==n&&(pe.src=n,pe.classList.add("icon-fallback"))}}
4784
4870
  />
4785
4871
  `:o.nothing}
@@ -4791,7 +4877,7 @@
4791
4877
  ${this._renderAccordion("metadata","Metadata",this._getAllMetadataRows(t))}
4792
4878
  `:o.nothing}
4793
4879
  </div>
4794
- `}};O.styles=o.css`
4880
+ `}};P.styles=o.css`
4795
4881
  :host {
4796
4882
  display: block;
4797
4883
  }
@@ -4800,8 +4886,8 @@
4800
4886
  min-width: 420px;
4801
4887
  max-width: 100%;
4802
4888
  height: 100%;
4803
- background: var(--ap-background, #fff);
4804
- border-left: 1px solid var(--ap-border, #e4e4e7);
4889
+ background: var(--ap-background, oklch(1 0 0));
4890
+ border-left: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
4805
4891
  display: flex;
4806
4892
  flex-direction: column;
4807
4893
  animation: ap-panel-in 300ms ease-out;
@@ -4817,12 +4903,12 @@
4817
4903
  align-items: center;
4818
4904
  justify-content: space-between;
4819
4905
  padding: 16px;
4820
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
4906
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
4821
4907
  }
4822
4908
  .panel-title {
4823
4909
  font-size: var(--ap-font-size-base, 1rem);
4824
4910
  font-weight: 600;
4825
- color: var(--ap-foreground, #09090b);
4911
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4826
4912
  white-space: nowrap;
4827
4913
  overflow: hidden;
4828
4914
  text-overflow: ellipsis;
@@ -4841,23 +4927,23 @@
4841
4927
  border: none;
4842
4928
  border-radius: var(--ap-radius-sm, 6px);
4843
4929
  background: none;
4844
- color: var(--ap-muted-foreground, #71717a);
4930
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
4845
4931
  cursor: pointer;
4846
4932
  }
4847
4933
  .icon-btn:hover:not(:disabled) {
4848
- background: var(--ap-muted, #f4f4f5);
4849
- color: var(--ap-foreground, #09090b);
4934
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4935
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4850
4936
  }
4851
4937
  .icon-btn:disabled {
4852
4938
  opacity: 0.3;
4853
4939
  cursor: default;
4854
4940
  }
4855
4941
  .icon-btn.selected {
4856
- background: var(--ap-primary, #3b82f6);
4942
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
4857
4943
  color: #fff;
4858
4944
  }
4859
4945
  .icon-btn.selected:hover {
4860
- background: var(--ap-primary, #3b82f6);
4946
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
4861
4947
  color: #fff;
4862
4948
  opacity: 0.9;
4863
4949
  }
@@ -4867,7 +4953,7 @@
4867
4953
  display: flex;
4868
4954
  align-items: center;
4869
4955
  justify-content: center;
4870
- background: var(--ap-muted, #f4f4f5);
4956
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4871
4957
  min-height: 300px;
4872
4958
  height: 300px;
4873
4959
  flex-shrink: 0;
@@ -4879,14 +4965,14 @@
4879
4965
  display: flex;
4880
4966
  align-items: center;
4881
4967
  justify-content: center;
4882
- background: var(--ap-muted, #f4f4f5);
4968
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
4883
4969
  z-index: 3;
4884
4970
  }
4885
4971
  .preview-loading .spinner {
4886
4972
  width: 24px;
4887
4973
  height: 24px;
4888
- border: 2.5px solid var(--ap-border, #e4e4e7);
4889
- border-top-color: var(--ap-primary, #3b82f6);
4974
+ border: 2.5px solid var(--ap-border, oklch(92.86% 0.009 247.92));
4975
+ border-top-color: var(--ap-primary, oklch(0.578 0.198 268.129));
4890
4976
  border-radius: 50%;
4891
4977
  animation: ap-spin 0.6s linear infinite;
4892
4978
  }
@@ -4978,6 +5064,25 @@
4978
5064
  .preview-area:fullscreen .nav-btn:hover:not(:disabled) {
4979
5065
  background: rgba(0,0,0,0.7);
4980
5066
  }
5067
+ .fs-close-btn {
5068
+ display: flex;
5069
+ align-items: center;
5070
+ justify-content: center;
5071
+ position: absolute;
5072
+ top: 16px;
5073
+ right: 16px;
5074
+ width: 40px;
5075
+ height: 40px;
5076
+ border: none;
5077
+ border-radius: 50%;
5078
+ background: rgba(0,0,0,0.5);
5079
+ color: #fff;
5080
+ cursor: pointer;
5081
+ z-index: 3;
5082
+ }
5083
+ .fs-close-btn:hover {
5084
+ background: rgba(0,0,0,0.7);
5085
+ }
4981
5086
  .nav-btn {
4982
5087
  position: absolute;
4983
5088
  top: 50%;
@@ -4989,14 +5094,14 @@
4989
5094
  height: 32px;
4990
5095
  border: none;
4991
5096
  border-radius: 50%;
4992
- background: var(--ap-background, #fff);
4993
- color: var(--ap-foreground, #09090b);
5097
+ background: var(--ap-background, oklch(1 0 0));
5098
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
4994
5099
  cursor: pointer;
4995
5100
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
4996
5101
  z-index: 2;
4997
5102
  }
4998
5103
  .nav-btn:hover:not(:disabled) {
4999
- background: var(--ap-muted, #f4f4f5);
5104
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
5000
5105
  }
5001
5106
  .nav-btn:disabled {
5002
5107
  opacity: 0.3;
@@ -5018,7 +5123,7 @@
5018
5123
  }
5019
5124
  /* Accordion styles */
5020
5125
  .accordion {
5021
- border-top: 1px solid var(--ap-border, #e4e4e7);
5126
+ border-top: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
5022
5127
  }
5023
5128
  .accordion-trigger {
5024
5129
  display: flex;
@@ -5032,15 +5137,15 @@
5032
5137
  font-family: inherit;
5033
5138
  font-size: 0.8125rem;
5034
5139
  font-weight: 600;
5035
- color: var(--ap-foreground, #09090b);
5140
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5036
5141
  text-align: left;
5037
5142
  }
5038
5143
  .accordion-trigger:hover {
5039
- background: var(--ap-muted, #f4f4f5);
5144
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
5040
5145
  }
5041
5146
  .accordion-chevron {
5042
5147
  transition: transform 200ms;
5043
- color: var(--ap-muted-foreground, #71717a);
5148
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
5044
5149
  }
5045
5150
  .accordion-trigger[aria-expanded="true"] .accordion-chevron {
5046
5151
  transform: rotate(180deg);
@@ -5056,14 +5161,14 @@
5056
5161
  display: flex;
5057
5162
  gap: 12px;
5058
5163
  padding: 6px 0;
5059
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
5164
+ border-bottom: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
5060
5165
  }
5061
5166
  .meta-row:last-child {
5062
5167
  border-bottom: none;
5063
5168
  }
5064
5169
  .meta-label {
5065
5170
  font-size: 0.8125rem;
5066
- color: var(--ap-muted-foreground, #71717a);
5171
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
5067
5172
  flex-shrink: 0;
5068
5173
  width: 100px;
5069
5174
  overflow: hidden;
@@ -5072,7 +5177,7 @@
5072
5177
  }
5073
5178
  .meta-value {
5074
5179
  font-size: 0.8125rem;
5075
- color: var(--ap-foreground, #09090b);
5180
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5076
5181
  min-width: 0;
5077
5182
  user-select: text;
5078
5183
  word-break: break-word;
@@ -5081,33 +5186,19 @@
5081
5186
  .panel { animation: none; }
5082
5187
  .accordion-chevron { transition: none; }
5083
5188
  }
5084
- `;P([c.property({type:Object})],O.prototype,"asset",2);P([c.property({type:Array})],O.prototype,"assets",2);P([c.property({type:Array})],O.prototype,"selectedIds",2);P([c.property()],O.prototype,"containerToken",2);P([c.property({type:Boolean})],O.prototype,"showMetadata",2);P([c.property({type:Array})],O.prototype,"metadataFields",2);P([c.property({type:Array})],O.prototype,"labels",2);P([c.property({type:Object})],O.prototype,"regionalFilters",2);P([c.property({type:Boolean})],O.prototype,"multiSelect",2);P([c.query(".preview-area")],O.prototype,"previewArea",2);P([c.query("video")],O.prototype,"_videoEl",2);P([c.state()],O.prototype,"_isFullscreen",2);P([c.state()],O.prototype,"_fsImageLoaded",2);P([c.state()],O.prototype,"_previewLoading",2);P([c.state()],O.prototype,"_openSections",2);O=P([c.customElement("ap-preview-panel")],O);var Na=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,Pe=(t,e,s,a)=>{for(var i=a>1?void 0:a?ja(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Na(e,s,i),i};let oe=class extends o.LitElement{constructor(){super(...arguments),this.selectedAssets=[],this.totalCount=0,this.isSelectingAll=!1,this.multiSelect=!0}_confirm(){this.dispatchEvent(new CustomEvent("selection-confirm",{detail:{assets:this.selectedAssets},bubbles:!0,composed:!0}))}_clear(){this.dispatchEvent(new CustomEvent("selection-clear",{bubbles:!0,composed:!0}))}_selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!0,composed:!0}))}_deselect(t){this.dispatchEvent(new CustomEvent("selection-deselect",{detail:{uuid:t},bubbles:!0,composed:!0}))}render(){return this.selectedAssets.length===0?o.nothing:o.html`
5189
+ `;I([c.property({type:Object})],P.prototype,"asset",2);I([c.property({type:Array})],P.prototype,"assets",2);I([c.property({type:Array})],P.prototype,"selectedIds",2);I([c.property()],P.prototype,"containerToken",2);I([c.property({type:Boolean})],P.prototype,"showMetadata",2);I([c.property({type:Array})],P.prototype,"metadataFields",2);I([c.property({type:Array})],P.prototype,"labels",2);I([c.property({type:Object})],P.prototype,"regionalFilters",2);I([c.property({type:Boolean})],P.prototype,"multiSelect",2);I([c.query(".preview-area")],P.prototype,"previewArea",2);I([c.query("video")],P.prototype,"_videoEl",2);I([c.state()],P.prototype,"_isFullscreen",2);I([c.state()],P.prototype,"_fsImageLoaded",2);I([c.state()],P.prototype,"_previewLoading",2);I([c.state()],P.prototype,"_openSections",2);P=I([c.customElement("ap-preview-panel")],P);var Ya=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Pe=(t,e,s,a)=>{for(var i=a>1?void 0:a?Xa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ya(e,s,i),i};let oe=class extends o.LitElement{constructor(){super(...arguments),this.selectedAssets=[],this.totalCount=0,this.isSelectingAll=!1,this.multiSelect=!0}_confirm(){this.dispatchEvent(new CustomEvent("selection-confirm",{detail:{assets:this.selectedAssets},bubbles:!0,composed:!0}))}_clear(){this.dispatchEvent(new CustomEvent("selection-clear",{bubbles:!0,composed:!0}))}_selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!0,composed:!0}))}render(){return this.selectedAssets.length===0?o.nothing:o.html`
5085
5190
  <div class="bar">
5086
- <span class="count">${this.selectedAssets.length} asset${this.selectedAssets.length>1?"s":""} selected</span>
5191
+ <span class="count">${this.selectedAssets.length} selected</span>
5192
+ <span class="select-label">Select:</span>
5087
5193
  ${this.multiSelect&&this.selectedAssets.length<this.totalCount&&(!this.maxSelections||this.selectedAssets.length<this.maxSelections)?o.html`<button
5088
- class="select-all-link"
5194
+ class="bar-link"
5089
5195
  ?disabled=${this.isSelectingAll}
5090
5196
  @click=${this._selectAll}
5091
- >${this.isSelectingAll?"Selecting...":this.maxSelections&&this.maxSelections<this.totalCount?`Select first ${this.maxSelections}`:`Select all ${this.totalCount.toLocaleString()}`}</button>`:o.nothing}
5197
+ >${this.isSelectingAll?"Selecting...":this.maxSelections&&this.maxSelections<this.totalCount?`First ${this.maxSelections}`:"All assets"}</button>`:o.nothing}
5198
+ <button class="bar-link" @click=${this._clear}>None</button>
5092
5199
  ${this.maxSelections&&this.selectedAssets.length>=this.maxSelections?o.html`<span class="limit-notice">Max ${this.maxSelections} allowed</span>`:o.nothing}
5093
- <div class="thumbnails">
5094
- ${this.selectedAssets.map(t=>{var d;const s=me(t.type)==="video",a=((d=t.extension)==null?void 0:d.toLowerCase())==="pdf",i=Pt(t.extension||"");let r="";s?r=Ot(t):a?r=ut(t):i&&(r=Be(t));const n=Ke(t.extension||""),l=ft(t.extension||"");return o.html`
5095
- <div class="thumb ${l&&r?"chess":""}" @click=${()=>this._deselect(t.uuid)} title="Click to deselect ${t.name}">
5096
- ${r?o.html`<img
5097
- src=${r}
5098
- alt=${t.name}
5099
- @error=${h=>{const u=h.target,g=be();u.src!==n&&u.src!==g?(u.src=n,u.classList.add("icon")):u.src!==g&&(u.src=g,u.classList.add("icon"))}}
5100
- />`:o.html`<img
5101
- class="icon"
5102
- src=${n}
5103
- alt=${t.name}
5104
- @error=${h=>{const u=h.target,g=be();u.src!==g&&(u.src=g)}}
5105
- />`}
5106
- </div>
5107
- `})}
5108
- </div>
5200
+ <div class="spacer"></div>
5109
5201
  <div class="actions">
5110
- <button class="btn btn-ghost" @click=${this._clear}>Clear</button>
5111
5202
  <button class="btn btn-primary" @click=${this._confirm}>Confirm</button>
5112
5203
  </div>
5113
5204
  </div>
@@ -5119,8 +5210,7 @@
5119
5210
  display: flex;
5120
5211
  align-items: center;
5121
5212
  padding: 12px 20px;
5122
- background: var(--ap-card, #fff);
5123
- border-top: 1px solid var(--ap-border, #e4e4e7);
5213
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
5124
5214
  animation: ap-bar-in 250ms ease-out;
5125
5215
  }
5126
5216
  @keyframes ap-bar-in {
@@ -5129,78 +5219,44 @@
5129
5219
  }
5130
5220
  .count {
5131
5221
  font-size: var(--ap-font-size-sm, 0.875rem);
5132
- font-weight: 500;
5133
- color: var(--ap-foreground, #09090b);
5222
+ font-weight: 400;
5223
+ color: var(--ap-primary-foreground, oklch(1 0 0));
5224
+ white-space: nowrap;
5225
+ }
5226
+ .select-label {
5227
+ font-size: var(--ap-font-size-sm, 0.875rem);
5228
+ color: oklch(1 0 0 / 0.7);
5229
+ margin-left: 24px;
5134
5230
  white-space: nowrap;
5135
5231
  }
5136
- .select-all-link {
5232
+ .bar-link {
5137
5233
  font-size: var(--ap-font-size-sm, 0.875rem);
5138
- color: var(--ap-primary, oklch(0.65 0.19 258));
5234
+ color: var(--ap-primary-foreground, oklch(1 0 0));
5139
5235
  background: none;
5140
5236
  border: none;
5141
5237
  cursor: pointer;
5142
5238
  padding: 0;
5143
5239
  margin-left: 8px;
5144
- font-weight: 500;
5240
+ font-weight: 600;
5145
5241
  font-family: var(--ap-font-family, system-ui, sans-serif);
5146
5242
  white-space: nowrap;
5147
5243
  }
5148
- .select-all-link:hover {
5244
+ .bar-link:hover {
5149
5245
  text-decoration: underline;
5150
5246
  }
5151
- .select-all-link:disabled {
5247
+ .bar-link:disabled {
5152
5248
  opacity: 0.5;
5153
5249
  cursor: default;
5154
5250
  text-decoration: none;
5155
5251
  }
5156
5252
  .limit-notice {
5157
5253
  font-size: var(--ap-font-size-xs, 0.75rem);
5158
- color: var(--ap-muted-foreground, #71717a);
5254
+ color: oklch(1 0 0 / 0.7);
5159
5255
  margin-left: 8px;
5160
5256
  white-space: nowrap;
5161
5257
  }
5162
- .thumbnails {
5258
+ .spacer {
5163
5259
  flex: 1;
5164
- display: flex;
5165
- align-items: center;
5166
- gap: 4px;
5167
- padding: 0 16px;
5168
- overflow-x: auto;
5169
- scrollbar-width: none;
5170
- }
5171
- .thumbnails::-webkit-scrollbar { display: none; }
5172
- .thumb {
5173
- width: 36px;
5174
- height: 36px;
5175
- border-radius: 4px;
5176
- overflow: hidden;
5177
- flex-shrink: 0;
5178
- cursor: pointer;
5179
- border: 2px solid transparent;
5180
- transition: border-color 100ms;
5181
- background: var(--ap-muted, #f4f4f5);
5182
- }
5183
- .thumb:hover {
5184
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
5185
- }
5186
- .thumb.chess {
5187
- background-image: conic-gradient(var(--ap-chess-a, #f0f0f0) 25%, var(--ap-chess-b, #fff) 25% 50%, var(--ap-chess-a, #f0f0f0) 50% 75%, var(--ap-chess-b, #fff) 75%);
5188
- background-size: 10px 10px;
5189
- }
5190
- .thumb {
5191
- display: flex;
5192
- align-items: center;
5193
- justify-content: center;
5194
- }
5195
- .thumb img {
5196
- width: 100%;
5197
- height: 100%;
5198
- object-fit: cover;
5199
- }
5200
- .thumb img.icon {
5201
- object-fit: contain;
5202
- width: 20px;
5203
- height: 20px;
5204
5260
  }
5205
5261
  .actions {
5206
5262
  display: flex;
@@ -5220,25 +5276,19 @@
5220
5276
  opacity: 0.9;
5221
5277
  }
5222
5278
  .btn-primary {
5223
- background: var(--ap-primary, oklch(0.65 0.19 258));
5224
- color: var(--ap-primary-foreground, #fff);
5225
- }
5226
- .btn-ghost {
5227
- background: none;
5228
- color: var(--ap-muted-foreground, #71717a);
5229
- }
5230
- .btn-ghost:hover {
5231
- color: var(--ap-foreground, #09090b);
5279
+ background: transparent;
5280
+ color: var(--ap-primary-foreground, oklch(1 0 0));
5281
+ border: 1px solid var(--ap-primary-foreground, oklch(1 0 0));
5232
5282
  }
5233
5283
  @media (prefers-reduced-motion: reduce) {
5234
5284
  .bar { animation: none; }
5235
5285
  }
5236
- `;Pe([c.property({type:Array})],oe.prototype,"selectedAssets",2);Pe([c.property({type:Number})],oe.prototype,"totalCount",2);Pe([c.property({type:Boolean})],oe.prototype,"isSelectingAll",2);Pe([c.property({type:Boolean})],oe.prototype,"multiSelect",2);Pe([c.property({type:Number})],oe.prototype,"maxSelections",2);oe=Pe([c.customElement("ap-selection-bar")],oe);var Ba=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,Dt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Va(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ba(e,s,i),i};let qe=class extends o.LitElement{constructor(){super(...arguments),this.active=!1,this.rect={x:0,y:0,width:0,height:0}}render(){return!this.active||this.rect.width<5||this.rect.height<5?o.nothing:o.html`
5286
+ `;Pe([c.property({type:Array})],oe.prototype,"selectedAssets",2);Pe([c.property({type:Number})],oe.prototype,"totalCount",2);Pe([c.property({type:Boolean})],oe.prototype,"isSelectingAll",2);Pe([c.property({type:Boolean})],oe.prototype,"multiSelect",2);Pe([c.property({type:Number})],oe.prototype,"maxSelections",2);oe=Pe([c.customElement("ap-selection-bar")],oe);var Wa=Object.defineProperty,Qa=Object.getOwnPropertyDescriptor,It=(t,e,s,a)=>{for(var i=a>1?void 0:a?Qa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Wa(e,s,i),i};let Ue=class extends o.LitElement{constructor(){super(...arguments),this.active=!1,this.rect={x:0,y:0,width:0,height:0}}render(){return!this.active||this.rect.width<5||this.rect.height<5?o.nothing:o.html`
5237
5287
  <div
5238
5288
  class="marquee"
5239
5289
  style="left:${this.rect.x}px;top:${this.rect.y}px;width:${this.rect.width}px;height:${this.rect.height}px"
5240
5290
  ></div>
5241
- `}};qe.styles=o.css`
5291
+ `}};Ue.styles=o.css`
5242
5292
  :host {
5243
5293
  display: block;
5244
5294
  position: absolute;
@@ -5251,11 +5301,11 @@
5251
5301
  }
5252
5302
  .marquee {
5253
5303
  position: absolute;
5254
- border: 2px solid var(--ap-primary, oklch(0.65 0.19 258));
5255
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
5304
+ border: 2px solid var(--ap-primary, oklch(0.578 0.198 268.129));
5305
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
5256
5306
  border-radius: 2px;
5257
5307
  }
5258
- `;Dt([c.property({type:Boolean})],qe.prototype,"active",2);Dt([c.property({type:Object})],qe.prototype,"rect",2);qe=Dt([c.customElement("ap-marquee-overlay")],qe);var qa=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,zt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ua(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&qa(e,s,i),i};const Ha={search:[{tag:"circle",attrs:{cx:"11",cy:"11",r:"8"}},{tag:"path",attrs:{d:"m21 21-4.3-4.3"}}],check:"M20 6 9 17l-5-5",close:[{tag:"path",attrs:{d:"M18 6 6 18"}},{tag:"path",attrs:{d:"m6 6 12 12"}}],"chevron-left":"m15 18-6-6 6-6","chevron-right":"m9 18 6-6-6-6","chevron-down":"m6 9 6 6 6-6",download:[{tag:"path",attrs:{d:"M12 15V3"}},{tag:"path",attrs:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}},{tag:"path",attrs:{d:"m7 10 5 5 5-5"}}],fullscreen:[{tag:"path",attrs:{d:"M8 3H5a2 2 0 0 0-2 2v3"}},{tag:"path",attrs:{d:"M21 8V5a2 2 0 0 0-2-2h-3"}},{tag:"path",attrs:{d:"M3 16v3a2 2 0 0 0 2 2h3"}},{tag:"path",attrs:{d:"M16 21h3a2 2 0 0 0 2-2v-3"}}],trash:[{tag:"path",attrs:{d:"M10 11v6"}},{tag:"path",attrs:{d:"M14 11v6"}},{tag:"path",attrs:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}},{tag:"path",attrs:{d:"M3 6h18"}},{tag:"path",attrs:{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}}],more:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"1"}},{tag:"circle",attrs:{cx:"19",cy:"12",r:"1"}},{tag:"circle",attrs:{cx:"5",cy:"12",r:"1"}}],grid:[{tag:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}},{tag:"path",attrs:{d:"M12 3v18"}},{tag:"path",attrs:{d:"M3 12h18"}}],list:[{tag:"path",attrs:{d:"M3 5h.01"}},{tag:"path",attrs:{d:"M3 12h.01"}},{tag:"path",attrs:{d:"M3 19h.01"}},{tag:"path",attrs:{d:"M8 5h13"}},{tag:"path",attrs:{d:"M8 12h13"}},{tag:"path",attrs:{d:"M8 19h13"}}],preview:[{tag:"path",attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}},{tag:"circle",attrs:{cx:"12",cy:"12",r:"3"}}],select:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"m9 12 2 2 4-4"}}],"gallery-vertical-end":[{tag:"path",attrs:{d:"M7 2h10"}},{tag:"path",attrs:{d:"M5 6h14"}},{tag:"rect",attrs:{width:"18",height:"12",x:"3",y:"10",rx:"2"}}],filter:[{tag:"path",attrs:{d:"M2 5h20"}},{tag:"path",attrs:{d:"M6 12h12"}},{tag:"path",attrs:{d:"M9 19h6"}}],sort:[{tag:"path",attrs:{d:"m21 16-4 4-4-4"}},{tag:"path",attrs:{d:"M17 20V4"}},{tag:"path",attrs:{d:"m3 8 4-4 4 4"}},{tag:"path",attrs:{d:"M7 4v16"}}],"sort-asc":[{tag:"path",attrs:{d:"m3 8 4-4 4 4"}},{tag:"path",attrs:{d:"M7 4v16"}},{tag:"path",attrs:{d:"M11 12h4"}},{tag:"path",attrs:{d:"M11 16h7"}},{tag:"path",attrs:{d:"M11 20h10"}}],"sort-desc":[{tag:"path",attrs:{d:"m3 16 4 4 4-4"}},{tag:"path",attrs:{d:"M7 20V4"}},{tag:"path",attrs:{d:"M11 4h4"}},{tag:"path",attrs:{d:"M11 8h7"}},{tag:"path",attrs:{d:"M11 12h10"}}],image:[{tag:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tag:"circle",attrs:{cx:"9",cy:"9",r:"2"}},{tag:"path",attrs:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}}],video:[{tag:"path",attrs:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"}},{tag:"rect",attrs:{x:"2",y:"6",width:"14",height:"12",rx:"2"}}],audio:[{tag:"path",attrs:{d:"M9 18V5l12-2v13"}},{tag:"circle",attrs:{cx:"6",cy:"18",r:"3"}},{tag:"circle",attrs:{cx:"18",cy:"16",r:"3"}}],music:[{tag:"path",attrs:{d:"M9 18V5l12-2v13"}},{tag:"circle",attrs:{cx:"6",cy:"18",r:"3"}},{tag:"circle",attrs:{cx:"18",cy:"16",r:"3"}}],document:[{tag:"path",attrs:{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}},{tag:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tag:"path",attrs:{d:"M10 9H8"}},{tag:"path",attrs:{d:"M16 13H8"}},{tag:"path",attrs:{d:"M16 17H8"}}],"file-text":[{tag:"path",attrs:{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}},{tag:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tag:"path",attrs:{d:"M10 9H8"}},{tag:"path",attrs:{d:"M16 13H8"}},{tag:"path",attrs:{d:"M16 17H8"}}],file:[{tag:"path",attrs:{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}},{tag:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}}],archive:[{tag:"rect",attrs:{width:"20",height:"5",x:"2",y:"3",rx:"1"}},{tag:"path",attrs:{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}},{tag:"path",attrs:{d:"M10 12h4"}}],font:[{tag:"path",attrs:{d:"M12 4v16"}},{tag:"path",attrs:{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}},{tag:"path",attrs:{d:"M9 20h6"}}],text:[{tag:"path",attrs:{d:"M12 4v16"}},{tag:"path",attrs:{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}},{tag:"path",attrs:{d:"M9 20h6"}}],clapperboard:[{tag:"path",attrs:{d:"m12.296 3.464 3.02 3.956"}},{tag:"path",attrs:{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z"}},{tag:"path",attrs:{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}},{tag:"path",attrs:{d:"m6.18 5.276 3.1 3.899"}}],folder:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z","folder-open":"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",tags:[{tag:"path",attrs:{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z"}},{tag:"path",attrs:{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193"}},{tag:"circle",attrs:{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor"}}],tag:[{tag:"path",attrs:{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}},{tag:"circle",attrs:{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}}],hash:[{tag:"path",attrs:{d:"M4 9h16"}},{tag:"path",attrs:{d:"M4 15h16"}},{tag:"path",attrs:{d:"M10 3 8 21"}},{tag:"path",attrs:{d:"M14 3 16 21"}}],"calendar-days":[{tag:"rect",attrs:{width:"18",height:"18",x:"3",y:"4",rx:"2"}},{tag:"path",attrs:{d:"M16 2v4"}},{tag:"path",attrs:{d:"M8 2v4"}},{tag:"path",attrs:{d:"M3 10h18"}},{tag:"path",attrs:{d:"M8 14h.01"}},{tag:"path",attrs:{d:"M12 14h.01"}},{tag:"path",attrs:{d:"M16 14h.01"}},{tag:"path",attrs:{d:"M8 18h.01"}},{tag:"path",attrs:{d:"M12 18h.01"}},{tag:"path",attrs:{d:"M16 18h.01"}}],"file-type":[{tag:"path",attrs:{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"}},{tag:"path",attrs:{d:"M14 2v4a2 2 0 0 0 2 2h4"}},{tag:"path",attrs:{d:"M2 13v-1h6v1"}},{tag:"path",attrs:{d:"M5 12v6"}},{tag:"path",attrs:{d:"M4 18h2"}}],scaling:[{tag:"path",attrs:{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}},{tag:"path",attrs:{d:"M14 15H9v-5"}},{tag:"path",attrs:{d:"M20 9V4h-5"}},{tag:"path",attrs:{d:"M20 4l-6 6"}}],history:[{tag:"path",attrs:{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}},{tag:"path",attrs:{d:"M3 3v5h5"}},{tag:"path",attrs:{d:"M12 7v5l4 2"}}],"swatch-book":[{tag:"path",attrs:{d:"M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z"}},{tag:"path",attrs:{d:"M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7"}},{tag:"path",attrs:{d:"M7 17h.01"}},{tag:"path",attrs:{d:"m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8"}}],"badge-check":[{tag:"path",attrs:{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"}},{tag:"path",attrs:{d:"m9 12 2 2 4-4"}}],box:[{tag:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tag:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tag:"path",attrs:{d:"M12 22V12"}}],"layout-grid":[{tag:"rect",attrs:{width:"7",height:"7",x:"3",y:"3",rx:"1"}},{tag:"rect",attrs:{width:"7",height:"7",x:"14",y:"3",rx:"1"}},{tag:"rect",attrs:{width:"7",height:"7",x:"14",y:"14",rx:"1"}},{tag:"rect",attrs:{width:"7",height:"7",x:"3",y:"14",rx:"1"}}],"layout-template":[{tag:"rect",attrs:{width:"18",height:"7",x:"3",y:"3",rx:"1"}},{tag:"rect",attrs:{width:"9",height:"7",x:"3",y:"14",rx:"1"}},{tag:"rect",attrs:{width:"5",height:"7",x:"16",y:"14",rx:"1"}}],pin:[{tag:"path",attrs:{d:"M12 17v5"}},{tag:"path",attrs:{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 2-2H6a2 2 0 0 0 2 2 1 1 0 0 1 1 1z"}}],"pin-off":[{tag:"path",attrs:{d:"M12 17v5"}},{tag:"path",attrs:{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 2-2H6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v2.34"}},{tag:"path",attrs:{d:"M2 2l20 20"}},{tag:"path",attrs:{d:"M9 12a2 2 0 0 1-1.11 1.79l-1.78.9"}},{tag:"path",attrs:{d:"M17 17H5"}}],lock:[{tag:"rect",attrs:{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}},{tag:"path",attrs:{d:"M7 11V7a5 5 0 0 1 10 0v4"}}],globe:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}},{tag:"path",attrs:{d:"M2 12h20"}}],"circle-check-big":[{tag:"path",attrs:{d:"M21.801 10A10 10 0 1 1 17 3.335"}},{tag:"path",attrs:{d:"m9 11 3 3L22 4"}}],"x-circle":[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"m15 9-6 6"}},{tag:"path",attrs:{d:"m9 9 6 6"}}],ban:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"m4.9 4.9 14.2 14.2"}}],clock:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"M12 6v6l4 2"}}],component:[{tag:"path",attrs:{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}},{tag:"path",attrs:{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}},{tag:"path",attrs:{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}},{tag:"path",attrs:{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}}]};let Ue=class extends o.LitElement{constructor(){super(...arguments),this.name="",this.size=20}render(){const t=Ha[this.name];if(!t)return o.nothing;const e=typeof t=="string"?o.svg`<path d=${t}></path>`:t.map(s=>{const{tag:a,attrs:i}=s;return a==="circle"?o.svg`<circle cx=${i.cx} cy=${i.cy} r=${i.r} fill=${i.fill??"none"}></circle>`:a==="rect"?o.svg`<rect width=${i.width} height=${i.height} x=${i.x} y=${i.y} rx=${i.rx??"0"} ry=${i.ry??"0"}></rect>`:o.svg`<path d=${i.d}></path>`});return o.html`
5308
+ `;It([c.property({type:Boolean})],Ue.prototype,"active",2);It([c.property({type:Object})],Ue.prototype,"rect",2);Ue=It([c.customElement("ap-marquee-overlay")],Ue);var Za=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Dt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ja(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Za(e,s,i),i};const er={search:[{tag:"circle",attrs:{cx:"11",cy:"11",r:"8"}},{tag:"path",attrs:{d:"m21 21-4.3-4.3"}}],check:"M20 6 9 17l-5-5",close:[{tag:"path",attrs:{d:"M18 6 6 18"}},{tag:"path",attrs:{d:"m6 6 12 12"}}],"chevron-left":"m15 18-6-6 6-6","chevron-right":"m9 18 6-6-6-6","chevron-down":"m6 9 6 6 6-6",download:[{tag:"path",attrs:{d:"M12 15V3"}},{tag:"path",attrs:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}},{tag:"path",attrs:{d:"m7 10 5 5 5-5"}}],upload:[{tag:"path",attrs:{d:"M12 3v12"}},{tag:"path",attrs:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}},{tag:"path",attrs:{d:"m17 8-5-5-5 5"}}],fullscreen:[{tag:"path",attrs:{d:"M8 3H5a2 2 0 0 0-2 2v3"}},{tag:"path",attrs:{d:"M21 8V5a2 2 0 0 0-2-2h-3"}},{tag:"path",attrs:{d:"M3 16v3a2 2 0 0 0 2 2h3"}},{tag:"path",attrs:{d:"M16 21h3a2 2 0 0 0 2-2v-3"}}],trash:[{tag:"path",attrs:{d:"M10 11v6"}},{tag:"path",attrs:{d:"M14 11v6"}},{tag:"path",attrs:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}},{tag:"path",attrs:{d:"M3 6h18"}},{tag:"path",attrs:{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}}],more:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"1"}},{tag:"circle",attrs:{cx:"19",cy:"12",r:"1"}},{tag:"circle",attrs:{cx:"5",cy:"12",r:"1"}}],grid:[{tag:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}},{tag:"path",attrs:{d:"M12 3v18"}},{tag:"path",attrs:{d:"M3 12h18"}}],list:[{tag:"path",attrs:{d:"M3 5h.01"}},{tag:"path",attrs:{d:"M3 12h.01"}},{tag:"path",attrs:{d:"M3 19h.01"}},{tag:"path",attrs:{d:"M8 5h13"}},{tag:"path",attrs:{d:"M8 12h13"}},{tag:"path",attrs:{d:"M8 19h13"}}],preview:[{tag:"path",attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}},{tag:"circle",attrs:{cx:"12",cy:"12",r:"3"}}],select:[{tag:"path",attrs:{d:"M5 12h14"}},{tag:"path",attrs:{d:"M12 5v14"}}],"gallery-vertical-end":[{tag:"path",attrs:{d:"M7 2h10"}},{tag:"path",attrs:{d:"M5 6h14"}},{tag:"rect",attrs:{width:"18",height:"12",x:"3",y:"10",rx:"2"}}],filter:[{tag:"path",attrs:{d:"M2 5h20"}},{tag:"path",attrs:{d:"M6 12h12"}},{tag:"path",attrs:{d:"M9 19h6"}}],sort:[{tag:"path",attrs:{d:"m21 16-4 4-4-4"}},{tag:"path",attrs:{d:"M17 20V4"}},{tag:"path",attrs:{d:"m3 8 4-4 4 4"}},{tag:"path",attrs:{d:"M7 4v16"}}],"sort-asc":[{tag:"path",attrs:{d:"m3 8 4-4 4 4"}},{tag:"path",attrs:{d:"M7 4v16"}},{tag:"path",attrs:{d:"M11 12h4"}},{tag:"path",attrs:{d:"M11 16h7"}},{tag:"path",attrs:{d:"M11 20h10"}}],"sort-desc":[{tag:"path",attrs:{d:"m3 16 4 4 4-4"}},{tag:"path",attrs:{d:"M7 20V4"}},{tag:"path",attrs:{d:"M11 4h4"}},{tag:"path",attrs:{d:"M11 8h7"}},{tag:"path",attrs:{d:"M11 12h10"}}],image:[{tag:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tag:"circle",attrs:{cx:"9",cy:"9",r:"2"}},{tag:"path",attrs:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}}],video:[{tag:"path",attrs:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"}},{tag:"rect",attrs:{x:"2",y:"6",width:"14",height:"12",rx:"2"}}],audio:[{tag:"path",attrs:{d:"M9 18V5l12-2v13"}},{tag:"circle",attrs:{cx:"6",cy:"18",r:"3"}},{tag:"circle",attrs:{cx:"18",cy:"16",r:"3"}}],music:[{tag:"path",attrs:{d:"M9 18V5l12-2v13"}},{tag:"circle",attrs:{cx:"6",cy:"18",r:"3"}},{tag:"circle",attrs:{cx:"18",cy:"16",r:"3"}}],document:[{tag:"path",attrs:{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}},{tag:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tag:"path",attrs:{d:"M10 9H8"}},{tag:"path",attrs:{d:"M16 13H8"}},{tag:"path",attrs:{d:"M16 17H8"}}],"file-text":[{tag:"path",attrs:{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}},{tag:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tag:"path",attrs:{d:"M10 9H8"}},{tag:"path",attrs:{d:"M16 13H8"}},{tag:"path",attrs:{d:"M16 17H8"}}],file:[{tag:"path",attrs:{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}},{tag:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}}],archive:[{tag:"rect",attrs:{width:"20",height:"5",x:"2",y:"3",rx:"1"}},{tag:"path",attrs:{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}},{tag:"path",attrs:{d:"M10 12h4"}}],font:[{tag:"path",attrs:{d:"M12 4v16"}},{tag:"path",attrs:{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}},{tag:"path",attrs:{d:"M9 20h6"}}],text:[{tag:"path",attrs:{d:"M12 4v16"}},{tag:"path",attrs:{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}},{tag:"path",attrs:{d:"M9 20h6"}}],clapperboard:[{tag:"path",attrs:{d:"m12.296 3.464 3.02 3.956"}},{tag:"path",attrs:{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z"}},{tag:"path",attrs:{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}},{tag:"path",attrs:{d:"m6.18 5.276 3.1 3.899"}}],folder:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z","folder-open":"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",tags:[{tag:"path",attrs:{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z"}},{tag:"path",attrs:{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193"}},{tag:"circle",attrs:{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor"}}],tag:[{tag:"path",attrs:{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}},{tag:"circle",attrs:{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}}],hash:[{tag:"path",attrs:{d:"M4 9h16"}},{tag:"path",attrs:{d:"M4 15h16"}},{tag:"path",attrs:{d:"M10 3 8 21"}},{tag:"path",attrs:{d:"M14 3 16 21"}}],calendar:[{tag:"path",attrs:{d:"M8 2v4"}},{tag:"path",attrs:{d:"M16 2v4"}},{tag:"rect",attrs:{width:"18",height:"18",x:"3",y:"4",rx:"2"}},{tag:"path",attrs:{d:"M3 10h18"}}],"file-type":[{tag:"path",attrs:{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"}},{tag:"path",attrs:{d:"M14 2v4a2 2 0 0 0 2 2h4"}},{tag:"path",attrs:{d:"M2 13v-1h6v1"}},{tag:"path",attrs:{d:"M5 12v6"}},{tag:"path",attrs:{d:"M4 18h2"}}],scaling:[{tag:"path",attrs:{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}},{tag:"path",attrs:{d:"M14 15H9v-5"}},{tag:"path",attrs:{d:"M20 9V4h-5"}},{tag:"path",attrs:{d:"M20 4l-6 6"}}],history:[{tag:"path",attrs:{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}},{tag:"path",attrs:{d:"M3 3v5h5"}},{tag:"path",attrs:{d:"M12 7v5l4 2"}}],"swatch-book":[{tag:"path",attrs:{d:"M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z"}},{tag:"path",attrs:{d:"M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7"}},{tag:"path",attrs:{d:"M7 17h.01"}},{tag:"path",attrs:{d:"m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8"}}],"badge-check":[{tag:"path",attrs:{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"}},{tag:"path",attrs:{d:"m9 12 2 2 4-4"}}],box:[{tag:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tag:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tag:"path",attrs:{d:"M12 22V12"}}],"layout-grid":[{tag:"rect",attrs:{width:"7",height:"7",x:"3",y:"3",rx:"1"}},{tag:"rect",attrs:{width:"7",height:"7",x:"14",y:"3",rx:"1"}},{tag:"rect",attrs:{width:"7",height:"7",x:"14",y:"14",rx:"1"}},{tag:"rect",attrs:{width:"7",height:"7",x:"3",y:"14",rx:"1"}}],"layout-template":[{tag:"rect",attrs:{width:"18",height:"7",x:"3",y:"3",rx:"1"}},{tag:"rect",attrs:{width:"9",height:"7",x:"3",y:"14",rx:"1"}},{tag:"rect",attrs:{width:"5",height:"7",x:"16",y:"14",rx:"1"}}],pin:[{tag:"path",attrs:{d:"M12 17v5"}},{tag:"path",attrs:{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 2-2H6a2 2 0 0 0 2 2 1 1 0 0 1 1 1z"}}],"pin-off":[{tag:"path",attrs:{d:"M12 17v5"}},{tag:"path",attrs:{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 2-2H6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v2.34"}},{tag:"path",attrs:{d:"M2 2l20 20"}},{tag:"path",attrs:{d:"M9 12a2 2 0 0 1-1.11 1.79l-1.78.9"}},{tag:"path",attrs:{d:"M17 17H5"}}],lock:[{tag:"rect",attrs:{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}},{tag:"path",attrs:{d:"M7 11V7a5 5 0 0 1 10 0v4"}}],globe:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}},{tag:"path",attrs:{d:"M2 12h20"}}],"circle-check-big":[{tag:"path",attrs:{d:"M21.801 10A10 10 0 1 1 17 3.335"}},{tag:"path",attrs:{d:"m9 11 3 3L22 4"}}],"x-circle":[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"m15 9-6 6"}},{tag:"path",attrs:{d:"m9 9 6 6"}}],ban:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"m4.9 4.9 14.2 14.2"}}],clock:[{tag:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tag:"path",attrs:{d:"M12 6v6l4 2"}}],component:[{tag:"path",attrs:{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}},{tag:"path",attrs:{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}},{tag:"path",attrs:{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}},{tag:"path",attrs:{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}}]};let Ve=class extends o.LitElement{constructor(){super(...arguments),this.name="",this.size=20}render(){const t=er[this.name];if(!t)return o.nothing;const e=typeof t=="string"?o.svg`<path d=${t}></path>`:t.map(s=>{const{tag:a,attrs:i}=s;return a==="circle"?o.svg`<circle cx=${i.cx} cy=${i.cy} r=${i.r} fill=${i.fill??"none"}></circle>`:a==="rect"?o.svg`<rect width=${i.width} height=${i.height} x=${i.x} y=${i.y} rx=${i.rx??"0"} ry=${i.ry??"0"}></rect>`:o.svg`<path d=${i.d}></path>`});return o.html`
5259
5309
  <svg
5260
5310
  style="--icon-size: ${this.size}px"
5261
5311
  viewBox="0 0 24 24"
@@ -5267,7 +5317,7 @@
5267
5317
  >
5268
5318
  ${e}
5269
5319
  </svg>
5270
- `}};Ue.styles=[o.css`
5320
+ `}};Ve.styles=[o.css`
5271
5321
  :host {
5272
5322
  display: inline-flex;
5273
5323
  align-items: center;
@@ -5277,64 +5327,64 @@
5277
5327
  width: var(--icon-size, 20px);
5278
5328
  height: var(--icon-size, 20px);
5279
5329
  }
5280
- `];zt([c.property()],Ue.prototype,"name",2);zt([c.property({type:Number})],Ue.prototype,"size",2);Ue=zt([c.customElement("ap-icon")],Ue);var Ka=Object.defineProperty,Ga=Object.getOwnPropertyDescriptor,ms=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ga(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ka(e,s,i),i};let rt=class extends o.LitElement{constructor(){super(...arguments),this.size=24}render(){return o.html`<div class="spinner" style="width:${this.size}px;height:${this.size}px"></div>`}};rt.styles=[o.css`
5330
+ `];Dt([c.property()],Ve.prototype,"name",2);Dt([c.property({type:Number})],Ve.prototype,"size",2);Ve=Dt([c.customElement("ap-icon")],Ve);var tr=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,_s=(t,e,s,a)=>{for(var i=a>1?void 0:a?sr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&tr(e,s,i),i};let rt=class extends o.LitElement{constructor(){super(...arguments),this.size=24}render(){return o.html`<div class="spinner" style="width:${this.size}px;height:${this.size}px"></div>`}};rt.styles=[o.css`
5281
5331
  :host {
5282
5332
  display: inline-flex;
5283
5333
  }
5284
5334
  .spinner {
5285
- border: 2px solid var(--ap-border, #e4e4e7);
5286
- border-top-color: var(--ap-primary, #3b82f6);
5335
+ border: 2px solid var(--ap-border, oklch(92.86% 0.009 247.92));
5336
+ border-top-color: var(--ap-primary, oklch(0.578 0.198 268.129));
5287
5337
  border-radius: 50%;
5288
5338
  animation: spin 0.6s linear infinite;
5289
5339
  }
5290
5340
  @keyframes spin {
5291
5341
  to { transform: rotate(360deg); }
5292
5342
  }
5293
- `];ms([c.property({type:Number})],rt.prototype,"size",2);rt=ms([c.customElement("ap-spinner")],rt);var Ya=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,gt=(t,e,s,a)=>{for(var i=a>1?void 0:a?Xa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Ya(e,s,i),i};let Me=class extends o.LitElement{constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this._handleHostClick=()=>{this.dispatchEvent(new CustomEvent("ap-toggle",{detail:{checked:!this.checked},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._handleHostClick)}render(){return o.html`
5343
+ `];_s([c.property({type:Number})],rt.prototype,"size",2);rt=_s([c.customElement("ap-spinner")],rt);var ir=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,ut=(t,e,s,a)=>{for(var i=a>1?void 0:a?ar(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ir(e,s,i),i};let Ae=class extends o.LitElement{constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this._hasLabel=!1,this._handleHostClick=()=>{this.dispatchEvent(new CustomEvent("ap-toggle",{detail:{checked:!this.checked},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._handleHostClick)}_onSlotChange(t){const e=t.target;this._hasLabel=e.assignedNodes({flatten:!0}).length>0,this.requestUpdate()}render(){return o.html`
5294
5344
  <div class="box">
5295
5345
  <svg class="check" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
5296
- <path d="M4.5 12.75l6 6 9-13.5"></path>
5346
+ <path d="M20 6 9 17l-5-5"></path>
5297
5347
  </svg>
5298
5348
  <svg class="dash" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
5299
5349
  <path d="M5 12h14"></path>
5300
5350
  </svg>
5301
5351
  </div>
5302
- <span class="label"><slot></slot></span>
5303
- `}};Me.styles=[o.css`
5352
+ <span class="label" ?hidden=${!this._hasLabel}><slot @slotchange=${this._onSlotChange}></slot></span>
5353
+ `}};Ae.styles=[o.css`
5304
5354
  :host {
5305
5355
  display: inline-flex;
5306
5356
  align-items: center;
5307
5357
  cursor: pointer;
5308
5358
  }
5309
5359
  .box {
5310
- width: 18px;
5311
- height: 18px;
5312
- border: 2px solid var(--ap-border, #e4e4e7);
5360
+ width: 16px;
5361
+ height: 16px;
5362
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
5313
5363
  border-radius: 4px;
5314
5364
  display: flex;
5315
5365
  align-items: center;
5316
5366
  justify-content: center;
5317
5367
  transition: all 150ms;
5318
- background: var(--ap-background, #fff);
5368
+ background: var(--ap-background, oklch(1 0 0));
5319
5369
  }
5320
5370
  :host([checked]) .box {
5321
- background: var(--ap-primary, #3b82f6);
5322
- border-color: var(--ap-primary, #3b82f6);
5371
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
5372
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
5323
5373
  }
5324
5374
  .check {
5325
5375
  display: none;
5326
- color: var(--ap-primary-foreground, #fff);
5376
+ color: var(--ap-primary-foreground, oklch(1 0 0));
5327
5377
  }
5328
5378
  :host([checked]) .check {
5329
5379
  display: block;
5330
5380
  }
5331
5381
  :host([indeterminate]) .box {
5332
- background: var(--ap-primary, #3b82f6);
5333
- border-color: var(--ap-primary, #3b82f6);
5382
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
5383
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
5334
5384
  }
5335
5385
  .dash {
5336
5386
  display: none;
5337
- color: var(--ap-primary-foreground, #fff);
5387
+ color: var(--ap-primary-foreground, oklch(1 0 0));
5338
5388
  }
5339
5389
  :host([indeterminate]:not([checked])) .dash {
5340
5390
  display: block;
@@ -5349,9 +5399,9 @@
5349
5399
  .label {
5350
5400
  margin-left: 8px;
5351
5401
  font-size: var(--ap-font-size-sm, 0.875rem);
5352
- color: var(--ap-foreground, #09090b);
5402
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5353
5403
  }
5354
- `];gt([c.property({type:Boolean,reflect:!0})],Me.prototype,"checked",2);gt([c.property({type:Boolean,reflect:!0})],Me.prototype,"indeterminate",2);gt([c.property({type:Boolean,reflect:!0})],Me.prototype,"disabled",2);Me=gt([c.customElement("ap-checkbox")],Me);var Wa=Object.defineProperty,Qa=Object.getOwnPropertyDescriptor,vs=(t,e,s,a)=>{for(var i=a>1?void 0:a?Qa(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Wa(e,s,i),i};let ot=class extends o.LitElement{constructor(){super(...arguments),this.open=!1,this._handleOutsideClick=t=>{this.open&&!t.composedPath().includes(this)&&(this.open=!1)}}render(){return o.html`
5404
+ `];ut([c.property({type:Boolean,reflect:!0})],Ae.prototype,"checked",2);ut([c.property({type:Boolean,reflect:!0})],Ae.prototype,"indeterminate",2);ut([c.property({type:Boolean,reflect:!0})],Ae.prototype,"disabled",2);Ae=ut([c.customElement("ap-checkbox")],Ae);var rr=Object.defineProperty,or=Object.getOwnPropertyDescriptor,ys=(t,e,s,a)=>{for(var i=a>1?void 0:a?or(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&rr(e,s,i),i};let ot=class extends o.LitElement{constructor(){super(...arguments),this.open=!1,this._handleOutsideClick=t=>{this.open&&!t.composedPath().includes(this)&&(this.open=!1)}}render(){return o.html`
5355
5405
  <slot name="trigger" @click=${()=>this.open=!this.open}></slot>
5356
5406
  <div class="content ${this.open?"open":""}">
5357
5407
  <slot></slot>
@@ -5368,8 +5418,8 @@
5368
5418
  left: 0;
5369
5419
  z-index: 50;
5370
5420
  min-width: 200px;
5371
- background: var(--ap-card, #fff);
5372
- border: 1px solid var(--ap-border, #e4e4e7);
5421
+ background: var(--ap-card, oklch(1 0 0));
5422
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
5373
5423
  border-radius: var(--ap-radius, 8px);
5374
5424
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
5375
5425
  padding: 8px;
@@ -5377,7 +5427,7 @@
5377
5427
  .content.open {
5378
5428
  display: block;
5379
5429
  }
5380
- `];vs([c.state()],ot.prototype,"open",2);ot=vs([c.customElement("ap-popover")],ot);var Za=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,j=(t,e,s,a)=>{for(var i=a>1?void 0:a?Ja(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Za(e,s,i),i};let z=class extends o.LitElement{constructor(){super(...arguments),this.value="",this.label="",this.variant="default",this.options=[],this._open=!1,this._focusedIndex=-1,this._menuPosition="below",this._menuAlign="align-left",this._menuTop=0,this._menuBottom=0,this._menuLeft=0,this._menuRight=0,this._handleOutsideClick=t=>{t.composedPath().includes(this)||(this._open=!1,document.removeEventListener("click",this._handleOutsideClick))}}close(){this._open=!1}render(){const t=this.options.find(s=>s.value===this.value),e="ap-dropdown-menu";return o.html`
5430
+ `];ys([c.state()],ot.prototype,"open",2);ot=ys([c.customElement("ap-popover")],ot);var nr=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,N=(t,e,s,a)=>{for(var i=a>1?void 0:a?lr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&nr(e,s,i),i};let z=class extends o.LitElement{constructor(){super(...arguments),this.value="",this.label="",this.variant="default",this.options=[],this._open=!1,this._focusedIndex=-1,this._menuPosition="below",this._menuAlign="align-left",this._menuTop=0,this._menuBottom=0,this._menuLeft=0,this._menuRight=0,this._handleOutsideClick=t=>{t.composedPath().includes(this)||(this._open=!1,document.removeEventListener("click",this._handleOutsideClick))}}close(){this._open=!1}render(){const t=this.options.find(s=>s.value===this.value),e="ap-dropdown-menu";return o.html`
5381
5431
  <button
5382
5432
  class="trigger"
5383
5433
  role="combobox"
@@ -5388,7 +5438,7 @@
5388
5438
  @keydown=${this._handleTriggerKeydown}
5389
5439
  >
5390
5440
  ${t!=null&&t.icon?o.html`<ap-icon name=${t.icon} .size=${16}></ap-icon>`:o.nothing}
5391
- ${this.label}${t?`${this.label?": ":""}${t.label}`:""}
5441
+ ${this.label?o.html`<span class="label">${this.label}${t?": ":""}</span>`:o.nothing}${t?t.label:""}
5392
5442
  <ap-icon name="chevron-down" .size=${14}></ap-icon>
5393
5443
  </button>
5394
5444
  ${this._open?o.html`
@@ -5424,34 +5474,34 @@
5424
5474
  .trigger {
5425
5475
  display: flex;
5426
5476
  align-items: center;
5427
- gap: 4px;
5477
+ gap: 8px;
5428
5478
  height: 36px;
5429
5479
  padding: 0 12px;
5430
- border: 1px solid var(--ap-border, #e4e4e7);
5480
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
5431
5481
  border-radius: var(--ap-radius-sm, 6px);
5432
- background: var(--ap-background, #fff);
5433
- color: var(--ap-foreground, #09090b);
5482
+ background: var(--ap-background, oklch(1 0 0));
5483
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5434
5484
  font-family: inherit;
5435
5485
  font-size: var(--ap-font-size-sm, 0.875rem);
5436
5486
  cursor: pointer;
5437
5487
  white-space: nowrap;
5438
5488
  }
5439
5489
  .trigger:hover {
5440
- background: var(--ap-muted, #f4f4f5);
5490
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
5441
5491
  }
5442
5492
  :host([variant="borderless"]) .trigger {
5443
5493
  border-color: transparent;
5444
5494
  background: none;
5445
5495
  }
5446
5496
  :host([variant="borderless"]) .trigger:hover {
5447
- background: var(--ap-muted, #f4f4f5);
5497
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
5448
5498
  }
5449
5499
  .menu {
5450
5500
  position: fixed;
5451
5501
  z-index: 50;
5452
5502
  min-width: 160px;
5453
- background: var(--ap-card, #fff);
5454
- border: 1px solid var(--ap-border, #e4e4e7);
5503
+ background: var(--ap-card, oklch(1 0 0));
5504
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
5455
5505
  border-radius: var(--ap-radius, 8px);
5456
5506
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
5457
5507
  padding: 4px;
@@ -5463,12 +5513,12 @@
5463
5513
  .option {
5464
5514
  display: flex;
5465
5515
  align-items: center;
5466
- gap: 6px;
5516
+ gap: 8px;
5467
5517
  width: 100%;
5468
5518
  padding: 6px 12px;
5469
5519
  border: none;
5470
5520
  background: none;
5471
- color: var(--ap-foreground, #09090b);
5521
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5472
5522
  font-family: inherit;
5473
5523
  font-size: var(--ap-font-size-sm, 0.875rem);
5474
5524
  text-align: left;
@@ -5476,13 +5526,25 @@
5476
5526
  border-radius: 4px;
5477
5527
  }
5478
5528
  .option:hover, .option.focused {
5479
- background: var(--ap-muted, #f4f4f5);
5529
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
5480
5530
  }
5481
5531
  .option[aria-selected="true"] {
5482
- background: var(--ap-selection-bg, oklch(0.65 0.19 258 / 0.08));
5483
- color: var(--ap-primary, oklch(0.65 0.19 258));
5532
+ background: var(--ap-selection-bg, oklch(0.578 0.198 268.129 / 0.08));
5533
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
5534
+ }
5535
+ .trigger .label {
5536
+ color: var(--ap-secondary-foreground, oklch(53.03% 0.039 249.89));
5484
5537
  }
5485
- `];j([c.property()],z.prototype,"value",2);j([c.property()],z.prototype,"label",2);j([c.property({reflect:!0})],z.prototype,"variant",2);j([c.property({type:Array})],z.prototype,"options",2);j([c.state()],z.prototype,"_open",2);j([c.state()],z.prototype,"_focusedIndex",2);j([c.state()],z.prototype,"_menuPosition",2);j([c.state()],z.prototype,"_menuAlign",2);j([c.state()],z.prototype,"_menuTop",2);j([c.state()],z.prototype,"_menuBottom",2);j([c.state()],z.prototype,"_menuLeft",2);j([c.state()],z.prototype,"_menuRight",2);z=j([c.customElement("ap-dropdown")],z);var er=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,bs=(t,e,s,a)=>{for(var i=a>1?void 0:a?tr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&er(e,s,i),i};let nt=class extends o.LitElement{constructor(){super(...arguments),this.variant="default"}render(){return o.html`<span class="badge"><slot></slot></span>`}};nt.styles=[o.css`
5538
+ .trigger ap-icon {
5539
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
5540
+ }
5541
+ .option ap-icon {
5542
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
5543
+ }
5544
+ .option[aria-selected="true"] ap-icon {
5545
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
5546
+ }
5547
+ `];N([c.property()],z.prototype,"value",2);N([c.property()],z.prototype,"label",2);N([c.property({reflect:!0})],z.prototype,"variant",2);N([c.property({type:Array})],z.prototype,"options",2);N([c.state()],z.prototype,"_open",2);N([c.state()],z.prototype,"_focusedIndex",2);N([c.state()],z.prototype,"_menuPosition",2);N([c.state()],z.prototype,"_menuAlign",2);N([c.state()],z.prototype,"_menuTop",2);N([c.state()],z.prototype,"_menuBottom",2);N([c.state()],z.prototype,"_menuLeft",2);N([c.state()],z.prototype,"_menuRight",2);z=N([c.customElement("ap-dropdown")],z);var cr=Object.defineProperty,dr=Object.getOwnPropertyDescriptor,xs=(t,e,s,a)=>{for(var i=a>1?void 0:a?dr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&cr(e,s,i),i};let nt=class extends o.LitElement{constructor(){super(...arguments),this.variant="default"}render(){return o.html`<span class="badge"><slot></slot></span>`}};nt.styles=[o.css`
5486
5548
  :host {
5487
5549
  display: inline-flex;
5488
5550
  }
@@ -5493,14 +5555,14 @@
5493
5555
  font-size: 0.75rem;
5494
5556
  font-weight: 500;
5495
5557
  border-radius: 9999px;
5496
- background: var(--ap-muted, #f4f4f5);
5497
- color: var(--ap-muted-foreground, #71717a);
5558
+ background: var(--ap-muted, oklch(0.974 0.006 239.819));
5559
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
5498
5560
  }
5499
5561
  :host([variant="primary"]) .badge {
5500
- background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.1));
5501
- color: var(--ap-primary, oklch(0.65 0.19 258));
5562
+ background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
5563
+ color: var(--ap-primary, oklch(0.578 0.198 268.129));
5502
5564
  }
5503
- `];bs([c.property({reflect:!0})],nt.prototype,"variant",2);nt=bs([c.customElement("ap-badge")],nt);var sr=Object.defineProperty,ir=Object.getOwnPropertyDescriptor,_s=(t,e,s,a)=>{for(var i=a>1?void 0:a?ir(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&sr(e,s,i),i};let lt=class extends o.LitElement{constructor(){super(...arguments),this.text=""}render(){return o.html`
5565
+ `];xs([c.property({reflect:!0})],nt.prototype,"variant",2);nt=xs([c.customElement("ap-badge")],nt);var pr=Object.defineProperty,hr=Object.getOwnPropertyDescriptor,$s=(t,e,s,a)=>{for(var i=a>1?void 0:a?hr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&pr(e,s,i),i};let lt=class extends o.LitElement{constructor(){super(...arguments),this.text=""}render(){return o.html`
5504
5566
  <slot></slot>
5505
5567
  <div class="tip">${this.text}</div>
5506
5568
  `}};lt.styles=[o.css`
@@ -5517,8 +5579,8 @@
5517
5579
  white-space: nowrap;
5518
5580
  padding: 4px 8px;
5519
5581
  font-size: 0.75rem;
5520
- background: var(--ap-foreground, #09090b);
5521
- color: var(--ap-background, #fff);
5582
+ background: var(--ap-foreground, oklch(0.37 0.022 248.413));
5583
+ color: var(--ap-background, oklch(1 0 0));
5522
5584
  border-radius: 4px;
5523
5585
  pointer-events: none;
5524
5586
  z-index: 100;
@@ -5526,7 +5588,7 @@
5526
5588
  :host(:hover) .tip {
5527
5589
  display: block;
5528
5590
  }
5529
- `];_s([c.property()],lt.prototype,"text",2);lt=_s([c.customElement("ap-tooltip")],lt);var ar=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,Ie=(t,e,s,a)=>{for(var i=a>1?void 0:a?rr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ar(e,s,i),i};let ne=class extends o.LitElement{constructor(){super(...arguments),this.value="",this.options=[],this.disabled=!1,this.direction="vertical",this._onKeydown=t=>{const e=this.options.filter(i=>!this.disabled&&!i.disabled);if(e.length===0)return;const s=e.findIndex(i=>i.value===this.value);let a=null;switch(t.key){case"ArrowDown":case"ArrowRight":t.preventDefault(),a=s<0?0:(s+1)%e.length;break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),a=s<0?e.length-1:(s-1+e.length)%e.length;break;case" ":case"Enter":t.preventDefault(),s>=0?this._select(e[s]):e.length>0&&this._select(e[0]);return;default:return}a!==null&&this._select(e[a])}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","radiogroup"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._onKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._onKeydown)}render(){return o.html`
5591
+ `];$s([c.property()],lt.prototype,"text",2);lt=$s([c.customElement("ap-tooltip")],lt);var ur=Object.defineProperty,gr=Object.getOwnPropertyDescriptor,Le=(t,e,s,a)=>{for(var i=a>1?void 0:a?gr(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ur(e,s,i),i};let ne=class extends o.LitElement{constructor(){super(...arguments),this.value="",this.options=[],this.disabled=!1,this.direction="vertical",this._onKeydown=t=>{const e=this.options.filter(i=>!this.disabled&&!i.disabled);if(e.length===0)return;const s=e.findIndex(i=>i.value===this.value);let a=null;switch(t.key){case"ArrowDown":case"ArrowRight":t.preventDefault(),a=s<0?0:(s+1)%e.length;break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),a=s<0?e.length-1:(s-1+e.length)%e.length;break;case" ":case"Enter":t.preventDefault(),s>=0?this._select(e[s]):e.length>0&&this._select(e[0]);return;default:return}a!==null&&this._select(e[a])}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","radiogroup"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._onKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._onKeydown)}render(){return o.html`
5530
5592
  ${this.options.map(t=>o.html`
5531
5593
  <div
5532
5594
  class="option"
@@ -5571,13 +5633,13 @@
5571
5633
  width: 18px;
5572
5634
  height: 18px;
5573
5635
  min-width: 18px;
5574
- border: 2px solid var(--ap-border, #e4e4e7);
5636
+ border: 1px solid var(--ap-input, oklch(0.871 0.016 241.798));
5575
5637
  border-radius: 50%;
5576
5638
  display: flex;
5577
5639
  align-items: center;
5578
5640
  justify-content: center;
5579
5641
  transition: border-color 150ms;
5580
- background: var(--ap-background, #fff);
5642
+ background: var(--ap-background, oklch(1 0 0));
5581
5643
  }
5582
5644
  .radio .dot {
5583
5645
  width: 10px;
@@ -5587,21 +5649,21 @@
5587
5649
  transition: background 150ms;
5588
5650
  }
5589
5651
  .option[aria-checked="true"] .radio {
5590
- border-color: var(--ap-primary, oklch(0.65 0.19 258));
5652
+ border-color: var(--ap-primary, oklch(0.578 0.198 268.129));
5591
5653
  }
5592
5654
  .option[aria-checked="true"] .radio .dot {
5593
- background: var(--ap-primary, oklch(0.65 0.19 258));
5655
+ background: var(--ap-primary, oklch(0.578 0.198 268.129));
5594
5656
  }
5595
5657
  .label {
5596
5658
  font-size: var(--ap-font-size-sm, 0.875rem);
5597
- color: var(--ap-foreground, #09090b);
5659
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5598
5660
  font-family: inherit;
5599
5661
  user-select: none;
5600
5662
  }
5601
- `];Ie([c.property()],ne.prototype,"value",2);Ie([c.property({type:Array})],ne.prototype,"options",2);Ie([c.property({type:Boolean})],ne.prototype,"disabled",2);Ie([c.property({reflect:!0})],ne.prototype,"direction",2);Ie([c.property({reflect:!0})],ne.prototype,"columns",2);ne=Ie([c.customElement("ap-radio-group")],ne);var or=Object.defineProperty,nr=(t,e,s,a)=>{for(var i=void 0,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=n(e,s,i)||i);return i&&or(e,s,i),i};const Rt=class Rt extends o.LitElement{constructor(){super(),this._initFailed=!1,this._loadId=0,this._loadMoreId=0,this._loadDataTimer=null,this._pendingFilter=null,this._pendingMetadataField=null,this.store=xs(),this.storeCtrl=new $s(this,this.store),this.selectionCtrl=new ws(this,this.store),this.infiniteScrollCtrl=new Ss(this,()=>this._loadMore()),this.marqueeCtrl=new Cs(this,this.store)}get _isInline(){var e;return((e=this.config)==null?void 0:e.displayMode)==="inline"}connectedCallback(){super.connectedCallback()}updated(e){super.updated(e),e.has("config")&&this.config&&this._initConfig(this.config);const s=this.renderRoot.querySelector("#sentinel");if(s&&s!==this._lastSentinel){this._lastSentinel=s;const i=this.renderRoot.querySelector(".main-content");this.infiniteScrollCtrl.observe(s,i)}const a=this.renderRoot.querySelector(".main-content");a&&a!==this._lastMarqueeContainer&&(this._lastMarqueeContainer=a,this.marqueeCtrl.attach(a))}_initConfig(e){this._initFailed=!1,this._initPromise=this._doInit(e).catch(()=>{this._initFailed=!0}),e.displayMode==="inline"&&!this.store.getState().isOpen&&this.open()}async _doInit(e){const s=ui(),a=s.sortBy??e.defaultSortBy??"created_at",i=s.sortDirection??e.defaultSortDirection??"desc";this.store.setState({config:e,projectToken:e.auth.projectToken,viewMode:e.rememberLastView&&mi()||e.defaultViewMode||"grid",sortBy:a,sortDirection:i,currentFolder:null,currentFolderPath:e.rootFolderPath??"/"}),this.apiClient=new ks(e.auth,e.apiBase);try{if(e.auth.mode==="securityTemplate"){const p=await Os(this.apiClient);this.apiClient.setSassKey(p),this.store.setState({sassKey:p})}const[r,n,l]=await Promise.allSettled([Ys(this.apiClient),Ts(this.apiClient),Ms(this.apiClient)]);if(r.status==="fulfilled"){const{fields:p,regionalVariantGroups:f,regionalFilters:v,brandColor:F}=r.value;this.store.setState({metadataFields:p,regionalVariantGroups:f,regionalFilters:v,...F?{brandColor:F}:{}})}n.status==="fulfilled"&&this.store.setState({labels:n.value.labels||[]}),l.status==="fulfilled"&&this.store.setState({tags:l.value});const{pinnedFilters:d,pinnedMetadata:h}=di(e.auth.projectToken??null),u=this.store.getState().filters;this.store.setState({filters:{...u,pinned:d,visible:[...d],metadata:{...u.metadata,pinned:h,visible:[...h]}}});const g=e.brandColor||this.store.getState().brandColor;g&&(this.store.setState({brandColor:g}),yi(this,g))}catch(r){throw this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:r,context:"init"},bubbles:!0,composed:!0})),r}}async open(){var l,d,h,u,g,p;const e=this.store.getState(),s=ze((l=this.config)==null?void 0:l.forcedFilters),a=new Set(Object.keys(s)),i={},r=ze((d=this.config)==null?void 0:d.defaultFilters);for(const[f,v]of Object.entries(r))a.has(f)||(i[f]=v);const n=Object.keys(i);this.store.setState({isOpen:!0,activeTab:((u=(h=this.config)==null?void 0:h.tabs)==null?void 0:u[0])??"assets",searchQuery:"",filters:{metadata:{pinned:e.filters.metadata.pinned,visible:[...e.filters.metadata.pinned],applied:{}},pinned:e.filters.pinned,visible:[...new Set([...e.filters.pinned,...n])],applied:i},offset:0,assets:[],folders:[],currentFolder:null,currentFolderPath:((g=this.config)==null?void 0:g.rememberLastFolder)&&fi()||((p=this.config)==null?void 0:p.rootFolderPath)||"/",breadcrumb:[],selectedAssets:new Map,folderPreviews:{},isPreviewOpen:!1,previewAsset:null,isLoading:!0,isSelectingAll:!1}),this.dispatchEvent(new CustomEvent("ap-open",{detail:{timestamp:Date.now()},bubbles:!0,composed:!0})),await this.updateComplete,!this._initPromise&&this.config&&this._initConfig(this.config),!(this._initPromise&&(await this._initPromise,this._initFailed))&&this._loadData()}close(){this.store.setState({isOpen:!1})}_scrollToTop(){var e;(e=this.renderRoot.querySelector(".main-content"))==null||e.scrollTo({top:0})}async _loadData(){var a,i,r,n,l,d,h,u,g,p,f,v,F,_;if(!this.apiClient)return;const e=++this._loadId,s=this.store.getState();this._scrollToTop(),this.store.setState({isLoading:!0});try{const I=s.activeTab;if(I==="assets"){const $=this._buildSearchNotation(),w=s.currentFolderPath||"/",S=We(this.apiClient,{folder:w,offset:0,limit:s.limit,sort_by:s.sortBy,sort_direction:s.sortDirection,search:s.searchQuery||void 0,q:$||void 0,recursive:1}),A=Bt(this.apiClient,{folder:w,q:$||void 0,search:s.searchQuery||void 0,recursive:1}).catch(()=>null),[L,k]=await Promise.all([S,A]);if(e!==this._loadId)return;const se=((a=L.files)==null?void 0:a.length)??0,ce=se>=s.limit,Se=((i=k==null?void 0:k.stats)==null?void 0:i.approx_files_count)??((r=k==null?void 0:k.info)==null?void 0:r.total_files_count)??((n=L.info)==null?void 0:n.total_files_count)??((d=(l=L.base)==null?void 0:l.count)==null?void 0:d.files_recursive)??((u=(h=L.base)==null?void 0:h.count)==null?void 0:u.files_direct)??se;this.store.setState({assets:L.files||[],folders:[],totalCount:Se,totalFolderCount:0,offset:0,hasMore:ce,isLoading:!1})}else if(I==="folders"){const $=this._buildSearchNotation(),w=s.currentFolderPath||"/",[S,A,L]=await Promise.all([Fs(this.apiClient,{folderPath:s.currentFolderPath,q:s.searchQuery||void 0,recursive:s.searchQuery?1:0,sort_by:s.sortBy,sort_direction:s.sortDirection}),We(this.apiClient,{folder:w,offset:0,limit:s.limit,sort_by:s.sortBy,sort_direction:s.sortDirection,search:s.searchQuery||void 0,q:$||void 0,recursive:0}),Bt(this.apiClient,{folder:w,q:$||void 0,search:s.searchQuery||void 0,recursive:0}).catch(()=>null)]);if(e!==this._loadId)return;const k=S.folders||[];let se={};if(k.length>0)try{se=await As(this.apiClient,k.map(de=>de.uuid))}catch{}if(e!==this._loadId)return;const ce=((g=A.files)==null?void 0:g.length)??0,Se=ce>=s.limit,Xe=((p=L==null?void 0:L.stats)==null?void 0:p.approx_files_count)??((f=L==null?void 0:L.info)==null?void 0:f.total_files_count)??((v=A.info)==null?void 0:v.total_files_count)??((_=(F=A.base)==null?void 0:F.count)==null?void 0:_.files_direct)??ce;this.store.setState({assets:A.files||[],folders:k,folderPreviews:se,totalCount:Xe,totalFolderCount:S.total??k.length,offset:0,hasMore:Se,isLoading:!1})}}catch(I){if(e!==this._loadId)return;this.store.setState({isLoading:!1}),this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:I,context:"loadData"},bubbles:!0,composed:!0}))}}async _loadMore(){const e=this.store.getState();if(e.isLoading||!e.hasMore||!this.apiClient)return;const s=++this._loadMoreId,a=e.offset+e.limit;this.store.setState({isLoading:!0});try{const i=this._buildSearchNotation(),r=await We(this.apiClient,{folder:e.currentFolderPath||"/",offset:a,limit:e.limit,sort_by:e.sortBy,sort_direction:e.sortDirection,search:e.searchQuery||void 0,q:i||void 0,recursive:e.activeTab==="folders"?0:1});if(s!==this._loadMoreId)return;const n=this.store.getState().assets,l=r.files||[],d=l.length>=e.limit,h=[...n,...l];this.store.setState({assets:h,offset:a,hasMore:d,isLoading:!1})}catch{if(s!==this._loadMoreId)return;this.store.setState({isLoading:!1})}}_debouncedLoadData(e=120){this._loadDataTimer&&clearTimeout(this._loadDataTimer),this._loadDataTimer=setTimeout(()=>{this._loadDataTimer=null,this._loadData()},e)}_handleCancel(e){var s,a;this.close(),(a=(s=this.config)==null?void 0:s.onCancel)==null||a.call(s),this.dispatchEvent(new CustomEvent("ap-cancel",{detail:{reason:e},bubbles:!0,composed:!0}))}_handleSearchChange(e){this.store.setState({searchQuery:e.detail.value,offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handleViewChange(e){var a;const s=e.detail.mode;this.store.setState({viewMode:s}),(a=this.config)!=null&&a.rememberLastView&&gi(s),this._scrollToTop()}_handleRegionalChange(e){const{groupUuid:s,value:a}=e.detail,i=this.store.getState().regionalFilters;this.store.setState({regionalFilters:{...i,[s]:a}})}_handleSortChange(e){const s=e.detail.value,a=this.store.getState();this.store.setState({sortBy:s,offset:0,assets:[],folders:[]}),Xt(s,a.sortDirection),this.selectionCtrl.resetRange(),this._loadData()}_handleSortDirectionChange(e){const s=e.detail.value,a=this.store.getState();this.store.setState({sortDirection:s,offset:0,assets:[],folders:[]}),Xt(a.sortBy,s),this.selectionCtrl.resetRange(),this._loadData()}_handleTabChange(e){var s;this.store.setState({activeTab:e.detail.tab,currentFolder:null,currentFolderPath:((s=this.config)==null?void 0:s.rootFolderPath)??"/",breadcrumb:[],offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handleAssetSelect(e){this.selectionCtrl.handleSelect(e.detail.asset,e.detail.index,e.detail.event)}_handleAssetPreview(e){this.store.setState({previewAsset:e.detail.asset,isPreviewOpen:!0})}_handleQuickSelect(e){var a,i;const s=e.detail.asset;(i=(a=this.config)==null?void 0:a.onSelect)==null||i.call(a,[s]),this.dispatchEvent(new CustomEvent("ap-select",{detail:{assets:[s]},bubbles:!0,composed:!0})),this._isInline||this.close()}_handleFolderOpen(e){var r;const s=e.detail.folder,a=this.store.getState(),i=s.path||`${a.currentFolderPath}${s.name}/`;(r=this.config)!=null&&r.rememberLastFolder&&Wt(i),this.store.setState({currentFolder:s.uuid,currentFolderPath:i,breadcrumb:[...a.breadcrumb,{uuid:s.uuid,name:s.name,path:i}],searchQuery:"",offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handleBreadcrumbNavigate(e){var l,d;const s=e.detail.uuid,a=this.store.getState(),i=s?a.breadcrumb.findIndex(h=>h.uuid===s):-1,r=s?a.breadcrumb.slice(0,i+1):[],n=r.length>0?r[r.length-1].path:((l=this.config)==null?void 0:l.rootFolderPath)||"/";(d=this.config)!=null&&d.rememberLastFolder&&Wt(n),this.store.setState({currentFolder:s||null,currentFolderPath:n,breadcrumb:r,offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handlePreviewClose(){this.store.setState({isPreviewOpen:!1,previewAsset:null})}_handlePreviewNavigate(e){this.store.setState({previewAsset:e.detail.asset})}_handleSelectionConfirm(e){var a,i;const s=e.detail.assets;(i=(a=this.config)==null?void 0:a.onSelect)==null||i.call(a,s),this.dispatchEvent(new CustomEvent("ap-select",{detail:{assets:s},bubbles:!0,composed:!0})),this._isInline||this.close()}async _handleSelectAll(){var a;const e=this.store.getState();if(!(e.isSelectingAll||!this.apiClient||!(((a=e.config)==null?void 0:a.multiSelect)??!0))){if(e.assets.length>=e.totalCount){this.selectionCtrl.selectAll(e.assets);return}this.store.setState({isSelectingAll:!0});try{const i=this._buildSearchNotation(),r=e.currentFolderPath||"/",n=e.limit,l=e.assets,d=e.totalCount,h=e.activeTab==="folders"?0:1,u=[];for(let _=l.length;_<d;_+=n)u.push(_);const g=4,p=[];for(let _=0;_<u.length;_+=g){const I=u.slice(_,_+g),$=await Promise.all(I.map(w=>We(this.apiClient,{folder:r,offset:w,limit:n,sort_by:e.sortBy,sort_direction:e.sortDirection,search:e.searchQuery||void 0,q:i||void 0,recursive:h})));for(const w of $)w.files&&p.push(...w.files)}const f=new Set(l.map(_=>_.uuid)),v=p.filter(_=>f.has(_.uuid)?!1:(f.add(_.uuid),!0)),F=[...l,...v];this.store.setState({assets:F,offset:Math.max(0,F.length-n),hasMore:!1,isSelectingAll:!1}),this.selectionCtrl.selectAll(F)}catch(i){this.store.setState({isSelectingAll:!1}),this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:i,context:"selectAll"},bubbles:!0,composed:!0}))}}}_handleSelectionClear(){this.selectionCtrl.clearSelection()}_handleSelectionDeselect(e){const s=new Map(this.store.getState().selectedAssets);s.delete(e.detail.uuid),this.store.setState({selectedAssets:s})}_isDateFilterKey(e){return e===m.DATE||e===m.LICENSE_EXPIRY||e===R.DUE_DATE}_handleFilterUpdate(e){const{key:s,values:a,operator:i}=e.detail,n={...this.store.getState().filters};let l=a===""||a===null||a===void 0||Array.isArray(a)&&a.length===0||typeof a=="object"&&!Array.isArray(a)&&Object.values(a).every(d=>d==null||d===""||Array.isArray(d)&&d.length===0);if(!l&&this._isDateFilterKey(s)&&typeof a=="object"&&!Array.isArray(a)){const{kind:d,preset:h,from:u,to:g}=a;l=!d&&!h&&!u&&!g}if(l){const d={...n.applied};delete d[s],n.applied=d,n.pinned.includes(s)||(n.visible=n.visible.filter(h=>h!==s))}else{const d={...n.applied};this._isDateFilterKey(s)&&typeof a=="object"&&!Array.isArray(a)?d[s]={type:"date",field:a.field||"created",kind:a.kind||null,preset:a.preset||null,from:a.from||null,to:a.to||null}:s===m.IMAGE&&typeof a=="object"&&!Array.isArray(a)?d[s]=a:d[s]={type:"string",values:Array.isArray(a)?a:[a],operator:i||":"},n.applied=d,n.visible.includes(s)||(n.visible=[...n.visible,s])}if(this.store.setState({filters:n,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData(),this._pendingFilter===s){this._pendingFilter=null;const d=this.renderRoot.querySelector("ap-filters-bar");d&&(d.pendingFilter=null)}}_handleFilterOpen(e){const s=e.detail.key,a=e.detail.chipRect,i=this.renderRoot.querySelector("ap-content-toolbar");let r;if(a){const n=this.renderRoot.querySelector(".toolbar-filters-wrapper");if(n){const l=n.getBoundingClientRect();r=a.left-l.left}}i==null||i.openFilterPanel(s,!0,r)}_handleMetadataFilterOpen(e){const{fieldKey:s,chipRect:a}=e.detail,i=this.renderRoot.querySelector("ap-content-toolbar");let r;if(a){const n=this.renderRoot.querySelector(".toolbar-filters-wrapper");if(n){const l=n.getBoundingClientRect();r=a.left-l.left}}i==null||i.openMetadataFieldPanel(s,!0,r)}_handleFilterPanelChange(e){const s=this.renderRoot.querySelector("ap-filters-bar");s&&(s.activeFilter=e.detail.key,s.activeMetadataField=e.detail.metadataFieldKey||null),!e.detail.key&&!e.detail.metadataFieldKey&&(this._pendingFilter||this._pendingMetadataField)&&(this._pendingFilter=null,this._pendingMetadataField=null,s&&(s.pendingFilter=null,s.pendingMetadataField=null))}async _handleFilterPending(e){var g,p,f;const{key:s,metadataFieldKey:a}=e.detail,i=this.renderRoot.querySelector("ap-filters-bar"),r=this.renderRoot.querySelector("ap-content-toolbar");if(!i||!r)return;a?(this._pendingMetadataField=a,i.pendingMetadataField=a):s&&(this._pendingFilter=s,i.pendingFilter=s),await i.updateComplete;let n=i.renderRoot.querySelector(".chip.pending");if(!n){const v=i.renderRoot.querySelectorAll(".chip.pinned-empty"),F=a?(g=i._getMetadataLabel)==null?void 0:g.call(i,a):void 0;for(const _ of v){const I=(f=(p=_.querySelector(".chip-label"))==null?void 0:p.textContent)==null?void 0:f.trim();if(a&&I===F){n=_;break}if(s&&I===(Ee[s]||s)){n=_;break}}}if(!n)return;const l=n.getBoundingClientRect(),d=this.renderRoot.querySelector(".toolbar-filters-wrapper"),h=d==null?void 0:d.getBoundingClientRect(),u=h?l.left-h.left:l.left;a?r.openMetadataFieldPanel(a,!0,u):s&&r.openFilterPanel(s,!0,u)}_handleFilterRemove(e){var n;const s=e.detail.key;if(s in(((n=this.config)==null?void 0:n.forcedFilters)??{}))return;const i={...this.store.getState().filters},r={...i.applied};delete r[s],i.applied=r,i.pinned.includes(s)||(i.visible=i.visible.filter(l=>l!==s)),this.store.setState({filters:i,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_handleMetadataFilterChange(e){const{fieldKey:s,operator:a,values:i,metadataType:r}=e.detail,l={...this.store.getState().filters},d={...l.metadata},h={...d.applied};if(!i||Array.isArray(i)&&i.length===0?(delete h[s],d.applied=h,d.pinned.includes(s)||(d.visible=d.visible.filter(g=>g!==s))):(h[s]={type:"string",values:Array.isArray(i)?i:[i],operator:a||":",metadataType:r},d.applied=h,d.visible.includes(s)||(d.visible=[...d.visible,s])),l.metadata=d,this.store.setState({filters:l,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData(),this._pendingMetadataField===s){this._pendingMetadataField=null;const g=this.renderRoot.querySelector("ap-filters-bar");g&&(g.pendingMetadataField=null)}}_handleMetadataFieldToggle(e){const{fieldKey:s,visible:a}=e.detail,r={...this.store.getState().filters},n={...r.metadata};a?n.visible.includes(s)||(n.visible=[...n.visible,s]):n.visible=n.visible.filter(l=>l!==s),r.metadata=n,this.store.setState({filters:r})}_handleMetadataFilterRemove(e){const{fieldKey:s}=e.detail,i={...this.store.getState().filters},r={...i.metadata},n={...r.applied};delete n[s],r.applied=n,r.pinned.includes(s)||(r.visible=r.visible.filter(l=>l!==s)),i.metadata=r,this.store.setState({filters:i,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_handleFilterPin(e){var l,d;const{key:s,pinned:a}=e.detail,r={...this.store.getState().filters};a?r.pinned.includes(s)||(r.pinned=[...r.pinned,s]):(r.pinned=r.pinned.filter(h=>h!==s),s in r.applied||(r.visible=r.visible.filter(h=>h!==s))),this.store.setState({filters:r});const n=((d=(l=this.store.getState().config)==null?void 0:l.auth)==null?void 0:d.projectToken)??null;pi(n,r.pinned)}_handleMetadataPin(e){var d,h;const{fieldKey:s,pinned:a}=e.detail,r={...this.store.getState().filters},n={...r.metadata};a?n.pinned.includes(s)||(n.pinned=[...n.pinned,s]):(n.pinned=n.pinned.filter(u=>u!==s),s in n.applied||(n.visible=n.visible.filter(u=>u!==s))),r.metadata=n,this.store.setState({filters:r});const l=((h=(d=this.store.getState().config)==null?void 0:d.auth)==null?void 0:h.projectToken)??null;hi(l,n.pinned)}_handleFiltersClearAll(){const e=this.store.getState();this.store.setState({filters:{...e.filters,applied:{},visible:[...e.filters.pinned],metadata:{...e.filters.metadata,applied:{},visible:[...e.filters.metadata.pinned]}},offset:0,assets:[],folders:[],isLoading:!0});const s=this.renderRoot.querySelector("ap-filters-bar");s&&(s.activeFilter=null),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_handleFilterDeactivate(e){const s=e.detail.key,i={...this.store.getState().filters};i.visible=i.visible.filter(r=>r!==s),this.store.setState({filters:i})}_handleMetadataFieldDeactivate(e){const{fieldKey:s}=e.detail,i={...this.store.getState().filters},r={...i.metadata};r.visible=r.visible.filter(n=>n!==s),i.metadata=r,this.store.setState({filters:i})}_handleFiltersSet(e){var h;const{applied:s,metadata:a}=e.detail,r={...this.store.getState().filters},n=new Set(Object.keys(((h=this.config)==null?void 0:h.forcedFilters)??{})),l={...s};for(const u of n)delete l[u];r.applied=l;const d=Object.keys(s);if(r.visible=[...new Set([...r.pinned,...d])],a){const u={...r.metadata};u.applied=a.applied;const g=Object.keys(a.applied);u.visible=[...new Set([...u.pinned,...g])],r.metadata=u}this.store.setState({filters:r,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_getSortOptions(){const e=this.storeCtrl.state;return e.searchQuery?xi:e.activeTab==="folders"?$i:At}_buildSearchNotation(){var i;const e=this.store.getState(),s={...ze((i=this.config)==null?void 0:i.forcedFilters),...e.filters.applied};return Qs(s,e.filters.metadata.applied).join(" ")}render(){var l,d,h,u,g,p,f;const e=this.storeCtrl.state,s=Array.from(e.selectedAssets.keys()),a=this.selectionCtrl.getSelectedAssets(),i=o.html`
5663
+ `];Le([c.property()],ne.prototype,"value",2);Le([c.property({type:Array})],ne.prototype,"options",2);Le([c.property({type:Boolean})],ne.prototype,"disabled",2);Le([c.property({reflect:!0})],ne.prototype,"direction",2);Le([c.property({reflect:!0})],ne.prototype,"columns",2);ne=Le([c.customElement("ap-radio-group")],ne);var fr=Object.defineProperty,zt=(t,e,s,a)=>{for(var i=void 0,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=n(e,s,i)||i);return i&&fr(e,s,i),i};const Rt=class Rt extends o.LitElement{constructor(){super(),this._initFailed=!1,this._loadId=0,this._loadMoreId=0,this._loadDataTimer=null,this._pendingFilter=null,this._pendingMetadataField=null,this._uploaderEl=null,this._uploaderImportPromise=null,this._dragCounter=0,this._isDragOver=!1,this._isUploaderOpen=!1,this._onDragEnter=e=>{var s;!((s=this.config)!=null&&s.uploader)||!this._hasFileTransfer(e)||(e.preventDefault(),this._dragCounter++,this._dragCounter===1&&(this._isDragOver=!0))},this._onDragOver=e=>{var s;!((s=this.config)!=null&&s.uploader)||!this._hasFileTransfer(e)||(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"))},this._onDragLeave=e=>{var s;!((s=this.config)!=null&&s.uploader)||!this._hasFileTransfer(e)||(e.preventDefault(),this._dragCounter--,this._dragCounter<=0&&(this._dragCounter=0,this._isDragOver=!1))},this._onDrop=e=>{var a,i;if(!((a=this.config)!=null&&a.uploader)||!this._hasFileTransfer(e))return;e.preventDefault(),this._dragCounter=0,this._isDragOver=!1;const s=Array.from(((i=e.dataTransfer)==null?void 0:i.files)??[]);s.length>0&&this._openUploader(s)},this.store=Os(),this.storeCtrl=new Ms(this,this.store),this.selectionCtrl=new Ps(this,this.store),this.infiniteScrollCtrl=new Ls(this,()=>this._loadMore()),this.marqueeCtrl=new Is(this,this.store)}get _isInline(){var e;return((e=this.config)==null?void 0:e.displayMode)==="inline"}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._uploaderEl&&(this._uploaderEl.remove(),this._uploaderEl=null),this._uploaderImportPromise=null,this._dragCounter=0,this._isDragOver=!1,this._isUploaderOpen=!1}updated(e){super.updated(e),e.has("config")&&this.config&&this._initConfig(this.config);const s=this.renderRoot.querySelector("#sentinel");if(s&&s!==this._lastSentinel){this._lastSentinel=s;const i=this.renderRoot.querySelector(".main-content");this.infiniteScrollCtrl.observe(s,i)}const a=this.renderRoot.querySelector(".main-content");a&&a!==this._lastMarqueeContainer&&(this._lastMarqueeContainer=a,this.marqueeCtrl.attach(a))}_initConfig(e){this._initFailed=!1,this._initPromise=this._doInit(e).catch(()=>{this._initFailed=!0}),e.displayMode==="inline"&&!this.store.getState().isOpen&&this.open()}async _doInit(e){const s=wi(),a=s.sortBy??e.defaultSortBy??"created_at",i=s.sortDirection??e.defaultSortDirection??"desc";this.store.setState({config:e,projectToken:e.auth.projectToken,viewMode:e.rememberLastView&&Ci()||e.defaultViewMode||"grid",sortBy:a,sortDirection:i,currentFolder:null,currentFolderPath:e.rootFolderPath??"/"}),this.apiClient=new Ds(e.auth,e.apiBase);try{if(e.auth.mode==="securityTemplate"){const p=await Us(this.apiClient);this.apiClient.setSassKey(p),this.store.setState({sassKey:p})}const[r,n,l]=await Promise.allSettled([ai(this.apiClient),Ns(this.apiClient),Bs(this.apiClient)]);if(r.status==="fulfilled"){const{fields:p,regionalVariantGroups:g,regionalFilters:v,brandColor:w}=r.value;this.store.setState({metadataFields:p,regionalVariantGroups:g,regionalFilters:v,...w?{brandColor:w}:{}})}n.status==="fulfilled"&&this.store.setState({labels:n.value.labels||[]}),l.status==="fulfilled"&&this.store.setState({tags:l.value});const{pinnedFilters:d,pinnedMetadata:h}=yi(e.auth.projectToken??null),u=this.store.getState().filters;this.store.setState({filters:{...u,pinned:d,visible:[...d],metadata:{...u.metadata,pinned:h,visible:[...h]}}});const f=e.brandColor||this.store.getState().brandColor;f&&(this.store.setState({brandColor:f}),Ti(this,f))}catch(r){throw this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:r,context:"init"},bubbles:!0,composed:!0})),r}}_ensureUploaderImport(){return this._uploaderImportPromise?this._uploaderImportPromise:(this._uploaderImportPromise=import("@scaleflex/uploader/define").then(()=>{},e=>{throw this._uploaderImportPromise=null,e}),this._uploaderImportPromise)}_buildUploaderConfig(){const e=this.config,s=e.uploader,a=this.store.getState();let i;return e.auth.mode==="securityTemplate"?i={mode:"security-template",container:e.auth.projectToken,securityTemplateId:e.auth.securityTemplateKey}:i={mode:"session",container:e.auth.projectToken,sessionToken:e.auth.sessionToken,companyToken:e.auth.companyToken},{auth:i,targetFolder:a.currentFolderPath||"/",mode:"inline",restrictions:s.restrictions,concurrency:s.concurrency,autoProceed:s.autoProceed,showFillMetadata:s.showFillMetadata,connectors:s.connectors,sourcesLayout:s.sourcesLayout,headerButton:s.headerButton??"back",clearOnClose:s.clearOnClose,clearOnComplete:s.clearOnComplete,rejectedFileAutoRemoveDelay:s.rejectedFileAutoRemoveDelay}}async _openUploader(e){var a;if(!((a=this.config)!=null&&a.uploader)||this._isUploaderOpen)return;try{await this._ensureUploaderImport()}catch(i){this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:i instanceof Error?i:new Error(String(i)),context:"uploader-load"},bubbles:!0,composed:!0}));return}this._uploaderEl=document.createElement("sfx-uploader");const s=this._uploaderEl;s.addEventListener("sfx-all-complete",()=>{this.store.getState().isOpen&&this._loadData()}),s.addEventListener("sfx-complete-action",()=>{this._closeUploader()}),s.addEventListener("sfx-cancel",()=>{this._closeUploader()}),this._isUploaderOpen=!0,await this.updateComplete,s.config=this._buildUploaderConfig(),await s.updateComplete,e!=null&&e.length&&s.addFiles(e)}_closeUploader(){this._isUploaderOpen=!1,this._uploaderEl=null}_handleUploadClick(){this._openUploader()}_hasFileTransfer(e){var s,a;return!!((a=(s=e.dataTransfer)==null?void 0:s.types)!=null&&a.includes("Files"))}async open(){var l,d,h,u,f,p;const e=this.store.getState(),s=De((l=this.config)==null?void 0:l.forcedFilters),a=new Set(Object.keys(s)),i={},r=De((d=this.config)==null?void 0:d.defaultFilters);for(const[g,v]of Object.entries(r))a.has(g)||(i[g]=v);const n=Object.keys(i);this.store.setState({isOpen:!0,activeTab:((u=(h=this.config)==null?void 0:h.tabs)==null?void 0:u[0])??"assets",searchQuery:"",filters:{metadata:{pinned:e.filters.metadata.pinned,visible:[...e.filters.metadata.pinned],applied:{}},pinned:e.filters.pinned,visible:[...new Set([...e.filters.pinned,...n])],applied:i},offset:0,assets:[],folders:[],currentFolder:null,currentFolderPath:((f=this.config)==null?void 0:f.rememberLastFolder)&&ki()||((p=this.config)==null?void 0:p.rootFolderPath)||"/",breadcrumb:[],selectedAssets:new Map,folderPreviews:{},isPreviewOpen:!1,previewAsset:null,isLoading:!0,isSelectingAll:!1}),this._dragCounter=0,this._isDragOver=!1,this.dispatchEvent(new CustomEvent("ap-open",{detail:{timestamp:Date.now()},bubbles:!0,composed:!0})),await this.updateComplete,!this._initPromise&&this.config&&this._initConfig(this.config),!(this._initPromise&&(await this._initPromise,this._initFailed))&&this._loadData()}close(){this.store.setState({isOpen:!1}),this._dragCounter=0,this._isDragOver=!1,this._isUploaderOpen=!1}_scrollToTop(){var e;(e=this.renderRoot.querySelector(".main-content"))==null||e.scrollTo({top:0})}async _loadData(){var a,i,r,n,l,d,h,u,f,p,g,v,w,b;if(!this.apiClient)return;const e=++this._loadId,s=this.store.getState();this._scrollToTop(),this.store.setState({isLoading:!0});try{const O=s.activeTab;if(O==="assets"){const $=this._buildSearchNotation(),k=s.currentFolderPath||"/",A=Ye(this.apiClient,{folder:k,offset:0,limit:s.limit,sort_by:s.sortBy,sort_direction:s.sortDirection,search:s.searchQuery||void 0,q:$||void 0,recursive:1}),T=Ut(this.apiClient,{folder:k,q:$||void 0,search:s.searchQuery||void 0,recursive:1}).catch(()=>null),[L,C]=await Promise.all([A,T]);if(e!==this._loadId)return;const se=((a=L.files)==null?void 0:a.length)??0,ce=se>=s.limit,$e=((i=C==null?void 0:C.stats)==null?void 0:i.approx_files_count)??((r=C==null?void 0:C.info)==null?void 0:r.total_files_count)??((n=L.info)==null?void 0:n.total_files_count)??((d=(l=L.base)==null?void 0:l.count)==null?void 0:d.files_recursive)??((u=(h=L.base)==null?void 0:h.count)==null?void 0:u.files_direct)??se;this.store.setState({assets:L.files||[],folders:[],totalCount:$e,totalFolderCount:0,offset:0,hasMore:ce,isLoading:!1})}else if(O==="folders"){const $=this._buildSearchNotation(),k=s.currentFolderPath||"/",[A,T,L]=await Promise.all([Rs(this.apiClient,{folderPath:s.currentFolderPath,q:s.searchQuery||void 0,recursive:s.searchQuery?1:0,sort_by:s.sortBy,sort_direction:s.sortDirection}),Ye(this.apiClient,{folder:k,offset:0,limit:s.limit,sort_by:s.sortBy,sort_direction:s.sortDirection,search:s.searchQuery||void 0,q:$||void 0,recursive:0}),Ut(this.apiClient,{folder:k,q:$||void 0,search:s.searchQuery||void 0,recursive:0}).catch(()=>null)]);if(e!==this._loadId)return;const C=A.folders||[];let se={};if(C.length>0)try{se=await js(this.apiClient,C.map(de=>de.uuid))}catch{}if(e!==this._loadId)return;const ce=((f=T.files)==null?void 0:f.length)??0,$e=ce>=s.limit,Ge=((p=L==null?void 0:L.stats)==null?void 0:p.approx_files_count)??((g=L==null?void 0:L.info)==null?void 0:g.total_files_count)??((v=T.info)==null?void 0:v.total_files_count)??((b=(w=T.base)==null?void 0:w.count)==null?void 0:b.files_direct)??ce;this.store.setState({assets:T.files||[],folders:C,folderPreviews:se,totalCount:Ge,totalFolderCount:A.total??C.length,offset:0,hasMore:$e,isLoading:!1})}}catch(O){if(e!==this._loadId)return;this.store.setState({isLoading:!1}),this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:O,context:"loadData"},bubbles:!0,composed:!0}))}}async _loadMore(){const e=this.store.getState();if(e.isLoading||!e.hasMore||!this.apiClient)return;const s=++this._loadMoreId,a=e.offset+e.limit;this.store.setState({isLoading:!0});try{const i=this._buildSearchNotation(),r=await Ye(this.apiClient,{folder:e.currentFolderPath||"/",offset:a,limit:e.limit,sort_by:e.sortBy,sort_direction:e.sortDirection,search:e.searchQuery||void 0,q:i||void 0,recursive:e.activeTab==="folders"?0:1});if(s!==this._loadMoreId)return;const n=this.store.getState().assets,l=r.files||[],d=l.length>=e.limit,h=[...n,...l];this.store.setState({assets:h,offset:a,hasMore:d,isLoading:!1})}catch{if(s!==this._loadMoreId)return;this.store.setState({isLoading:!1})}}_debouncedLoadData(e=120){this._loadDataTimer&&clearTimeout(this._loadDataTimer),this._loadDataTimer=setTimeout(()=>{this._loadDataTimer=null,this._loadData()},e)}_handleCancel(e){var s,a;this.close(),(a=(s=this.config)==null?void 0:s.onCancel)==null||a.call(s),this.dispatchEvent(new CustomEvent("ap-cancel",{detail:{reason:e},bubbles:!0,composed:!0}))}_handleSearchChange(e){this.store.setState({searchQuery:e.detail.value,offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handleViewChange(e){var a;const s=e.detail.mode;this.store.setState({viewMode:s}),(a=this.config)!=null&&a.rememberLastView&&Si(s),this._scrollToTop()}_handleRegionalChange(e){const{groupUuid:s,value:a}=e.detail,i=this.store.getState().regionalFilters;this.store.setState({regionalFilters:{...i,[s]:a}})}_handleSortChange(e){const s=e.detail.value,a=this.store.getState();this.store.setState({sortBy:s,offset:0,assets:[],folders:[]}),Xt(s,a.sortDirection),this.selectionCtrl.resetRange(),this._loadData()}_handleSortDirectionChange(e){const s=e.detail.value,a=this.store.getState();this.store.setState({sortDirection:s,offset:0,assets:[],folders:[]}),Xt(a.sortBy,s),this.selectionCtrl.resetRange(),this._loadData()}_handleTabChange(e){var s;this.store.setState({activeTab:e.detail.tab,currentFolder:null,currentFolderPath:((s=this.config)==null?void 0:s.rootFolderPath)??"/",breadcrumb:[],offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handleAssetSelect(e){this.selectionCtrl.handleSelect(e.detail.asset,e.detail.index,e.detail.event)}_handleAssetPreview(e){this.store.setState({previewAsset:e.detail.asset,isPreviewOpen:!0})}_handleQuickSelect(e){var a,i;const s=e.detail.asset;(i=(a=this.config)==null?void 0:a.onSelect)==null||i.call(a,[s]),this.dispatchEvent(new CustomEvent("ap-select",{detail:{assets:[s]},bubbles:!0,composed:!0})),this._isInline||this.close()}_handleFolderOpen(e){var r;const s=e.detail.folder,a=this.store.getState(),i=s.path||`${a.currentFolderPath}${s.name}/`;(r=this.config)!=null&&r.rememberLastFolder&&Wt(i),this.store.setState({currentFolder:s.uuid,currentFolderPath:i,breadcrumb:[...a.breadcrumb,{uuid:s.uuid,name:s.name,path:i}],searchQuery:"",offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handleBreadcrumbNavigate(e){var l,d;const s=e.detail.uuid,a=this.store.getState(),i=s?a.breadcrumb.findIndex(h=>h.uuid===s):-1,r=s?a.breadcrumb.slice(0,i+1):[],n=r.length>0?r[r.length-1].path:((l=this.config)==null?void 0:l.rootFolderPath)||"/";(d=this.config)!=null&&d.rememberLastFolder&&Wt(n),this.store.setState({currentFolder:s||null,currentFolderPath:n,breadcrumb:r,offset:0,assets:[],folders:[]}),this.selectionCtrl.resetRange(),this._loadData()}_handlePreviewClose(){this.store.setState({isPreviewOpen:!1,previewAsset:null})}_handlePreviewNavigate(e){this.store.setState({previewAsset:e.detail.asset})}_handleSelectionConfirm(e){var a,i;const s=e.detail.assets;(i=(a=this.config)==null?void 0:a.onSelect)==null||i.call(a,s),this.dispatchEvent(new CustomEvent("ap-select",{detail:{assets:s},bubbles:!0,composed:!0})),this._isInline||this.close()}async _handleSelectAll(){var a;const e=this.store.getState();if(!(e.isSelectingAll||!this.apiClient||!(((a=e.config)==null?void 0:a.multiSelect)??!0))){if(e.assets.length>=e.totalCount){this.selectionCtrl.selectAll(e.assets);return}this.store.setState({isSelectingAll:!0});try{const i=this._buildSearchNotation(),r=e.currentFolderPath||"/",n=e.limit,l=e.assets,d=e.totalCount,h=e.activeTab==="folders"?0:1,u=[];for(let b=l.length;b<d;b+=n)u.push(b);const f=4,p=[];for(let b=0;b<u.length;b+=f){const O=u.slice(b,b+f),$=await Promise.all(O.map(k=>Ye(this.apiClient,{folder:r,offset:k,limit:n,sort_by:e.sortBy,sort_direction:e.sortDirection,search:e.searchQuery||void 0,q:i||void 0,recursive:h})));for(const k of $)k.files&&p.push(...k.files)}const g=new Set(l.map(b=>b.uuid)),v=p.filter(b=>g.has(b.uuid)?!1:(g.add(b.uuid),!0)),w=[...l,...v];this.store.setState({assets:w,offset:Math.max(0,w.length-n),hasMore:!1,isSelectingAll:!1}),this.selectionCtrl.selectAll(w)}catch(i){this.store.setState({isSelectingAll:!1}),this.dispatchEvent(new CustomEvent("ap-error",{detail:{error:i,context:"selectAll"},bubbles:!0,composed:!0}))}}}_handleSelectionClear(){this.selectionCtrl.clearSelection()}_handleSelectionDeselect(e){const s=new Map(this.store.getState().selectedAssets);s.delete(e.detail.uuid),this.store.setState({selectedAssets:s})}_isDateFilterKey(e){return e===m.DATE||e===m.LICENSE_EXPIRY||e===R.DUE_DATE}_handleFilterUpdate(e){const{key:s,values:a,operator:i}=e.detail,n={...this.store.getState().filters};let l=a===""||a===null||a===void 0||Array.isArray(a)&&a.length===0||typeof a=="object"&&!Array.isArray(a)&&Object.values(a).every(d=>d==null||d===""||Array.isArray(d)&&d.length===0);if(!l&&this._isDateFilterKey(s)&&typeof a=="object"&&!Array.isArray(a)){const{kind:d,preset:h,from:u,to:f}=a;l=!d&&!h&&!u&&!f}if(l){const d={...n.applied};delete d[s],n.applied=d,n.pinned.includes(s)||(n.visible=n.visible.filter(h=>h!==s))}else{const d={...n.applied};this._isDateFilterKey(s)&&typeof a=="object"&&!Array.isArray(a)?d[s]={type:"date",field:a.field||"created",kind:a.kind||null,preset:a.preset||null,from:a.from||null,to:a.to||null}:s===m.IMAGE&&typeof a=="object"&&!Array.isArray(a)?d[s]=a:d[s]={type:"string",values:Array.isArray(a)?a:[a],operator:i||":"},n.applied=d,n.visible.includes(s)||(n.visible=[...n.visible,s])}if(this.store.setState({filters:n,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData(),this._pendingFilter===s){this._pendingFilter=null;const d=this.renderRoot.querySelector("ap-filters-bar");d&&(d.pendingFilter=null)}}_handleFilterOpen(e){const s=e.detail.key,a=e.detail.chipRect,i=this.renderRoot.querySelector("ap-content-toolbar");let r;if(a){const n=this.renderRoot.querySelector(".toolbar-filters-wrapper");if(n){const l=n.getBoundingClientRect();r=a.left-l.left}}i==null||i.openFilterPanel(s,!0,r)}_handleMetadataFilterOpen(e){const{fieldKey:s,chipRect:a}=e.detail,i=this.renderRoot.querySelector("ap-content-toolbar");let r;if(a){const n=this.renderRoot.querySelector(".toolbar-filters-wrapper");if(n){const l=n.getBoundingClientRect();r=a.left-l.left}}i==null||i.openMetadataFieldPanel(s,!0,r)}_handleFilterPanelChange(e){const s=this.renderRoot.querySelector("ap-filters-bar");s&&(s.activeFilter=e.detail.key,s.activeMetadataField=e.detail.metadataFieldKey||null),!e.detail.key&&!e.detail.metadataFieldKey&&(this._pendingFilter||this._pendingMetadataField)&&(this._pendingFilter=null,this._pendingMetadataField=null,s&&(s.pendingFilter=null,s.pendingMetadataField=null))}async _handleFilterPending(e){var f,p,g;const{key:s,metadataFieldKey:a}=e.detail,i=this.renderRoot.querySelector("ap-filters-bar"),r=this.renderRoot.querySelector("ap-content-toolbar");if(!i||!r)return;a?(this._pendingMetadataField=a,i.pendingMetadataField=a):s&&(this._pendingFilter=s,i.pendingFilter=s),await i.updateComplete;let n=i.renderRoot.querySelector(".chip.pending");if(!n){const v=i.renderRoot.querySelectorAll(".chip.pinned-empty"),w=a?(f=i._getMetadataLabel)==null?void 0:f.call(i,a):void 0;for(const b of v){const O=(g=(p=b.querySelector(".chip-label"))==null?void 0:p.textContent)==null?void 0:g.trim();if(a&&O===w){n=b;break}if(s&&O===(ke[s]||s)){n=b;break}}}if(!n)return;const l=n.getBoundingClientRect(),d=this.renderRoot.querySelector(".toolbar-filters-wrapper"),h=d==null?void 0:d.getBoundingClientRect(),u=h?l.left-h.left:l.left;a?r.openMetadataFieldPanel(a,!0,u):s&&r.openFilterPanel(s,!0,u)}_handleFilterRemove(e){var n;const s=e.detail.key;if(s in(((n=this.config)==null?void 0:n.forcedFilters)??{}))return;const i={...this.store.getState().filters},r={...i.applied};delete r[s],i.applied=r,i.pinned.includes(s)||(i.visible=i.visible.filter(l=>l!==s)),this.store.setState({filters:i,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_handleMetadataFilterChange(e){const{fieldKey:s,operator:a,values:i,metadataType:r}=e.detail,l={...this.store.getState().filters},d={...l.metadata},h={...d.applied};if(!i||Array.isArray(i)&&i.length===0?(delete h[s],d.applied=h,d.pinned.includes(s)||(d.visible=d.visible.filter(f=>f!==s))):(h[s]={type:"string",values:Array.isArray(i)?i:[i],operator:a||":",metadataType:r},d.applied=h,d.visible.includes(s)||(d.visible=[...d.visible,s])),l.metadata=d,this.store.setState({filters:l,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData(),this._pendingMetadataField===s){this._pendingMetadataField=null;const f=this.renderRoot.querySelector("ap-filters-bar");f&&(f.pendingMetadataField=null)}}_handleMetadataFieldToggle(e){const{fieldKey:s,visible:a}=e.detail,r={...this.store.getState().filters},n={...r.metadata};a?n.visible.includes(s)||(n.visible=[...n.visible,s]):n.visible=n.visible.filter(l=>l!==s),r.metadata=n,this.store.setState({filters:r})}_handleMetadataFilterRemove(e){const{fieldKey:s}=e.detail,i={...this.store.getState().filters},r={...i.metadata},n={...r.applied};delete n[s],r.applied=n,r.pinned.includes(s)||(r.visible=r.visible.filter(l=>l!==s)),i.metadata=r,this.store.setState({filters:i,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_handleFilterPin(e){var l,d;const{key:s,pinned:a}=e.detail,r={...this.store.getState().filters};a?r.pinned.includes(s)||(r.pinned=[...r.pinned,s]):(r.pinned=r.pinned.filter(h=>h!==s),s in r.applied||(r.visible=r.visible.filter(h=>h!==s))),this.store.setState({filters:r});const n=((d=(l=this.store.getState().config)==null?void 0:l.auth)==null?void 0:d.projectToken)??null;xi(n,r.pinned)}_handleMetadataPin(e){var d,h;const{fieldKey:s,pinned:a}=e.detail,r={...this.store.getState().filters},n={...r.metadata};a?n.pinned.includes(s)||(n.pinned=[...n.pinned,s]):(n.pinned=n.pinned.filter(u=>u!==s),s in n.applied||(n.visible=n.visible.filter(u=>u!==s))),r.metadata=n,this.store.setState({filters:r});const l=((h=(d=this.store.getState().config)==null?void 0:d.auth)==null?void 0:h.projectToken)??null;$i(l,n.pinned)}_handleFiltersClearAll(){const e=this.store.getState();this.store.setState({filters:{...e.filters,applied:{},visible:[...e.filters.pinned],metadata:{...e.filters.metadata,applied:{},visible:[...e.filters.metadata.pinned]}},offset:0,assets:[],folders:[],isLoading:!0});const s=this.renderRoot.querySelector("ap-filters-bar");s&&(s.activeFilter=null),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_handleFilterDeactivate(e){const s=e.detail.key,i={...this.store.getState().filters};i.visible=i.visible.filter(r=>r!==s),this.store.setState({filters:i})}_handleMetadataFieldDeactivate(e){const{fieldKey:s}=e.detail,i={...this.store.getState().filters},r={...i.metadata};r.visible=r.visible.filter(n=>n!==s),i.metadata=r,this.store.setState({filters:i})}_handleFiltersSet(e){var h;const{applied:s,metadata:a}=e.detail,r={...this.store.getState().filters},n=new Set(Object.keys(((h=this.config)==null?void 0:h.forcedFilters)??{})),l={...s};for(const u of n)delete l[u];r.applied=l;const d=Object.keys(s);if(r.visible=[...new Set([...r.pinned,...d])],a){const u={...r.metadata};u.applied=a.applied;const f=Object.keys(a.applied);u.visible=[...new Set([...u.pinned,...f])],r.metadata=u}this.store.setState({filters:r,offset:0,assets:[],folders:[],isLoading:!0}),this.selectionCtrl.resetRange(),this._debouncedLoadData()}_getSortOptions(){const e=this.storeCtrl.state;return e.searchQuery?Oi:e.activeTab==="folders"?Mi:Ft}_buildSearchNotation(){var i;const e=this.store.getState(),s={...De((i=this.config)==null?void 0:i.forcedFilters),...e.filters.applied};return ni(s,e.filters.metadata.applied).join(" ")}render(){var h,u,f,p,g,v,w,b;const e=this.storeCtrl.state,s=Array.from(e.selectedAssets.keys()),a=this.selectionCtrl.getSelectedAssets(),i=o.html`
5602
5664
  <ap-header
5603
5665
  .activeTab=${e.activeTab}
5604
- .tabs=${((l=this.config)==null?void 0:l.tabs)??["assets","folders"]}
5666
+ .tabs=${((h=this.config)==null?void 0:h.tabs)??["assets","folders"]}
5605
5667
  .viewMode=${e.viewMode}
5606
5668
  .searchQuery=${e.searchQuery}
5607
5669
  .regionalGroups=${e.regionalVariantGroups}
@@ -5613,8 +5675,21 @@
5613
5675
  @regional-change=${this._handleRegionalChange}
5614
5676
  @ap-close=${()=>this._handleCancel("close-button")}
5615
5677
  ></ap-header>
5616
- `,r=o.html`
5617
- <div class="content-area">
5678
+ `,r=!!((u=this.config)!=null&&u.uploader),n=o.html`
5679
+ <div class="content-area"
5680
+ @dragenter=${this._onDragEnter}
5681
+ @dragover=${this._onDragOver}
5682
+ @dragleave=${this._onDragLeave}
5683
+ @drop=${this._onDrop}
5684
+ >
5685
+ ${this._isDragOver?o.html`
5686
+ <div class="drop-zone-overlay">
5687
+ <div class="drop-zone-label">
5688
+ <ap-icon name="upload" .size=${32}></ap-icon>
5689
+ Drop files to upload
5690
+ </div>
5691
+ </div>
5692
+ `:o.nothing}
5618
5693
  <div class="main-content">
5619
5694
  ${e.breadcrumb.length>0?o.html`<ap-breadcrumb
5620
5695
  .items=${e.breadcrumb}
@@ -5626,6 +5701,7 @@
5626
5701
  .isLoading=${e.isLoading}
5627
5702
  .totalCount=${e.totalCount}
5628
5703
  .totalFolderCount=${e.totalFolderCount}
5704
+ .showUpload=${r}
5629
5705
  .sortBy=${e.sortBy}
5630
5706
  .sortDirection=${e.sortDirection}
5631
5707
  .sortOptions=${this._getSortOptions()}
@@ -5635,7 +5711,7 @@
5635
5711
  .metadataFields=${e.metadataFields}
5636
5712
  .pinnedFilters=${e.filters.pinned}
5637
5713
  .apiClient=${this.apiClient}
5638
- .forcedFilterKeys=${Object.keys(ze((d=this.config)==null?void 0:d.forcedFilters))}
5714
+ .forcedFilterKeys=${Object.keys(De((f=this.config)==null?void 0:f.forcedFilters))}
5639
5715
  @sort-change=${this._handleSortChange}
5640
5716
  @sort-direction-change=${this._handleSortDirectionChange}
5641
5717
  @filter-update=${this._handleFilterUpdate}
@@ -5645,6 +5721,7 @@
5645
5721
  @metadata-pin=${this._handleMetadataPin}
5646
5722
  @filter-panel-change=${this._handleFilterPanelChange}
5647
5723
  @filter-pending=${this._handleFilterPending}
5724
+ @upload-click=${this._handleUploadClick}
5648
5725
  ></ap-content-toolbar>
5649
5726
 
5650
5727
  <ap-filters-bar
@@ -5655,7 +5732,7 @@
5655
5732
  .labels=${e.labels}
5656
5733
  .pinnedFilters=${e.filters.pinned}
5657
5734
  .pinnedMetadataFields=${e.filters.metadata.pinned}
5658
- .forcedFilters=${((h=this.config)==null?void 0:h.forcedFilters)??{}}
5735
+ .forcedFilters=${((p=this.config)==null?void 0:p.forcedFilters)??{}}
5659
5736
  @filter-remove=${this._handleFilterRemove}
5660
5737
  @filter-deactivate=${this._handleFilterDeactivate}
5661
5738
  @filter-open=${this._handleFilterOpen}
@@ -5678,11 +5755,11 @@
5678
5755
  .assets=${e.assets}
5679
5756
  .selectedIds=${s}
5680
5757
  .containerToken=${e.projectToken}
5681
- .showMetadata=${((u=this.config)==null?void 0:u.showMetadata)!==!1}
5758
+ .showMetadata=${((g=this.config)==null?void 0:g.showMetadata)!==!1}
5682
5759
  .metadataFields=${e.metadataFields}
5683
5760
  .labels=${e.labels}
5684
5761
  .regionalFilters=${e.regionalFilters}
5685
- .multiSelect=${((g=this.config)==null?void 0:g.multiSelect)??!0}
5762
+ .multiSelect=${((v=this.config)==null?void 0:v.multiSelect)??!0}
5686
5763
  @preview-close=${this._handlePreviewClose}
5687
5764
  @preview-navigate=${this._handlePreviewNavigate}
5688
5765
  @asset-select=${this._handleAssetSelect}
@@ -5690,32 +5767,45 @@
5690
5767
  @filter-update=${this._handleFilterUpdate}
5691
5768
  ></ap-preview-panel>`:o.nothing}
5692
5769
  </div>
5693
- `,n=o.html`
5770
+ `,l=o.html`
5694
5771
  <ap-selection-bar
5695
5772
  .selectedAssets=${a}
5696
5773
  .totalCount=${e.totalCount}
5697
5774
  .isSelectingAll=${e.isSelectingAll}
5698
- .multiSelect=${((p=this.config)==null?void 0:p.multiSelect)??!0}
5699
- .maxSelections=${(f=this.config)==null?void 0:f.maxSelections}
5775
+ .multiSelect=${((w=this.config)==null?void 0:w.multiSelect)??!0}
5776
+ .maxSelections=${(b=this.config)==null?void 0:b.maxSelections}
5700
5777
  @selection-confirm=${this._handleSelectionConfirm}
5701
5778
  @selection-clear=${this._handleSelectionClear}
5702
5779
  @selection-deselect=${this._handleSelectionDeselect}
5703
5780
  @select-all=${this._handleSelectAll}
5704
5781
  ></ap-selection-bar>
5705
- `;return this._isInline?e.isOpen?o.html`
5782
+ `,d=this._isUploaderOpen?o.html`
5783
+ <div class="uploader-overlay">
5784
+ ${this._isInline?o.nothing:o.html`
5785
+ <button class="uploader-close-btn" @click=${()=>this._handleCancel("close-button")} title="Close">
5786
+ <ap-icon name="close" .size=${18}></ap-icon>
5787
+ </button>
5788
+ `}
5789
+ <div class="uploader-body">${this._uploaderEl}</div>
5790
+ </div>
5791
+ `:o.nothing;return this._isInline?e.isOpen?o.html`
5706
5792
  <div class="ap-inline">
5707
- <div class="inline-header">${i}</div>
5708
- <div class="inline-content">${r}</div>
5709
- <div class="inline-footer">${n}</div>
5793
+ ${this._isUploaderOpen?d:o.html`
5794
+ <div class="inline-header">${i}</div>
5795
+ <div class="inline-content">${n}</div>
5796
+ <div class="inline-footer">${l}</div>
5797
+ `}
5710
5798
  </div>
5711
5799
  `:o.nothing:o.html`
5712
5800
  <ap-modal
5713
5801
  ?open=${e.isOpen}
5714
- @ap-cancel=${v=>this._handleCancel(v.detail.reason)}
5802
+ @ap-cancel=${O=>this._handleCancel(O.detail.reason)}
5715
5803
  >
5716
- <div slot="header">${i}</div>
5717
- ${r}
5718
- <div slot="footer">${n}</div>
5804
+ ${this._isUploaderOpen?d:o.html`
5805
+ <div slot="header">${i}</div>
5806
+ ${n}
5807
+ <div slot="footer">${l}</div>
5808
+ `}
5719
5809
  </ap-modal>
5720
5810
  `}_renderContent(e,s){var a,i,r;return e.activeTab==="assets"?!e.isLoading&&e.assets.length===0?o.html`
5721
5811
  <div class="empty-state">
@@ -5815,7 +5905,7 @@
5815
5905
  align-items: center;
5816
5906
  justify-content: center;
5817
5907
  padding: 64px 20px;
5818
- color: var(--ap-muted-foreground, #71717a);
5908
+ color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
5819
5909
  text-align: center;
5820
5910
  }
5821
5911
  .empty-state ap-icon {
@@ -5825,7 +5915,7 @@
5825
5915
  .empty-title {
5826
5916
  font-size: var(--ap-font-size-base, 1rem);
5827
5917
  font-weight: 500;
5828
- color: var(--ap-foreground, #09090b);
5918
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5829
5919
  margin-bottom: 4px;
5830
5920
  }
5831
5921
  .empty-desc {
@@ -5844,13 +5934,12 @@
5844
5934
  overflow: hidden;
5845
5935
  display: flex;
5846
5936
  flex-direction: column;
5847
- background: var(--ap-background, #fff);
5937
+ background: var(--ap-background, oklch(1 0 0));
5848
5938
  font-family: var(--ap-font-family, system-ui, -apple-system, sans-serif);
5849
- color: var(--ap-foreground, #09090b);
5939
+ color: var(--ap-foreground, oklch(0.37 0.022 248.413));
5850
5940
  }
5851
5941
  .ap-inline .inline-header {
5852
5942
  flex-shrink: 0;
5853
- border-bottom: 1px solid var(--ap-border, #e4e4e7);
5854
5943
  }
5855
5944
  .ap-inline .inline-content {
5856
5945
  flex: 1;
@@ -5862,4 +5951,90 @@
5862
5951
  .ap-inline .inline-footer {
5863
5952
  flex-shrink: 0;
5864
5953
  }
5865
- `];let ct=Rt;nr([c.property({type:Object})],ct.prototype,"config");exports.AssetPicker=ct;
5954
+
5955
+ /* Upload drop zone overlay */
5956
+ .drop-zone-overlay {
5957
+ position: absolute;
5958
+ inset: 0;
5959
+ z-index: 100;
5960
+ display: flex;
5961
+ align-items: center;
5962
+ justify-content: center;
5963
+ background: var(--ap-primary-10, oklch(0.65 0.19 258 / 0.08));
5964
+ border: 2px dashed var(--ap-primary, oklch(0.65 0.19 258));
5965
+ border-radius: var(--ap-radius, 8px);
5966
+ pointer-events: none;
5967
+ animation: drop-zone-in 150ms ease-out;
5968
+ }
5969
+ .drop-zone-overlay .drop-zone-label {
5970
+ display: flex;
5971
+ flex-direction: column;
5972
+ align-items: center;
5973
+ gap: 8px;
5974
+ color: var(--ap-primary, oklch(0.65 0.19 258));
5975
+ font-size: 1rem;
5976
+ font-weight: 500;
5977
+ }
5978
+ @keyframes drop-zone-in {
5979
+ from { opacity: 0; }
5980
+ to { opacity: 1; }
5981
+ }
5982
+ @media (prefers-reduced-motion: reduce) {
5983
+ .drop-zone-overlay { animation: none; }
5984
+ }
5985
+
5986
+ /* Uploader overlay panel — fills the entire modal/inline container */
5987
+ .uploader-overlay {
5988
+ position: relative;
5989
+ display: flex;
5990
+ flex-direction: column;
5991
+ flex: 1;
5992
+ min-height: 0;
5993
+ background: var(--ap-background, #fff);
5994
+ animation: uploader-slide-in 250ms ease-out;
5995
+ }
5996
+ .uploader-close-btn {
5997
+ position: absolute;
5998
+ top: 14px;
5999
+ right: 20px;
6000
+ z-index: 1;
6001
+ display: flex;
6002
+ align-items: center;
6003
+ justify-content: center;
6004
+ width: 30px;
6005
+ height: 30px;
6006
+ border: none;
6007
+ border-radius: var(--ap-radius-sm, 6px);
6008
+ background: none;
6009
+ color: var(--ap-muted-foreground, #71717a);
6010
+ cursor: pointer;
6011
+ transition: all 150ms;
6012
+ }
6013
+ .uploader-close-btn:hover {
6014
+ background: var(--ap-muted, #f4f4f5);
6015
+ color: var(--ap-foreground, #09090b);
6016
+ }
6017
+ .uploader-close-btn:focus-visible {
6018
+ outline: 2px solid var(--ap-ring, oklch(0.65 0.19 258));
6019
+ outline-offset: -2px;
6020
+ }
6021
+ @keyframes uploader-slide-in {
6022
+ from { transform: translateX(100%); }
6023
+ to { transform: translateX(0); }
6024
+ }
6025
+ @media (prefers-reduced-motion: reduce) {
6026
+ .uploader-overlay { animation: none; }
6027
+ }
6028
+ .uploader-body {
6029
+ flex: 1;
6030
+ overflow: hidden;
6031
+ min-height: 0;
6032
+ }
6033
+ .uploader-body sfx-uploader {
6034
+ display: block;
6035
+ width: 100%;
6036
+ height: 100%;
6037
+ --sfx-up-border: transparent;
6038
+ --sfx-up-radius: 0;
6039
+ }
6040
+ `];let Te=Rt;zt([c.state()],Te.prototype,"_isDragOver");zt([c.state()],Te.prototype,"_isUploaderOpen");zt([c.property({type:Object})],Te.prototype,"config");exports.AssetPicker=Te;