efficient-shell 15.8.0 → 15.9.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/README.md +1 -1
- package/dist/{Browser-5QLDJ74Z.js → Browser-FEZ2X7B5.js} +16 -16
- package/dist/{Calculator-6WNTZLWL.js → Calculator-MBHZSFJ6.js} +22 -22
- package/dist/{CurrencyConverter-C4KCZWUM.js → CurrencyConverter-7FPB7WJE.js} +10 -10
- package/dist/{Files-VFRXPQLV.js → Files-DHTF6LGF.js} +59 -59
- package/dist/{Notepad-S5JMXH2O.js → Notepad-KS37VSPL.js} +9 -9
- package/dist/{PdfViewer-AIAVQYZ6.js → PdfViewer-KS2BCFSA.js} +1 -1
- package/dist/PomodoroTimer-TYSJOYDJ.js +91 -0
- package/dist/{Preview-HTFTEL7K.js → Preview-NXCA3X4S.js} +28 -28
- package/dist/Sidebar-IU4EG3D3.js +44 -0
- package/dist/{Stock-LIOPTQG5.js → Stock-Y74YC25V.js} +3 -3
- package/dist/{Weather-K3BVAFRV.js → Weather-EO4LYAPA.js} +22 -22
- package/dist/{WorldClock-RHAHXLW4.js → WorldClock-3E3KLHSD.js} +7 -7
- package/dist/ai/index.js +37 -37
- package/dist/apps/ImageAnnotator.js +1 -1
- 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/brand.css +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/{chunk-LFUXWZV7.js → chunk-2EBHJGMM.js} +1 -1
- package/dist/chunk-37FQVY2O.js +2 -0
- package/dist/{chunk-VHBRVW5O.js → chunk-3OK5VZOU.js} +3 -3
- package/dist/{chunk-UYM7562M.js → chunk-43YU7YWL.js} +2 -2
- package/dist/{chunk-XYVFJLAU.js → chunk-452LT77I.js} +1 -1
- package/dist/chunk-4YH7U7WL.js +1 -0
- package/dist/{chunk-KERCZSIA.js → chunk-54WCVNJJ.js} +1 -1
- package/dist/{chunk-OK2J6WSC.js → chunk-6ZQC6XFU.js} +1 -1
- package/dist/{chunk-A3RD7AQ2.js → chunk-7AF5JGRM.js} +1 -1
- package/dist/{chunk-RIA6KKIB.js → chunk-7EPCBDS5.js} +6 -6
- package/dist/{chunk-4NTAZLT3.js → chunk-7KUHILEA.js} +3 -3
- package/dist/chunk-ATTQTQJI.js +14 -0
- package/dist/chunk-AYTGYEOI.js +8 -0
- package/dist/{chunk-S6C7X6CR.js → chunk-AZANUXJT.js} +16 -16
- package/dist/{chunk-QSFQTMWV.js → chunk-BGLUOC7W.js} +1 -1
- package/dist/{chunk-D7MRZZVV.js → chunk-BYTQRQ5P.js} +1 -1
- package/dist/{chunk-DVKOVZJ2.js → chunk-DFI5EHSV.js} +12 -12
- package/dist/{chunk-GUUBFQ6L.js → chunk-DYJQIZX2.js} +2 -2
- package/dist/{chunk-KTI4ZJVX.js → chunk-GNB6KUCT.js} +1 -1
- package/dist/chunk-GURLMAZM.js +3 -0
- package/dist/{chunk-YFVQKS5U.js → chunk-GYY7GS2I.js} +1 -1
- package/dist/{chunk-GUOAPXUY.js → chunk-GZ57F6PN.js} +4 -4
- package/dist/{chunk-EA423N2F.js → chunk-HPDNKHIO.js} +2 -2
- package/dist/chunk-IDH323EU.js +6 -0
- package/dist/{chunk-5OXQ5M5S.js → chunk-JKO4JZPO.js} +1 -1
- package/dist/{chunk-YEDAXZYO.js → chunk-JU6VBLTU.js} +1 -1
- package/dist/{chunk-ZVKUOJNS.js → chunk-JUGRSO5J.js} +1 -1
- package/dist/{chunk-PCNFY6EK.js → chunk-LH7ZKPHJ.js} +12 -12
- package/dist/{chunk-5QHNDAZ6.js → chunk-LLXI57MB.js} +1 -1
- package/dist/chunk-LRASKGEZ.js +4 -0
- package/dist/chunk-LYGIOJ3J.js +1 -0
- package/dist/{chunk-V62FEHS4.js → chunk-MDXZ7YAC.js} +1 -1
- package/dist/{chunk-62UNBUTU.js → chunk-NO5BMPT5.js} +1 -1
- package/dist/{chunk-3AVXNZY5.js → chunk-NPBRNEMR.js} +1 -1
- package/dist/{chunk-WGDVYCQX.js → chunk-OHRKENEP.js} +21 -21
- package/dist/{chunk-JRKD7SD3.js → chunk-OLXUMB2V.js} +16 -16
- package/dist/chunk-ONUNFTZD.js +11 -0
- package/dist/{chunk-KIIZNION.js → chunk-OX7Q5PPR.js} +5 -5
- package/dist/{chunk-ASNRA3ZL.js → chunk-P7X4PWJJ.js} +1 -1
- package/dist/chunk-PLJB4H3G.js +1 -0
- package/dist/{chunk-UMIRPFQJ.js → chunk-QD7IODP2.js} +1 -1
- package/dist/{chunk-NM7U42KL.js → chunk-QO2CN2ND.js} +8 -8
- package/dist/{chunk-QSOBETAI.js → chunk-QY2DGLCJ.js} +6 -6
- package/dist/chunk-R7OZ2AQD.js +6 -0
- package/dist/{chunk-U7PA4KNZ.js → chunk-RBOGLXMV.js} +8 -8
- package/dist/{chunk-OEWBWKKD.js → chunk-SWH3IEUT.js} +9 -9
- package/dist/{chunk-LGVVXYW7.js → chunk-SYASK4QG.js} +1 -1
- package/dist/{chunk-YXMXATYP.js → chunk-THVE54FN.js} +1 -1
- package/dist/{chunk-TEYG2W7A.js → chunk-TM5NQTFA.js} +2 -2
- package/dist/{chunk-FQ3SYDKI.js → chunk-US7F3NC3.js} +1 -1
- package/dist/{chunk-XZKVGJIB.js → chunk-V77UETV3.js} +1 -1
- package/dist/{chunk-I2NVBDKH.js → chunk-VLT4ZEHT.js} +1 -1
- package/dist/chunk-WUNZBM53.js +28 -0
- package/dist/{chunk-GD5NGS6D.js → chunk-XNPCOWOO.js} +45 -45
- package/dist/{chunk-EULBBS5L.js → chunk-XOEYCDWT.js} +1 -1
- package/dist/{chunk-QJ3X2PHY.js → chunk-YCA2XXAB.js} +1 -1
- package/dist/{chunk-AKEED2BC.js → chunk-YQKNRT7L.js} +1 -1
- package/dist/{chunk-QYOIS4BN.js → chunk-ZKWAWQ74.js} +3 -3
- package/dist/{chunk-RRWQBWLW.js → chunk-ZV2ZAHZV.js} +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.d.ts +1 -0
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SearchInput.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/buttonStyles.d.ts +8 -1
- package/dist/forms/buttonStyles.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +172 -172
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.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/PomodoroTimer-BGTCWT53.js +0 -91
- package/dist/Sidebar-KAALEIIX.js +0 -44
- package/dist/chunk-345FP3IX.js +0 -4
- package/dist/chunk-5RCKE4X2.js +0 -6
- package/dist/chunk-6FOLK4HD.js +0 -1
- package/dist/chunk-A4ROXNUF.js +0 -2
- package/dist/chunk-APFDZ2HG.js +0 -1
- package/dist/chunk-DEV3ZHPP.js +0 -8
- package/dist/chunk-E4WVF6AS.js +0 -28
- package/dist/chunk-MQNSKFZY.js +0 -11
- package/dist/chunk-OHPDB4UN.js +0 -14
- package/dist/chunk-QXEZBS3H.js +0 -6
- package/dist/chunk-R6YVKP6D.js +0 -3
- package/dist/chunk-UQYNPYF4.js +0 -1
- /package/dist/{chunk-TEQ5ZPAL.js → chunk-NQWORKZD.js} +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
2
|
-
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),E=a(null),F=a(0),T=a([]),$=a(null),
|
|
3
|
-
return m(p.Provider,{value:
|
|
4
|
-
/* @__PURE__ */h(e,{open:t,onClose:()=>
|
|
5
|
-
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>
|
|
6
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>
|
|
1
|
+
import{Dialog as e}from"./chunk-R7OZ2AQD.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-LYGIOJ3J.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),L=t({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
|
|
2
|
+
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),E=a(null),F=a(0),T=a([]),$=a(null),D=a(null),R=u(e=>{E.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),J=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++F.current,options:r,resolve:e};null===E.current?R(n):T.current.push(n)})},[R]),[O,W]=c(!1),[Z,G]=c({message:""}),[H,I]=c(""),K=a(),Q=u(e=>(G(e),I(""),W(!0),new Promise(e=>{K.current=e})),[]),[S,V]=c(!1),[A,B]=c({}),[Y,q]=c(""),z=a(),M=u(e=>{const r="string"==typeof e?{message:e}:e;return B(r),q(r.defaultValue??""),V(!0),new Promise(e=>{z.current=e})},[]);d(()=>{b=J,y=Q,N=M},[J,Q,M]);const U=(e,r)=>{if(E.current!==e)return;const n=k.current,t=T.current.shift();t?R(t):(E.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{W(!1),I(""),K.current?.(e)},_=e=>{if(e){const e=Y.trim();if(!e&&!A.allowEmpty)return V(!1),void z.current?.(null);V(!1),z.current?.(e)}else V(!1),z.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===Z.variant?"warning":"danger"],te=Z.confirmWord,oe=null==te||H===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
|
|
3
|
+
return m(p.Provider,{value:J,children:[r,
|
|
4
|
+
/* @__PURE__ */h(e,{open:t,onClose:()=>U(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
|
+
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>U(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
6
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>U(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
7
7
|
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
8
8
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
9
|
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
10
|
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
11
|
-
/* @__PURE__ */h(e,{open:
|
|
12
|
-
/* @__PURE__ */h("button",{ref:
|
|
13
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>
|
|
11
|
+
/* @__PURE__ */h(e,{open:O,onClose:()=>X(!1),initialFocus:null!=te?void 0:D,footer:/* @__PURE__ */m(f,{children:[
|
|
12
|
+
/* @__PURE__ */h("button",{ref:D,type:"button",onClick:()=>X(!1),className:C,children:Z.cancelLabel||le.destructiveCancel}),
|
|
13
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??Z.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
14
14
|
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
15
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
16
|
-
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:
|
|
17
|
-
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:
|
|
16
|
+
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:Z.title||le.destructiveTitle}),
|
|
17
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:Z.message}),null!=te&&/* @__PURE__ */m(f,{children:[
|
|
18
18
|
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
19
19
|
/* @__PURE__ */h("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),se]}),
|
|
20
|
-
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:
|
|
21
|
-
/* @__PURE__ */m(e,{open:
|
|
22
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:
|
|
23
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!
|
|
24
|
-
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:
|
|
20
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:H,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&H===te&&X(!0)},placeholder:te,className:`mt-2 ${P} focus:border-red-500`})]})]})]})}),
|
|
21
|
+
/* @__PURE__ */m(e,{open:S,onClose:()=>_(!1),title:A.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
|
|
22
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:A.cancelLabel||le.cancel}),
|
|
23
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!A.allowEmpty&&!Y.trim(),className:L,children:A.confirmLabel||le.ok})]}),children:[A.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:A.message}),
|
|
24
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:Y,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:A.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{E as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as n,mediaFileName as r}from"./chunk-TAIH2VIW.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as s}from"./chunk-37FQVY2O.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{createShellPortal as m}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-KEFNQEXZ.js";import{buttonClasses as f}from"./chunk-LYGIOJ3J.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-NRHG4R2Q.js";import{useRef as x,useState as k,useCallback as b,useEffect as g}from"react";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:n(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",I=e=>e.stopPropagation();function Q({images:n,startIndex:y=0,onClose:Q,onIndexChange:R,onOpenFile:D}){const G=p().lightbox,O=d(),W=x(null),$=x(null),[z,A]=k(y),F=n.length,J=O&&F>0,L=b(e=>{if(F<2)return;const t=((z+e)%F+F)%F;A(t),R?.(t)},[z,F,R]);if(a(J),l(W,J,$),i(J),g(()=>{if(J)return h(()=>(Q(),!0),()=>W.current)},[J,Q]),g(()=>{if(!J)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),L("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[J,L]),!J)return null;const U=n[Math.min(z,F-1)],V=j(U),Y=U.caption||r(U.url);let E;return E="video"===V?/* @__PURE__ */v("video",{src:U.url,controls:!0,playsInline:!0,"aria-label":Y,onClick:I,className:`${e} rounded-lg bg-black`}):"file"===V?/* @__PURE__ */w("div",{onClick:I,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
|
+
/* @__PURE__ */v(c,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:Y}),D?/* @__PURE__ */v(s,{size:"sm",onClick:()=>D(U),children:G.openFile}):/* @__PURE__ */v("a",{href:U.url,target:"_blank",rel:"noopener noreferrer",className:f({size:"sm"}),children:G.openFile})]}):/* @__PURE__ */v(t,{src:U.url,alt:Y,className:`${e} object-contain`,frameClassName:"rounded-lg"}),m(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:W,...o({role:"dialog",modal:!0,label:G.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:Q,children:[E,
|
|
5
|
+
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:I,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:G.counter(z+1,F)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:$,type:"button",onClick:Q,"aria-label":G.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(c,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),F>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{I(e),L(-1)},"aria-label":G.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(c,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{I(e),L(1)},"aria-label":G.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(c,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:I,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:Y}),"file"!==V&&/* @__PURE__ */v("a",{href:U.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:G.openOriginal})]})]}),document.body)}export{Q as ImageLightbox,j as lightboxKind};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-TM5NQTFA.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-CIZAUBWA.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:R=""}){const j=a().widths,A=s(),z=p(Math.round(x)||1,1,n),B=e($,z),T=B??[...r[z]??[]],S=[...T,100-g(T)],D=P||M,K=c(null),O=c({onChange:k,shown:T,locked:D,n:z,stored:B});O.current={onChange:k,shown:T,locked:D,n:z,stored:B};const H=r=>{const{onChange:t,shown:n,locked:o,n:l}=O.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},I=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],H(l.slice(0,-1))&&(ne.current=null)},L=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=S[e]+S[e+1],l="ArrowRight"===r.key?S[e]+n:"ArrowLeft"===r.key?S[e]-n:"PageUp"===r.key?S[e]+10:"PageDown"===r.key?S[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),I(S,e,l))},U=c(null),[E,F]=u(null),G=()=>{U.current=null,F(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>G,[]);const V=e=>r=>{if(0!==r.button||D)return;r.preventDefault();const t=K.current?.getBoundingClientRect().width??0;t<=0||(U.current={i:e,x:r.clientX,width:t,from:S,moved:!1,pointer:r.pointerId},F(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},W=e=>{const r=U.current;if(!r)return;if(0===e.buttons)return void G();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}I(r.from,r.i,r.from[r.i]+t/r.width*100)},Q=e=>{const r=U.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),G())},X=(e,r)=>{const{shown:n}=O.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return H(o.slice(0,-1))?o:null},[q,J]=u(0);d(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>J(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Z=c(null),[Y,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=O.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=S.join(",");d(()=>{const e=null===Y?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Z.current,Y);re(r=>v(r,e)?r:e)},[Y,le,q]);const ie=j.hint(z,t),ae=S.slice(0,-1).map((e,r)=>g(S.slice(0,r+1)));/* @__PURE__ */
|
|
2
2
|
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?A:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${R}`.trim(),children:[
|
|
3
|
-
/* @__PURE__ */f("div",{ref:
|
|
4
|
-
/* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:
|
|
5
|
-
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&
|
|
6
|
-
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
3
|
+
/* @__PURE__ */f("div",{ref:Z,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
+
/* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:S.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
|
|
5
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&S.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Y===r,l=g(S.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(z-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":j.column(r+1),"aria-describedby":A,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||X(r,e)},onRevert:e=>((e,r)=>{O.current.locked||null===r||oe(e,r)||X(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:O.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<z-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":S[r],"aria-valuemin":t,"aria-valuemax":S[r]+S[r+1]-t,"aria-valuetext":j.dividerValue(r+1,S[r],r+2,S[r+1]),"aria-disabled":D||void 0,onKeyDown:D?void 0:L(r),onPointerDown:V(r),onPointerMove:W,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:()=>{U.current&&G()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(D?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(D?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${E===r?"w-1":y}`)})})})})]},r))]}),z>1&&/* @__PURE__ */m("span",{id:A,className:"sr-only",children:ie})]})}export{x as WidthsBar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-6NXPOZ6X.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-6NXPOZ6X.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-37FQVY2O.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="15.9.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-KGRJSTPM.js";import{setPdfPreview as n}from"./chunk-I4RJAMLJ.js";import{toast_default as i}from"./chunk-
|
|
1
|
+
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-KGRJSTPM.js";import{setPdfPreview as n}from"./chunk-I4RJAMLJ.js";import{toast_default as i}from"./chunk-VLT4ZEHT.js";var o="react-os-shell:preview-opened";async function a(a){const{filePath:r,filename:l,kind:c,onStaged:s,load:d}=a;try{const a=d?d():e().readShortcut?.(r)??null;let f;if(a)f=await a;else{const e=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(r)}`,{credentials:"include"});if(!e.ok)return i.error(`Download failed (${e.status})`),!1;f=await e.blob()}if("csv"===c){const e=await f.text();t({csv:e,filename:l}),s?.("/spreadsheet")}else{const e=URL.createObjectURL(f);n({url:e,filename:l,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o,{detail:{filePath:r,filename:l,kind:c}})),!0}catch(e){return i.error(e?.message||"Open failed"),!1}}export{o as PREVIEW_OPENED_EVENT,a as openPreviewFile};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{copyToClipboard as e,selectionAt as t}from"./chunk-
|
|
2
|
-
return x(a,{title:K,message:P,onRetry:A});if(0===R.length)/* @__PURE__ */return x(w,{children:
|
|
3
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-452LT77I.js";import{ResizableTable as n}from"./chunk-TXGVSWH6.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-U73K3ICC.js";import{ListLoadError as a}from"./chunk-SYASK4QG.js";import{LoadingSpinner as c}from"./chunk-4PJFL26P.js";import{PopupMenu as s,PopupMenuLabel as d,PopupMenuItem as h,PopupMenuDivider as m}from"./chunk-P56YLT73.js";import{keepsNativeMenu as u}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{shellHttp as f}from"./chunk-STKJA4PV.js";import{toast_default as g}from"./chunk-VLT4ZEHT.js";import{useShellStrings as y}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:L,emptyState:T,totalCount:N,isError:$,onRetry:A,errorTitle:K,errorMessage:P,tableId:E,columns:M,renderCell:F,getRowId:I=e=>e.id,sort:H,onSort:U,selected:D,setSelected:G,onRowClick:W,onRowHover:J,getRowClassName:O,footerLabel:Q,footerExtra:V,footerExtraAfter:Z,sentinelRef:_,isFetchingNextPage:B,saveDefaultPerms:Y,exportEndpoint:z,exportFilename:X="export.csv",contextActions:q}=S,[ee,te]=k(null),ne=b(null),re=y(),oe=re.entityList,le=e=>{G(t=>{const n=new Set(t),r=I(e);return n.has(r)?n.delete(r):n.add(r),n})},ie=()=>{G(e=>{const t=R.map(I),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ae=r(R,W,le,ie,(e,t)=>{G(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(I(R[n]));return r})},ne),ce=R.filter(e=>D.has(I(e))),se=()=>{const e=[...ne.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(I(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(M.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{te(null);const{header:t,body:n}=se();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(oe.copiedRows(n.length),r,l)},he=async()=>{te(null);const e=ce.map(I);if(!e.length||!z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(M.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${E}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return M.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=z.includes("?")?"&":"?";try{const n=await f.get(`${z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=X,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void g.notify(Number.isFinite(a)?oe.exportTruncated(a,e.length):oe.exportTruncatedUnknown(e.length));g.success(oe.exported(e.length))}catch{g.error(oe.exportFailed)}};if(L)/* @__PURE__ */return x(c,{});if($&&0===R.length)/* @__PURE__ */
|
|
2
|
+
return x(a,{title:K,message:P,onRetry:A});if(0===R.length)/* @__PURE__ */return x(w,{children:T});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=D.size-ce.length,fe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":re.table.selectAll,checked:me,indeterminate:ue,onChange:ie,style:{height:14,width:14}})},...M],ge=/* @__PURE__ */x(i,{selectedCount:ce.length,hiddenSelectedCount:pe,loadedCount:R.length,totalCount:N,label:Q,isFetchingMore:B,extra:V,extraAfter:Z}),ye=_?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:_}),B&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0!==N&&N>R.length;ke=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
4
|
/* @__PURE__ */x(d,{children:pe>0?re.list.selectedNotShown(a,pe):re.list.selected(a)}),
|
|
5
5
|
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),W(r)},children:oe.open}),
|
|
6
6
|
/* @__PURE__ */x(m,{}),o&&/* @__PURE__ */x(h,{onClick:()=>{c(),e(oe.copiedText,o.text,o.html)},children:oe.copy}),l&&/* @__PURE__ */x(h,{onClick:()=>(t=>{te(null);const{keys:n,body:r}=se(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:oe.copyColumn(l.label)}),
|
|
7
|
-
/* @__PURE__ */x(h,{disabled:0===a,onClick:de,children:oe.copyRows(a)}),
|
|
7
|
+
/* @__PURE__ */x(h,{disabled:0===a,onClick:de,children:oe.copyRows(a)}),z&&/* @__PURE__ */x(h,{onClick:he,children:oe.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(m,{}),
|
|
8
8
|
/* @__PURE__ */x(h,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ce)},children:e.label})]},t)),
|
|
9
|
-
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),
|
|
10
|
-
/* @__PURE__ */x(h,{onClick:()=>{c(),
|
|
9
|
+
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),G(e=>/* @__PURE__ */new Set([...e,...R.map(I)]))},children:u?oe.selectAllLoaded(R.length):oe.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(h,{onClick:()=>{c(),G(/* @__PURE__ */new Set)},children:oe.clearSelection}),A&&/* @__PURE__ */x(h,{onClick:()=>{c(),A()},children:oe.refresh})]})}
|
|
11
11
|
/* @__PURE__ */
|
|
12
12
|
return C("div",{className:"flex-1 flex flex-col bg-surface overflow-hidden",children:[
|
|
13
|
-
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:E,columns:fe,sort:
|
|
14
|
-
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":
|
|
13
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:E,columns:fe,sort:H,onSort:U,footer:ge,afterBody:ye,saveDefaultPerms:Y,children:e=>/* @__PURE__ */x("tbody",{ref:ne,children:R.map((n,r)=>{const o=I(n);/* @__PURE__ */
|
|
14
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":(r%2==1?"bg-row-stripe ":"")+"hover:bg-line"} ${O?.(n)??""}`,onClick:()=>W(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||u(e.target))return;e.preventDefault();const r=I(n);D.has(r)||G(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?M.find(e=>e.key===o)?.label:void 0;te({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:J?()=>J(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":re.table.selectRow,checked:D.has(o),onChange:()=>le(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):F(n,e.key)},e.key))},o)})})})}),ke]})}export{S as EntityList};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-452LT77I.js";import{IconButton_default as r}from"./chunk-4YH7U7WL.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-VLT4ZEHT.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:
|
|
4
|
-
return m("div",{id:
|
|
5
|
-
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:t,children:y??t}),!
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:
|
|
3
|
+
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":T,className:L=""}){const[C,H]=i(!1),R=o(null),B=a().copy;c(()=>()=>{R.current&&clearTimeout(R.current)},[]);const I=l(async()=>{await e(t)?(H(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{H(!1),R.current=null},2e3),v?.(t)):n.error(B.failed)},[t,v,B]),{box:S,button:V}=p[g],z=!N;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:z?void 0:j,"aria-describedby":z?void 0:T,className:["inline-flex max-w-full items-center rounded-md",u[k],S,L].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
|
+
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:t,children:y??t}),!N&&/* @__PURE__ */m(d,{children:[
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?B.copyLabel(x):B.copy,"aria-describedby":T,onClick:I,className:`${V} text-gray-400`,children:/* @__PURE__ */s(C?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:C?B.copied:""})]})]})}export{y as Snippet};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as l,usePopupLevel as t,usePopupLevelBindings as i,windowScrimStyle as a,OverlayLayerProvider as o,scrimHasCorners as n,popupLayerStyle as s,POPUP_GUTTER as d}from"./chunk-CJ4OEY3T.js";import{CloseButton as c}from"./chunk-LLXI57MB.js";import{useDiscardGuard as m}from"./chunk-NQWORKZD.js";import{dialogA11y as p}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as u}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as f,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as x,DESCRIPTION_TEXT as v,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{createShellPortal as w}from"./chunk-5QRHQCRG.js";import{useHydrated as y}from"./chunk-KEFNQEXZ.js";import{registerModalEscapeInterceptor as $}from"./chunk-TWVUQUUD.js";import{useShellStrings as g}from"./chunk-NRHG4R2Q.js";import{useRef as N,useId as j,useState as k,useEffect as C}from"react";import{jsxs as Q,Fragment as W,jsx as Z}from"react/jsx-runtime";var B=`calc(100% - ${2*d}px)`,D="grid grid-cols-[minmax(0,1fr)_auto]",E="bg-black/30 backdrop-blur-sm",R={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl",full:"max-w-none"};function G({open:d,onClose:G,title:H,description:T,role:Y="dialog",children:J,footer:O,headerActions:U,blocking:_=!1,size:A="md",aside:F=!1,dirty:I=!1,initialFocus:K,"aria-label":L,"aria-labelledby":V,"aria-describedby":X,className:z=""}){const M=N(null),q=j(),P=j(),S=!_,ee="full"===A,re=ee||null!=U,le=Boolean(H||T),te=j();g().dialog;const ie=e(y()),[ae,oe]=k(null),ne=m({open:d,dirty:I,onClose:G,title:H,layer:ae}),se=N(null),de=r(d&&null!==ie,se),ce=l(de,M),me=t(d&&null!==ie,se),pe=i(me,ae),ue=a(me),fe=null!==me.host;if(u(d),f(M,d&&null!==ie,K,pe),h(d),C(()=>{if(d)return $(()=>!pe.current?.(document.activeElement)&&(_||ne(),!0),()=>M.current)},[d,_,ne,pe]),!d||!ie)return null;/* @__PURE__ */
|
|
2
|
+
return Q(W,{children:[/* @__PURE__ */Z("span",{ref:se,hidden:!0,"data-popup-anchor":""}),w(
|
|
3
|
+
/* @__PURE__ */Z(o,{value:ae,children:/* @__PURE__ */Q("div",{ref:oe,className:"fixed inset-0"+(F?" pointer-events-none opacity-0":fe?" pointer-events-none":""),style:s(me),role:"presentation","data-overlay-layer":"","data-aside":F?"":void 0,children:[!fe&&/* @__PURE__ */Z("div",{className:`fixed inset-0 ${E}`,"aria-hidden":"true","data-popup-scrim":"system"}),ue&&/* @__PURE__ */Z("div",{className:`fixed ${E}${F?"":" pointer-events-auto"}${n(me)?" rounded-(--radius-window)":""}`,style:ue,onClick:_?void 0:ne,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
+
/* @__PURE__ */Z("div",{className:de?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:_||fe?void 0:e=>{e.target===e.currentTarget&&ne()},children:/* @__PURE__ */Q("div",{ref:M,"data-popup-panel":"",style:de?{left:ce?.left??0,top:ce?.top??0,visibility:ce?void 0:"hidden",width:B,[ee?"height":"maxHeight"]:B}:void 0,...p({role:Y,modal:!0,titleId:H?te:void 0,labelledBy:V,label:L}),"aria-describedby":X??(T?P:J?q:void 0),className:(ee?`${de?"absolute":"relative h-full w-full max-h-full"} ${R[A]} ${D} grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-(--radius-popup) ${b}`:`${de?"absolute":"relative max-h-full w-full"} ${R[A]}${re?` ${D} content-start gap-x-2`:""} overflow-y-auto overscroll-contain rounded-(--radius-card) ${b} p-6`)+`${fe&&!F?" pointer-events-auto":""} ${z}`.trimEnd(),children:[ee?le&&
|
|
5
|
+
/* @__PURE__ */Q("div",{className:"col-start-1 row-start-1 flex min-h-(--row-height-window-bar) flex-col justify-center border-b border-line py-2 pl-6 pr-4",children:[H&&/* @__PURE__ */Z("h2",{id:te,className:x,children:H}),T&&/* @__PURE__ */Z("p",{id:P,className:`${H?"mt-1 ":""}${v}`,children:T})]}):H&&/* @__PURE__ */Z("h2",{id:te,className:`${re?"col-start-1 row-start-1 ":S?"pr-8 ":""}${x}`,children:H}),!ee&&T&&/* @__PURE__ */Z("p",{id:P,className:`${re?"col-start-1 ":""}${H?"mt-1":S&&!re?"pr-8":""} ${v}`.trim(),children:T}),J&&/* @__PURE__ */Z("div",{id:q,className:ee?"col-span-2 row-start-2 min-h-0 overflow-auto":(re?"col-span-2 ":"")+"mt-2 text-sm text-gray-600",children:J}),O&&/* @__PURE__ */Z("div",{className:ee?"col-span-2 row-start-3 flex flex-wrap justify-end gap-3 border-t border-line px-6 py-4":(re?"col-span-2 ":"")+"mt-6 flex flex-wrap justify-end gap-3",children:O}),re?
|
|
6
|
+
/* @__PURE__ */Q("div",{className:"col-start-2 row-start-1 flex items-center gap-1 "+(ee?(le?"border-b border-line ":"")+"pr-3":"-mr-3 -mt-3 self-start"),children:[U,S&&/* @__PURE__ */Z(c,{onClose:ne})]}):S&&/* @__PURE__ */Z(c,{onClose:ne,className:"absolute right-3 top-3"})]})})]})}),ie)]})}export{G as Dialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-NPBRNEMR.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),R=N.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!R||e.title.toLowerCase().includes(R)||e.body.toLowerCase().includes(R)||e.category_label.toLowerCase().includes(R),E=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,R]),L=n(()=>E.flatMap(e=>e.docs),[E]),A=(w?L.find(e=>e.slug===w):void 0)??L[0]??null,B=e=>!!R||(C[e]??e===A?.category);/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===
|
|
9
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===E.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:R?y.help.noResults:b??y.help.empty}):E.map(e=>{const t=B(e.key);/* @__PURE__ */
|
|
10
10
|
return i("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!B(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */o(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=A?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:A?/* @__PURE__ */i(c,{children:[
|
|
17
17
|
/* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */i("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(
|
|
19
|
+
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:A.title}),
|
|
20
|
+
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[A.category_label,!1===A.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(A),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(A):A.body?/* @__PURE__ */o(e,{children:A.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{createShellPortal as n}from"./chunk-5QRHQCRG.js";import{fitBoxScale as r,fitScale as a}from"./chunk-M6UKCZHT.js";import{toast_default as o}from"./chunk-
|
|
2
|
-
/* @__PURE__ */m("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||h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${h.version}/build/pdf.worker.min.mjs`);var y={"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},v=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=y[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 f(n,t,a);return a}};function b(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:v}}var x=[50,75,100,125,150,200,300,400];function k(e,t,n){const o={width:t.width-40,height:t.height-40};if(o.width<=0||"page"===e&&o.height<=0)return.3;const i="page"===e?r(o,n):a(o.width,n.width);return Math.min(Math.max(i,.3),4)}function C({url:n,filename:r,fit:a="width",onDownload:s,onEmail:l,workerSrc:f,wasmUrl:g}){const y=i().pdf,v=c(null),C=c(null),N=c(null),[j,
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{createShellPortal as n}from"./chunk-5QRHQCRG.js";import{fitBoxScale as r,fitScale as a}from"./chunk-M6UKCZHT.js";import{toast_default as o}from"./chunk-VLT4ZEHT.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{createContext as s,useContext as l,useRef as c,useState as d,useEffect as u}from"react";import*as h from"pdfjs-dist";import{jsx as m,jsxs as p}from"react/jsx-runtime";function f(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 g=s(null);function w({children:e}){const t=l(g);return t?n(e,t):
|
|
2
|
+
/* @__PURE__ */m("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||h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${h.version}/build/pdf.worker.min.mjs`);var y={"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},v=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=y[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 f(n,t,a);return a}};function b(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:v}}var x=[50,75,100,125,150,200,300,400];function k(e,t,n){const o={width:t.width-40,height:t.height-40};if(o.width<=0||"page"===e&&o.height<=0)return.3;const i="page"===e?r(o,n):a(o.width,n.width);return Math.min(Math.max(i,.3),4)}function C({url:n,filename:r,fit:a="width",onDownload:s,onEmail:l,workerSrc:f,wasmUrl:g}){const y=i().pdf,v=c(null),C=c(null),N=c(null),[j,E]=d(null),[M,P]=d(1),[z,_]=d(0),[D,S]=d(1),[T,L]=d(!0),[W,$]=d(!0),H=c(y.loadFailed);H.current=y.loadFailed,u(()=>{let e=!1;return $(!0),P(1),f&&(h.GlobalWorkerOptions.workerSrc=f),h.getDocument({url:n,...b(g)}).promise.then(t=>{e||(E(t),_(t.numPages),$(!1))}).catch(()=>{e||(o.error(H.current),$(!1))}),()=>{e=!0}},[n,f,g]),u(()=>{if(!j||!T||!N.current)return;const e=()=>{const e=N.current;e&&j.getPage(M).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=k(a,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});S(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[j,M,T,a]),u(()=>{if(!j||!v.current)return;let e=!1,t=null,n=null;return j.getPage(M).then(r=>{if(e||!v.current)return;const a=r.getViewport({scale:D}),o=v.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=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new h.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()}},[j,M,D]),u(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===a?y.fitPage:y.fitWidth,R="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return p("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */p(w,{children:[
|
|
5
|
-
/* @__PURE__ */m("button",{type:"button","aria-label":y.previousPage,onClick:()=>P(e=>Math.max(1,e-1)),disabled:
|
|
6
|
-
/* @__PURE__ */m("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(
|
|
7
|
-
/* @__PURE__ */m("button",{type:"button","aria-label":y.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:
|
|
5
|
+
/* @__PURE__ */m("button",{type:"button","aria-label":y.previousPage,onClick:()=>P(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */m(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
|
+
/* @__PURE__ */m("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(M,z)}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button","aria-label":y.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:M>=z,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */m(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */m("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
9
|
/* @__PURE__ */m("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{L(!1),S(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:R,children:/* @__PURE__ */m("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
-
/* @__PURE__ */p("select",{value:
|
|
11
|
-
/* @__PURE__ */m("option",{value:"fit",children:O}),!
|
|
10
|
+
/* @__PURE__ */p("select",{value:T?"fit":x.includes(Math.round(100*D))?Math.round(100*D):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(L(!1),S(Number(t)/100)):L(!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":y.zoom,title:y.zoom,children:[
|
|
11
|
+
/* @__PURE__ */m("option",{value:"fit",children:O}),!T&&!x.includes(Math.round(100*D))&&/* @__PURE__ */p("option",{value:"custom",children:[Math.round(100*D),"%"]}),x.map(e=>/* @__PURE__ */p("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
12
|
/* @__PURE__ */m("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{L(!1),S(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:R,children:/* @__PURE__ */m("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>L(!0),"aria-pressed":
|
|
13
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>L(!0),"aria-pressed":T,className:R+(T?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
|
|
14
14
|
/* @__PURE__ */m("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
15
|
/* @__PURE__ */p("button",{type:"button",onClick:()=>{if(!j)return;const e=window.open("","_blank");if(!e)return void o.error(y.allowPopups);const t=[];for(let e=1;e<=z;e++)t.push(j.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(t).then(t=>{var n;e.document.write(`<html><head><title>${n=r,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),e.document.write(t.map(e=>`<img src="${e}"/>`).join("")),e.document.write("</body></html>"),e.document.close(),setTimeout(()=>{e.print(),e.close()},300)})},className:R,children:[
|
|
16
16
|
/* @__PURE__ */m(e,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),y.print]}),
|
|
17
17
|
/* @__PURE__ */p("button",{type:"button",onClick:s??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:R,children:[
|
|
18
18
|
/* @__PURE__ */m(e,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),y.download]}),l&&/* @__PURE__ */p("button",{type:"button",onClick:l,className:R,children:[
|
|
19
19
|
/* @__PURE__ */m(e,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),y.email]})]}),
|
|
20
|
-
/* @__PURE__ */m("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!j)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&
|
|
20
|
+
/* @__PURE__ */m("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!j)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<z?(e.preventDefault(),P(e=>Math.min(z,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),P(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!j)return;if(e.defaultPrevented)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<z&&(e.preventDefault(),P(e=>Math.min(z,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>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:W?/* @__PURE__ */m(t,{size:"sm",padding:"",className:"h-full",label:y.loading}):/* @__PURE__ */p("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */m("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__ */p("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */m("canvas",{ref:v,className:"block rounded"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Button_default as e}from"./chunk-
|
|
1
|
+
import{Button_default as e}from"./chunk-37FQVY2O.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
3
3
|
/* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
4
4
|
/* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-BYTQRQ5P.js";import{Button_default as a}from"./chunk-37FQVY2O.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{unitBox as e}from"./chunk-4MDSZSLC.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-
|
|
2
|
-
return v("div",{className:"relative","data-number-box":"",style
|
|
1
|
+
import{unitBox as e}from"./chunk-4MDSZSLC.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-4YH7U7WL.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:t,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":t,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(n,{size:"sm",...v,children:u})}var j=c(function({value:n,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:D,disabled:E,readOnly:B,invalid:S,placeholder:C,size:M,prefix:$,suffix:O,suffixControl:P,units:U,id:F,name:L,className:R="",onBlur:W,onFocus:K,steppers:z,stepFrom:T,snap:V=!1,allowEmpty:Y=!0,appearance:I="box",display:A,reportWhileTyping:G=!0,onRevert:H,"aria-label":Q,"aria-labelledby":Z,"aria-describedby":J,auto:X,...q},_){const ee="bare"===I,re=P??("string"==typeof O?e(O,U,E||B):void 0),te=r(),ne=X??te,oe=s(),ie="string"==typeof O&&""!==O.trim()?O.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(O||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(n,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(n),he=d(n);he.current=n;const be=Boolean(E||B),ge=z??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==n&&de(x(n,g))},[n,g]);const De=e=>{if(be)return;let r=(ae(pe.current)??T??(C?ae(C):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Oe()},Ee=d(De);Ee.current=De;const Be=d({unit:j??1,big:D??10*(j??1),locked:be});Be.current={unit:j??1,big:D??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),Ee.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Se,Ce]=u(!1),[Me,$e]=u(0),Oe=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Se&&document.activeElement===fe.current&&fe.current?.select()},[ee,Se,Me]);const Pe=d(!1);f(()=>{if(Se&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(H??o)(r),Oe(),!0})},[Se,be,g,o,H]);const Ue=()=>{const e=ae(pe.current);if(null==e){if(!Y){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(V?Math.max(b(j??1),b(i??0)):void 0);V&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Fe=/* @__PURE__ */m("input",{ref:me,id:F,"data-number-input":"",name:L,type:"text",inputMode:0===g?"numeric":"decimal",value:!Se&&A?A(n):ue,disabled:E,readOnly:B,placeholder:C,step:j,role:"spinbutton","aria-valuenow":n??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==n?C||void 0:`${x(n,g)}${ee&&ie?ie:""}`,"aria-describedby":[J,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":S||void 0,"aria-label":Q,"aria-labelledby":Z,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!G)return;const t=ae(e);(null!==t||Y)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Ue(),void Oe();const r=j??1,t=D??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),De(n))},onFocus:()=>{ve.current=he.current,Ce(!0),Pe.current=!0,K?.()},onMouseUp:ee?e=>{Pe.current&&(Pe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Ce(!1),Pe.current=!1,Ue(),W?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Se?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",R].filter(Boolean).join(" "):t({invalid:S,size:M,readOnly:B,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Se?"text-ellipsis":"",R].filter(Boolean).join(" ")})}),Le=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Le?/* @__PURE__ */v(h,{children:[Fe,Le]}):Fe;const Re=ae(ue);/* @__PURE__ */
|
|
2
|
+
return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Fe,Le,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):O&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:O}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Re&&Re<=i,onStep:e=>Ee.current(-(e?D??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Re&&Re>=c,onStep:e=>Ee.current(e?D??10*(j??1):j??1)});/* @__PURE__ */
|
|
3
3
|
return v("span",xe?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{j as InputNumber_default,g as stepRounding};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-FUUUPTVN.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-FUUUPTVN.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-BYTQRQ5P.js";import{Button_default as i}from"./chunk-37FQVY2O.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-XNPCOWOO.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buttonClasses as t}from"./chunk-
|
|
1
|
+
import{buttonClasses as t}from"./chunk-LYGIOJ3J.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-NRHG4R2Q.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
|