efficient-shell 7.29.0 → 7.30.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/THIRD_PARTY_NOTICES.md +130 -0
- package/dist/{Browser-5DWPCWSB.js → Browser-7CW6GBAM.js} +14 -14
- package/dist/Calculator-DQZGGP2K.js +29 -0
- package/dist/ConfirmDialog-VQWA4FJP.js +1 -0
- package/dist/{CurrencyConverter-TVIYMDYE.js → CurrencyConverter-MU7GOOUX.js} +12 -12
- package/dist/{Documents-ZHENRDK2.js → Documents-XGAKQCM6.js} +12 -12
- package/dist/{Files-YKUTWABM.js → Files-ENPGM6CG.js} +49 -49
- package/dist/{Notepad-7MXZE6S4.js → Notepad-JVHWK2O3.js} +14 -14
- package/dist/PdfViewer-ATYZB7RS.js +1 -0
- package/dist/{PomodoroTimer-IUPEDDQV.js → PomodoroTimer-LTN3OMBD.js} +20 -20
- package/dist/{Preview-6XGCKFXK.js → Preview-UWVSCZ2A.js} +41 -41
- package/dist/Sidebar-TAEAB6AF.js +44 -0
- package/dist/{Spreadsheet-POFCH3DZ.js → Spreadsheet-CWZWUFBJ.js} +13 -13
- package/dist/{Stock-MKUCNEAH.js → Stock-NUJG2IAB.js} +3 -3
- package/dist/{Weather-6Q7DSJR4.js → Weather-DG7HC4TT.js} +15 -15
- package/dist/{WorldClock-LTJJP4SS.js → WorldClock-M4BQE7D6.js} +3 -3
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-YO4FRA7Y.js → chunk-5MKWCHMD.js} +9 -9
- package/dist/{chunk-EFYGUYEZ.js → chunk-6YNWFATP.js} +2 -2
- package/dist/{chunk-C4QIJNW3.js → chunk-7VJ3J7EH.js} +15 -15
- package/dist/{chunk-IIIUHK3J.js → chunk-AAOAQKB4.js} +11 -11
- package/dist/{chunk-GNW45MGV.js → chunk-AEJQC7GF.js} +9 -9
- package/dist/{chunk-H3ODY2XB.js → chunk-E5DFGCAL.js} +3 -3
- package/dist/{chunk-JIHKEOLY.js → chunk-EQI47WNM.js} +1 -1
- package/dist/{chunk-REZ2UWJT.js → chunk-HTHLFM24.js} +65 -65
- package/dist/chunk-IAEWRSF7.js +1035 -0
- package/dist/{chunk-OD3MT6SF.js → chunk-IQW3EDEB.js} +2 -2
- package/dist/{chunk-B427NVDP.js → chunk-KMSAHFLP.js} +3 -3
- package/dist/{chunk-4EMCPU7W.js → chunk-LTH3NJTS.js} +18 -18
- package/dist/{chunk-Y6UUDJNU.js → chunk-MDD5DHF2.js} +2 -2
- package/dist/{chunk-MZHH3MC7.js → chunk-T4HEQXBK.js} +1 -1
- package/dist/{chunk-DFEO2CGF.js → chunk-TGXWSTRC.js} +1 -1
- package/dist/{chunk-T3UAIICC.js → chunk-XDM6YBBX.js} +1 -1
- package/dist/chunk-XT7UUKFA.js +1 -0
- package/dist/chunk-YHP3JWUC.js +1 -0
- package/dist/{chunk-X6ALQ2S6.js → chunk-ZUQIYFNG.js} +5 -5
- package/dist/{chunk-GPHWFPXA.js → chunk-ZX5MQM4I.js} +1 -1
- package/dist/icons/efficient-looks.d.ts +1 -1
- package/dist/icons/efficient.d.ts +1 -1
- package/dist/icons/iconoir.d.ts +6 -0
- package/dist/icons/iconoir.js +777 -0
- package/dist/icons/index.d.ts +44 -3
- package/dist/icons/index.js +1 -1
- package/dist/icons/lucide.d.ts +6 -0
- package/dist/icons/lucide.js +1057 -0
- package/dist/icons/phosphor.d.ts +6 -0
- package/dist/icons/phosphor.js +251 -0
- package/dist/icons/tabler.d.ts +6 -0
- package/dist/icons/tabler.js +1173 -0
- package/dist/{index-CLkh3Bps.d.ts → index-cU2t_ZWe.d.ts} +18 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +682 -678
- package/dist/map/index.js +10 -10
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{registry-Dw6QO2Ch.d.ts → registry-IyW-xYGB.d.ts} +3 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +1 -1
- package/package.json +25 -1
- package/dist/Calculator-756J7AGT.js +0 -29
- package/dist/ConfirmDialog-GY3PLMAD.js +0 -1
- package/dist/PdfViewer-T6SP6R6J.js +0 -1
- package/dist/Sidebar-P3WJQSY5.js +0 -44
- package/dist/chunk-D47VEYIW.js +0 -1
- package/dist/chunk-LKFJPLTO.js +0 -1035
- package/dist/chunk-V5MNUKAJ.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{
|
|
2
|
-
return u(
|
|
3
|
-
return u(
|
|
4
|
-
return u(
|
|
5
|
-
return u(
|
|
1
|
+
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{Icon as r}from"./chunk-KMSAHFLP.js";import{useShellStrings as n}from"./chunk-2PNYIWIN.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)",f="(max-width: 767px)";function m(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}var h=()=>m(d),w=()=>m(f);function g(){return!1}var p=e=>y(d,e),v=e=>y(f,e);function y(e,t){if("undefined"==typeof window||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?(r.addEventListener("change",t),()=>r.removeEventListener("change",t)):(r.addListener(t),()=>r.removeListener(t))}function x(){return i(p,h,g)}function b(){return i(v,w,g)}var _={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},S={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},C={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function D({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
2
|
+
return u(r,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
|
+
return u(r,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
|
+
return u(r,{name:"error",...t});default:/* @__PURE__ */
|
|
5
|
+
return u(r,{name:"info",...t})}}function E({status:e="info",title:t,subTitle:r,extra:o,icon:i,children:a,className:s=""}){const c=_[e],d=n().errors;/* @__PURE__ */
|
|
6
6
|
return l("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
|
|
7
|
-
/* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${
|
|
8
|
-
/* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??
|
|
9
|
-
return u("kbd",{className:[
|
|
10
|
-
return u(
|
|
7
|
+
/* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${S[c]}`,children:i??/* @__PURE__ */u(D,{tone:c})}),
|
|
8
|
+
/* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??C[e]?.(d)??""}),r&&/* @__PURE__ */u("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:r}),a&&/* @__PURE__ */u("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},N=L?0:1,T=M.MOD[N],A=M.ALT[N],k="⇧",I="⏎",H=M.CMD_ENTER[N],j=M.CMD_S[N],F=M.CMD_K[N],P=M.CMD_DOT[N],Z=M.CMD_A[N],O=M.CMD_Z[N],K=M.CMD_SHIFT_Z[N],R=M.ALT_SHIFT_D[N],z=M.ALT_SHIFT_E[N],J=M.ALT_SHIFT_N[N],U=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function W(t){return e()?t:U.get(t)??t}var $={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},B={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function Y({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=W(e);/* @__PURE__ */
|
|
9
|
+
return u("kbd",{className:[$[r],B[t],n].filter(Boolean).join(" "),children:o})}var q=o(null);function G({value:e,children:t}){/* @__PURE__ */
|
|
10
|
+
return u(q.Provider,{value:e,children:t})}function Q(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var V={prefs:{},save:()=>{}};function X(){return s(q)??V}function ee(){const{prefs:e,save:t}=X(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var te="react-os-shell:stale-chunk-reload-at",re=3e4,ne="vite:preloadError",oe="/_next/static/",ie=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ae(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ie.test(t)}function se(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(te),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?oe:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(te),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(te,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ae(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(ne,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(ne,s),d&&window.removeEventListener("error",d,!0)}}export{A as ALT,R as ALT_SHIFT_D,z as ALT_SHIFT_E,J as ALT_SHIFT_N,Z as CMD_A,P as CMD_DOT,H as CMD_ENTER,F as CMD_K,j as CMD_S,K as CMD_SHIFT_Z,O as CMD_Z,I as ENTER,Y as Kbd,T as MOD,oe as NEXT_CHUNK_PATH_PREFIX,E as Result,k as SHIFT,re as STALE_CHUNK_RELOAD_COOLDOWN_MS,te as STALE_CHUNK_RELOAD_KEY,G as ShellPrefsProvider,ne as VITE_PRELOAD_ERROR_EVENT,se as installStaleChunkReload,L as isMac,ae as isStaleChunkError,x as useIsMobile,b as useIsPhone,Q as useLocalStoragePrefs,ee as useShellPrefs,X as useShellPrefsAdapter,W as useShortcutLabel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{navVisible as e,isReachable as t,visibleChildren as r,isSection as n}from"./chunk-5A7MWTXX.js";import{LoadingSpinner as a}from"./chunk-NVFKXL52.js";import{
|
|
1
|
+
import{navVisible as e,isReachable as t,visibleChildren as r,isSection as n}from"./chunk-5A7MWTXX.js";import{LoadingSpinner as a}from"./chunk-NVFKXL52.js";import{useDismissPopupsOnOpen as s}from"./chunk-UVBK6YSR.js";import{isAriaDisabled as l,swallowPress as o,describedByWith as i,OffWithReason as c}from"./chunk-WOZ36LPR.js";import{glassStyle as d}from"./chunk-7IQ3B77H.js";import{Z_LAYERS as u}from"./chunk-FIEA5CGB.js";import{iconButtonClasses as p}from"./chunk-K7PQXJO7.js";import{useShellStrings as y}from"./chunk-2PNYIWIN.js";import{forwardRef as f,useId as m,useState as h,useEffect as b,useRef as g,useMemo as k,useCallback as v}from"react";import{jsx as x,jsxs as w}from"react/jsx-runtime";import{createPortal as N}from"react-dom";var L=f(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",pressed:s,disabledReason:d,ink:u,disabled:y,onClick:f,"aria-disabled":h,"aria-describedby":b,...g},k){const v=m(),w=(Boolean(y)||l(h))&&null!=d&&""!==d,N=w||l(h),L=/* @__PURE__ */x("button",{ref:k,type:n,className:p({variant:t,size:r,pressed:s??(!0===g["aria-pressed"]||"true"===g["aria-pressed"]),ink:u,className:a}),...g,disabled:w?void 0:y,"aria-disabled":!!N||h,"aria-describedby":i(b,w?v:void 0),onClick:N?o:f,children:e});return w?/* @__PURE__ */x(c,{reason:d,id:v,children:L}):L}),_={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function A(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function C(e,t,r){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===r?"plate-dark":"bare":"dark"===r?"plate-light":"bare"}var I={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function $(e,t,r){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:r}}function E({src:e,fallbackSrc:t,fallbackHasAlpha:r=null,fallbackIsLight:n=null,fallbackAdaptive:a,alt:s,slot:l="compact",surface:o="light",size:i,width:c,height:d,decorative:u=!1,fallbackMode:p="monogram",adaptive:y=!1,hasAlpha:f=null,isLight:m=null,treatmentPadding:g=4,treatmentRadius:k=8,className:v="",style:w}){const[N,L]=h(e||t||"");b(()=>{L(e||t||"")},[e,t]);const E=Boolean(t&&N===t&&N!==e),j=(E?a??y:y)?C(E?r:f,E?n:m,o):"bare",T=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==i&&null==c&&null==d?_[l]:"","dark"===o?"text-white":"text-gray-700",I[j],v].filter(Boolean).join(" "),S={...$(j,k,g),...null==i?{width:c,height:d}:{width:i,height:i},...w};return N?/* @__PURE__ */x("span",{className:T,"data-brand-treatment":j,style:S,children:/* @__PURE__ */x("img",{src:N,alt:u?"":s,"data-brand-slot":l,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>L(e=>t&&e!==t?t:"")})}):"none"===p?null:/* @__PURE__ */x("span",{"data-brand-fallback":!0,"data-brand-slot":l,"aria-label":u?void 0:s,"aria-hidden":u||void 0,role:u?void 0:"img",className:`${T} rounded-md bg-gray-100 font-semibold`,style:S,children:u?null:A(s)})}function j(r,n){return e(r,n)?r.items.filter(r=>e(r,n)&&t(r,n)):[]}function T(e,n){return r(e,n).filter(e=>t(e,n))}function S(r,a,s){const l=new Set(a.erp),o=new Set(a.system),i=new Set(a.footer??[]),c=r.filter(n),d=e=>c.filter(t=>e.has(t.label)&&j(t,s).length>0);return{topItems:r.filter(e=>!n(e)).filter(r=>e(r,s)&&t(r,s)),erpSections:d(l),systemSections:d(o),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(r=>e(r,s)&&t(r,s))}}function M(e,t,r){return!!t&&e.some(e=>e.to===t||M(T(e,r),t,r))}var R="__page__";function K(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const r=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:r.get("search")??""}}function B(e,t,r){const n=function(e,t){const r=[],n=e=>{const a=T(e,t);0===a.length?r.push(e):a.forEach(n)};e.topItems.forEach(n);for(const r of[...e.erpSections,...e.systemSections,...e.footerSections])j(r,t).forEach(n);for(const t of e.virtualSections)t.items.forEach(n);return e.footerItems.forEach(n),r}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,s=[];for(const e of n){const n=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!n.toLowerCase().includes(t)||(a.add(e.to),s.push({type:r,label:e.label,entity_type:R,entity_id:e.to}))}return s.slice(0,8)},{destinations:n})}function P(e,t){if(!Array.isArray(e))return[];const r=[];for(const n of e){if(!n||"string"!=typeof n.entityType||"string"!=typeof n.entityId||"string"!=typeof n.label)continue;if("preview-file"===n.entityType)continue;const e="page"===n.entityType;r.push({type:e?t:"",label:n.label,entity_type:e?R:n.entityType,entity_id:n.entityId})}return r}var D="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function z(e){return e.typeKey??e.type}function F(e,t){return t?.[z(e)]??e.type}function H(e,t,r){return 0===r.length?null:{key:e,title:t,rows:r.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:r.length}}function U(e,t,r,n){return{type:e,label:t,entity_type:R,entity_id:`${r}?search=${encodeURIComponent(n.trim())}`}}function W(e,t,r,n,a){const s=function(e){const t=/* @__PURE__ */new Map;for(const r of e){const e=z(r),n=t.get(e);n?n.results.push(r):t.set(e,{type:r.type,results:[r]})}return Array.from(t,([e,t])=>({key:e,...t}))}(e).map(e=>{const t=e.results.map((t,r)=>({kind:"result",key:`result:${e.key}:${t.entity_type}:${t.entity_id}:${r}`,label:t.label,sub:t.sub,result:t})),n=!!a?.truncatedTypes?.includes(e.key),s=n?a?.listRoutes?.[e.key]:void 0,l=a?.typeLabels?.[e.key]??e.type;if(a&&s){const n=a.seeAllLabel(s.label);t.push({kind:"seeAll",key:`seeall:${e.key}`,label:n,result:U(l,n,s.path,r)})}return{key:`type:${e.key}`,title:l,rows:t,count:e.results.length,truncated:n}}),l=H("actions",n,function(e,t){const r=t.trim().toLowerCase();return e&&r?e.filter(e=>e.label.toLowerCase().includes(r)||(e.keywords??[]).some(e=>e.toLowerCase().includes(r))):[]}(t,r));return l?[...s,l]:s}function O(e,t,r){return 0===r?0:Math.min(Math.max(e+t,0),r-1)}var X=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function V(e,t,r=8){return[t,...e.filter(e=>!X(e,t))].slice(0,r)}function G(e){if(!Array.isArray(e))return[];const t=[];for(const r of e){if(!r||"object"!=typeof r)continue;const e=r;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const n={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(n.sub=e.sub),"string"==typeof e.typeKey&&(n.typeKey=e.typeKey),t.some(e=>X(e,n))||t.push(n)}return t.slice(0,8)}function Q(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var Y=[];function q(e,t,r){const[n,a]=h([]),[s,l]=h(Y),[o,i]=h(!1),[c,d]=h("none"),u=g(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());b(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(Y),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...Q(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:v(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(Y),d("none"),i(!1)},[])}}var J=(e,t)=>`${e}-opt-${t}`;function Z(e,t){if("seeAll"===e.kind)return"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3";if("action"===e.kind)return e.icon??D;if(e.icon)return e.icon;const r=t?.[z(e.result)];return r||D}function ee({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
2
|
return x("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */w("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
|
|
3
3
|
/* @__PURE__ */w("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
4
4
|
/* @__PURE__ */x("span",{children:e.title}),
|
|
@@ -6,7 +6,7 @@ return x("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.m
|
|
|
6
6
|
return w("div",{id:J(r,n),role:"option","aria-selected":s,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(s?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>o(n),children:[
|
|
7
7
|
/* @__PURE__ */x("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:Z(e,a)})}),
|
|
8
8
|
/* @__PURE__ */w("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
-
/* @__PURE__ */x("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */x("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */x("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-gray-500",children:l})]},e.key)})]},e.key))})}var te="react-os-shell:open-global-search";function re(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(te))}function ne({providers:e,typeIcons:t,typeLabels:r,listRoutes:n,placeholder:
|
|
9
|
+
/* @__PURE__ */x("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */x("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */x("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-gray-500",children:l})]},e.key)})]},e.key))})}var te="react-os-shell:open-global-search";function re(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(te))}function ne({providers:e,typeIcons:t,typeLabels:r,listRoutes:n,placeholder:l,quickActions:o,onSelect:i,recent:c,onRecord:p,favorites:f,hotkey:L=!0}={}){const _=y().search,A=l??_.placeholder,[C,I]=h(!1),[$,E]=h(""),[j,T]=h(0),S=g(null),{results:M,truncatedTypes:R,loading:K,failure:B,reset:P}=q($,e,2);b(()=>{const e=e=>{L&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),I(e=>!e)),"Escape"===e.key&&C&&I(!1)},t=()=>I(!0);return window.addEventListener("keydown",e),window.addEventListener(te,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(te,t)}},[C,L]),s(C);const[z,U]=h(!1);C!==z&&(U(C),C&&(E(""),T(0),P())),b(()=>{C?setTimeout(()=>S.current?.focus(),50):E("")},[C]),b(()=>{T(0)},[M]);const X=$.length>=2,V=k(()=>X?W(M,o,$,_.actions,{truncatedTypes:R,listRoutes:n,typeLabels:r,seeAllLabel:_.seeAll}):function(e,t){const r=[];e.recent?.length&&r.push({key:"recent",title:t.recent,rows:e.recent.map((t,r)=>({kind:"recent",key:`recent:${t.entity_type}:${t.entity_id}:${r}`,label:t.label,sub:t.sub,badge:F(t,e.typeLabels),result:t})),count:e.recent.length}),e.favorites?.length&&r.push({key:"favorites",title:t.favorites,rows:e.favorites.map((t,r)=>({kind:"favorite",key:`favorite:${t.entity_type}:${t.entity_id}:${r}`,label:t.label,sub:t.sub,badge:F(t,e.typeLabels)||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:t})),count:e.favorites.length});const n=H("actions",t.actions,e.actions??[]);return n&&r.push(n),r}({recent:c,favorites:f,actions:o,typeLabels:r},_),[X,M,R,n,r,o,$,c,f,_]),G=k(()=>function(e){return e.flatMap(e=>e.rows)}(V),[V]),Q=Math.min(j,Math.max(G.length-1,0)),Y=m(),Z=G.length>0;b(()=>{C&&0!==G.length&&document.getElementById(J(Y,Q))?.scrollIntoView?.({block:"nearest"})},[C,Q,G.length,Y]);const re=v(e=>{I(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||p?.(e.result),i?.(e.result)):e.action.onSelect()},[i,p]);return C?N(
|
|
10
10
|
/* @__PURE__ */w("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>I(!1),children:[
|
|
11
11
|
/* @__PURE__ */x("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
12
|
/* @__PURE__ */w("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:d(),children:[
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-BTLM7W6P.js";import{LoadingSpinner as t}from"./chunk-NVFKXL52.js";import{
|
|
2
|
-
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=
|
|
1
|
+
import{toast_default as e}from"./chunk-BTLM7W6P.js";import{LoadingSpinner as t}from"./chunk-NVFKXL52.js";import{Icon as n}from"./chunk-KMSAHFLP.js";import{useShellStrings as r}from"./chunk-2PNYIWIN.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
|
|
2
|
+
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),N=i(null),C=i(null),[M,j]=s(null),[E,P]=s(1),[z,L]=s(0),[W,_]=s(1),[D,S]=s(!0),[T,$]=s(!0),A=i(x.loadFailed);A.current=x.loadFailed,l(()=>{let t=!1;return $(!0),P(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),L(e.numPages),$(!1))}).catch(()=>{t||(e.error(A.current),$(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!D||!C.current)return;const e=()=>{const e=C.current;e&&M.getPage(E).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});_(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[M,E,D,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:W}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=N.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,W]),l(()=>{const e=()=>N.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===d?x.fitPage:x.fitWidth,F="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */m(f,{children:[
|
|
5
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>P(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(
|
|
5
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>P(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(n,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
6
|
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,z)}),
|
|
7
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:E>=z,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(
|
|
7
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:E>=z,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(n,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),
|
|
10
|
-
/* @__PURE__ */m("select",{value:
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:O}),!
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),
|
|
13
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),_(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:D?"fit":v.includes(Math.round(100*W))?Math.round(100*W):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(S(!1),_(Number(t)/100)):S(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
|
|
11
|
+
/* @__PURE__ */u("option",{value:"fit",children:O}),!D&&!v.includes(Math.round(100*W))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*W),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),_(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":D,className:F+(D?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!
|
|
16
|
-
/* @__PURE__ */u(
|
|
17
|
-
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:
|
|
18
|
-
/* @__PURE__ */u(
|
|
19
|
-
/* @__PURE__ */u(
|
|
20
|
-
/* @__PURE__ */u("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=z;e++)n.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:F,children:[
|
|
16
|
+
/* @__PURE__ */u(n,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
|
|
17
|
+
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:F,children:[
|
|
18
|
+
/* @__PURE__ */u(n,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:F,children:[
|
|
19
|
+
/* @__PURE__ */u(n,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
|
|
20
|
+
/* @__PURE__ */u("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<z?(e.preventDefault(),P(e=>Math.min(z,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<z&&(e.preventDefault(),P(e=>Math.min(z,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),P(1)):"End"===e.key&&(e.preventDefault(),P(z)))},children:T?/* @__PURE__ */u(t,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
|
|
22
22
|
/* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as t}from"./chunk-
|
|
2
|
-
return m(
|
|
3
|
-
return m("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */m(t,{copied:i,className:"size-3.5"})})}function b({tabs:e,activeKey:t,idFor:
|
|
1
|
+
import{useCopyText as e,CopyGlyph as t}from"./chunk-E5DFGCAL.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-AEJQC7GF.js";import{Icon as i}from"./chunk-KMSAHFLP.js";import{useShellStrings as a}from"./chunk-2PNYIWIN.js";import{useState as o,useEffect as s,Fragment as c}from"react";import{jsxs as d,jsx as m,Fragment as u}from"react/jsx-runtime";var y="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function p(){/* @__PURE__ */
|
|
2
|
+
return m(i,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function h({text:n,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(n);/* @__PURE__ */
|
|
3
|
+
return m("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */m(t,{copied:i,className:"size-3.5"})})}function b({tabs:e,activeKey:t,idFor:i,panelMounted:b,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:N,end:w,onIconMenu:C,menuItems:j}){const I=a().pageTabs,[$,z]=o(null),A=e.length;s(()=>{if(!t)return;const e=document.getElementById(i(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[i,t,A]);const D=e.some(e=>e.key===t)?t:e[0]?.key,M=t=>{const n=e[(t+e.length)%e.length];n&&document.getElementById(i(n.key,"tab"))?.focus()},E=$?e.find(e=>e.key===$.key):void 0,_=E&&j?j(E.key):[],F=E?e.indexOf(E):-1,L=e=>e.some(e=>!e.pinned),B=e=>()=>{z(null),e()};/* @__PURE__ */
|
|
4
4
|
return d("div",{className:v??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
5
5
|
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
6
|
-
/* @__PURE__ */m("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const n=e.findIndex(e=>document.getElementById(
|
|
7
|
-
/* @__PURE__ */d("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[o,
|
|
6
|
+
/* @__PURE__ */m("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const n=e.findIndex(e=>document.getElementById(i(e.key,"tab"))===t.target);if(!(n<0)){if("ArrowRight"===t.key)M(n+1);else if("ArrowLeft"===t.key)M(n-1);else if("Home"===t.key)M(0);else if("End"===t.key)M(e.length-1);else{if("Delete"!==t.key||e[n].pinned)return;g(e[n].key)}t.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.map((n,r)=>{const l=n.key===t,a=!!n.dirty,o=n.icon,s=l?N??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",u=r>0&&!l&&e[r-1].key!==t,x={type:"button",role:"tab",id:i(n.key,"tab"),"aria-selected":l,"aria-controls":b?.(n.key)?i(n.key,"panel"):void 0,tabIndex:n.key===D?0:-1,title:n.title,onClick:()=>f(n.key)},k={onContextMenu:e=>((e,t)=>{e.preventDefault(),z({x:e.clientX,y:e.clientY,key:t.key})})(e,n),onAuxClick:e=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),g(t.key))})(e,n),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=o&&
|
|
7
|
+
/* @__PURE__ */d("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[o,a&&!l&&!n.pinned&&
|
|
8
8
|
/* @__PURE__ */m("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),w=l&&!!C&&!!o;return n.pinned?/* @__PURE__ */m("div",{role:"presentation",className:`group relative flex h-9 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${o?"w-10":""} ${s}`,...k,children:/* @__PURE__ */d("button",{...x,className:`flex h-full items-center justify-center rounded-t-md ${o?"w-full":"px-3"} ${y}`,children:[v,
|
|
9
9
|
/* @__PURE__ */m("span",{className:o?"sr-only":"whitespace-nowrap text-sm",children:n.title})]})},n.key):/* @__PURE__ */d(c,{children:[u&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
10
10
|
/* @__PURE__ */d("div",{role:"presentation",className:`group @container relative flex h-9 items-center rounded-t-md border border-b-0 text-sm transition-colors ${l&&(n.copy||w)?"flex-[0_1_20rem]":"flex-[0_1_15rem]"} ${l?"min-w-[4.25rem]":"min-w-[2.75rem]"} ${s}`,...k,children:[w&&
|
|
11
11
|
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":I.tabMenu,title:I.tabMenu,onClick:e=>{const t=e.currentTarget.getBoundingClientRect();C?.(n.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${y}`,children:v}),
|
|
12
12
|
/* @__PURE__ */d("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${w?"pl-2":"pl-3"} ${y} ${l?w?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2"}`,children:[!w&&v,
|
|
13
13
|
/* @__PURE__ */m("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(o?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:n.title})]}),l&&n.copy&&/* @__PURE__ */m(h,{text:n.copy,label:I.copy(n.copy),copiedLabel:I.copied}),
|
|
14
|
-
/* @__PURE__ */d("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-label":I.closeTab?.(n.title)??`${I.close} ${n.title}`,onClick:()=>g(n.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(
|
|
14
|
+
/* @__PURE__ */d("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[a&&/* @__PURE__ */m("span",{role:"img","aria-label":I.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-label":I.closeTab?.(n.title)??`${I.close} ${n.title}`,onClick:()=>g(n.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(a?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */m(p,{})})]})]})]},n.key)})}),w&&/* @__PURE__ */m("div",{className:"flex shrink-0 items-center gap-2 self-center",children:w}),$&&E&&/* @__PURE__ */d(n,{portal:!0,style:{left:$.x,top:$.y},onClose:()=>z(null),children:[_.length>0&&/* @__PURE__ */d(u,{children:[_.map((e,t)=>/* @__PURE__ */d(r,{onClick:B(e.onSelect),children:[e.icon,e.label]},t)),
|
|
16
16
|
/* @__PURE__ */m(l,{})]}),
|
|
17
|
-
/* @__PURE__ */m(r,{disabled:
|
|
17
|
+
/* @__PURE__ */m(r,{disabled:E.pinned,onClick:B(()=>g(E.key)),children:I.close}),
|
|
18
18
|
/* @__PURE__ */m(l,{}),
|
|
19
|
-
/* @__PURE__ */m(r,{disabled:!L(e.filter(e=>e.key!==
|
|
20
|
-
/* @__PURE__ */m(r,{disabled:!L(e.slice(
|
|
21
|
-
/* @__PURE__ */m(r,{disabled:!L(e),onClick:
|
|
19
|
+
/* @__PURE__ */m(r,{disabled:!L(e.filter(e=>e.key!==E.key)),onClick:B(()=>x("others",E.key)),children:I.closeOthers}),
|
|
20
|
+
/* @__PURE__ */m(r,{disabled:!L(e.slice(F+1)),onClick:B(()=>x("right",E.key)),children:I.closeRight}),
|
|
21
|
+
/* @__PURE__ */m(r,{disabled:!L(e),onClick:B(()=>x("all",null)),children:I.closeAll})]})]})}export{b as TabStrip};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{Icon as l}from"./chunk-
|
|
2
|
-
return w("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&
|
|
3
|
-
return b("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */w(
|
|
1
|
+
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{Icon as l}from"./chunk-KMSAHFLP.js";import{createContext as u,forwardRef as c,useContext as s,useRef as d,useId as p,useState as m,useEffect as h,useMemo as f,useCallback as g}from"react";import{createPortal as y}from"react-dom";import{jsxs as b,jsx as w,Fragment as x}from"react/jsx-runtime";var v=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),k="data-native-context-menu";function C(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function N(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(C(t,`[${k}]`))return!0;if(C(t,"textarea"))return!0;if(C(t,"img, picture, canvas, video, audio"))return!0;const n=C(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(v.has(e))return!0}const r=C(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var T=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function E(e,t,n){const r=C(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return T.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function L(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return N(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function M(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function A(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function B(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function $(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function W(e,t,n,r,o,i=!1,a=8){const l=t+o,u=e-o-n,c=u>=a;return i&&c?{left:u,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:c?{left:u,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function H(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var P=u(null),R=u(!1);function D({children:t,style:a,className:l="",onClose:u,minWidth:c=180,portal:s=!1}){const g=d(null),b=p(),[x,v]=m([]),k=d();h(()=>()=>clearTimeout(k.current),[]);const C=i(),T=f(()=>{const e=()=>clearTimeout(k.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>M(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>A(e,t)),200)},closeBelow:t=>{e(),v(e=>A(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:g}},[b,x,u]);h(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||g.current&&!g.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const o=n(u),i=r(()=>!1,()=>g.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),o(),i()}},[u,b]),h(()=>{const e=g.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const E=H(),L=/(^|[\s:])!?z-/.test(l),B=/* @__PURE__ */w("div",{ref:g,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===E?"py-1":"large"===E?"py-2":"py-1"} ${l}`,onContextMenu:e=>{N(e.target)||e.preventDefault()},style:{...L?{}:{zIndex:o.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...a},children:/* @__PURE__ */w(P.Provider,{value:T,children:t})});return s?C?y(B,document.body):null:B}function F(e,t,n,r=!1){const o=H(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 not-disabled:not-aria-disabled:hover:bg-blue-50 not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var I=/* @__PURE__ */w(l,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function S({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return w("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&I}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&I})}var j=c(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,tabIndex:l,id:u,onMouseEnter:c},d){const p=s(P),m=s(R),h=F(r,o,n),f=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return b("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */w(S,{kind:f,checked:!!a}),t]})}),z=/* @__PURE__ */w(l,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function q(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function K(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function U({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:c}){const m=s(P),v=p(),k=d(null),C=d(null),T=d(),E=d(!1),L=`${v}-menu`;h(()=>()=>clearTimeout(T.current),[]);const M=m?.depth??0,A=m?.path[M],B=!!A&&A.key===v&&!i,R=g(e=>{if(!m||i||!k.current)return;clearTimeout(T.current),E.current=e;const t=k.current.getBoundingClientRect(),n=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,o=M>0&&(m.path[M-1]?.flipped??!1),a=W(r.left,r.right,u,window.innerWidth,4,o);m.open(M,{key:v,y:t.top,...a})},[m,i,M,v,u]),D=e=>{m?.closeBelow(M),k.current?.focus()};h(()=>{if(B)return r(e=>"Escape"===e.key&&(!(m&&m.path.length>M+1)&&(D(),!0)),()=>C.current)}),a(()=>{if(!B||!A)return;const e=()=>{const e=C.current;if(!e||!k.current)return;const t=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??k.current.getBoundingClientRect(),r=M>0&&(m?.path[M-1]?.flipped??!1),o=e.offsetWidth||u,i=W(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=$(k.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),h(()=>{B&&E.current&&(E.current=!1,K(C.current)[0]?.focus())},[B]);const I=f(()=>m&&{...m,depth:M+1},[m,M]);if(!m)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=F(!1,i,l,B),j=H();/* @__PURE__ */
|
|
4
4
|
return b(x,{children:[
|
|
5
|
-
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded"
|
|
6
|
-
/* @__PURE__ */w("span",{className:"min-w-0 flex-1 truncate",children:t}),z]})
|
|
7
|
-
/* @__PURE__ */w("div",{ref:C,id:
|
|
8
|
-
return w("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function
|
|
9
|
-
return w("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function
|
|
10
|
-
return w("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{
|
|
5
|
+
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":B,"aria-controls":B?L:void 0,disabled:i,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;B?t&&K(C.current)[0]?.focus():R(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),R(!0))},onMouseEnter:()=>{i||(m.cancelClose(),B?m.closeBelow(M+1):(clearTimeout(T.current),T.current=setTimeout(()=>R(!1),120)))},onMouseLeave:()=>{clearTimeout(T.current),m.scheduleClose(M)},children:[n,
|
|
6
|
+
/* @__PURE__ */w("span",{className:"min-w-0 flex-1 truncate",children:t}),z]}),B&&y(
|
|
7
|
+
/* @__PURE__ */w("div",{ref:C,id:L,role:"menu","data-popup-menu-tree":m.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===j?"py-1":"large"===j?"py-2":"py-1"),style:{left:A.left,top:A.y,minWidth:u,maxHeight:void 0===c?"calc(100vh - 16px)":`min(${"number"==typeof c?`${c}px`:c}, calc(100vh - 16px))`,zIndex:q(m.root.current)+M+1,animation:(A.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...e()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=K(C.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),D())},onMouseEnter:()=>{m.cancelClose(),clearTimeout(T.current)},onMouseLeave:()=>m.scheduleClose(M+1),onContextMenu:e=>{N(e.target)||e.preventDefault()},children:/* @__PURE__ */w(P.Provider,{value:I,children:o})}),document.body)]})}function G(){const e=H();/* @__PURE__ */
|
|
8
|
+
return w("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function J({children:e}){const t=H(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
9
|
+
return w("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function O({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
10
|
+
return w("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{S as MenuCheckMark,O as MenuIcon,R as MenuSemanticsContext,k as NATIVE_MENU_ATTR,D as PopupMenu,G as PopupMenuDivider,j as PopupMenuItem,J as PopupMenuLabel,U as PopupSubmenu,$ as clampMenuTop,A as closeMenuBelow,E as describeContextTarget,F as itemLook,N as keepsNativeMenu,L as leavesContextMenuAlone,W as menuPanelLeft,M as openMenuLevel,B as resolveMenuLevels};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return n(t
|
|
3
|
-
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(
|
|
1
|
+
import{Icon as e}from"./chunk-KMSAHFLP.js";import{useShellStrings as t}from"./chunk-2PNYIWIN.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
|
+
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
|
+
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-HTHLFM24.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|