efficient-shell 12.21.0 → 12.23.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 (39) hide show
  1. package/README.md +26 -2
  2. package/dist/{Browser-ZR4RSWBV.js → Browser-G3NJJDFN.js} +13 -13
  3. package/dist/{Files-54RPAKLE.js → Files-A5MD7QNE.js} +8 -8
  4. package/dist/{Notepad-JZ5UMA6T.js → Notepad-CUWBPETD.js} +9 -9
  5. package/dist/{Preview-WHZ4O6UT.js → Preview-DRNDT6WX.js} +14 -14
  6. package/dist/apps/index.js +1 -1
  7. package/dist/bin/media-host-check.js +1 -1
  8. package/dist/bin/ui-check.js +1 -1
  9. package/dist/brand.css +1 -1
  10. package/dist/{chunk-JUXPKGO3.js → chunk-EEGTFJUQ.js} +6 -6
  11. package/dist/{chunk-4BKJ6A5H.js → chunk-F4XGUOVL.js} +4 -4
  12. package/dist/chunk-MDVABA4H.js +1 -0
  13. package/dist/{chunk-XACIU7IR.js → chunk-MFSDS6CN.js} +1 -1
  14. package/dist/{chunk-ME7XHU3P.js → chunk-QJWQ6OMF.js} +6 -6
  15. package/dist/chunk-T2OSPUS6.js +11 -0
  16. package/dist/{chunk-TUPPFC74.js → chunk-WLX24TG6.js} +4 -4
  17. package/dist/{chunk-C6W5P6CY.js → chunk-ZNLCITYY.js} +3 -3
  18. package/dist/chunk-ZSEB7XW4.js +1 -0
  19. package/dist/format/index.d.ts +50 -8
  20. package/dist/format/index.js +1 -1
  21. package/dist/forms/BrandAssetEditor.js +1 -1
  22. package/dist/forms/LinkPicker.js +1 -1
  23. package/dist/forms/MediaLibrary.js +1 -1
  24. package/dist/forms/MediaUploadField.d.ts +6 -1
  25. package/dist/forms/MediaUploadField.js +1 -1
  26. package/dist/icons/index.js +1 -1
  27. package/dist/index.js +77 -77
  28. package/dist/motion/entrance.d.ts +4 -1
  29. package/dist/motion/entrance.js +1 -1
  30. package/dist/motion.css +49 -17
  31. package/dist/shell/LanguageSelect.js +1 -1
  32. package/dist/shell/SettingRow.js +1 -1
  33. package/dist/telemetry/index.js +1 -1
  34. package/dist/ui/index.js +1 -1
  35. package/dist/version.js +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-B4GCTNGM.js +0 -9
  38. package/dist/chunk-Q2SCJQ5H.js +0 -1
  39. package/dist/chunk-TLNZ5KEO.js +0 -1
@@ -1,20 +1,20 @@
1
- import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-OLCRYT3N.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-T2TZBTSM.js";import{ImageLightbox as r}from"./chunk-436PJFHC.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-UP4HLGMZ.js";import{Breadcrumbs as d}from"./chunk-QMSINDXL.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-VQ4X3OBR.js";import{useMediaMoveItems as u}from"./chunk-NOGSS432.js";import{RenameField as m}from"./chunk-GEZM6ARD.js";import{NativeSelect as h}from"./chunk-TM4CRQ3W.js";import{MediaUploadGrid as p}from"./chunk-OG53D3R5.js";import{MediaUsedInList as f}from"./chunk-FQ4IRBMA.js";import{Segmented as g}from"./chunk-HNIIDDLJ.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-Y7KDCC6E.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-6FZ5JTBY.js";import{Banner as C}from"./chunk-N3R6N7LG.js";import{Input_default as N}from"./chunk-6RK6R3RY.js";import{DropdownMenu as I}from"./chunk-SFULX4E3.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-V4XR4MOS.js";import{ColoredBadge as z}from"./chunk-CJHYOHMU.js";import{Button_default as T}from"./chunk-EVYD6UFQ.js";import{Icon as F}from"./chunk-XZXFUZIK.js";import{Tooltip as O}from"./chunk-SOZCWT6I.js";import{buttonClasses as L}from"./chunk-UQYNPYF4.js";import{usePlotWidth as M}from"./chunk-MAFUXCPZ.js";import{useShellStrings as R}from"./chunk-JSHMIMAJ.js";import{useRef as A,useMemo as E,useCallback as P,useState as U,useEffect as B}from"react";import{jsxs as K,Fragment as H,jsx as J}from"react/jsx-runtime";var V="application/x-efficient-media-files",G="application/x-efficient-media-folder",Y="application/x-efficient-media-file";function Z(e){if(!e||!Array.from(e.types).includes(Y))return null;try{const n=JSON.parse(e.getData(Y));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var Q={type:"all",use:"any",sort:"newest"},X={lock:/* @__PURE__ */J(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */J(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */J(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */J(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */J(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */J(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */J(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */J(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */J(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */J(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */J(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */J(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */J(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */J(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */J(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */J(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},$={link:/* @__PURE__ */J(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */J(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */J(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */J(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function W(F){const{mode:Z="manage",layout:W="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=Q,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:he,usedIn:pe,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ce,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Te,onOpenInDesign:Fe,onChoose:Oe,onCancel:Le,pickNote:Me,onDragOut:Re,className:Ae=""}=F,Ee=R().mediaLibrary,Pe=R().media,Ue="pick"===Z,Be=!Ue,Ke=A(null),He=M(Ke,"phone"===W?343:1200),Je="phone"===W||"auto"===W&&He<640,Ve=E(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),Ge=E(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ye=E(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Ge.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Ge]),Ze=P(e=>{const n=[];for(let l=e?Ge.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Ge.get(l.parentId):void 0);return n},[Ge,ee.length]),Qe=P((e,n)=>Ze(e).some(e=>e.id===n),[Ze]),[Xe,$e]=U(()=>/* @__PURE__ */new Set(["@files"])),We=e=>$e(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=P(e=>{$e(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=q).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;B(()=>{if("files"===q.place)qe(["@files",...Ze(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?Ve.get(q.nodeId)?.path??[]:[];qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===q.place,ln="trash"===q.place,an="files"===q.place,rn=an?q.folderId:null,tn=nn&&q.nodeId?Ve.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ee.readOnly} ${Ee.editedAtHq(e.sharedFrom)}`:Ee.readOnly,dn=E(()=>ie.map(e=>e.id),[ie]),sn=E(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=v(dn),un=E(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,hn=A(!0);B(()=>{hn.current?hn.current=!1:cn.clear()},[_e]);const pn=me?.join("\0");B(()=>{me&&cn.setSelection(me)},[pn]);const fn=A(pn??""),gn=un.join("\0");B(()=>{fn.current!==gn&&(fn.current=gn,he?.(un))},[gn]);const vn=(e,n={})=>{Ue?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=U(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Ge.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);qe(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=P(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ee.alreadyHere:void 0;const l=Ge.get(e.id);return n===e.id||n&&Qe(n,e.id)?Ee.notIntoItself:(l?.parentId??null)===n?Ee.folderAlreadyHere:void 0};n.push({key:s,label:Ee.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Ye.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[Ye,Ge,an,Qe,rn,Ee]),Cn=P(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=U(null),Dn={words:Ee,media:Pe,denied:fe,moveTargets:xn,kindOf:Cn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Be?e=>{wn(e)}:void 0,rename:xe&&Be?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ce&&Be?Ce:void 0,trash:Ne&&Be?Ne:void 0,deleteFolder:Ie&&Be?Ie:void 0,folderNotEmpty:e=>!!Ge.get(e)?.notEmpty,replace:ze&&Be?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&y(Ee.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>c(e,Dn),jn=w(),zn=(e,n)=>{Ue||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Tn,Fn]=U(null),[On,Ln]=U(null),[Mn,Rn]=U(null);B(()=>{if(!On&&!Tn)return;const e=()=>{Ln(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Tn]);const An=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),En=(e,n)=>!(!Ce||fe.move||Ue)&&(!!An(e,V)||!(!An(e,G)||!Mn)&&(n!==Mn&&!(n&&Qe(n,Mn)))),Pn=(e,n)=>({onDragEnter:l=>{En(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{En(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(En(e,n))if(e.preventDefault(),Fn(null),An(e,V)){let l;try{l=JSON.parse(e.dataTransfer.getData(V))}catch{l=null}Array.isArray(l)&&l.length&&Ce({kind:"files",ids:l.map(String)},n)}else Mn&&(Ce({kind:"folder",id:Mn},n),Rn(null))}}),Un=e=>{const n=e=>An(e,V)||An(e,G)||An(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&On!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Bn=(e,n,l)=>/* @__PURE__ */J(O,{side:"right",content:On===e?Ee.noDropProducts:on(l),open:On===e||!On&&void 0,children:/* @__PURE__ */J("span",{children:n})}),Kn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Hn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Xe.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
1
+ import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-OLCRYT3N.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-T2TZBTSM.js";import{ImageLightbox as r}from"./chunk-436PJFHC.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-UP4HLGMZ.js";import{Breadcrumbs as d}from"./chunk-QMSINDXL.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-VQ4X3OBR.js";import{useMediaMoveItems as h}from"./chunk-NOGSS432.js";import{RenameField as p}from"./chunk-GEZM6ARD.js";import{NativeSelect as f}from"./chunk-TM4CRQ3W.js";import{MediaUploadGrid as g}from"./chunk-OG53D3R5.js";import{MediaUsedInList as v}from"./chunk-FQ4IRBMA.js";import{Segmented as k}from"./chunk-HNIIDDLJ.js";import{copyToClipboard as y}from"./chunk-Y7KDCC6E.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-6FZ5JTBY.js";import{Banner as C}from"./chunk-N3R6N7LG.js";import{Input_default as N}from"./chunk-6RK6R3RY.js";import{DropdownMenu as I}from"./chunk-SFULX4E3.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-V4XR4MOS.js";import{ColoredBadge as z}from"./chunk-CJHYOHMU.js";import{Button_default as T}from"./chunk-EVYD6UFQ.js";import{Icon as F}from"./chunk-XZXFUZIK.js";import{Tooltip as O}from"./chunk-SOZCWT6I.js";import{buttonClasses as L}from"./chunk-UQYNPYF4.js";import{usePlotWidth as M}from"./chunk-MAFUXCPZ.js";import{useShellStrings as R}from"./chunk-JSHMIMAJ.js";import{useRef as A,useMemo as E,useCallback as P,useState as U,useEffect as B}from"react";import{jsxs as K,Fragment as H,jsx as J}from"react/jsx-runtime";var V="application/x-efficient-media-files",G="application/x-efficient-media-folder",Y="application/x-efficient-media-file";function Z(e){if(!e||!Array.from(e.types).includes(Y))return null;try{const n=JSON.parse(e.getData(Y));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var Q={type:"all",use:"any",sort:"newest"},X={lock:/* @__PURE__ */J(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */J(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */J(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */J(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */J(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */J(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */J(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */J(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */J(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */J(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */J(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */J(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */J(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */J(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */J(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */J(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},$={link:/* @__PURE__ */J(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */J(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */J(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */J(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function W(F){const{mode:Z="manage",layout:W="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=Q,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:he,usedIn:pe,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ce,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Te,onOpenInDesign:Fe,onChoose:Oe,onCancel:Le,pickNote:Me,onDragOut:Re,className:Ae=""}=F,Ee=R().mediaLibrary,Pe=R().media,Ue="pick"===Z,Be=!Ue,Ke=A(null),He=M(Ke,"phone"===W?343:1200),Je="phone"===W||"auto"===W&&He<640,Ve=E(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),Ge=E(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ye=E(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Ge.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Ge]),Ze=P(e=>{const n=[];for(let l=e?Ge.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Ge.get(l.parentId):void 0);return n},[Ge,ee.length]),Qe=P((e,n)=>Ze(e).some(e=>e.id===n),[Ze]),[Xe,$e]=U(()=>/* @__PURE__ */new Set(["@files"])),We=e=>$e(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=P(e=>{$e(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=q).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;B(()=>{if("files"===q.place)qe(["@files",...Ze(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?Ve.get(q.nodeId)?.path??[]:[];qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===q.place,ln="trash"===q.place,an="files"===q.place,rn=an?q.folderId:null,tn=nn&&q.nodeId?Ve.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ee.readOnly} ${Ee.editedAtHq(e.sharedFrom)}`:Ee.readOnly,dn=E(()=>ie.map(e=>e.id),[ie]),sn=E(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=s(dn),un=E(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,hn=A(!0);B(()=>{hn.current?hn.current=!1:cn.clear()},[_e]);const pn=me?.join("\0");B(()=>{me&&cn.setSelection(me)},[pn]);const fn=A(pn??""),gn=un.join("\0");B(()=>{fn.current!==gn&&(fn.current=gn,he?.(un))},[gn]);const vn=(e,n={})=>{Ue?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=U(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Ge.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);qe(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=P(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ee.alreadyHere:void 0;const l=Ge.get(e.id);return n===e.id||n&&Qe(n,e.id)?Ee.notIntoItself:(l?.parentId??null)===n?Ee.folderAlreadyHere:void 0};n.push({key:u,label:Ee.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Ye.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[Ye,Ge,an,Qe,rn,Ee]),Cn=P(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=U(null),Dn={words:Ee,media:Pe,denied:fe,moveTargets:xn,kindOf:Cn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Be?e=>{wn(e)}:void 0,rename:xe&&Be?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ce&&Be?Ce:void 0,trash:Ne&&Be?Ne:void 0,deleteFolder:Ie&&Be?Ie:void 0,folderNotEmpty:e=>!!Ge.get(e)?.notEmpty,replace:ze&&Be?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&y(Ee.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=w(),zn=(e,n)=>{Ue||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Tn,Fn]=U(null),[On,Ln]=U(null),[Mn,Rn]=U(null);B(()=>{if(!On&&!Tn)return;const e=()=>{Ln(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Tn]);const An=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),En=(e,n)=>!(!Ce||fe.move||Ue)&&(!!An(e,V)||!(!An(e,G)||!Mn)&&(n!==Mn&&!(n&&Qe(n,Mn)))),Pn=(e,n)=>({onDragEnter:l=>{En(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{En(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(En(e,n))if(e.preventDefault(),Fn(null),An(e,V)){let l;try{l=JSON.parse(e.dataTransfer.getData(V))}catch{l=null}Array.isArray(l)&&l.length&&Ce({kind:"files",ids:l.map(String)},n)}else Mn&&(Ce({kind:"folder",id:Mn},n),Rn(null))}}),Un=e=>{const n=e=>An(e,V)||An(e,G)||An(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&On!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Bn=(e,n,l)=>/* @__PURE__ */J(O,{side:"right",content:On===e?Ee.noDropProducts:on(l),open:On===e||!On&&void 0,children:/* @__PURE__ */J("span",{children:n})}),Kn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Hn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Xe.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
2
2
  return K("div",{role:"none",className:"contents",children:[
3
3
  /* @__PURE__ */J(n,{label:Bn(r,e.name,t),level:a,icon:d&&o?X.folderOpen:X.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:nn&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>We(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Un(r),...Be?Kn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */J(l,{children:Hn(d,a+1,t)})]},e.id)}),Jn=(e,a)=>(Ye.get(e)??[]).map(e=>{const i=Ye.get(e.id),r=Xe.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
4
4
  return K("div",{role:"none",className:"contents",children:[
5
- /* @__PURE__ */J(n,{label:e.name,level:a,icon:i&&r?X.folderOpen:X.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:t||an&&q.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>We(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Tn===e.id?"into":void 0,dragging:Mn===e.id,draggable:Be&&!!Ce&&!fe.move,rename:t?/* @__PURE__ */J(m,{value:e.name,label:Ee.folderName,onDone:bn}):void 0,actions:Be&&o.length?/* @__PURE__ */J(I,{align:"end","aria-label":Ee.folderActions,trigger:X.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Pn(e.id,e.id),...Be?Kn({kind:"folder",id:e.id}):{},...Be&&Ce&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(G,e.id),Rn(e.id)},onDragEnd:()=>{Rn(null),Fn(null)}}:{}}}),i&&r&&/* @__PURE__ */J(l,{children:Jn(e.id,a+1)})]},e.id)}),Vn=Xe.has("@files"),Gn=Xe.has("@products"),Yn=/* @__PURE__ */K(e,{"aria-label":Ee.folders,children:[ne&&/* @__PURE__ */K(H,{children:[
5
+ /* @__PURE__ */J(n,{label:e.name,level:a,icon:i&&r?X.folderOpen:X.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:t||an&&q.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>We(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Tn===e.id?"into":void 0,dragging:Mn===e.id,draggable:Be&&!!Ce&&!fe.move,rename:t?/* @__PURE__ */J(p,{value:e.name,label:Ee.folderName,onDone:bn}):void 0,actions:Be&&o.length?/* @__PURE__ */J(I,{align:"end","aria-label":Ee.folderActions,trigger:X.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Pn(e.id,e.id),...Be?Kn({kind:"folder",id:e.id}):{},...Be&&Ce&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(G,e.id),Rn(e.id)},onDragEnd:()=>{Rn(null),Fn(null)}}:{}}}),i&&r&&/* @__PURE__ */J(l,{children:Jn(e.id,a+1)})]},e.id)}),Vn=Xe.has("@files"),Gn=Xe.has("@products"),Yn=/* @__PURE__ */K(e,{"aria-label":Ee.folders,children:[ne&&/* @__PURE__ */K(H,{children:[
6
6
  /* @__PURE__ */J(n,{label:Bn("@products",Ee.products),level:1,icon:X.lock,badge:{label:Ee.readOnlyBadge,tone:"neutral"},expanded:ne.length?Gn:void 0,onToggle:()=>We("@products"),selected:nn&&null==q.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Un("@products")}}),Gn&&ne.length>0&&/* @__PURE__ */J(l,{children:Hn(ne,2)})]}),
7
- /* @__PURE__ */J(n,{label:Ee.allFiles,level:1,icon:Vn?X.folderOpen:X.folder,count:le,countLabel:null!=le?Ee.fileCount(le):void 0,expanded:Ye.get(null)?.length?Vn:void 0,onToggle:()=>We("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Pn("@files",null)}}),Vn&&(Ye.get(null)?.length??0)>0&&/* @__PURE__ */J(l,{children:Jn(null,2)}),Be&&/* @__PURE__ */J(n,{label:Ee.trash,level:1,icon:X.trash,count:ae,countLabel:null!=ae?Ee.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Zn=(()=>{if(ln)return[{label:Ee.trash}];if(nn){const e=q.nodeId?Ve.get(q.nodeId)?.path??[]:[];return[{label:Ee.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=Ze(rn);return[{label:Ee.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Qn=nn?Ee.readOnly:fe.upload,Xn=!!be&&!ln&&!Qn,$n=S({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Xn,onAccept:e=>be?.(e,rn)}),Wn=nn?Ee.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[Be&&we&&!ln&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.folderPlus,onClick:()=>{wn(rn)},...qn(Wn),children:Ee.newFolder}),be&&!ln&&/* @__PURE__ */J(T,{variant:"primary",size:"sm",leftIcon:X.upload,onClick:()=>$n.open(),...qn(Qn),children:Ee.upload}),Be&&ln&&je&&ie.length>0&&/* @__PURE__ */J(T,{variant:"danger",size:"sm",onClick:je,...qn(fe.deleteForever),children:Ee.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */J("div",{style:{width:Je?void 0:i,flex:Je?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */J(h,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */J("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */J(N,{size:"sm",type:"search",leftIcon:X.search,placeholder:nn?Ee.searchProducts:Ee.search,"aria-label":nn?Ee.searchProducts:Ee.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ee.mediaType,oe.type,[{value:"all",label:Ee.allTypes},{value:"image",label:Ee.images},{value:"video",label:Ee.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ee.use,oe.use,[{value:"any",label:Ee.anyUse},{value:"email",label:Ee.emailOnly},{value:"website",label:Ee.websiteOnly},{value:"unused",label:Ee.notUsed}],nl("use"),130),de&&Be&&el(Ee.sort,oe.sort,[{value:"newest",label:Ee.newest},{value:"name",label:Ee.byName},{value:"size",label:Ee.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */J(g,{size:"sm",label:Ee.view,value:ce,onChange:ue,options:[{value:"grid",label:Ee.grid,icon:X.grid},{value:"list",label:Ee.list,icon:X.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ee.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:$.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ee.used(e.usedCount),count:e.usedCount,icon:$.link,tone:"active"}),e.email&&n.push({key:"e",label:Ee.email,icon:$.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ee.private,icon:$.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */J(z,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Be&&an&&!!Ce&&!fe.move,tl=!!Re&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[Y]:ol(e)}}:{}})),sl=Je?Math.max(72,Math.floor((He-24-16-1)/3)):112,cl=A(null),ul=k({containerRef:cl,enabled:Be&&!Je&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Ue){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},hl=ie.length?null:re?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.noMatches}):nn?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.trashEmpty}):!Xn||Ue?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.emptyFolder}):null,pl="list"===ce&&ie.length>0,fl=hl??(pl?/* @__PURE__ */J("ul",{role:"listbox","aria-multiselectable":Be||void 0,"aria-label":Ee.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */K("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Y,ol(e)),Re("start")}:void 0,onDragEnd:ol(e)?e=>Re("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
7
+ /* @__PURE__ */J(n,{label:Ee.allFiles,level:1,icon:Vn?X.folderOpen:X.folder,count:le,countLabel:null!=le?Ee.fileCount(le):void 0,expanded:Ye.get(null)?.length?Vn:void 0,onToggle:()=>We("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Pn("@files",null)}}),Vn&&(Ye.get(null)?.length??0)>0&&/* @__PURE__ */J(l,{children:Jn(null,2)}),Be&&/* @__PURE__ */J(n,{label:Ee.trash,level:1,icon:X.trash,count:ae,countLabel:null!=ae?Ee.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Zn=(()=>{if(ln)return[{label:Ee.trash}];if(nn){const e=q.nodeId?Ve.get(q.nodeId)?.path??[]:[];return[{label:Ee.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=Ze(rn);return[{label:Ee.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Qn=nn?Ee.readOnly:fe.upload,Xn=!!be&&!ln&&!Qn,$n=S({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Xn,onAccept:e=>be?.(e,rn)}),Wn=nn?Ee.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[Be&&we&&!ln&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.folderPlus,onClick:()=>{wn(rn)},...qn(Wn),children:Ee.newFolder}),be&&!ln&&/* @__PURE__ */J(T,{variant:"primary",size:"sm",leftIcon:X.upload,onClick:()=>$n.open(),...qn(Qn),children:Ee.upload}),Be&&ln&&je&&ie.length>0&&/* @__PURE__ */J(T,{variant:"danger",size:"sm",onClick:je,...qn(fe.deleteForever),children:Ee.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */J("div",{style:{width:Je?void 0:i,flex:Je?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */J(f,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */J("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */J(N,{size:"sm",type:"search",leftIcon:X.search,placeholder:nn?Ee.searchProducts:Ee.search,"aria-label":nn?Ee.searchProducts:Ee.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ee.mediaType,oe.type,[{value:"all",label:Ee.allTypes},{value:"image",label:Ee.images},{value:"video",label:Ee.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ee.use,oe.use,[{value:"any",label:Ee.anyUse},{value:"email",label:Ee.emailOnly},{value:"website",label:Ee.websiteOnly},{value:"unused",label:Ee.notUsed}],nl("use"),130),de&&Be&&el(Ee.sort,oe.sort,[{value:"newest",label:Ee.newest},{value:"name",label:Ee.byName},{value:"size",label:Ee.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */J(k,{size:"sm",label:Ee.view,value:ce,onChange:ue,options:[{value:"grid",label:Ee.grid,icon:X.grid},{value:"list",label:Ee.list,icon:X.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ee.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:$.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ee.used(e.usedCount),count:e.usedCount,icon:$.link,tone:"active"}),e.email&&n.push({key:"e",label:Ee.email,icon:$.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ee.private,icon:$.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */J(z,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Be&&an&&!!Ce&&!fe.move,tl=!!Re&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[Y]:ol(e)}}:{}})),sl=Je?Math.max(72,Math.floor((He-24-16-1)/3)):112,cl=A(null),ul=c({containerRef:cl,enabled:Be&&!Je&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Ue){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},hl=ie.length?null:re?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.noMatches}):nn?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.trashEmpty}):!Xn||Ue?/* @__PURE__ */J(i,{variant:"dashed",title:Ee.emptyFolder}):null,pl="list"===ce&&ie.length>0,fl=hl??(pl?/* @__PURE__ */J("ul",{role:"listbox","aria-multiselectable":Be||void 0,"aria-label":Ee.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */K("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Y,ol(e)),Re("start")}:void 0,onDragEnd:ol(e)?e=>Re("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
8
8
  /* @__PURE__ */J("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
9
9
  /* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
10
- /* @__PURE__ */J("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */J("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */J(p,{items:dl,readOnly:!Xn||Ue,onFiles:Xn&&!Ue?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?V:tl?Y:void 0,onDragOutChange:tl?e=>Re(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Be?zn:void 0,menuOnMedia:Be})),gl=u({count:un.length,kind:Cn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ce?.({kind:"files",ids:un},e.key===s?null:e.key)}),vl=L({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */J(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(H,{children:[X.folder,Ee.moveTo]}),items:gl,disabled:!!fe.move}),yl=Be&&un.length>1&&!nn?/* @__PURE__ */K("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
10
+ /* @__PURE__ */J("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */J("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */J(g,{items:dl,readOnly:!Xn||Ue,onFiles:Xn&&!Ue?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?V:tl?Y:void 0,onDragOutChange:tl?e=>Re(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Be?zn:void 0,menuOnMedia:Be})),gl=h({count:un.length,kind:Cn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ce?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=L({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */J(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(H,{children:[X.folder,Ee.moveTo]}),items:gl,disabled:!!fe.move}),yl=Be&&un.length>1&&!nn?/* @__PURE__ */K("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
11
11
  /* @__PURE__ */J(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ee.selected(un.length)}),/* @__PURE__ */K(H,ln?{children:[De&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.undo,onClick:()=>De(un),...qn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */J(T,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...qn(fe.deleteForever),children:Ee.deleteForever})]}:{children:[Ce&&kl,xe&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.edit,disabled:!0,children:Ee.rename}),Ne&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.trash,onClick:()=>Ne({kind:"files",ids:un}),...qn(fe.trash),children:Ee.moveFilesToTrash(un.length)})]}),
12
- /* @__PURE__ */J(T,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ee.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Ee.name,a?/* @__PURE__ */J(m,{value:e.name,label:Ee.fileName,onDone:bn}):e.name),l("type",Ee.type,e.typeLabel),l("size",Ee.size,e.sizeLabel),l("resolution",Ee.resolution,e.resolution),nn?(l("design",Ee.design,e.design),l("finish",Ee.finish,e.finish),l("angle",Ee.angleLug,e.angleLug),l("owner",Ee.owner,e.owner)):(l("added",Ee.addedBy,e.addedBy),l("folder",Ee.folder,e.folderPath)),l("used",Ee.usedIn,null!=e.usedCount?Ee.places(e.usedCount):void 0);const i=c({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
12
+ /* @__PURE__ */J(T,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ee.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Ee.name,a?/* @__PURE__ */J(p,{value:e.name,label:Ee.fileName,onDone:bn}):e.name),l("type",Ee.type,e.typeLabel),l("size",Ee.size,e.sizeLabel),l("resolution",Ee.resolution,e.resolution),nn?(l("design",Ee.design,e.design),l("finish",Ee.finish,e.finish),l("angle",Ee.angleLug,e.angleLug),l("owner",Ee.owner,e.owner)):(l("added",Ee.addedBy,e.addedBy),l("folder",Ee.folder,e.folderPath)),l("used",Ee.usedIn,null!=e.usedCount?Ee.places(e.usedCount):void 0);const i=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
13
13
  return K("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
14
14
  /* @__PURE__ */J("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */J(C,{tone:"neutral",title:Ee.readOnlyBadge,children:on(tn)}),
15
15
  /* @__PURE__ */J(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */K("div",{className:"flex gap-2",children:[
16
16
  /* @__PURE__ */J("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */J(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ee.fileUrl,onFocus:e=>e.currentTarget.select()})}),
17
- /* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.copy,onClick:()=>Dn.copyUrl(e.id),children:Ee.copyUrl})]}),an&&Be&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Ee.replace}),Te&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.crop,onClick:()=>Te(e.id),children:Ee.cropEdit}),Ce&&"submenu"===i?.type&&/* @__PURE__ */J(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(H,{children:[X.folder,Ee.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.edit,onClick:()=>yn({kind:"file",id:e.id}),...qn(fe.rename),children:Ee.rename}),Ne&&/* @__PURE__ */J(D,{"aria-label":Ee.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:X.trash})]}),ln&&Be&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */J(T,{variant:"primary",size:"sm",leftIcon:X.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */J(T,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...qn(fe.deleteForever),children:Ee.deleteForever})]}),nn&&Fe&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ee.openInDesign}),pe&&/* @__PURE__ */J(f,{items:pe})]})},wl=mn?mn.private?Ee.privateNoPick:mn.pickDisabledReason:void 0,xl=Ue?/* @__PURE__ */K("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
17
+ /* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.copy,onClick:()=>Dn.copyUrl(e.id),children:Ee.copyUrl})]}),an&&Be&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Ee.replace}),Te&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.crop,onClick:()=>Te(e.id),children:Ee.cropEdit}),Ce&&"submenu"===i?.type&&/* @__PURE__ */J(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(H,{children:[X.folder,Ee.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.edit,onClick:()=>yn({kind:"file",id:e.id}),...qn(fe.rename),children:Ee.rename}),Ne&&/* @__PURE__ */J(D,{"aria-label":Ee.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:X.trash})]}),ln&&Be&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */J(T,{variant:"primary",size:"sm",leftIcon:X.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */J(T,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...qn(fe.deleteForever),children:Ee.deleteForever})]}),nn&&Fe&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",leftIcon:X.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ee.openInDesign}),pe&&/* @__PURE__ */J(v,{items:pe})]})},wl=mn?mn.private?Ee.privateNoPick:mn.pickDisabledReason:void 0,xl=Ue?/* @__PURE__ */K("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
18
18
  /* @__PURE__ */J("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ee.oneChosen(mn.name):Ee.noneChosen}),
19
19
  /* @__PURE__ */K("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */J(T,{variant:"secondary",size:"sm",onClick:Le,children:Ee.cancel}),
20
20
  /* @__PURE__ */J(T,{variant:"primary",size:"sm",disabled:!mn,...qn(wl),onClick:()=>{mn&&!wl&&Oe?.(mn)},children:Ee.chooseImage})]})]}):null,Cl=Be&&!!mn,Nl=/* @__PURE__ */K("div",{className:"flex min-w-0 flex-col gap-3",children:[Me&&/* @__PURE__ */J(C,{tone:"neutral",children:Me}),
@@ -1,9 +1,9 @@
1
- import{CountBadge as e}from"./chunk-OM6VWUAZ.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:M=""}){const W=t();if(!a(j,P,A))return null;const I="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
1
+ import{CountBadge as e}from"./chunk-OM6VWUAZ.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as n,SettingAutoContext as a}from"./chunk-2NMW66P5.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:M=""}){const W=t();if(!i(j,P,A))return null;const I="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
2
  /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
3
- /* @__PURE__ */s("span",{className:"sr-only",children:W.settingView.edited})]}):null,T=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),M&&c.push(M);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
- /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),I]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
3
+ /* @__PURE__ */s("span",{className:"sr-only",children:W.settingView.edited})]}):null,T=null!=f&&!1!==f;if("compact"===k){const e=m(u),i=m(h);if(!e&&!i)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),M&&c.push(M);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
+ /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),I]}),y=e=>/* @__PURE__ */s(n.Provider,{value:t,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
5
5
  return r("div",{className:c.join(" "),children:[
6
- /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),T&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const V=c,F=void 0!==u||void 0===N&&null==h,H=null==u||""===u,J=y?"text-gray-500":"text-gray-800",O=H?"text-gray-400":y?"text-gray-500":"text-gray-900",S=`${V.text} font-medium ${J}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:S,children:l}):/* @__PURE__ */s("span",{id:g,className:S,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:H?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",V.pad,M].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${V.bodyTop} border-t border-line-subtle ${V.bodyPad}`,children:N});/* @__PURE__ */
6
+ /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),T&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),i&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const V=c,F=void 0!==u||void 0===N&&null==h,H=null==u||""===u,J=y?"text-gray-500":"text-gray-800",O=H?"text-gray-400":y?"text-gray-500":"text-gray-900",S=`${V.text} font-medium ${J}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:S,children:l}):/* @__PURE__ */s("span",{id:g,className:S,children:l}),z=/* @__PURE__ */s(n.Provider,{value:g,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:H?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",V.pad,M].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${V.bodyTop} border-t border-line-subtle ${V.bodyPad}`,children:N});/* @__PURE__ */
7
7
  return r("div",T?{className:B,children:[
8
8
  /* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
9
9
  /* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${J}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,I]})}),
@@ -0,0 +1 @@
1
+ var r="12.23.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-TLNZ5KEO.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],N=[800,1800],B=e=>{document.prerendering?C(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var O=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,U=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},K=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&U.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&O.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,N,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,N,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,N,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(K,"[redacted]").replace(J,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-MDVABA4H.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],A=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},P=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,H=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,O=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,D=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&H.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();A(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,P,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,P,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),A(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&O.test(e.app),n="string"==typeof e.release&&O.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:O.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(D,"[id]").replace(W,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -1,11 +1,11 @@
1
- import{MediaUploadField as e}from"./chunk-B4GCTNGM.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[R,C]=l(""),[H,I]=l(""),[A,F]=l(!1),[G,B]=l(!1),E=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),M=t().brandAsset,O=R||d||g||"",S=L?null:d?o:h,J=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const P=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
- return n("section",{"aria-label":M.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
1
+ import{MediaUploadField as e}from"./chunk-T2OSPUS6.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[R,H]=l(""),[I,S]=l(""),[A,C]=l(!1),[F,O]=l(!1),E=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),P=t().brandAsset,B=R||d||g||"",G=L?null:d?o:h,J=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const M=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
+ return n("section",{"aria-label":P.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
3
3
  /* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
4
- /* @__PURE__ */c(e,{value:O,onChange:()=>{},onFile:e=>{if(k)return;P();const r=URL.createObjectURL(e);j.current=r,U(e),C(r),I("")},label:p,hint:H||M.usedFor(b),error:H||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:A||G,disabled:k}),
4
+ /* @__PURE__ */c(e,{value:B,onChange:()=>{},onFile:e=>{if(k)return;M();const r=URL.createObjectURL(e);j.current=r,U(e),H(r),S("")},label:p,hint:I||P.usedFor(b),error:I||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:A||F,disabled:k}),
5
5
  /* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
6
- /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!A){F(!0),I("");try{await x(L),P(),U(null),C("")}catch(e){I(e instanceof Error?e.message:M.saveFailed(E,p))}finally{F(!1)}}},disabled:!L||k,loading:A,children:M.save(E,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!G){if(L)return P(),U(null),C(""),void I("");if(d){B(!0),I("");try{await f()}catch(e){I(e instanceof Error?e.message:M.removeFailed(E,p))}finally{B(!1)}}}},disabled:k,loading:G,children:L?M.discard:M.remove(E,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":M.previews(p),children:[
7
- /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:M.preview}),
8
- /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:O,alt:M.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:J,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
6
+ /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!A){C(!0),S("");try{await x(L),M(),U(null),H("")}catch(e){S(e instanceof Error?e.message:P.saveFailed(E,p))}finally{C(!1)}}},disabled:!L||k,loading:A,children:P.save(E,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!F){if(L)return M(),U(null),H(""),void S("");if(d){O(!0),S("");try{await f()}catch(e){S(e instanceof Error?e.message:P.removeFailed(E,p))}finally{O(!1)}}}},disabled:k,loading:F,children:L?P.discard:P.remove(E,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":P.previews(p),children:[
7
+ /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:P.preview}),
8
+ /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:B,alt:P.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:G,isLight:J,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
9
9
  return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
10
10
  /* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
11
11
  /* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
@@ -0,0 +1,11 @@
1
+ import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-232YPI2L.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-VLMBXPRM.js";import{TransferProgress as u}from"./chunk-FJVZ2W55.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-V4XR4MOS.js";import{Icon as p}from"./chunk-XZXFUZIK.js";import{useShellStrings as b}from"./chunk-JSHMIMAJ.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:F,label:$,hint:C,error:U,required:z,className:P,accept:I="image/*",maxSizeBytes:O,fit:H="cover",height:M,shape:q="rect",placeholder:B,cta:J,acceptHint:S,showFilename:V=!0,allowReplace:X=!0,allowRemove:D=!0,replaceLabel:K,removeLabel:W,busy:Z=!1,busyLabel:A,choosingLabel:Y,pickFailedLabel:_,progress:E,disabled:G=!1,kind:Q,onKindChange:T,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=M??(re?96:112),ne=J??te.cta,se=Q??(/video/.test(I)&&!/image/.test(I)?"video":"image"),le="string"==typeof W&&W?W:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=Z||ce,be=ce&&!Z?Y??te.choosing:A??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=G||pe,Ne=!!w&&(t(w,I)||w===ke),we=B??r(I,te),Le=K??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):F?F(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Fe=m({accept:I,maxSizeBytes:O,acceptHint:S,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:$e}=Fe,Ce=()=>{je||(R?ge():Fe.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Pe=G||!X&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[X&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Ce(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
+ /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
+ /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),D&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${N}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Ie=/* @__PURE__ */k("div",{...Fe.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",$e?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
4
+ /* @__PURE__ */x(a,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:H,objectPosition:ee||void 0}}),V&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:E,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
5
+ /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
6
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),S&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:S})]}),He=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>Ce(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:C?`${ve}-hint`:void 0,...Fe.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",je?"cursor-not-allowed opacity-60":"cursor-pointer",c(je)].join(" "),children:[
7
+ /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",$e?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
+ /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):Oe})]}),Me=re?He:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>Ce(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:C?`${ve}-hint`:void 0,...Fe.zoneProps,className:d($e,je,c(je)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):/* @__PURE__ */k(j,{children:[
9
+ /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Oe]})});/* @__PURE__ */
10
+ return k(i,{label:$,htmlFor:ve,hint:C,error:fe,required:z,className:P,children:[T&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(e,{value:se,onChange:e=>T(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Ie:Me,!R&&/* @__PURE__ */x("input",{...Fe.inputProps}),
11
+ /* @__PURE__ */x(h,{rejections:Fe.rejections})]})}export{w as MediaUploadField};
@@ -1,8 +1,8 @@
1
- import{SearchableSelect as e}from"./chunk-ZQ24H5UO.js";import{Select_default as a}from"./chunk-TM4CRQ3W.js";import{labelClasses as l}from"./chunk-EQKUFYX6.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-6RK6R3RY.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{Icon as o}from"./chunk-XZXFUZIK.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-JSHMIMAJ.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:C,readOnly:N,placeholder:F,className:j="",tidyAddress:O,addressAddon:E}=t,$=void 0!==t.onApply,A=u().link,T=y.isSafe??k,U=d(),z=c(null),M=c(null),[R,Y]=p({url:n}),D=$?R.url:n,[K,Q]=p(!1),[Z,W]=p(null),[H,P]=p(null),[S,X]=p(!1),B=c(null),I=c(()=>{});I.current=$?t.onCancel:()=>{},m(()=>{if($)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(I.current(),!0)},()=>z.current)},[$]),m(()=>{if(!$)return;const e=M.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const J=o??[{value:b,label:A.address,target:{type:"text"}}],L=Z&&Z.against===D?Z.kind:y.kindOf(D),V=J.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),q=V.find(e=>"text"===e.target.type),G=V.find(e=>e.value===L)??q??V[0];if(!G)return null;const _="text"!==G.target.type,ee=_?y.targetOf(D):D,ae=h(G.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:A.unavailable(e)}),re="select"===G.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(D):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=H&&H.against===D?H.text:D,se=_?D:O?O(oe.trim()).trim():oe.trim(),ue=$&&O?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!$||K);_&&S&&X(!1);const pe=(e,a)=>{$?Y({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{W(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{Q(!1);const a=e.trim();a?T(e)?(P({text:e,against:a}),me(a)):P({text:e,against:D}):(P({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===M.current||B.current?.contains(a)))return;if(X(!1),$||!O||N)return;const l=O(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!$||!se)return;if(!_&&de)return void Q(!0);const e=_&&R.url===se?R.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(l,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const a=r.some(e=>""===e.value);/* @__PURE__ */
2
- return f(e,{"aria-label":l,value:t,options:o,disabled:N,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
- return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:N,onChange:n})};let ke;if("text"===G.target.type)ke=/* @__PURE__ */f(r,{ref:M,id:`${U}-address`,size:"sm",type:"text",invalid:ce,"aria-label":A.address,"aria-describedby":ce?`${U}-why`:void 0,placeholder:F??A.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:N,onChange:e=>ve(e.target.value),onFocus:()=>X(!0),onBlur:ge,onKeyDown:O&&!$?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===G.target.type?G.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):G.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:G.target.placeholder},...be(e,ee)];ke=xe(G.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(A.linkType,G.value,V.map(e=>({value:e.value,label:e.label})),e=>{P(null),Q(!1);const a=V.find(a=>a.value===e);if(!a||"text"===a.target.type)return void W({kind:e,against:D});const l=h(a.target)[0];W({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&S&&!N&&"text"===G.target.type&&/* @__PURE__ */f("div",{ref:B,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe(A.filter,ne?.param??"",[{value:"",label:A.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(A.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${U}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:A.unsafe}),G.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:G.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:A.filterHint})]});if(!$)/* @__PURE__ */
1
+ import{SearchableSelect as e}from"./chunk-ZQ24H5UO.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-TM4CRQ3W.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-6RK6R3RY.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{Icon as o}from"./chunk-XZXFUZIK.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-JSHMIMAJ.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:C,readOnly:N,placeholder:F,className:j="",tidyAddress:O,addressAddon:E}=t,$=void 0!==t.onApply,A=u().link,T=y.isSafe??k,U=d(),z=c(null),M=c(null),[R,Y]=p({url:n}),D=$?R.url:n,[K,Q]=p(!1),[Z,W]=p(null),[H,P]=p(null),[S,X]=p(!1),B=c(null),I=c(()=>{});I.current=$?t.onCancel:()=>{},m(()=>{if($)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(I.current(),!0)},()=>z.current)},[$]),m(()=>{if(!$)return;const e=M.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const J=o??[{value:b,label:A.address,target:{type:"text"}}],L=Z&&Z.against===D?Z.kind:y.kindOf(D),V=J.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),q=V.find(e=>"text"===e.target.type),G=V.find(e=>e.value===L)??q??V[0];if(!G)return null;const _="text"!==G.target.type,ee=_?y.targetOf(D):D,ae=h(G.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:A.unavailable(e)}),re="select"===G.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(D):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=H&&H.against===D?H.text:D,se=_?D:O?O(oe.trim()).trim():oe.trim(),ue=$&&O?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!$||K);_&&S&&X(!1);const pe=(e,a)=>{$?Y({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{W(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{Q(!1);const a=e.trim();a?T(e)?(P({text:e,against:a}),me(a)):P({text:e,against:D}):(P({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===M.current||B.current?.contains(a)))return;if(X(!1),$||!O||N)return;const l=O(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!$||!se)return;if(!_&&de)return void Q(!0);const e=_&&R.url===se?R.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
2
+ return f(e,{"aria-label":a,value:t,options:o,disabled:N,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:N,onChange:n})};let ke;if("text"===G.target.type)ke=/* @__PURE__ */f(r,{ref:M,id:`${U}-address`,size:"sm",type:"text",invalid:ce,"aria-label":A.address,"aria-describedby":ce?`${U}-why`:void 0,placeholder:F??A.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:N,onChange:e=>ve(e.target.value),onFocus:()=>X(!0),onBlur:ge,onKeyDown:O&&!$?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===G.target.type?G.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):G.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:G.target.placeholder},...be(e,ee)];ke=xe(G.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(A.linkType,G.value,V.map(e=>({value:e.value,label:e.label})),e=>{P(null),Q(!1);const a=V.find(a=>a.value===e);if(!a||"text"===a.target.type)return void W({kind:e,against:D});const l=h(a.target)[0];W({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&S&&!N&&"text"===G.target.type&&/* @__PURE__ */f("div",{ref:B,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe(A.filter,ne?.param??"",[{value:"",label:A.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(A.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${U}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:A.unsafe}),G.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:G.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:A.filterHint})]});if(!$)/* @__PURE__ */
4
4
  return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:C?"group":void 0,"aria-label":C,children:ye});const we=t.onRemove;/* @__PURE__ */
5
- return v("div",{ref:z,role:"dialog","aria-label":C??A.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:l({inline:!0}),children:A.title}):/* @__PURE__ */f("label",{htmlFor:`${U}-address`,className:l({inline:!0}),children:A.title}),ye,
5
+ return v("div",{ref:z,role:"dialog","aria-label":C??A.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:A.title}):/* @__PURE__ */f("label",{htmlFor:`${U}-address`,className:a({inline:!0}),children:A.title}),ye,
6
6
  /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:A.remove}):null,
7
7
  /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
8
  /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>I.current(),children:A.cancel}),
@@ -1,9 +1,9 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-XQNZJNEJ.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-TLNZ5KEO.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),N=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:s}){const i=x[s],[h,w]=l(!1),v=m(()=>w(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,v,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):N,[j,Z]=a(b.partOf);/* @__PURE__ */
2
- return d(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-XQNZJNEJ.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-MDVABA4H.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function N({app:s}){const i=x[s],[h,N]=l(!1),v=m(()=>N(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,v,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,A]=a(b.partOf);/* @__PURE__ */
2
+ return d(t,{open:!0,onClose:()=>N(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
5
5
  /* @__PURE__ */d("p",{className:"text-2xs font-mono text-ink-faintest",children:b.version(i.version)}),
6
6
  /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
7
7
  /* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),Z]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{w as AboutApp,x as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),A]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{N as AboutApp,x as BUILTIN_APP_INFO};
@@ -0,0 +1 @@
1
+ import{motionSeconds as t}from"./chunk-AIJ3G6BD.js";var e=["none","fade","rise","scale","glide","bounce","flip","reveal","spin"],n=["glide","bounce","flip","reveal"],r=["top","bottom","left","right"],o="bottom",i="data-motion-entrance",a="--motion-entrance-duration",d="--motion-entrance-delay",s="data-motion-from",u="data-motion-state";function c(i,a,d,s){const u=e.includes(i)?i:"none",c=(t=>n.includes(t))(u)?r.includes(a)?a:o:null;return{kind:u,from:c,duration:t("entrance","duration",d),delay:t("entrance","delay",s)}}function f(t){if("none"===t.kind)return{attrs:{},style:{}};const e={[i]:t.kind};t.from&&(e[s]=t.from);const n={},r=c("fade");return t.duration!==r.duration&&(n[a]=`${t.duration}s`),t.delay!==r.delay&&(n[d]=`${t.delay}s`),{attrs:e,style:n}}function l(t){const e=()=>{};if("undefined"==typeof IntersectionObserver)return e;if(!t.getAttribute(i))return e;const n=window.innerHeight||document.documentElement.clientHeight;if(t.getBoundingClientRect().top<n)return e;t.setAttribute(u,"armed");const r=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){r.disconnect(),m(t);break}},{threshold:0});return r.observe(t),()=>{r.disconnect(),t.removeAttribute(u)}}function m(t){if(!t.getAttribute(i))return;t.removeAttribute(u),t.offsetWidth,t.setAttribute(u,"play");const e=n=>{n.target===t&&(t.removeAttribute(u),t.removeEventListener("animationend",e))};t.addEventListener("animationend",e)}export{i as ENTRANCE_ATTR,d as ENTRANCE_DELAY_VAR,a as ENTRANCE_DURATION_VAR,r as ENTRANCE_FROM,s as ENTRANCE_FROM_ATTR,o as ENTRANCE_FROM_DEFAULT,e as ENTRANCE_KINDS,n as ENTRANCE_KINDS_WITH_FROM,u as ENTRANCE_STATE_ATTR,l as armEntrance,f as entranceAttrs,m as playEntrance,c as readEntrance};
@@ -9,7 +9,7 @@ export { ROOT_THEME_ATTRIBUTES, RootThemeOptions, rootIsDark, watchRootTheme } f
9
9
  export { FOCAL_DEFAULT, FOCAL_NUDGE_COARSE, FOCAL_NUDGE_STEP, FocalPoint, focalFromRect, formatFocal, nudgeFocal, parseFocal } from '../forms/imageFocus.js';
10
10
  import { MotionRange } from '../motion/values.js';
11
11
  export { HOVER_MOTION, MOTION_EASING, MOTION_GROUPS, MOTION_TIMING, MotionEasing, MotionGroup, MotionTiming, TimedMotionGroup, motionSeconds, rotateDegrees } from '../motion/values.js';
12
- export { ENTRANCE_ATTR, ENTRANCE_FROM, ENTRANCE_FROM_ATTR, ENTRANCE_FROM_DEFAULT, ENTRANCE_KINDS, ENTRANCE_KINDS_WITH_FROM, ENTRANCE_STATE_ATTR, EntranceFrom, EntranceKind, EntranceValue, armEntrance, entranceAttrs, playEntrance, readEntrance } from '../motion/entrance.js';
12
+ export { ENTRANCE_ATTR, ENTRANCE_DELAY_VAR, ENTRANCE_DURATION_VAR, ENTRANCE_FROM, ENTRANCE_FROM_ATTR, ENTRANCE_FROM_DEFAULT, ENTRANCE_KINDS, ENTRANCE_KINDS_WITH_FROM, ENTRANCE_STATE_ATTR, EntranceFrom, EntranceKind, EntranceValue, armEntrance, entranceAttrs, playEntrance, readEntrance } from '../motion/entrance.js';
13
13
  export { B as BORDER_LINE_STYLES, a as BorderLineStyle } from '../borderLineStyles-C-W0uSzL.js';
14
14
  export { RowRule, ShowWhenCheck, ShowWhenContext, ShowWhenFactData, ShowWhenFacts, ShowWhenRule, ShowWhenValue, WithShowWhen, WithShowWhenFacts, addShowWhenFacts, isShown, lazyShowWhenContext, showWhenFactReaders, showWhenFactsContext, showWhenOf, shownForOption, truthy, withRowRules, withRowsShownWhen, withShowWhen, withShowWhenFacts } from '../forms/showWhenRule.js';
15
15
 
@@ -57,6 +57,31 @@ declare const SCROLL_ATTR = "data-motion-scroll";
57
57
  declare const PIN_ATTR = "data-motion-pin";
58
58
  /** The pinned section's frame: the part of the track that sticks to the screen. */
59
59
  declare const PIN_FRAME_ATTR = "data-motion-pin-frame";
60
+ /** A host's mark: this stuck box paints above the sections after it (`pinAttrs` `above`). */
61
+ declare const PIN_ABOVE_ATTR = "data-motion-pin-above";
62
+ /** A part's Zoom, as the scale it ends or starts on (`scrollAttrs`). */
63
+ declare const SCROLL_ZOOM_VAR = "--motion-zoom";
64
+ /** A Zoom part's focus point, `"x% y%"` (`scrollAttrs`). */
65
+ declare const SCROLL_ORIGIN_VAR = "--motion-origin";
66
+ /** A part's Start and End, 0-100 (`scrollAttrs`). */
67
+ declare const SCROLL_START_VAR = "--motion-scroll-start";
68
+ declare const SCROLL_END_VAR = "--motion-scroll-end";
69
+ /** A part's progress, 0-1, where the browser has no scroll timelines (`armScrollProgress`). */
70
+ declare const SCROLL_PROGRESS_VAR = "--motion-p";
71
+ /** A view's answer for a track: 1 = pinned (default), 0 = a plain section. */
72
+ declare const PIN_ON_VAR = "--motion-pin-on";
73
+ /** Where a pin stops, from the screen top (default 0px), both forms. */
74
+ declare const PIN_TOP_VAR = "--motion-pin-top";
75
+ /** A track's effect screens (`pinAttrs`; default `PIN_LENGTH.default`). */
76
+ declare const PIN_LENGTH_VAR = "--motion-pin-length";
77
+ /** The stick form's position in a view: sticky (default), or static where it is off. */
78
+ declare const PIN_POSITION_VAR = "--motion-pin-position";
79
+ /** A view's answer for a track: 1 = draw the stick look, 0 = the track (default). Written by `pinStickVars` only. */
80
+ declare const PIN_STICK_VAR = "--motion-pin-stick";
81
+ /** A track's position in a view: relative (default), sticky where it sticks. Written by `pinStickVars` only. */
82
+ declare const PIN_TRACK_POSITION_VAR = "--motion-pin-track-position";
83
+ /** The stack order of a box marked `PIN_ABOVE_ATTR` (default 30: over the later sections, under a host header and its page overlays). */
84
+ declare const PIN_ABOVE_Z_VAR = "--motion-pin-above-z";
60
85
  interface ScrollValue {
61
86
  readonly effect: ScrollEffect;
62
87
  /** Percent, inside `SCROLL_ZOOM`. */
@@ -94,15 +119,32 @@ declare function scrollAttrs(value: ScrollValue, origin?: string): {
94
119
  };
95
120
  /** A stored pin, read. Only `true` pins; the length clamps to `PIN_LENGTH`. */
96
121
  declare function readPin(on: unknown, length?: unknown): PinValue;
122
+ /**
123
+ * A view's stick answer for a track, as the values `motion.css` reads: stuck
124
+ * is `--motion-pin-stick: 1` AND `--motion-pin-track-position: sticky`, not
125
+ * stuck is `0` AND `relative` (the defaults, written out so a view rule can
126
+ * turn stick off where the base view has it on). CSS cannot turn a number
127
+ * into a position keyword, so the two always travel together. The one writer
128
+ * of both: a host with a different answer per view calls it once per view and
129
+ * puts the result in that view's rule; `pinAttrs` uses it for a track that
130
+ * sticks in every view.
131
+ */
132
+ declare function pinStickVars(stick: boolean): Record<string, string>;
97
133
  /**
98
134
  * What the pinned element carries. Off writes nothing. The track form writes a
99
- * length other than the default; the stick form has no length (the section is
100
- * its own frame). A host's stop and view answers go in its own stylesheet:
101
- * both forms read `--motion-pin-top`; the track reads `--motion-pin-on` and
102
- * `--motion-pin-length`; the stick form reads `--motion-pin-position` (it
103
- * ignores `--motion-pin-on`).
135
+ * length other than the default, and the stick values (`pinStickVars`) when
136
+ * `stick` says the track sticks in every view; the stick form has no length
137
+ * (the section is its own frame) and already sticks. A host's stop and view
138
+ * answers go in its own stylesheet: both forms read `--motion-pin-top`; the
139
+ * track reads `--motion-pin-on`, `--motion-pin-length` and the stick pair; the
140
+ * stick form reads `--motion-pin-position` (it ignores `--motion-pin-on`).
141
+ * `above` marks a stuck box that stays painted above the sections after it
142
+ * (a bar); a track takes the mark only where a view draws it stuck.
104
143
  */
105
- declare function pinAttrs(value: PinValue, form?: PinForm): {
144
+ declare function pinAttrs(value: PinValue, form?: PinForm, options?: {
145
+ readonly stick?: boolean;
146
+ readonly above?: boolean;
147
+ }): {
106
148
  attrs: Record<string, string>;
107
149
  style: Record<string, string>;
108
150
  };
@@ -161,4 +203,4 @@ type HoverKind = (typeof HOVER_KINDS)[number];
161
203
  /** The kinds of {@link HOVER_KINDS} in `offered`, in the list's order. */
162
204
  declare function hoverKindsOf<K extends HoverKind>(offered: readonly K[]): readonly K[];
163
205
 
164
- export { HOVER_KINDS, type HoverKind, type LayoutNode, MotionRange, PIN_ATTR, PIN_FORMS, PIN_FRAME_ATTR, PIN_LENGTH, type PinForm, type PinValue, SCROLL_ATTR, SCROLL_EFFECTS, SCROLL_EFFECTS_WITH_ZOOM, SCROLL_END, SCROLL_START, SCROLL_ZOOM, type ScrollBox, type ScrollEffect, type ScrollValue, armScrollProgress, hoverKindsOf, layoutBox, pinAttrs, readPin, readScroll, scrollAttrs, scrollProgress };
206
+ export { HOVER_KINDS, type HoverKind, type LayoutNode, MotionRange, PIN_ABOVE_ATTR, PIN_ABOVE_Z_VAR, PIN_ATTR, PIN_FORMS, PIN_FRAME_ATTR, PIN_LENGTH, PIN_LENGTH_VAR, PIN_ON_VAR, PIN_POSITION_VAR, PIN_STICK_VAR, PIN_TOP_VAR, PIN_TRACK_POSITION_VAR, type PinForm, type PinValue, SCROLL_ATTR, SCROLL_EFFECTS, SCROLL_EFFECTS_WITH_ZOOM, SCROLL_END, SCROLL_END_VAR, SCROLL_ORIGIN_VAR, SCROLL_PROGRESS_VAR, SCROLL_START, SCROLL_START_VAR, SCROLL_ZOOM, SCROLL_ZOOM_VAR, type ScrollBox, type ScrollEffect, type ScrollValue, armScrollProgress, hoverKindsOf, layoutBox, pinAttrs, pinStickVars, readPin, readScroll, scrollAttrs, scrollProgress };
@@ -1 +1 @@
1
- export{slugify}from"../chunk-24AL3CDS.js";export{ENTRANCE_ATTR,ENTRANCE_FROM,ENTRANCE_FROM_ATTR,ENTRANCE_FROM_DEFAULT,ENTRANCE_KINDS,ENTRANCE_KINDS_WITH_FROM,ENTRANCE_STATE_ATTR,armEntrance,entranceAttrs,playEntrance,readEntrance}from"../chunk-Q2SCJQ5H.js";export{HOVER_MOTION,MOTION_EASING,MOTION_GROUPS,MOTION_TIMING,motionSeconds,rotateDegrees}from"../chunk-AIJ3G6BD.js";export{hexWithAlpha,mixHex,rgbToHex}from"../chunk-CJSZW3OS.js";export{addShowWhenFacts,isShown,lazyShowWhenContext,showWhenFactReaders,showWhenFactsContext,showWhenOf,shownForOption,truthy,withRowRules,withRowsShownWhen,withShowWhen,withShowWhenFacts}from"../chunk-HCP7WOAL.js";export{BORDER_LINE_STYLES}from"../chunk-NOMWJTN2.js";export{contrastRatio,hexToRgb,parseHexColor,readableInk,relativeLuminance}from"../chunk-S6OB6HJB.js";export{FOCAL_DEFAULT,FOCAL_NUDGE_COARSE,FOCAL_NUDGE_STEP,focalFromRect,formatFocal,nudgeFocal,parseFocal}from"../chunk-25RR3GQW.js";export{fromDateKey,toDateKey}from"../chunk-2HMNOLKX.js";export{escapeHtml}from"../chunk-G6DKCCWH.js";export{currencyDecimals,currencySymbol,formatBytes,formatMoney,setCurrencyFormats,timeAgo}from"../chunk-GEYM4WN3.js";export{DATE_FORMAT_OPTIONS,TZ_AUTO,formatDate,formatDateTime,formatTime,getUserDateFormat,getUserTimezone,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile}from"../chunk-Y3JW2GW5.js";export{EMPTY_VALUE}from"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";export{ROOT_THEME_ATTRIBUTES,rootIsDark,watchRootTheme}from"../chunk-LNXBTK7Q.js";var t=["none","zoom-in","zoom-out","fade-in","fade-out","move-up","move-down","reveal","parallax"],e=["zoom-in","zoom-out"],o=(t,e,o,n)=>({default:t,min:e,max:o,step:n}),n=o(30,0,100,10),r=o(0,0,100,5),i=o(100,0,100,5),s=o(2,0,4,.5),a="data-motion-scroll",m="data-motion-pin",u="data-motion-pin-frame",c=["track","stick"],l=/^\s*-?\d+(\.\d+)?\s*$/;function f(t,e){const o="number"==typeof e?e:"string"==typeof e&&l.test(e)?Number(e):Number.NaN;if(!Number.isFinite(o))return t.default;const n=Math.min(t.max,Math.max(t.min,o)),r=Math.round(Number((n/t.step).toFixed(6)));return Number((r*t.step).toFixed(3))}function h(e,o,s,a){const m=t.includes(e)?e:"none",u=f(r,s),c=f(i,a);return{effect:m,zoom:f(n,o),start:Math.min(u,c),end:Math.max(u,c)}}function p(t,o){if("none"===t.effect)return{attrs:{},style:{}};const n={};var s;return s=t.effect,e.includes(s)&&(n["--motion-zoom"]=String(Number((1+t.zoom/100).toFixed(3))),o&&(n["--motion-origin"]=o)),t.start!==r.default&&(n["--motion-scroll-start"]=String(t.start)),t.end!==i.default&&(n["--motion-scroll-end"]=String(t.end)),{attrs:{[a]:t.effect},style:n}}function d(t,e){return{on:!0===t,length:f(s,e)}}function T(t,e="track"){if(!t.on)return{attrs:{},style:{}};if("stick"===e)return{attrs:{[m]:"stick"},style:{}};const o=t.length===s.default?{}:{"--motion-pin-length":String(t.length)};return{attrs:{[m]:""},style:o}}function N(t,e,o,n){let r;if(e){const t=e.length*e.vh;r=t>0?((e.stop??0)-e.top)/t:1}else r=(t.vh-t.top)/(t.vh+t.height);const i=o/100,s=n/100,a=s>i?(r-i)/(s-i):r>=s?1:0;return Math.min(1,Math.max(0,Number(a.toFixed(4))))}var E=(t,e)=>{const o=Number.parseFloat(t);return Number.isFinite(o)?o:e};function S(t=document){const e=()=>{};if("undefined"==typeof window||"undefined"==typeof CSS)return e;if(CSS.supports("animation-timeline: view()"))return e;let o=0;const n=()=>{o=0;const e=window.innerHeight||document.documentElement.clientHeight,n=[];for(const o of t.querySelectorAll(`[${a}]`)){if(o.hasAttribute("data-motion-entrance"))continue;const t=getComputedStyle(o),a=o.closest(`[${m}]:not([${m}="stick"])`),c=a?getComputedStyle(a):null,l=!!c&&0===E(c.getPropertyValue("--motion-pin-on"),1),f=g(l&&a?a:o,e),h=a?.querySelector(`[${u}]`),p=a&&!l?{...g(a,e),length:E(c.getPropertyValue("--motion-pin-length"),s.default),stop:h?E(getComputedStyle(h).top,0):0}:null;n.push({el:o,p:N({top:f.top,height:f.height,vh:e},p,E(t.getPropertyValue("--motion-scroll-start"),r.default),E(t.getPropertyValue("--motion-scroll-end"),i.default))})}for(const{el:t,p:e}of n)t.style.setProperty("--motion-p",String(e))},c=()=>{o||(o=requestAnimationFrame(n))};return n(),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c,{passive:!0}),()=>{o&&cancelAnimationFrame(o),window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}}function g(t,e,o=("undefined"==typeof window?0:window.scrollY)){let n=0;for(let e=t;e;e=e.offsetParent)n+=e.offsetTop;return{top:n-o,height:t.offsetHeight,vh:e}}var w=["none","nextImage","rotate","zoom","lift","mono"];function x(t){return w.filter(e=>t.includes(e))}export{w as HOVER_KINDS,m as PIN_ATTR,c as PIN_FORMS,u as PIN_FRAME_ATTR,s as PIN_LENGTH,a as SCROLL_ATTR,t as SCROLL_EFFECTS,e as SCROLL_EFFECTS_WITH_ZOOM,i as SCROLL_END,r as SCROLL_START,n as SCROLL_ZOOM,S as armScrollProgress,x as hoverKindsOf,g as layoutBox,T as pinAttrs,d as readPin,h as readScroll,p as scrollAttrs,N as scrollProgress};
1
+ export{slugify}from"../chunk-24AL3CDS.js";import{ENTRANCE_ATTR as t}from"../chunk-ZSEB7XW4.js";export{ENTRANCE_ATTR,ENTRANCE_DELAY_VAR,ENTRANCE_DURATION_VAR,ENTRANCE_FROM,ENTRANCE_FROM_ATTR,ENTRANCE_FROM_DEFAULT,ENTRANCE_KINDS,ENTRANCE_KINDS_WITH_FROM,ENTRANCE_STATE_ATTR,armEntrance,entranceAttrs,playEntrance,readEntrance}from"../chunk-ZSEB7XW4.js";export{HOVER_MOTION,MOTION_EASING,MOTION_GROUPS,MOTION_TIMING,motionSeconds,rotateDegrees}from"../chunk-AIJ3G6BD.js";export{hexWithAlpha,mixHex,rgbToHex}from"../chunk-CJSZW3OS.js";export{addShowWhenFacts,isShown,lazyShowWhenContext,showWhenFactReaders,showWhenFactsContext,showWhenOf,shownForOption,truthy,withRowRules,withRowsShownWhen,withShowWhen,withShowWhenFacts}from"../chunk-HCP7WOAL.js";export{fromDateKey,toDateKey}from"../chunk-2HMNOLKX.js";export{BORDER_LINE_STYLES}from"../chunk-NOMWJTN2.js";export{contrastRatio,hexToRgb,parseHexColor,readableInk,relativeLuminance}from"../chunk-S6OB6HJB.js";export{FOCAL_DEFAULT,FOCAL_NUDGE_COARSE,FOCAL_NUDGE_STEP,focalFromRect,formatFocal,nudgeFocal,parseFocal}from"../chunk-25RR3GQW.js";export{escapeHtml}from"../chunk-G6DKCCWH.js";export{currencyDecimals,currencySymbol,formatBytes,formatMoney,setCurrencyFormats,timeAgo}from"../chunk-GEYM4WN3.js";export{DATE_FORMAT_OPTIONS,TZ_AUTO,formatDate,formatDateTime,formatTime,getUserDateFormat,getUserTimezone,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile}from"../chunk-Y3JW2GW5.js";export{EMPTY_VALUE}from"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";export{ROOT_THEME_ATTRIBUTES,rootIsDark,watchRootTheme}from"../chunk-LNXBTK7Q.js";var e=["none","zoom-in","zoom-out","fade-in","fade-out","move-up","move-down","reveal","parallax"],o=["zoom-in","zoom-out"],n=(t,e,o,n)=>({default:t,min:e,max:o,step:n}),r=n(30,0,100,10),i=n(0,0,100,5),s=n(100,0,100,5),a=n(2,0,4,.5),m="data-motion-scroll",u="data-motion-pin",c="data-motion-pin-frame",l="data-motion-pin-above",f="--motion-zoom",h="--motion-origin",p="--motion-scroll-start",d="--motion-scroll-end",T="--motion-p",E="--motion-pin-on",N="--motion-pin-top",A="--motion-pin-length",S="--motion-pin-position",R="--motion-pin-stick",g="--motion-pin-track-position",y="--motion-pin-above-z",w=["track","stick"],x=/^\s*-?\d+(\.\d+)?\s*$/;function F(t,e){const o="number"==typeof e?e:"string"==typeof e&&x.test(e)?Number(e):Number.NaN;if(!Number.isFinite(o))return t.default;const n=Math.min(t.max,Math.max(t.min,o)),r=Math.round(Number((n/t.step).toFixed(6)));return Number((r*t.step).toFixed(3))}function O(t,o,n,a){const m=e.includes(t)?t:"none",u=F(i,n),c=F(s,a);return{effect:m,zoom:F(r,o),start:Math.min(u,c),end:Math.max(u,c)}}function _(t,e){if("none"===t.effect)return{attrs:{},style:{}};const n={};var r;return r=t.effect,o.includes(r)&&(n[f]=String(Number((1+t.zoom/100).toFixed(3))),e&&(n[h]=e)),t.start!==i.default&&(n[p]=String(t.start)),t.end!==s.default&&(n[d]=String(t.end)),{attrs:{[m]:t.effect},style:n}}function k(t,e){return{on:!0===t,length:F(a,e)}}function C(t){return t?{[R]:"1",[g]:"sticky"}:{[R]:"0",[g]:"relative"}}function v(t,e="track",o={}){if(!t.on)return{attrs:{},style:{}};const n=!0===o.above?{[l]:""}:{};if("stick"===e)return{attrs:{[u]:"stick",...n},style:{}};const r=t.length===a.default?{}:{[A]:String(t.length)};return{attrs:{[u]:"",...n},style:!0===o.stick?{...r,...C(!0)}:r}}function D(t,e,o,n){let r;if(e){const t=e.length*e.vh;r=t>0?((e.stop??0)-e.top)/t:1}else r=(t.vh-t.top)/(t.vh+t.height);const i=o/100,s=n/100,a=s>i?(r-i)/(s-i):r>=s?1:0;return Math.min(1,Math.max(0,Number(a.toFixed(4))))}var M=(t,e)=>{const o=Number.parseFloat(t);return Number.isFinite(o)?o:e};function W(e=document){const o=()=>{};if("undefined"==typeof window||"undefined"==typeof CSS)return o;if(CSS.supports("animation-timeline: view()"))return o;let n=0;const r=()=>{n=0;const o=window.innerHeight||document.documentElement.clientHeight,r=[];for(const n of e.querySelectorAll(`[${m}]`)){if(n.hasAttribute(t))continue;const e=getComputedStyle(n),m=n.closest(`[${u}]:not([${u}="stick"])`),l=m?getComputedStyle(m):null,f=!!l&&(0===M(l.getPropertyValue(E),1)||0!==M(l.getPropertyValue(R),0)),h=I(f&&m?m:n,o),T=m?.querySelector(`[${c}]`),N=m&&!f?{...I(m,o),length:M(l.getPropertyValue(A),a.default),stop:T?M(getComputedStyle(T).top,0):0}:null;r.push({el:n,p:D({top:h.top,height:h.height,vh:o},N,M(e.getPropertyValue(p),i.default),M(e.getPropertyValue(d),s.default))})}for(const{el:t,p:e}of r)t.style.setProperty(T,String(e))},l=()=>{n||(n=requestAnimationFrame(r))};return r(),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{n&&cancelAnimationFrame(n),window.removeEventListener("scroll",l),window.removeEventListener("resize",l)}}function I(t,e,o=("undefined"==typeof window?0:window.scrollY)){let n=0;for(let e=t;e;e=e.offsetParent)n+=e.offsetTop;return{top:n-o,height:t.offsetHeight,vh:e}}var L=["none","nextImage","rotate","zoom","lift","mono"];function b(t){return L.filter(e=>t.includes(e))}export{L as HOVER_KINDS,l as PIN_ABOVE_ATTR,y as PIN_ABOVE_Z_VAR,u as PIN_ATTR,w as PIN_FORMS,c as PIN_FRAME_ATTR,a as PIN_LENGTH,A as PIN_LENGTH_VAR,E as PIN_ON_VAR,S as PIN_POSITION_VAR,R as PIN_STICK_VAR,N as PIN_TOP_VAR,g as PIN_TRACK_POSITION_VAR,m as SCROLL_ATTR,e as SCROLL_EFFECTS,o as SCROLL_EFFECTS_WITH_ZOOM,s as SCROLL_END,d as SCROLL_END_VAR,h as SCROLL_ORIGIN_VAR,T as SCROLL_PROGRESS_VAR,i as SCROLL_START,p as SCROLL_START_VAR,r as SCROLL_ZOOM,f as SCROLL_ZOOM_VAR,W as armScrollProgress,b as hoverKindsOf,I as layoutBox,v as pinAttrs,C as pinStickVars,k as readPin,O as readScroll,_ as scrollAttrs,D as scrollProgress};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{BrandAssetEditor as default}from"../chunk-ME7XHU3P.js";import"../chunk-B4GCTNGM.js";import"../chunk-HNIIDDLJ.js";import"../chunk-EFKJLUYP.js";import"../chunk-232YPI2L.js";import"../chunk-6KBDNYRW.js";import"../chunk-MI67DI3H.js";import"../chunk-25RR3GQW.js";import"../chunk-VLMBXPRM.js";import"../chunk-FJVZ2W55.js";import"../chunk-V4XR4MOS.js";import"../chunk-JMGDGNM7.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{BrandAssetEditor as default}from"../chunk-QJWQ6OMF.js";import"../chunk-T2OSPUS6.js";import"../chunk-HNIIDDLJ.js";import"../chunk-EFKJLUYP.js";import"../chunk-6KBDNYRW.js";import"../chunk-232YPI2L.js";import"../chunk-25RR3GQW.js";import"../chunk-MI67DI3H.js";import"../chunk-VLMBXPRM.js";import"../chunk-FJVZ2W55.js";import"../chunk-V4XR4MOS.js";import"../chunk-JMGDGNM7.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{TextLinkField,LinkPicker as default}from"../chunk-TUPPFC74.js";import"../chunk-ZQ24H5UO.js";import"../chunk-TM4CRQ3W.js";import"../chunk-EO5RLFRX.js";import"../chunk-GLRRX4AL.js";import"../chunk-EQKUFYX6.js";import"../chunk-2NMW66P5.js";import"../chunk-UJUTS6LJ.js";import"../chunk-Z5TE3MEG.js";import"../chunk-6RK6R3RY.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-UGTRSRIW.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{TextLinkField,LinkPicker as default}from"../chunk-WLX24TG6.js";import"../chunk-ZQ24H5UO.js";import"../chunk-EQKUFYX6.js";import"../chunk-TM4CRQ3W.js";import"../chunk-EO5RLFRX.js";import"../chunk-GLRRX4AL.js";import"../chunk-2NMW66P5.js";import"../chunk-UJUTS6LJ.js";import"../chunk-Z5TE3MEG.js";import"../chunk-6RK6R3RY.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-UGTRSRIW.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{MEDIA_FILES_DRAG_TYPE,MEDIA_FILE_DRAG_TYPE,MEDIA_FOLDER_DRAG_TYPE,MediaLibrary as default,readMediaFileDrag}from"../chunk-JUXPKGO3.js";import"../chunk-OLCRYT3N.js";import"../chunk-RF3ZFTAU.js";import"../chunk-IC72MGON.js";import"../chunk-T2TZBTSM.js";import"../chunk-436PJFHC.js";import"../chunk-CGUMJZUB.js";import"../chunk-SACUSHVN.js";import"../chunk-UP4HLGMZ.js";import"../chunk-QMSINDXL.js";import"../chunk-VQ4X3OBR.js";import"../chunk-NOGSS432.js";import"../chunk-GEZM6ARD.js";import"../chunk-TM4CRQ3W.js";import"../chunk-EO5RLFRX.js";import"../chunk-GLRRX4AL.js";import"../chunk-OG53D3R5.js";import"../chunk-FQ4IRBMA.js";import"../chunk-2NMW66P5.js";import"../chunk-HNIIDDLJ.js";import"../chunk-EFKJLUYP.js";import"../chunk-6KBDNYRW.js";import"../chunk-VLKDWKVR.js";import"../chunk-OLFYNMTD.js";import"../chunk-LACL4MAR.js";import"../chunk-Y7KDCC6E.js";import"../chunk-CGZBDI6C.js";import"../chunk-6FZ5JTBY.js";import"../chunk-N3R6N7LG.js";import"../chunk-6RK6R3RY.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-VLMBXPRM.js";import"../chunk-FJVZ2W55.js";import"../chunk-V4XR4MOS.js";import"../chunk-MWTCGJAI.js";import"../chunk-RIG5FEVS.js";import"../chunk-5WK56FA3.js";import"../chunk-VWGWZY7A.js";import"../chunk-7QSDPSXP.js";import"../chunk-CJHYOHMU.js";import"../chunk-F3ZOO23R.js";import"../chunk-UGTRSRIW.js";import"../chunk-DWGYC7OD.js";import"../chunk-JMGDGNM7.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-3YBXA72C.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{MEDIA_FILES_DRAG_TYPE,MEDIA_FILE_DRAG_TYPE,MEDIA_FOLDER_DRAG_TYPE,MediaLibrary as default,readMediaFileDrag}from"../chunk-EEGTFJUQ.js";import"../chunk-OLCRYT3N.js";import"../chunk-RF3ZFTAU.js";import"../chunk-IC72MGON.js";import"../chunk-T2TZBTSM.js";import"../chunk-436PJFHC.js";import"../chunk-CGUMJZUB.js";import"../chunk-SACUSHVN.js";import"../chunk-UP4HLGMZ.js";import"../chunk-QMSINDXL.js";import"../chunk-VLKDWKVR.js";import"../chunk-OLFYNMTD.js";import"../chunk-LACL4MAR.js";import"../chunk-VQ4X3OBR.js";import"../chunk-NOGSS432.js";import"../chunk-GEZM6ARD.js";import"../chunk-TM4CRQ3W.js";import"../chunk-EO5RLFRX.js";import"../chunk-GLRRX4AL.js";import"../chunk-OG53D3R5.js";import"../chunk-FQ4IRBMA.js";import"../chunk-2NMW66P5.js";import"../chunk-HNIIDDLJ.js";import"../chunk-EFKJLUYP.js";import"../chunk-6KBDNYRW.js";import"../chunk-Y7KDCC6E.js";import"../chunk-CGZBDI6C.js";import"../chunk-6FZ5JTBY.js";import"../chunk-N3R6N7LG.js";import"../chunk-6RK6R3RY.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-VLMBXPRM.js";import"../chunk-FJVZ2W55.js";import"../chunk-V4XR4MOS.js";import"../chunk-MWTCGJAI.js";import"../chunk-RIG5FEVS.js";import"../chunk-5WK56FA3.js";import"../chunk-VWGWZY7A.js";import"../chunk-7QSDPSXP.js";import"../chunk-CJHYOHMU.js";import"../chunk-F3ZOO23R.js";import"../chunk-UGTRSRIW.js";import"../chunk-DWGYC7OD.js";import"../chunk-JMGDGNM7.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-3YBXA72C.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";