efficient-shell 16.2.0 → 16.3.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.
- package/dist/{Browser-WDTBITTV.js → Browser-FO7ICGJP.js} +14 -14
- package/dist/{Files-SVMIMC2S.js → Files-XUGJSFME.js} +28 -28
- package/dist/{Notepad-LDMCDXVA.js → Notepad-Q3YNHSWM.js} +7 -7
- package/dist/{Preview-2OIC2CV5.js → Preview-56C2XB7V.js} +18 -18
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-QCHG5ZKT.js → chunk-5L7II37P.js} +30 -30
- package/dist/chunk-CLFXMTD2.js +1 -0
- package/dist/{chunk-VUSH7MYA.js → chunk-EF75NNOR.js} +1 -1
- package/dist/chunk-F4KB3K3I.js +1 -0
- package/dist/{chunk-WSN5J6P4.js → chunk-HOSLX3ST.js} +3 -3
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/RenameField.d.ts +4 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/index.js +96 -96
- package/dist/routine-index.json +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6ZQC6XFU.js +0 -2
- package/dist/chunk-RZVODVGN.js +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-BTMZ5MUY.js";import{readStoredWidth as r,writeStoredWidth as a,ResizeHandle as i}from"./chunk-2KD6R2XF.js";import{ImageLightbox as t}from"./chunk-ONUNFTZD.js";import{MarqueeBox as o}from"./chunk-IC72MGON.js";import{Drawer as d}from"./chunk-AYTGYEOI.js";import{EmptyState as s}from"./chunk-W3454ZES.js";import{DescriptionList as c}from"./chunk-SACUSHVN.js";import{Breadcrumbs as u}from"./chunk-WREUA43Q.js";import{ROOT_KEY as m,mediaLibraryMenu as p}from"./chunk-UFJR63AO.js";import{useMediaMoveItems as h}from"./chunk-GRAFJD3L.js";import{RenameField as f}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
return
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
return
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-BTMZ5MUY.js";import{readStoredWidth as r,writeStoredWidth as a,ResizeHandle as i}from"./chunk-2KD6R2XF.js";import{ImageLightbox as t}from"./chunk-ONUNFTZD.js";import{MarqueeBox as o}from"./chunk-IC72MGON.js";import{Drawer as d}from"./chunk-AYTGYEOI.js";import{EmptyState as s}from"./chunk-W3454ZES.js";import{DescriptionList as c}from"./chunk-SACUSHVN.js";import{Breadcrumbs as u}from"./chunk-WREUA43Q.js";import{ROOT_KEY as m,mediaLibraryMenu as p}from"./chunk-UFJR63AO.js";import{useMediaMoveItems as h}from"./chunk-GRAFJD3L.js";import{RenameField as f}from"./chunk-F4KB3K3I.js";import{MediaUploadGrid as g}from"./chunk-B4Y5NGHR.js";import{MediaUsedInList as v}from"./chunk-XOEYCDWT.js";import{NativeSelect as k}from"./chunk-W7HTHKN2.js";import{useGridSelection as y}from"./chunk-VLKDWKVR.js";import{useMarquee as b}from"./chunk-OLFYNMTD.js";import{copyToClipboard as w}from"./chunk-452LT77I.js";import{Checkbox_default as x}from"./chunk-CGZBDI6C.js";import{Segmented as N}from"./chunk-TALQMTCE.js";import{useContextMenu as C,ContextMenu as I}from"./chunk-MF7OELXP.js";import{Banner as D}from"./chunk-OSMRYND3.js";import{Input_default as T}from"./chunk-BYTQRQ5P.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-TNGIXSTM.js";import{setModalDragAside as L,modalIdHolding as z}from"./chunk-EIFNESXS.js";import{ColoredBadge as F}from"./chunk-L2WQOJ3T.js";import{DropdownMenu as O}from"./chunk-NJY4HPNB.js";import{IconButton_default as E}from"./chunk-4YH7U7WL.js";import{Button_default as A}from"./chunk-37FQVY2O.js";import{Icon as M}from"./chunk-ISVODSRP.js";import{Tooltip as P}from"./chunk-CIZAUBWA.js";import{useBrowserState as R}from"./chunk-KEFNQEXZ.js";import{buttonClasses as U}from"./chunk-LYGIOJ3J.js";import{usePlotWidth as B}from"./chunk-MAFUXCPZ.js";import{useShellStrings as K}from"./chunk-NRHG4R2Q.js";import{useRef as W,useId as Y,useEffect as G,useMemo as H,useCallback as J,useState as Q}from"react";import{jsxs as V,Fragment as X,jsx as Z}from"react/jsx-runtime";var $="application/x-efficient-media-files",q="application/x-efficient-media-folder",_="application/x-efficient-media-file";function ee(e){if(!e||!Array.from(e.types).includes(_))return null;try{const n=JSON.parse(e.getData(_));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 ne="mediaLibrary.folderWidth",le={type:"all",use:"any",sort:"newest"},re={lock:/* @__PURE__ */Z(M,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */Z(M,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */Z(M,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */Z(M,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */Z(M,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */Z(M,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */Z(M,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */Z(M,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */Z(M,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */Z(M,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */Z(M,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */Z(M,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */Z(M,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */Z(M,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */Z(M,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */Z(M,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},ae={link:/* @__PURE__ */Z(M,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */Z(M,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */Z(M,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */Z(M,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function ie(M){const{mode:ee="manage",layout:ie="auto",location:te,onLocationChange:oe,folders:de,products:se,allFilesCount:ce,trashCount:ue,files:me,query:pe,onQueryChange:he,filters:fe=le,onFiltersChange:ge,extraFilters:ve,view:ke="grid",onViewChange:ye,selectedIds:be,onSelectionChange:we,usedIn:xe,denied:Ne={},accept:Ce="image/*,video/*",maxSizeBytes:Ie,busy:De,progress:Te,onUpload:Se,onNewFolder:je,onRename:Le,onMove:ze,onTrash:Fe,onDeleteFolder:Oe,onRestore:Ee,onDeleteForever:Ae,onEmptyTrash:Me,onReplace:Pe,onCropEdit:Re,onOpenInDesign:Ue,onChoose:Be,onCancel:Ke,pickNote:We,onDragOut:Ye,className:Ge=""}=M,He=K().mediaLibrary,Je=K().media,Qe="pick"===ee,Ve=!Qe,Xe=W(null),Ze=B(Xe,"phone"===ie?343:1200),$e="phone"===ie||"auto"===ie&&Ze<640,[qe,_e]=R(()=>r(ne,240,480)??280,280),en=Y();G(()=>{const e=window.setTimeout(()=>a(ne,qe),200);return()=>window.clearTimeout(e)},[qe]);const nn=H(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(se),[se]),ln=H(()=>new Map(de.map(e=>[e.id,e])),[de]),rn=H(()=>{const e=/* @__PURE__ */new Map;for(const n of de){const l=n.parentId&&ln.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[de,ln]),an=J(e=>{const n=[];for(let l=e?ln.get(e):void 0;l&&(n.unshift(l),!(n.length>de.length));l=l.parentId?ln.get(l.parentId):void 0);return n},[ln,de.length]),tn=J((e,n)=>an(e).some(e=>e.id===n),[an]),[on,dn]=Q(()=>/* @__PURE__ */new Set(["@files"])),sn=e=>dn(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),cn=J(e=>{dn(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),un="files"===(mn=te).place?`files:${mn.folderId??""}`:"products"===mn.place?`products:${mn.nodeId??""}`:"trash";var mn;G(()=>{if("files"===te.place)cn(["@files",...an(te.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===te.place){const e=te.nodeId?nn.get(te.nodeId)?.path??[]:[];cn(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[un]);const pn="products"===te.place,hn="trash"===te.place,fn="files"===te.place,gn=fn?te.folderId:null,vn=pn&&te.nodeId?nn.get(te.nodeId)?.path[0]:void 0,kn=e=>e?.sharedFrom?`${He.readOnly} ${He.editedAtHq(e.sharedFrom)}`:He.readOnly,yn=H(()=>me.map(e=>e.id),[me]),bn=H(()=>new Map(me.map(e=>[e.id,e])),[me]),wn=y(yn),xn=H(()=>yn.filter(e=>wn.selected.has(e)),[yn,wn.selected]),Nn=1===xn.length?bn.get(xn[0]):void 0,Cn=W(!0);G(()=>{Cn.current?Cn.current=!1:wn.clear()},[un]);const In=be?.join("\0");G(()=>{be&&wn.setSelection(be)},[In]);const Dn=W(In??""),Tn=xn.join("\0");G(()=>{Dn.current!==Tn&&(Dn.current=Tn,we?.(xn))},[Tn]);const Sn=(e,n={})=>{Qe?wn.select(e):wn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[jn,Ln]=Q(null),zn=e=>{const n=jn;if(Ln(null),!n||null==e)return;e!==("folder"===n.kind?ln.get(n.id)?.name:bn.get(n.id)?.name)&&Le?.(n,e)},Fn=async e=>{if(!je)return;const n=await je(e);cn(["@files",...e?[e]:[]]),"string"==typeof n&&Ln({kind:"folder",id:n})},On=J(e=>{const n=[],l=n=>{if("files"===e.kind)return n===gn&&fn?He.alreadyHere:void 0;const l=ln.get(e.id);return n===e.id||n&&tn(n,e.id)?He.notIntoItself:(l?.parentId??null)===n?He.folderAlreadyHere:void 0};n.push({key:m,label:He.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of rn.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[rn,ln,fn,tn,gn,He]),En=J(e=>{const n=new Set(e.map(e=>bn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[bn]),[An,Mn]=Q(null),Pn={words:He,media:Je,denied:Ne,moveTargets:On,kindOf:En,urlOf:e=>bn.get(e)?.url,newSubfolder:je&&Ve?e=>{Fn(e)}:void 0,rename:Le&&Ve?e=>{"file"!==e.kind||wn.isSelected(e.id)||wn.select(e.id),Ln(e)}:void 0,move:ze&&Ve?ze:void 0,trash:Fe&&Ve?Fe:void 0,deleteFolder:Oe&&Ve?Oe:void 0,folderNotEmpty:e=>!!ln.get(e)?.notEmpty,replace:Pe&&Ve?Pe:void 0,copyUrl:e=>{const n=bn.get(e)?.url;n&&w(He.urlLabel,n)},openInDesign:Ue,restore:Ee,deleteForever:Ae},Rn=e=>p(e,Pn),Un=C(),Bn=(e,n)=>{Qe||(wn.isSelected(e)||wn.select(e),Un.open(n,(e=>{const n=wn.isSelected(e)?xn:[e];return pn?{kind:"render",id:e}:hn?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Kn,Wn]=Q(null),[Yn,Gn]=Q(null),[Hn,Jn]=Q(null);G(()=>{if(!Yn&&!Kn)return;const e=()=>{Gn(null),Wn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Yn,Kn]);const Qn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Vn=(e,n)=>!(!ze||Ne.move||Qe)&&(!!Qn(e,$)||!(!Qn(e,q)||!Hn)&&(n!==Hn&&!(n&&tn(n,Hn)))),Xn=(e,n)=>({onDragEnter:l=>{Vn(l,n)&&(l.preventDefault(),Wn(e))},onDragOver:l=>{Vn(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Kn!==e&&Wn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Wn(n=>n===e?null:n)},onDrop:e=>{if(Vn(e,n))if(e.preventDefault(),Wn(null),Qn(e,$)){let l;try{l=JSON.parse(e.dataTransfer.getData($))}catch{l=null}Array.isArray(l)&&l.length&&ze({kind:"files",ids:l.map(String)},n)}else Hn&&(ze({kind:"folder",id:Hn},n),Jn(null))}}),Zn=e=>{const n=e=>Qn(e,$)||Qn(e,q)||Qn(e,"Files");return{onDragEnter:l=>{n(l)&&Gn(e)},onDragOver:l=>{n(l)&&Yn!==e&&Gn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Gn(n=>n===e?null:n)}}},$n=(e,n,l)=>/* @__PURE__ */Z(P,{side:"right",content:Yn===e?He.noDropProducts:kn(l),open:Yn===e||!Yn&&void 0,children:/* @__PURE__ */Z("span",{children:n})}),qn=e=>({onContextMenu:n=>{Un.open(n,e)}}),_n=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=on.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return V("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */Z(n,{label:$n(i,e.name,t),level:r,icon:d&&o?re.folderOpen:re.folder,count:e.count,countLabel:null!=e.count?e.countLabel??He.fileCount(e.count):void 0,selected:pn&&te.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>sn(i):void 0,onSelect:()=>oe({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Zn(i),...Ve?qn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */Z(l,{children:_n(d,r+1,t)})]},e.id)}),el=(e,r)=>(rn.get(e)??[]).map(e=>{const a=rn.get(e.id),i=on.has(e.id),t="folder"===jn?.kind&&jn.id===e.id,o=Rn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return V("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */Z(n,{label:e.name,level:r,icon:a&&i?re.folderOpen:re.folder,count:e.count,countLabel:null!=e.count?e.countLabel??He.fileCount(e.count):void 0,selected:t||fn&&te.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>sn(e.id):void 0,onSelect:()=>oe({place:"files",folderId:e.id}),drop:Kn===e.id?"into":void 0,dragging:Hn===e.id,draggable:Ve&&!!ze&&!Ne.move,rename:t?/* @__PURE__ */Z(f,{value:e.name,label:He.folderName,onDone:zn}):void 0,actions:Ve&&o.length?/* @__PURE__ */Z(O,{align:"end","aria-label":He.folderActions,trigger:re.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Xn(e.id,e.id),...Ve?qn({kind:"folder",id:e.id}):{},...Ve&&ze&&!Ne.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(q,e.id),Jn(e.id)},onDragEnd:()=>{Jn(null),Wn(null)}}:{}}}),a&&i&&/* @__PURE__ */Z(l,{children:el(e.id,r+1)})]},e.id)}),nl=on.has("@files"),ll=on.has("@products"),rl=/* @__PURE__ */V(e,{"aria-label":He.folders,children:[se&&/* @__PURE__ */V(X,{children:[
|
|
6
|
+
/* @__PURE__ */Z(n,{label:$n("@products",He.products),level:1,icon:re.lock,badge:{label:He.readOnlyBadge,tone:"neutral"},expanded:se.length?ll:void 0,onToggle:()=>sn("@products"),selected:pn&&null==te.nodeId,onSelect:()=>oe({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Zn("@products")}}),ll&&se.length>0&&/* @__PURE__ */Z(l,{children:_n(se,2)})]}),
|
|
7
|
+
/* @__PURE__ */Z(n,{label:He.allFiles,level:1,icon:nl?re.folderOpen:re.folder,count:ce,countLabel:null!=ce?He.fileCount(ce):void 0,expanded:rn.get(null)?.length?nl:void 0,onToggle:()=>sn("@files"),selected:fn&&null==te.folderId,onSelect:()=>oe({place:"files",folderId:null}),drop:"@files"===Kn?"into":void 0,rowProps:{"data-media-row":"@files",...Xn("@files",null)}}),nl&&(rn.get(null)?.length??0)>0&&/* @__PURE__ */Z(l,{children:el(null,2)}),Ve&&/* @__PURE__ */Z(n,{label:He.trash,level:1,icon:re.trash,count:ue,countLabel:null!=ue?He.fileCount(ue):void 0,selected:hn,onSelect:()=>oe({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),al=(()=>{if(hn)return[{label:He.trash}];if(pn){const e=te.nodeId?nn.get(te.nodeId)?.path??[]:[];return[{label:He.products,onClick:e.length?()=>oe({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>oe({place:"products",nodeId:n.id}):void 0}))]}const e=an(gn);return[{label:He.allFiles,onClick:e.length?()=>oe({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>oe({place:"files",folderId:n.id}):void 0}))]})(),il=pn?He.readOnly:Ne.upload,tl=!!Se&&!hn&&!il,ol=S({accept:Ce,maxSizeBytes:Ie,multiple:!0,disabled:!tl,onAccept:e=>Se?.(e,gn)}),dl=pn?He.noProductFolder:Ne.newFolder,sl=e=>e?{"aria-disabled":!0,disabledReason:e}:{},cl=/* @__PURE__ */V("div",{className:"flex flex-wrap items-center gap-2",children:[Ve&&je&&!hn&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.folderPlus,onClick:()=>{Fn(gn)},...sl(dl),children:He.newFolder}),Se&&!hn&&/* @__PURE__ */Z(A,{variant:"primary",size:"sm",leftIcon:re.upload,onClick:()=>ol.open(),...sl(il),children:He.upload}),Ve&&hn&&Me&&me.length>0&&/* @__PURE__ */Z(A,{variant:"danger",size:"sm",onClick:Me,...sl(Ne.deleteForever),children:He.emptyTrash})]}),ul=(e,n,l,r,a)=>/* @__PURE__ */Z("div",{style:{width:$e?void 0:a,flex:$e?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */Z(k,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),ml=e=>n=>ge?.({...fe,[e]:n}),pl=/* @__PURE__ */V("div",{className:"flex flex-wrap items-center gap-2",children:[he&&/* @__PURE__ */Z("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */Z(T,{size:"sm",type:"search",leftIcon:re.search,placeholder:pn?He.searchProducts:He.search,"aria-label":pn?He.searchProducts:He.search,value:pe??"",onChange:e=>he(e.target.value)})}),ge&&ul(He.mediaType,fe.type,[{value:"all",label:He.allTypes},{value:"image",label:He.images},{value:"video",label:He.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],ml("type"),130),ge&&!pn&&!hn&&ul(He.use,fe.use,[{value:"any",label:He.anyUse},{value:"email",label:He.emailOnly},{value:"website",label:He.websiteOnly},{value:"unused",label:He.notUsed}],ml("use"),130),ge&&Ve&&ul(He.sort,fe.sort,[{value:"newest",label:He.newest},{value:"name",label:He.byName},{value:"size",label:He.bySize}],ml("sort"),110),ve?.map(e=>ul(e.label,e.value,e.options,e.onChange,120)),ye&&/* @__PURE__ */Z(N,{size:"sm",label:He.view,value:ke,onChange:ye,options:[{value:"grid",label:He.grid,icon:re.grid},{value:"list",label:He.list,icon:re.list}]})]}),hl=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:He.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:ae.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:He.used(e.usedCount),count:e.usedCount,icon:ae.link,tone:"active"}),e.email&&n.push({key:"e",label:He.email,icon:ae.email,tone:"queued"}),e.private&&n.push({key:"p",label:He.private,icon:ae.lock,tone:"neutral"}),n},fl=e=>hl(e).map(e=>/* @__PURE__ */Z(F,{tone:e.tone,size:"xs",children:e.label},e.key)),gl=Ve&&fn&&!!ze&&!Ne.move,vl=!!Ye&&!hn,kl=W(""),yl=W(null),bl=()=>yl.current?.dropped?"dropped":"cancelled",wl=W(Ye);wl.current=Ye;const xl=J(e=>{const n=yl.current;n&&(yl.current=null,n.stop(),L(kl.current,!1),e&&wl.current?.(e))},[]),Nl=J(e=>{xl(bl());const n=Xe.current?.ownerDocument;if(!n)return;kl.current=z(Xe.current);const l=Xe.current?.closest("[data-modal-panel]"),r=e=>{kl.current&&!l?.contains(e.target)&&L(kl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=yl.current;if(e){if(a())return xl("dropped");e.dropped=!0,L(kl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;xl(n&&"none"!==n?"dropped":a()?bl():"cancelled")},o=()=>{a()&&xl(bl())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);yl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[xl]);G(()=>()=>xl(bl()),[xl]);const Cl=(e,n,l)=>{if("start"!==e)return;const r=bn.get(n);r&&Il(r)&&(Nl(l??null),Ye(e))},Il=e=>!vl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),Dl=me.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:hl(e),dragData:gl?JSON.stringify(wn.isSelected(e.id)?xn:[e.id]):Il(e),...gl&&Il(e)?{dragAlso:{[_]:Il(e)}}:{}})),Tl=$e?Math.max(72,Math.floor((Ze-24-16-1)/3)):112,Sl=W(null),jl=b({containerRef:Sl,enabled:Ve&&!$e&&me.length>0,selected:wn.selected,setSelection:e=>wn.setSelection(e),clearSelection:wn.clear}),Ll=e=>{if(Qe){const n=bn.get(e);return void(!n||n.private||n.pickDisabledReason||Be?.(n))}const n=yn.indexOf(e);n>=0&&Mn(n)},zl=me.length?null:pe?/* @__PURE__ */Z(s,{variant:"dashed",title:He.noMatches}):pn?/* @__PURE__ */Z(s,{variant:"dashed",title:He.emptyProducts,description:kn(vn)}):hn?/* @__PURE__ */Z(s,{variant:"dashed",title:He.trashEmpty}):!tl||Qe?/* @__PURE__ */Z(s,{variant:"dashed",title:He.emptyFolder}):null,Fl="list"===ke&&me.length>0,Ol=zl??(Fl?/* @__PURE__ */Z("ul",{role:"listbox","aria-multiselectable":Ve||void 0,"aria-label":He.folders,className:"flex flex-col gap-1",children:me.map(e=>/* @__PURE__ */V("li",{role:"option","aria-selected":wn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>Sn(e.id,n),onDoubleClick:()=>Ll(e.id),onContextMenu:n=>Bn(e.id,n),draggable:!!Il(e)||void 0,onDragStart:Il(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(_,Il(e)),Cl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),Sn(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)] "+(wn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */Z("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */Z("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */Z("span",{className:"flex shrink-0 items-center gap-1",children:fl(e)}),e.sizeLabel&&/* @__PURE__ */Z("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */Z(g,{items:Dl,readOnly:!tl||Qe,onFiles:tl&&!Qe?e=>Se(e,gn):void 0,accept:Ce,maxSizeBytes:Ie,busy:De,progress:Te,fit:"contain",thumbSize:Tl,dragType:gl?$:vl?_:void 0,onDragOutChange:vl?(e,n,l)=>Cl(e,n,l):void 0,selected:wn.selected,onItemClick:Sn,onItemDoubleClick:Ll,onItemContextMenu:Ve?Bn:void 0,menuOnMedia:Ve})),El=h({count:xn.length,kind:En(xn),targets:On({kind:"files",ids:xn}),onPick:e=>ze?.({kind:"files",ids:xn},e.key===m?null:e.key)}),Al=U({variant:"secondary",size:"sm"}),Ml=/* @__PURE__ */Z(O,{align:"start",triggerClassName:Al,trigger:/* @__PURE__ */V(X,{children:[re.folder,He.moveTo]}),items:El,disabled:!!Ne.move}),Pl=Ve&&xn.length>1&&!pn?/* @__PURE__ */V("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */Z(x,{checked:xn.length===me.length,indeterminate:xn.length<me.length,onChange:e=>e?wn.selectAll():wn.clear(),label:He.selected(xn.length)}),/* @__PURE__ */V(X,hn?{children:[Ee&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.undo,onClick:()=>Ee(xn),...sl(Ne.restore),children:He.restore}),Ae&&/* @__PURE__ */Z(A,{variant:"secondary-danger",size:"sm",onClick:()=>Ae(xn),...sl(Ne.deleteForever),children:He.deleteForever})]}:{children:[ze&&Ml,Le&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.edit,disabled:!0,children:He.rename}),Fe&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.trash,onClick:()=>Fe({kind:"files",ids:xn}),...sl(Ne.trash),children:He.moveFilesToTrash(xn.length)})]}),
|
|
12
|
+
/* @__PURE__ */Z(A,{variant:"ghost",size:"sm",onClick:wn.clear,children:He.clearSelection})]}):null,Rl=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===jn?.kind&&jn.id===e.id;l("name",He.name,r?/* @__PURE__ */Z(f,{value:e.name,label:He.fileName,onDone:zn}):e.name),l("type",He.type,e.typeLabel),l("size",He.size,e.sizeLabel),l("resolution",He.resolution,e.resolution),pn?(l("design",He.design,e.design),l("finish",He.finish,e.finish),l("angle",He.angleLug,e.angleLug),l("owner",He.owner,e.owner)):(l("added",He.addedBy,e.addedBy),l("folder",He.folder,e.folderPath)),l("used",He.usedIn,null!=e.usedCount?He.places(e.usedCount):void 0);const a=p({kind:"files",ids:[e.id]},Pn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return V("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */Z("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),pn&&/* @__PURE__ */Z(D,{tone:"neutral",title:He.readOnlyBadge,children:kn(vn)}),
|
|
15
|
+
/* @__PURE__ */Z(c,{size:"sm",columns:1,items:n}),!hn&&/* @__PURE__ */V("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */Z("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */Z(T,{size:"sm",readOnly:!0,value:e.url,"aria-label":He.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.copy,onClick:()=>Pn.copyUrl(e.id),children:He.copyUrl})]}),fn&&Ve&&/* @__PURE__ */V("div",{className:"flex flex-wrap gap-2",children:[Pe&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.swap,onClick:()=>Pe(e.id),...sl(Ne.replace),children:He.replace}),Re&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.crop,onClick:()=>Re(e.id),children:He.cropEdit}),ze&&"submenu"===a?.type&&/* @__PURE__ */Z(O,{align:"start",triggerClassName:Al,trigger:/* @__PURE__ */V(X,{children:[re.folder,He.moveTo]}),items:a.items,disabled:!!Ne.move}),Le&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.edit,onClick:()=>Ln({kind:"file",id:e.id}),...sl(Ne.rename),children:He.rename}),Fe&&/* @__PURE__ */Z(E,{"aria-label":He.moveToTrash,size:"sm",onClick:()=>Fe({kind:"files",ids:[e.id]}),disabledReason:Ne.trash,"aria-disabled":!!Ne.trash||void 0,children:re.trash})]}),hn&&Ve&&/* @__PURE__ */V("div",{className:"flex flex-wrap gap-2",children:[Ee&&/* @__PURE__ */Z(A,{variant:"primary",size:"sm",leftIcon:re.undo,onClick:()=>Ee([e.id]),...sl(Ne.restore),children:He.restore}),Ae&&/* @__PURE__ */Z(A,{variant:"danger",size:"sm",onClick:()=>Ae([e.id]),...sl(Ne.deleteForever),children:He.deleteForever})]}),pn&&Ue&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",leftIcon:re.external,onClick:()=>Ue({kind:"render",id:e.id}),children:He.openInDesign}),xe&&/* @__PURE__ */Z(v,{items:xe})]})},Ul=Nn?Nn.private?He.privateNoPick:Nn.pickDisabledReason:void 0,Bl=Qe?/* @__PURE__ */V("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
|
+
/* @__PURE__ */Z("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:Nn?He.oneChosen(Nn.name):He.noneChosen}),
|
|
19
|
+
/* @__PURE__ */V("div",{className:"flex gap-2",children:[Ke&&/* @__PURE__ */Z(A,{variant:"secondary",size:"sm",onClick:Ke,children:He.cancel}),
|
|
20
|
+
/* @__PURE__ */Z(A,{variant:"primary",size:"sm",disabled:!Nn,...sl(Ul),onClick:()=>{Nn&&!Ul&&Be?.(Nn)},children:He.chooseImage})]})]}):null,Kl=Ve&&!!Nn,Wl=Math.max(240,Math.min(480,Ze-360-(Kl?300:0))),Yl=Math.min(qe,Wl),Gl=/* @__PURE__ */V("div",{className:"flex min-w-0 flex-col gap-3",children:[We&&/* @__PURE__ */Z(D,{tone:"neutral",children:We}),
|
|
21
|
+
/* @__PURE__ */V("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */Z(u,{items:al}),cl]}),pl,Pl,
|
|
23
|
+
/* @__PURE__ */V("div",{ref:Sl,className:"relative",onPointerDown:jl.onPointerDown,onKeyDown:e=>{Ve&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),wn.selectAll()):"Escape"===e.key&&wn.size&&wn.clear()},children:[Ol,
|
|
24
|
+
/* @__PURE__ */Z(o,{rect:jl.rect})]}),tl&&/* @__PURE__ */Z("input",{...ol.inputProps}),
|
|
25
|
+
/* @__PURE__ */Z(j,{rejections:ol.rejections})]});/* @__PURE__ */
|
|
26
|
+
return V("div",{ref:Xe,"data-media-library":"","data-layout":$e?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ge}`.trim(),children:[/* @__PURE__ */V("div",$e?{className:"flex flex-col gap-3 p-3",children:[rl,Gl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */V("div",{"data-media-folder-column":"",className:"relative flex shrink-0 border-r border-line",style:{width:Yl},children:[
|
|
28
|
+
/* @__PURE__ */Z("div",{id:en,className:"min-w-0 flex-1 overflow-y-auto p-3",style:{"--rosh-tree-ground":"var(--surface)"},children:rl}),
|
|
29
|
+
/* @__PURE__ */Z(i,{side:"left",width:Yl,onResize:_e,min:240,max:Wl,defaultWidth:280,controls:en})]}),
|
|
30
|
+
/* @__PURE__ */Z("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Gl}),Kl&&/* @__PURE__ */Z("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:Rl(Nn)})]}),Bl,$e&&/* @__PURE__ */Z(d,{open:Kl,onClose:wn.clear,side:"bottom",title:Nn?.name,children:Nn&&Rl(Nn)}),Un.state&&/* @__PURE__ */Z(I,{...Un.props,items:Rn(Un.state.data)}),null!=An&&me.length>0&&/* @__PURE__ */Z(t,{images:me.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(An,me.length-1),onClose:()=>Mn(null)})]})}export{$ as MEDIA_FILES_DRAG_TYPE,_ as MEDIA_FILE_DRAG_TYPE,q as MEDIA_FOLDER_DRAG_TYPE,ie as MediaLibrary,ee as readMediaFileDrag};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="16.3.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-RZVODVGN.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],P=(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)})},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})}},R=[200,500],F=(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,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,R,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,R,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?E(()=>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}},V=/[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,K=/\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&&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);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;_(()=>{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),F(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(V,"[redacted]").replace(J,"[redacted]").replace(K,"[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
|
+
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-CLFXMTD2.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],P=(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)})},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,_=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)}}},F=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})}},Z=[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,Z,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)=>{F(()=>{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,Z,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/_:.\-[\]{}*@~]+$/,O=/^[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}},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,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\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,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(X,"").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=Q.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&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").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;F(()=>{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,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&&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(J,"[redacted]").replace(K,"[redacted]").replace(D,"[url]").replace(V,"[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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input_default as e}from"./chunk-BYTQRQ5P.js";import{useState as r,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";function o({value:o,label:a,onDone:i,appearance:c="field"}){const[l,u]=r(o),p=n(!1),s=e=>{p.current||(p.current=!0,i(e))},m={autoFocus:!0,"aria-label":a,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),s(l.trim()||o)):"Escape"===e.key&&(e.preventDefault(),s(null))},onBlur:()=>s(l.trim()||o),onClick:e=>e.stopPropagation()};return"inline"===c?/* @__PURE__ */t("input",{...m,type:"text","data-rename-inline":"",className:"m-0 block w-full min-w-0 appearance-none rounded-none border-0 border-b border-accent-border bg-transparent p-0 [font:inherit] [letter-spacing:inherit] text-inherit rosh-focus-ring",onFocus:e=>{const r=e.currentTarget.value.length;e.currentTarget.setSelectionRange(r,r)}}):/* @__PURE__ */t(e,{size:"sm",...m,onFocus:e=>e.currentTarget.select()})}export{o as RenameField};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-XNPCOWOO.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-
|
|
2
|
-
return d(t,{open:!0,onClose:()=>
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-XNPCOWOO.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-CLFXMTD2.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-NRHG4R2Q.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.5.1",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.1",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,C]=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"}),
|
|
9
|
+
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),C]}),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};
|
|
@@ -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-
|
|
2
|
+
export{MEDIA_FILES_DRAG_TYPE,MEDIA_FILE_DRAG_TYPE,MEDIA_FOLDER_DRAG_TYPE,MediaLibrary as default,readMediaFileDrag}from"../chunk-5L7II37P.js";import"../chunk-BTMZ5MUY.js";import"../chunk-5B7CLXHC.js";import"../chunk-2KD6R2XF.js";import"../chunk-ONUNFTZD.js";import"../chunk-CGUMJZUB.js";import"../chunk-IC72MGON.js";import"../chunk-AYTGYEOI.js";import"../chunk-W3454ZES.js";import"../chunk-SACUSHVN.js";import"../chunk-WREUA43Q.js";import"../chunk-UFJR63AO.js";import"../chunk-GRAFJD3L.js";import"../chunk-F4KB3K3I.js";import"../chunk-B4Y5NGHR.js";import"../chunk-XOEYCDWT.js";import"../chunk-W7HTHKN2.js";import"../chunk-EO5RLFRX.js";import"../chunk-GML6FVPA.js";import"../chunk-6KBDNYRW.js";import"../chunk-2NMW66P5.js";import"../chunk-VLKDWKVR.js";import"../chunk-OLFYNMTD.js";import"../chunk-LACL4MAR.js";import"../chunk-452LT77I.js";import"../chunk-CGZBDI6C.js";import"../chunk-TALQMTCE.js";import"../chunk-EFKJLUYP.js";import"../chunk-MF7OELXP.js";import"../chunk-OSMRYND3.js";import"../chunk-BYTQRQ5P.js";import"../chunk-AYZY3YNC.js";import"../chunk-TAIH2VIW.js";import"../chunk-TAB3K2WF.js";import"../chunk-TNGIXSTM.js";import"../chunk-EIFNESXS.js";import"../chunk-PO2KNVCC.js";import"../chunk-CJ4OEY3T.js";import"../chunk-LLXI57MB.js";import"../chunk-NQWORKZD.js";import"../chunk-VWGWZY7A.js";import"../chunk-DBQNYJZ6.js";import"../chunk-L2WQOJ3T.js";import"../chunk-UGTRSRIW.js";import"../chunk-F3ZOO23R.js";import"../chunk-NJY4HPNB.js";import"../chunk-PM6HY5BH.js";import"../chunk-DWGYC7OD.js";import"../chunk-4YH7U7WL.js";import"../chunk-ABIWAS5K.js";import"../chunk-P56YLT73.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-37FQVY2O.js";import"../chunk-TSZPGDU3.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-FAPZFMS3.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-VLT4ZEHT.js";import"../chunk-LYGIOJ3J.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -7,7 +7,10 @@ interface RenameFieldProps {
|
|
|
7
7
|
label: string;
|
|
8
8
|
/** The kept name, or `null` when Escape dropped the draft. */
|
|
9
9
|
onDone: (name: string | null) => void;
|
|
10
|
+
/** `field` (default): the kit's small input. `inline`: no box, the
|
|
11
|
+
* surrounding font, caret at the end. */
|
|
12
|
+
appearance?: 'field' | 'inline';
|
|
10
13
|
}
|
|
11
|
-
declare function RenameField({ value, label, onDone }: RenameFieldProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function RenameField({ value, label, onDone, appearance }: RenameFieldProps): react_jsx_runtime.JSX.Element;
|
|
12
15
|
|
|
13
16
|
export { type RenameFieldProps, RenameField as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{RenameField as default}from"../chunk-
|
|
2
|
+
export{RenameField as default}from"../chunk-F4KB3K3I.js";import"../chunk-BYTQRQ5P.js";import"../chunk-AYZY3YNC.js";import"../chunk-NJY4HPNB.js";import"../chunk-PM6HY5BH.js";import"../chunk-DWGYC7OD.js";import"../chunk-4YH7U7WL.js";import"../chunk-P56YLT73.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-TSZPGDU3.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-LYGIOJ3J.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";
|