efficient-shell 8.35.0 → 8.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/README.md +11 -0
  2. package/dist/{Browser-ERZNOFN7.js → Browser-5TOAZTHJ.js} +14 -14
  3. package/dist/Calculator-I4P2BWR7.js +29 -0
  4. package/dist/CurrencyConverter-K2IIOVHM.js +21 -0
  5. package/dist/{Documents-POWS4L44.js → Documents-IYGZXCU2.js} +14 -14
  6. package/dist/Files-EMPEGBMQ.js +87 -0
  7. package/dist/Notepad-VYJZ2XA4.js +25 -0
  8. package/dist/PdfViewer-KJCJ6EPG.js +1 -0
  9. package/dist/{PomodoroTimer-GLYNCO4H.js → PomodoroTimer-BEVXP5KG.js} +28 -28
  10. package/dist/{Preview-WZDFVBNJ.js → Preview-AVQQI32Z.js} +36 -36
  11. package/dist/Sidebar-6I4FC5AK.js +43 -0
  12. package/dist/Spreadsheet-EM6OOJ6I.js +37 -0
  13. package/dist/Stock-YJNQMFSV.js +16 -0
  14. package/dist/{Weather-UKLNJ3VF.js → Weather-XDT4ZEHN.js} +19 -19
  15. package/dist/{WorldClock-OZ3I7D2M.js → WorldClock-7PTVRQ2A.js} +6 -6
  16. package/dist/ai/index.d.ts +118 -3
  17. package/dist/ai/index.js +53 -43
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/{chunk-ZRHQGFO5.js → chunk-3CST4ZDP.js} +2 -2
  23. package/dist/chunk-454DAGYG.js +19 -0
  24. package/dist/{chunk-TRD22FC7.js → chunk-45S6M77O.js} +6 -6
  25. package/dist/chunk-4AJRHTTB.js +1 -0
  26. package/dist/chunk-4IVT244O.js +8 -0
  27. package/dist/{chunk-G2MJTE6X.js → chunk-4OFD6ICH.js} +10 -10
  28. package/dist/{chunk-5N5DBTTF.js → chunk-4SZDP3JF.js} +12 -12
  29. package/dist/{chunk-FMKTVZAO.js → chunk-4Y4PWKMM.js} +1 -1
  30. package/dist/{chunk-DIN3EFOM.js → chunk-5BZMSSOV.js} +8 -8
  31. package/dist/{chunk-64ZHCEZN.js → chunk-5TFTSYOD.js} +1 -1
  32. package/dist/{chunk-GK3QH63P.js → chunk-63EK6S3W.js} +1 -1
  33. package/dist/{chunk-ECCUEG3J.js → chunk-6BCFVOG7.js} +1 -1
  34. package/dist/{chunk-M2KV4WKR.js → chunk-6GWZ5UPX.js} +1 -1
  35. package/dist/{chunk-EBC4XFL2.js → chunk-6SMQNPWS.js} +1 -1
  36. package/dist/{chunk-EW6FRPFJ.js → chunk-6WWAQC5V.js} +1 -1
  37. package/dist/{chunk-TTY62G5D.js → chunk-7C56GLLI.js} +16 -16
  38. package/dist/{chunk-MICWRC72.js → chunk-7MSFHQAY.js} +7 -7
  39. package/dist/{chunk-XZL3HCWH.js → chunk-7OCNF4AI.js} +1 -1
  40. package/dist/chunk-AAW27HJY.js +3 -0
  41. package/dist/{chunk-WME5DFB6.js → chunk-BIJ7ADTZ.js} +1 -1
  42. package/dist/{chunk-SEXLHFMR.js → chunk-BMPBVI7P.js} +1 -1
  43. package/dist/{chunk-TOVHLONK.js → chunk-BT3XDH3L.js} +4 -4
  44. package/dist/{chunk-JVIOAZHW.js → chunk-BUGAWNOC.js} +4 -4
  45. package/dist/{chunk-R4C3GGCS.js → chunk-BVW5U7QQ.js} +3 -3
  46. package/dist/{chunk-AF7R2MV4.js → chunk-CKZ6ZDU5.js} +1 -1
  47. package/dist/{chunk-IHEEJO5S.js → chunk-CPK7JTN3.js} +1 -1
  48. package/dist/{chunk-EVB35JP5.js → chunk-DOCUM3K7.js} +1 -1
  49. package/dist/{chunk-FKZEGBLK.js → chunk-DXTKNHWG.js} +11 -11
  50. package/dist/{chunk-2U2GJCSP.js → chunk-EL2RLUT6.js} +7 -7
  51. package/dist/{chunk-4GVH4ZUH.js → chunk-ET2EF5CI.js} +1 -1
  52. package/dist/{chunk-MC43PRTL.js → chunk-EXWGPXOS.js} +1 -1
  53. package/dist/{chunk-2SHYR3RA.js → chunk-FSPFV4MI.js} +9 -4
  54. package/dist/{chunk-YBB56N6X.js → chunk-G63BCOQ6.js} +1 -1
  55. package/dist/{chunk-DG2WU3BU.js → chunk-GSBIJLTD.js} +2 -2
  56. package/dist/{chunk-ZXSMSVLU.js → chunk-I7HDD4IM.js} +1 -1
  57. package/dist/chunk-J47HXHSL.js +8 -0
  58. package/dist/{chunk-2WL3Q7VW.js → chunk-J7FZAOKT.js} +16 -16
  59. package/dist/{chunk-RB2F65YJ.js → chunk-JPRJQ6B7.js} +11 -11
  60. package/dist/{chunk-S4IW5OL3.js → chunk-K52WWA5G.js} +1 -1
  61. package/dist/{chunk-M2LLVSBR.js → chunk-KWX6NAOR.js} +1 -1
  62. package/dist/{chunk-OFKWTOXK.js → chunk-L7FDYGGF.js} +3 -3
  63. package/dist/{chunk-6ANFVX4M.js → chunk-L7IKTEOC.js} +11 -11
  64. package/dist/{chunk-EZY4CO4A.js → chunk-LGAN7DNC.js} +5 -5
  65. package/dist/{chunk-PCKYNZ5Y.js → chunk-LGLZTJ2W.js} +6 -6
  66. package/dist/{chunk-WKRFD4E4.js → chunk-LSISFKKS.js} +8 -8
  67. package/dist/{chunk-7ACSSYEZ.js → chunk-MEJK6PBN.js} +1 -1
  68. package/dist/{chunk-4RNF6MNW.js → chunk-MGXE75N5.js} +2 -2
  69. package/dist/{chunk-IUCIYWTT.js → chunk-NDO24PK6.js} +8 -8
  70. package/dist/{chunk-XDDTFV32.js → chunk-NESJOC3R.js} +1 -1
  71. package/dist/{chunk-BYCOB6WT.js → chunk-NGBT7AHL.js} +6 -6
  72. package/dist/chunk-NLWS7HMX.js +29 -0
  73. package/dist/chunk-O4Q475GF.js +1 -0
  74. package/dist/chunk-PCQPV6MS.js +6 -0
  75. package/dist/{chunk-CCPNMYCK.js → chunk-Q23EHOXW.js} +1 -1
  76. package/dist/{chunk-ACW3J77L.js → chunk-Q7HN6T3H.js} +1 -1
  77. package/dist/{chunk-NUSSZJF2.js → chunk-REVC6YPT.js} +5 -5
  78. package/dist/{chunk-2AHHM4SK.js → chunk-RJ4KZGAT.js} +56 -56
  79. package/dist/{chunk-EM6BEHAD.js → chunk-RWGSMZGS.js} +1 -1
  80. package/dist/{chunk-4MO375G3.js → chunk-S2OIRC5H.js} +3 -3
  81. package/dist/chunk-SG3ILR7W.js +4 -0
  82. package/dist/{chunk-FTKKGGOQ.js → chunk-SR4XAYLC.js} +1 -1
  83. package/dist/{chunk-RPJ2GC3K.js → chunk-SRKSGUGT.js} +20 -20
  84. package/dist/{chunk-2F7ZOMKK.js → chunk-SZIENHKR.js} +1 -1
  85. package/dist/{chunk-UZ3CZQA4.js → chunk-TGLHJS3M.js} +1 -1
  86. package/dist/{chunk-O2YAB6WK.js → chunk-TIQKDAON.js} +6 -6
  87. package/dist/{chunk-TANR67XF.js → chunk-TVJRENCQ.js} +9 -9
  88. package/dist/{chunk-SWHRP52Y.js → chunk-TZMJEOZA.js} +1 -1
  89. package/dist/{chunk-MY755PTJ.js → chunk-UZMZ2EDW.js} +1 -1
  90. package/dist/{chunk-S4J4B7LY.js → chunk-WCKZHEFC.js} +5 -5
  91. package/dist/{chunk-5OX6KXWY.js → chunk-WIW2547G.js} +1 -1
  92. package/dist/{chunk-AZU7YOES.js → chunk-WRORJNS5.js} +8 -8
  93. package/dist/{chunk-XB2YPUKR.js → chunk-XLD53X4P.js} +8 -8
  94. package/dist/{chunk-4HCRZHIX.js → chunk-XSPDPN5O.js} +1 -1
  95. package/dist/{chunk-TZHWF3P5.js → chunk-Y6IQYQYN.js} +2 -2
  96. package/dist/chunk-YALPQIBR.js +7 -0
  97. package/dist/{chunk-HAIMJAI4.js → chunk-ZCHBOAPA.js} +2 -2
  98. package/dist/{chunk-M2AIC7IK.js → chunk-ZEKM6HAA.js} +2 -2
  99. package/dist/{chunk-5YELPBUT.js → chunk-ZK2SULCA.js} +1 -1
  100. package/dist/{chunk-BHMUOWAE.js → chunk-ZSFUNXRD.js} +4 -4
  101. package/dist/{chunk-JDKRQG7X.js → chunk-ZWAVSUWT.js} +2 -2
  102. package/dist/data/ListLoadError.js +1 -1
  103. package/dist/format/index.js +1 -1
  104. package/dist/forms/BorderInput.js +1 -1
  105. package/dist/forms/BrandAssetEditor.js +1 -1
  106. package/dist/forms/Calendar.js +1 -1
  107. package/dist/forms/ColorPicker.js +1 -1
  108. package/dist/forms/ComposerAttachments.js +1 -1
  109. package/dist/forms/CornersInput.js +1 -1
  110. package/dist/forms/DatePicker.js +1 -1
  111. package/dist/forms/DateRangePicker.js +1 -1
  112. package/dist/forms/DisplayChips.js +1 -1
  113. package/dist/forms/FilePicker.js +1 -1
  114. package/dist/forms/IconPicker.js +1 -1
  115. package/dist/forms/InputNumber.js +1 -1
  116. package/dist/forms/LinkPicker.js +1 -1
  117. package/dist/forms/MediaLibrary.js +1 -1
  118. package/dist/forms/MediaUploadField.js +1 -1
  119. package/dist/forms/MediaUploadGrid.js +1 -1
  120. package/dist/forms/MediaUsedInList.js +1 -1
  121. package/dist/forms/PositionInput.js +1 -1
  122. package/dist/forms/Select.js +1 -1
  123. package/dist/forms/SidesInput.js +1 -1
  124. package/dist/forms/Slider.js +1 -1
  125. package/dist/forms/Snippet.js +1 -1
  126. package/dist/forms/SplitButton.js +1 -1
  127. package/dist/forms/TagInput.js +1 -1
  128. package/dist/forms/TextToolbar.js +1 -1
  129. package/dist/forms/WidthsBar.js +1 -1
  130. package/dist/forms/mediaLibraryMenu.js +1 -1
  131. package/dist/forms/textAlign.js +1 -1
  132. package/dist/icons/index.js +1 -1
  133. package/dist/index.js +169 -169
  134. package/dist/map/index.js +3 -3
  135. package/dist/markdown/index.js +1 -1
  136. package/dist/page-tabs/index.js +5 -5
  137. package/dist/pdf/index.js +1 -1
  138. package/dist/shell/Accordion.js +1 -1
  139. package/dist/shell/AppUpdateBanner.js +1 -1
  140. package/dist/shell/Banner.js +1 -1
  141. package/dist/shell/Breadcrumbs.js +1 -1
  142. package/dist/shell/ColoredBadge.js +1 -1
  143. package/dist/shell/ConfirmDialog.js +1 -1
  144. package/dist/shell/ContextMenu.js +1 -1
  145. package/dist/shell/Dialog.d.ts +2 -2
  146. package/dist/shell/Dialog.js +1 -1
  147. package/dist/shell/Drawer.d.ts +2 -2
  148. package/dist/shell/Drawer.js +1 -1
  149. package/dist/shell/DropdownMenu.js +1 -1
  150. package/dist/shell/EmptyState.js +1 -1
  151. package/dist/shell/HelpCenter.js +1 -1
  152. package/dist/shell/ImageLightbox.js +1 -1
  153. package/dist/shell/LanguageSelect.js +1 -1
  154. package/dist/shell/Markdown.js +1 -1
  155. package/dist/shell/PageHeader.js +1 -1
  156. package/dist/shell/PopupMenu.js +1 -1
  157. package/dist/shell/ProductionTimeline.js +1 -1
  158. package/dist/shell/Result.js +1 -1
  159. package/dist/shell/SearchableSelect.js +1 -1
  160. package/dist/shell/SettingReset.js +1 -1
  161. package/dist/shell/SettingRow.js +1 -1
  162. package/dist/shell/SidebarLayout.js +1 -1
  163. package/dist/shell/SidebarNav.js +1 -1
  164. package/dist/shell/SortableList.js +1 -1
  165. package/dist/shell/StepChain.js +1 -1
  166. package/dist/shell/Stepper.js +1 -1
  167. package/dist/shell/TopNav.js +1 -1
  168. package/dist/shell/Tree.js +1 -1
  169. package/dist/telemetry/index.js +1 -1
  170. package/dist/templates/ChatTemplate.js +1 -1
  171. package/dist/templates/CheckoutTemplate.js +1 -1
  172. package/dist/templates/DataTablePage.js +1 -1
  173. package/dist/templates/EmailTemplate.js +1 -1
  174. package/dist/templates/FormLayoutPage.js +1 -1
  175. package/dist/ui/index.js +1 -1
  176. package/dist/version.js +1 -1
  177. package/package.json +1 -1
  178. package/dist/Calculator-NXIOZMML.js +0 -29
  179. package/dist/CurrencyConverter-57WUTV4H.js +0 -21
  180. package/dist/Files-O44UH6ZF.js +0 -87
  181. package/dist/Notepad-66ZCGUHC.js +0 -25
  182. package/dist/PdfViewer-KSLOYXMD.js +0 -1
  183. package/dist/Sidebar-QQFJJWE2.js +0 -43
  184. package/dist/Spreadsheet-OYAVNRCT.js +0 -37
  185. package/dist/Stock-CIHUZOQS.js +0 -16
  186. package/dist/chunk-2PWZNFFP.js +0 -19
  187. package/dist/chunk-5FCEBKT2.js +0 -7
  188. package/dist/chunk-BZMZTPS6.js +0 -1
  189. package/dist/chunk-CAMLFCGY.js +0 -29
  190. package/dist/chunk-HMHL27AU.js +0 -6
  191. package/dist/chunk-JBQWR4SX.js +0 -8
  192. package/dist/chunk-NKZNPYDB.js +0 -3
  193. package/dist/chunk-QPWD5CCS.js +0 -8
  194. package/dist/chunk-TW6WYYBC.js +0 -3
@@ -1,20 +1,20 @@
1
- import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-3PGK3VFS.js";import{GROUP_COLORS as n}from"./chunk-D323R2FT.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{OneLineLabel as i}from"./chunk-6KO5VTL7.js";import{Tooltip as s}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
1
+ import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-3PGK3VFS.js";import{GROUP_COLORS as n}from"./chunk-D323R2FT.js";import{Icon as o}from"./chunk-FSPFV4MI.js";import{OneLineLabel as i}from"./chunk-6KO5VTL7.js";import{Tooltip as s}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
2
2
  return g("div",{...n,ref:o,role:"tree","aria-label":r?void 0:e,"aria-labelledby":r,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:t})}function v({children:e,hidden:r,className:t=""}){/* @__PURE__ */
3
3
  return g("div",{role:"group",hidden:r,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${t}`.trim(),children:e})}var x=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),k=`${x} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function w(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!m(e)&&"label"in e}function N(e){if(null==e||!1===e)return null;const r=Array.isArray(e)&&e.length>0&&e.every(w)?e:w(e)?[e]:null;return r?r.map((e,r)=>/* @__PURE__ */g("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${x} ${n[e.tone]}`:k,children:e.label},r)):/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:e})}function A({children:e,count:r,expanded:t,onToggle:a}){const n=void 0!==t,o=
4
4
  /* @__PURE__ */g("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */g(i,{children:e})}),s=null!=r&&!1!==r&&/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:r}),l="text-xs font-semibold uppercase tracking-wide text-gray-500";return n?/* @__PURE__ */g("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */h("button",{type:"button","aria-expanded":t,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",l].join(" "),children:[
5
5
  /* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:j(!!t)}),o,s]})}):/* @__PURE__ */h("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${l}`,children:[
6
- /* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),o,s]})}var j=e=>/* @__PURE__ */g(o,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function C({label:n,level:o=1,icon:s,preview:l,selected:c=!1,tone:d,expanded:u,onToggle:m,onSelect:f,muted:b=!1,badge:y,actions:v,actionsPinned:x=!1,actionsOverlay:k=!0,rename:w,drop:A,dragging:C=!1,draggable:P=!1,dragHint:$,onMove:K,rowProps:S,className:E=""}){const H=void 0!==u,I=p(),T=[S?.["aria-describedby"],K?I:void 0].filter(Boolean).join(" ")||void 0,R="shared"===d?"text-[color:var(--status-success-soft-ink)]":null,L=c?R?`bg-[var(--status-success-soft)] ${R}`:"bg-blue-50 text-blue-700":"into"===A?`bg-blue-50 ${R??"text-gray-900"}`:`${R??"text-gray-700"} hover:bg-gray-100`;/* @__PURE__ */
7
- return h("div",{...S,role:"treeitem","aria-level":o,"aria-selected":c,"aria-expanded":H?u:void 0,"data-tone":d,tabIndex:c?0:-1,"aria-keyshortcuts":S?.["aria-keyshortcuts"]??(K?e:void 0),"aria-describedby":T,"data-drop":A,"data-draggable":P||void 0,onKeyDown:e=>{if(S?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&K?(e.preventDefault(),K(r)):"Enter"!==e.key&&" "!==e.key||!f?("ArrowRight"===e.key&&H&&!u&&m||"ArrowLeft"===e.key&&H&&u&&m)&&(e.preventDefault(),m()):(e.preventDefault(),f())},onClick:e=>{S?.onClick?.(e),e.defaultPrevented||f?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",P?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",L,"into"===A?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",C?"opacity-40":"",E].filter(Boolean).join(" "),children:["before"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),P&&
8
- /* @__PURE__ */g(r,{marker:"tree",hint:$,dragging:C,revealClassName:"group-hover/treerow:opacity-100"}),
9
- /* @__PURE__ */g("span",H?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),m?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!u)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(b?"text-gray-400":""),children:s}),
6
+ /* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),o,s]})}var j=e=>/* @__PURE__ */g(o,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function P({label:n,level:o=1,icon:s,preview:l,selected:c=!1,tone:d,expanded:u,onToggle:m,onSelect:f,muted:b=!1,badge:y,actions:v,actionsPinned:x=!1,actionsOverlay:k=!0,rename:w,drop:A,dragging:P=!1,draggable:C=!1,dragHint:$,onMove:K,rowProps:I,className:S=""}){const E=void 0!==u,T=p(),H=[I?.["aria-describedby"],K?T:void 0].filter(Boolean).join(" ")||void 0,F="shared"===d?"text-[color:var(--status-success-soft-ink)]":null,L=c?F?`bg-[var(--status-success-soft)] ${F}`:"bg-blue-50 text-blue-700":"into"===A?`bg-blue-50 ${F??"text-gray-900"}`:`${F??"text-gray-700"} hover:bg-gray-100`;/* @__PURE__ */
7
+ return h("div",{...I,role:"treeitem","aria-level":o,"aria-selected":c,"aria-expanded":E?u:void 0,"data-tone":d,tabIndex:c?0:-1,"aria-keyshortcuts":I?.["aria-keyshortcuts"]??(K?e:void 0),"aria-describedby":H,"data-drop":A,"data-draggable":C||void 0,onKeyDown:e=>{if(I?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&K?(e.preventDefault(),K(r)):"Enter"!==e.key&&" "!==e.key||!f?("ArrowRight"===e.key&&E&&!u&&m||"ArrowLeft"===e.key&&E&&u&&m)&&(e.preventDefault(),m()):(e.preventDefault(),f())},onClick:e=>{I?.onClick?.(e),e.defaultPrevented||f?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",C?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",L,"into"===A?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",P?"opacity-40":"",S].filter(Boolean).join(" "),children:["before"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),C&&
8
+ /* @__PURE__ */g(r,{marker:"tree",hint:$,dragging:P,revealClassName:"group-hover/treerow:opacity-100"}),
9
+ /* @__PURE__ */g("span",E?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),m?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!u)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(b?"text-gray-400":""),children:s}),
10
10
  /* @__PURE__ */h("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[w??
11
11
  /* @__PURE__ */g("span",{className:`flex min-w-0 ${c?"font-semibold":"font-medium"} ${b?"text-gray-400 line-through":""}`,children:/* @__PURE__ */h(i,{children:[n,null!=l&&/* @__PURE__ */g("span",{className:"ml-2 font-normal text-gray-500",children:l})]})}),N(y),null!=v&&!k&&/* @__PURE__ */g("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(x||b?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:v})]}),null!=v&&k&&
12
12
  /* @__PURE__ */h("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:D,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(x||b||c?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
13
13
  /* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
14
14
  /* @__PURE__ */g("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
15
- /* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:v})]}),K&&/* @__PURE__ */g(t,{id:I})]})}function P({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
15
+ /* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:v})]}),K&&/* @__PURE__ */g(t,{id:T})]})}function C({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
16
16
  return g("div",{...a,role:"presentation","data-drop":t||void 0,children:e?/* @__PURE__ */h("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
17
17
  /* @__PURE__ */g("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */g("span",{className:i,children:o})})}function $({onInsert:e,label:r,drop:t=!1,seamProps:a}){const n=c().tree,i=r??n.insertHere,l=t?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
18
18
  return h("div",{...a,role:"presentation","data-tree-seam":"","data-drop":t||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
19
19
  /* @__PURE__ */g("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
20
- /* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${l}`}),e&&/* @__PURE__ */g(s,{content:i,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */g("button",{type:"button","aria-label":i,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(t?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(o,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,P as TreeEmptySlot,v as TreeGroup,A as TreeGroupLabel,C as TreeRow,$ as TreeSeam};
20
+ /* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${l}`}),e&&/* @__PURE__ */g(s,{content:i,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */g("button",{type:"button","aria-label":i,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(t?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(o,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,v as TreeGroup,A as TreeGroupLabel,P as TreeRow,$ as TreeSeam};
@@ -1,3 +1,3 @@
1
- import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-D323R2FT.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{OneLineLabel as r}from"./chunk-6KO5VTL7.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
1
+ import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-D323R2FT.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{OneLineLabel as r}from"./chunk-6KO5VTL7.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
2
2
  return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
3
3
  /* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-2SHYR3RA.js";import{SpinnerRing as t}from"./chunk-Q5MD3VY6.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
1
+ import{Icon as e}from"./chunk-FSPFV4MI.js";import{SpinnerRing as t}from"./chunk-Q5MD3VY6.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
2
2
  /* @__PURE__ */l("button",{type:"button",onClick:()=>{h(!x),d?.(!x)},"aria-expanded":x,"aria-controls":x?g:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
3
3
  /* @__PURE__ */n(e,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(x?"rotate-90":"")}),
4
4
  /* @__PURE__ */n("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:t})]}),x&&/* @__PURE__ */n("ol",{id:g,"aria-label":m,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:p})]})}var o={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},d={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function m({status:a}){switch(a){case"active":/* @__PURE__ */
@@ -31,7 +31,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
31
31
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})},check:function({size:e=18,...r}){/* @__PURE__ */
32
32
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})})},"check-circle":function({size:e=18,...r}){/* @__PURE__ */
33
33
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})},"check-circle:mini":function({size:e=18,...r}){/* @__PURE__ */
34
- return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"})})},"chevron-double-left":function({size:e=18,...r}){/* @__PURE__ */
34
+ return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"})})},"check:mini":function({size:e=18,...r}){/* @__PURE__ */
35
+ return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})})},"chevron-double-left":function({size:e=18,...r}){/* @__PURE__ */
35
36
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"})})},"chevron-double-right":function({size:e=18,...r}){/* @__PURE__ */
36
37
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"})})},"chevron-down":function({size:e=18,...r}){/* @__PURE__ */
37
38
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},"chevron-left":function({size:e=18,...r}){/* @__PURE__ */
@@ -47,7 +48,10 @@ return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-h
47
48
  return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})})},code:function({size:e=18,...r}){/* @__PURE__ */
48
49
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})})},collapse:function({size:e=18,...r}){/* @__PURE__ */
49
50
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})})},copy:function({size:e=18,...r}){/* @__PURE__ */
50
- return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})})},corner:function({size:e=18,...r}){/* @__PURE__ */
51
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})})},"copy:mini":function({size:e=18,...r}){/* @__PURE__ */
52
+ return o("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:[
53
+ /* @__PURE__ */t("path",{fillRule:"evenodd",d:"M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z",clipRule:"evenodd"}),
54
+ /* @__PURE__ */t("path",{d:"M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"})]})},corner:function({size:e=18,...r}){/* @__PURE__ */
51
55
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M5.25 18.75V9a3.75 3.75 0 0 1 3.75-3.75h9.75"})})},crop:function({size:e=18,...r}){/* @__PURE__ */
52
56
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M6.75 3v14.25h14.25M3 6.75h14.25V21"})})},"crop-bottom":function({size:e=18,...r}){/* @__PURE__ */
53
57
  return o("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:[
@@ -156,7 +160,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
156
160
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"})})},subscript:function({size:e=18,...r}){/* @__PURE__ */
157
161
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M4.59 15.75L9 5.25L13.41 15.75M6.266 11.97L11.734 11.97M15.75 17.156a1.40625 1.40625 0 1 1 2.813 0c0 .75-0.75 1.2-2.813 3.281h2.813"})})},superscript:function({size:e=18,...r}){/* @__PURE__ */
158
162
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M4.59 19.5L9 9L13.41 19.5M6.266 15.72L11.734 15.72M15.75 5.156a1.40625 1.40625 0 1 1 2.813 0c0 .75-0.75 1.2-2.813 3.281h2.813"})})},swap:function({size:e=18,...r}){/* @__PURE__ */
159
- return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})})},"text-color":function({size:e=18,...r}){/* @__PURE__ */
163
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})})},table:function({size:e=18,...r}){/* @__PURE__ */
164
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"})})},"text-color":function({size:e=18,...r}){/* @__PURE__ */
160
165
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{"data-part":"swatch",d:"M10 3L14 3L21 21L17 21L15.44 17L8.56 17L7 21L3 21ZM9.92 13.5L14.08 13.5L12 8.14Z"})})},trash:function({size:e=18,...r}){/* @__PURE__ */
161
166
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})},underline:function({size:e=18,...r}){/* @__PURE__ */
162
167
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.995 3.744v7.5a6 6 0 1 1-12 0v-7.5m-2.25 16.502h16.5"})})},undo:function({size:e=18,...r}){/* @__PURE__ */
@@ -166,5 +171,5 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
166
171
  return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"})})},widgets:function({size:e=18,...r}){/* @__PURE__ */
167
172
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})})},window:function({size:e=18,...r}){/* @__PURE__ */
168
173
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8.25V18a2.25 2.25 0 0 0 2.25 2.25h13.5A2.25 2.25 0 0 0 21 18V8.25m-18 0V6a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6ZM7.5 6h.008v.008H7.5V6Zm2.25 0h.008v.008H9.75V6Z"})})},"zoom-in":function({size:e=18,...r}){/* @__PURE__ */
169
- return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})})}};function h(e,r){return(r?d[`${e}:${r}`]:void 0)??d[e]}var a={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},u=/* @__PURE__ */new Set;function s({name:o,glyph:d,size:s,tone:l,look:c,title:L,fallback:k,className:M,...v}){n(e,r,r);const p=o??d,f=i(p,c)??k??h(p,c);if(!f)return u.has(p)||(u.add(p),console.warn(`efficient-shell/icons: no registered icon set draws "${p}". Register one at startup, for example registerIconSet(efficient) from 'efficient-shell/icons/efficient'.`)),null;const g=void 0!==L||void 0!==v["aria-label"]||void 0!==v["aria-labelledby"],w=[l?a[l]:"",M??""].filter(Boolean).join(" ");/* @__PURE__ */
174
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})})}};function h(e,r){return(r?d[`${e}:${r}`]:void 0)??d[e]}var a={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},u=/* @__PURE__ */new Set;function s({name:o,glyph:d,size:s,tone:c,look:l,title:L,fallback:k,className:M,...v}){n(e,r,r);const p=o??d,f=i(p,l)??k??h(p,l);if(!f)return u.has(p)||(u.add(p),console.warn(`efficient-shell/icons: no registered icon set draws "${p}". Register one at startup, for example registerIconSet(efficient) from 'efficient-shell/icons/efficient'.`)),null;const g=void 0!==L||void 0!==v["aria-label"]||void 0!==v["aria-labelledby"],w=[c?a[c]:"",M??""].filter(Boolean).join(" ");/* @__PURE__ */
170
175
  return t(f,{width:s??"1em",height:s??"1em","data-icon":p,"aria-hidden":!g||void 0,role:g?"img":void 0,"aria-label":L,...v,className:w||void 0})}export{s as Icon,h as kitDrawing};
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a}from"./chunk-HAIMJAI4.js";import{Icon as e}from"./chunk-2SHYR3RA.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
1
+ import{InputNumber_default as a}from"./chunk-ZCHBOAPA.js";import{Icon as e}from"./chunk-FSPFV4MI.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
2
2
  return r("div",{role:"group","aria-label":e,className:"grid min-w-0 grid-cols-2 gap-2",children:[u("x"),u("y")]})}export{s as PositionInput};
@@ -1,4 +1,4 @@
1
- import{navIcons as e}from"./chunk-CY5N5OA3.js";import{Icon as t}from"./chunk-2SHYR3RA.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},s={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
1
+ import{navIcons as e}from"./chunk-CY5N5OA3.js";import{Icon as t}from"./chunk-FSPFV4MI.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},s={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
2
2
  return o(t,{name:"folder",look:"solid",className:e})}function u(t,r){return r&&e[r]||(t?e[t]:void 0)}var m=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function h({entityType:e,isSelected:t,entityId:l,label:h,fileKind:w}){const g="preview-file"===e&&w,y=g?f[w]:null,x=g?c[w]:null;if("folder"===e)/* @__PURE__ */
3
3
  return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=u(l,h),i=a(l||h||"page");/* @__PURE__ */
4
4
  return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&r(e)?n(e,{className:"h-7 w-7 text-white"}):m})})}/* @__PURE__ */
@@ -10,4 +10,4 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
10
10
  /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${y??d[e]??"text-gray-600"}`,children:x??s[e]??e.slice(0,3).toUpperCase()})]})}function w({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
11
  return o(p,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=u(e.entityId,e.label);/* @__PURE__ */
12
12
  return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${a(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&r(t)?n(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?f[e.fileKind]:d[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function j(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function I(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function S(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function T(){const e=S();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,C as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,T as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,S as peekFilesViewRequest,b as publishDesktopFolders,I as requestFilesDesktopFolderView,j as requestFilesTrashView,v as subscribeDesktopFolders};
13
+ return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function j(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function I(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function P(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function S(){const e=P();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,C as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,S as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,P as peekFilesViewRequest,b as publishDesktopFolders,I as requestFilesDesktopFolderView,j as requestFilesTrashView,v as subscribeDesktopFolders};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as a}from"./chunk-2PWZNFFP.js";import{Pagination as r}from"./chunk-M5P6A7KS.js";import{Input_default as t}from"./chunk-GX2GSDJP.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-D323R2FT.js";import{Button_default as l}from"./chunk-4IU5BSVE.js";import{Icon as c}from"./chunk-2SHYR3RA.js";import{TH_ONE_LINE as m}from"./chunk-6KO5VTL7.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as a}from"./chunk-454DAGYG.js";import{Pagination as r}from"./chunk-M5P6A7KS.js";import{Input_default as t}from"./chunk-GX2GSDJP.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-D323R2FT.js";import{Button_default as l}from"./chunk-4IU5BSVE.js";import{Icon as c}from"./chunk-FSPFV4MI.js";import{TH_ONE_LINE as m}from"./chunk-6KO5VTL7.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
2
2
  return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
@@ -0,0 +1,8 @@
1
+ import{useOverlayTarget as e,OverlayLayerProvider as r}from"./chunk-4AJRHTTB.js";import{dialogA11y as i}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-PKXQDCNR.js";import{useFocusTrap as t,useScrollLock as l}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import{Z_LAYERS as a}from"./chunk-62LW225J.js";import{useHydrated as n}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as d}from"./chunk-TWVUQUUD.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as m,useId as h,useState as u,useEffect as f}from"react";import{createPortal as p}from"react-dom";import{jsx as b,jsxs as x}from"react/jsx-runtime";var g={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},y={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function v({onClose:e}){const r=c().dialog;/* @__PURE__ */
2
+ return b("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function k({open:s,onClose:c,side:k="right",size:N="md",title:j,description:w,footer:C,children:W,blocking:D=!1,initialFocus:J,"aria-label":L,"aria-labelledby":T,"aria-describedby":U,className:z=""}){const A=m(null),B=h(),F=h(),G=h(),H=e(n()),[I,V]=u(null);if(o(s),t(A,s&&null!==H,J),l(s),f(()=>{if(s)return d(()=>(D||c(),!0),()=>A.current)},[s,D,c]),!s||!H)return null;const K="bottom"===k,P=K?{maxHeight:"85vh"}:void 0;return p(
3
+ /* @__PURE__ */b(r,{value:I,children:/* @__PURE__ */x("div",{ref:V,className:"fixed inset-0",style:{zIndex:a.overlay},role:"presentation",children:[
4
+ /* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30",onClick:D?void 0:c,"aria-hidden":"true"}),
5
+ /* @__PURE__ */x("div",{ref:A,...i({modal:!0,titleId:j?G:void 0,labelledBy:T,label:L}),"aria-describedby":U??(w?F:W?B:void 0),"data-drawer-side":k,style:P,className:["fixed flex flex-col bg-white shadow-xl",K?"":`w-full max-w-full ${g[N]}`,y[k],K?"rounded-t-xl":"",z].filter(Boolean).join(" "),children:[j?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
6
+ /* @__PURE__ */x("div",{className:"min-w-0",children:[
7
+ /* @__PURE__ */b("h2",{id:G,className:"text-base font-semibold text-gray-900",children:j}),w&&/* @__PURE__ */b("p",{id:F,className:"mt-0.5 text-sm text-gray-500",children:w})]}),!D&&/* @__PURE__ */b(v,{onClose:c})]}):!D&&/* @__PURE__ */b("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */b(v,{onClose:c})}),
8
+ /* @__PURE__ */x("div",{id:B,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[w&&!j&&/* @__PURE__ */b("p",{id:F,className:("mb-3 text-sm text-gray-500 "+(D?"":"pr-8")).trim(),children:w}),W]}),C&&/* @__PURE__ */b("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:C})]})]})}),H)}export{k as Drawer};
@@ -1,27 +1,27 @@
1
- import{Dialog as e}from"./chunk-TW6WYYBC.js";import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{useShellStrings as n,splitAround as o}from"./chunk-E6UCGCOC.js";import{createContext as l,useContext as a,useState as i,useRef as s,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var b=l(()=>Promise.resolve(!1)),f=()=>a(b),g=()=>Promise.resolve(!1),p=e=>g(e),y=()=>Promise.resolve(!1),v=e=>y(e),x=()=>Promise.resolve(null),N=e=>x(e),k={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-blue-100",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),L="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function P(){/* @__PURE__ */
1
+ import{Dialog as e}from"./chunk-SG3ILR7W.js";import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useShellStrings as n,splitAround as o}from"./chunk-E6UCGCOC.js";import{createContext as l,useContext as a,useState as i,useRef as s,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var b=l(()=>Promise.resolve(!1)),f=()=>a(b),g=()=>Promise.resolve(!1),p=e=>g(e),y=()=>Promise.resolve(!1),v=e=>y(e),x=()=>Promise.resolve(null),N=e=>x(e),k={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-blue-100",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),L="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function P(){/* @__PURE__ */
2
2
  return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j(){/* @__PURE__ */
3
- return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:t}){const[r,l]=i(!1),[a,f]=i({message:""}),[p,v]=i(0),N=s(),E=s(null),W=s(0),F=s([]),T=s(null),$=s(null),K=c(e=>{E.current=e.id,N.current=e.resolve,v(e.id),f(e.options),l(!0)},[]),R=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++W.current,options:t,resolve:e};null===E.current?K(r):F.current.push(r)})},[K]),[Y,D]=i(!1),[U,A]=i({message:""}),[B,G]=i(""),H=s(),J=c(e=>(A(e),G(""),D(!0),new Promise(e=>{H.current=e})),[]),[O,S]=i(!1),[V,X]=i({}),[q,z]=i(""),I=s(),M=c(e=>{const t="string"==typeof e?{message:e}:e;return X(t),z(t.defaultValue??""),S(!0),new Promise(e=>{I.current=e})},[]);u(()=>{g=R,y=J,x=M},[R,J,M]);const Q=(e,t)=>{if(E.current!==e)return;const r=N.current,n=F.current.shift();n?K(n):(E.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{D(!1),G(""),H.current?.(e)},_=e=>{if(e){const e=q.trim();if(!e&&!V.allowEmpty)return S(!1),void I.current?.(null);S(!1),I.current?.(e)}else S(!1),I.current?.(null)},ee=a.variant||(a.confirmLabel?.toLowerCase().includes("delete")||a.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===U.variant?"warning":"danger"],ne=U.confirmWord,oe=null==ne||B===ne,le=n().dialog,[ae,ie]=o(le.typeToConfirm);/* @__PURE__ */
4
- return d(b.Provider,{value:R,children:[t,
5
- /* @__PURE__ */m(e,{open:r,onClose:()=>Q(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
6
- /* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>Q(p,!1),className:w,children:a.cancelLabel||le.cancel}),
7
- /* @__PURE__ */m("button",{type:"button",onClick:()=>Q(p,!0),className:te.button,children:a.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
3
+ return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:t}){const[r,l]=i(!1),[a,f]=i({message:""}),[p,v]=i(0),N=s(),F=s(null),E=s(0),W=s([]),T=s(null),$=s(null),K=c(e=>{F.current=e.id,N.current=e.resolve,v(e.id),f(e.options),l(!0)},[]),D=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===F.current?K(r):W.current.push(r)})},[K]),[G,I]=i(!1),[R,S]=i({message:""}),[U,V]=i(""),J=s(),M=c(e=>(S(e),V(""),I(!0),new Promise(e=>{J.current=e})),[]),[O,X]=i(!1),[q,z]=i({}),[A,B]=i(""),H=s(),Q=c(e=>{const t="string"==typeof e?{message:e}:e;return z(t),B(t.defaultValue??""),X(!0),new Promise(e=>{H.current=e})},[]);u(()=>{g=D,y=M,x=Q},[D,M,Q]);const Y=(e,t)=>{if(F.current!==e)return;const r=N.current,n=W.current.shift();n?K(n):(F.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{I(!1),V(""),J.current?.(e)},_=e=>{if(e){const e=A.trim();if(!e&&!q.allowEmpty)return X(!1),void H.current?.(null);X(!1),H.current?.(e)}else X(!1),H.current?.(null)},ee=a.variant||(a.confirmLabel?.toLowerCase().includes("delete")||a.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===R.variant?"warning":"danger"],ne=R.confirmWord,oe=null==ne||U===ne,le=n().dialog,[ae,ie]=o(le.typeToConfirm);/* @__PURE__ */
4
+ return d(b.Provider,{value:D,children:[t,
5
+ /* @__PURE__ */m(e,{open:r,onClose:()=>Y(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
6
+ /* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>Y(p,!1),className:w,children:a.cancelLabel||le.cancel}),
7
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>Y(p,!0),className:te.button,children:a.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
8
8
  /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
9
9
  /* @__PURE__ */d("div",{className:"flex-1",children:[
10
10
  /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:a.title||le.confirmTitle}),
11
11
  /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:a.message})]})]})}),
12
- /* @__PURE__ */d(e,{open:Y,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
13
- /* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>Z(!1),className:w,children:U.cancelLabel||le.destructiveCancel}),
14
- /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??U.confirmLabel??le.destructiveConfirm})]}),children:[
12
+ /* @__PURE__ */d(e,{open:G,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
13
+ /* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>Z(!1),className:w,children:R.cancelLabel||le.destructiveCancel}),
14
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??R.confirmLabel??le.destructiveConfirm})]}),children:[
15
15
  /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
16
16
  /* @__PURE__ */d("div",{className:"flex gap-4",children:[
17
17
  /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(P,{})}),
18
18
  /* @__PURE__ */d("div",{className:"flex-1",children:[
19
- /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:U.title||le.destructiveTitle}),
20
- /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:U.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
19
+ /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:R.title||le.destructiveTitle}),
20
+ /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:R.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
21
21
  /* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ae,
22
22
  /* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),ie]}),
23
- /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:B,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key&&B===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
24
- /* @__PURE__ */d(e,{open:O,onClose:()=>_(!1),title:V.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
- /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:V.cancelLabel||le.cancel}),
26
- /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!V.allowEmpty&&!q.trim(),className:C,children:V.confirmLabel||le.ok})]}),children:[V.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:V.message}),
27
- /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:q,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:V.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{E as ConfirmProvider,p as confirm,v as confirmDestructive,N as prompt,f as useConfirm};
23
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:U,onChange:e=>V(e.target.value),onKeyDown:e=>{"Enter"===e.key&&U===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
24
+ /* @__PURE__ */d(e,{open:O,onClose:()=>_(!1),title:q.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:q.cancelLabel||le.cancel}),
26
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!q.allowEmpty&&!A.trim(),className:C,children:q.confirmLabel||le.ok})]}),children:[q.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:q.message}),
27
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:A,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:q.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,p as confirm,v as confirmDestructive,N as prompt,f as useConfirm};
@@ -1,14 +1,14 @@
1
- import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-E6UCGCOC.js";import{useMemo as l,useState as i,useRef as s,useEffect as c}from"react";import{jsxs as u,jsx as g,Fragment as d}from"react/jsx-runtime";var h=e=>String(e).padStart(2,"0"),m="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function b(e){return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function f(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var y=e=>`${e.getFullYear()}-${h(e.getMonth()+1)}`;var v=()=>b(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:h,endValue:w,mode:N="single",onSelect:D,min:M,max:Y,month:k,defaultMonth:F,onMonthChange:C,weekStartsOn:j,quickJump:A=!0,markedDates:S,readOnly:$=!1,"aria-label":q,className:O=""}){const P=l(()=>new Set(S??[]),[S]),E=f(h),H=a(v,null),K=f(H),R=n().calendar,T=o(),U=e(T),G=a(()=>t(T),0),J=j??G,W=()=>{if(!K)return null;const e=y(K);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[B,I]=i(()=>F||(E?y(E):W())),L=k??B??W(),V=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,K),[z,Q]=i(()=>h??H),X=s(null),Z=s(!1),[_,ee]=i("days"),te=l(()=>V?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(V,J):[],[L,J]),re=e=>!!M&&e<M||!!Y&&e>Y,ae=z??H,ne=te.some(e=>b(e)===ae),oe=V?te.find(e=>e.getMonth()===V.getMonth())??te[0]:null,le=ne&&ae?ae:oe?b(oe):"";if(c(()=>{Z.current&&(Z.current=!1,X.current?.querySelector('[data-active="true"]')?.focus())},[le,L]),!V)/* @__PURE__ */
2
- return u("div",{className:O,"aria-hidden":"true","data-calendar-pending":"",children:[
1
+ import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-E6UCGCOC.js";import{useMemo as l,useState as i,useRef as s,useEffect as c}from"react";import{jsxs as u,jsx as g,Fragment as d}from"react/jsx-runtime";var h=e=>String(e).padStart(2,"0"),m="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function b(e){return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function f(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var y=e=>`${e.getFullYear()}-${h(e.getMonth()+1)}`;var v=()=>b(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:h,endValue:w,mode:N="single",onSelect:D,min:M,max:Y,month:F,defaultMonth:k,onMonthChange:C,weekStartsOn:j,quickJump:S=!0,markedDates:$,readOnly:A=!1,"aria-label":P,className:q=""}){const O=l(()=>new Set($??[]),[$]),E=f(h),K=a(v,null),T=f(K),U=n().calendar,G=o(),H=e(G),I=a(()=>t(G),0),J=j??I,V=()=>{if(!T)return null;const e=y(T);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[W,B]=i(()=>k||(E?y(E):V())),L=F??W??V(),R=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,T),[z,Q]=i(()=>h??K),X=s(null),Z=s(!1),[_,ee]=i("days"),te=l(()=>R?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(R,J):[],[L,J]),re=e=>!!M&&e<M||!!Y&&e>Y,ae=z??K,ne=te.some(e=>b(e)===ae),oe=R?te.find(e=>e.getMonth()===R.getMonth())??te[0]:null,le=ne&&ae?ae:oe?b(oe):"";if(c(()=>{Z.current&&(Z.current=!1,X.current?.querySelector('[data-active="true"]')?.focus())},[le,L]),!R)/* @__PURE__ */
2
+ return u("div",{className:q,"aria-hidden":"true","data-calendar-pending":"",children:[
3
3
  /* @__PURE__ */g("div",{className:"mb-2 h-6"}),
4
- /* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(V.getFullYear()+12*e,V.getMonth(),1):"months"===_?new Date(V.getFullYear()+e,V.getMonth(),1):x(V,e),se=e=>{const t=y(e);void 0===k&&I(t),C?.(t)},ce=q??U.monthYear(V.getFullYear(),V.getMonth());/* @__PURE__ */
5
- return u("div",{className:O,children:[
4
+ /* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(R.getFullYear()+12*e,R.getMonth(),1):"months"===_?new Date(R.getFullYear()+e,R.getMonth(),1):x(R,e),se=e=>{const t=y(e);void 0===F&&B(t),C?.(t)},ce=P??H.monthYear(R.getFullYear(),R.getMonth());/* @__PURE__ */
5
+ return u("div",{className:q,children:[
6
6
  /* @__PURE__ */u("div",{className:"mb-2 flex items-center justify-between px-1",children:[
7
- /* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?R.previousYears:"months"===_?R.previousYear:R.previousMonth,onClick:()=>se(ie(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
8
- /* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:A?/* @__PURE__ */u(d,{children:["years"!==_&&/* @__PURE__ */g("button",{type:"button","aria-label":R.chooseMonth(U.months[V.getMonth()]),onClick:()=>ee(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:U.months[V.getMonth()]}),
9
- /* @__PURE__ */g("button",{type:"button","aria-label":R.chooseYear(V.getFullYear()),onClick:()=>ee(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:V.getFullYear()})]}):/* @__PURE__ */g("span",{children:U.monthYear(V.getFullYear(),V.getMonth())})}),
10
- /* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?R.nextYears:"months"===_?R.nextYear:R.nextMonth,onClick:()=>se(ie(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":R.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:U.monthsShort.map((e,t)=>/* @__PURE__ */g("button",{type:"button","aria-pressed":t===V.getMonth(),onClick:()=>{se(new Date(V.getFullYear(),t,1)),ee("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===V.getMonth()?"bg-blue-600 font-semibold text-white":K&&t===K.getMonth()&&V.getFullYear()===K.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":R.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=V.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */g("button",{type:"button","aria-pressed":e===V.getFullYear(),onClick:()=>{se(new Date(e,V.getMonth(),1)),ee("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===V.getFullYear()?"bg-blue-600 font-semibold text-white":e===K?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
11
- /* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly":$||void 0,onKeyDown:e=>{const t=f(le)??K??V,r={ArrowLeft:()=>p(t,-1),ArrowRight:()=>p(t,1),ArrowUp:()=>p(t,-7),ArrowDown:()=>p(t,7),Home:()=>p(t,-(t.getDay()-J+7)%7),End:()=>p(t,6-(t.getDay()-J+7)%7),PageUp:()=>x(t,e.shiftKey?-12:-1),PageDown:()=>x(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),Z.current=!0,Q(b(a)),void(y(a)!==L&&se(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$||re(le)||D(le))},hidden:"days"!==_,children:[
7
+ /* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?U.previousYears:"months"===_?U.previousYear:U.previousMonth,onClick:()=>se(ie(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
8
+ /* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */u(d,{children:["years"!==_&&/* @__PURE__ */g("button",{type:"button","aria-label":U.chooseMonth(H.months[R.getMonth()]),onClick:()=>ee(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:H.months[R.getMonth()]}),
9
+ /* @__PURE__ */g("button",{type:"button","aria-label":U.chooseYear(R.getFullYear()),onClick:()=>ee(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:R.getFullYear()})]}):/* @__PURE__ */g("span",{children:H.monthYear(R.getFullYear(),R.getMonth())})}),
10
+ /* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?U.nextYears:"months"===_?U.nextYear:U.nextMonth,onClick:()=>se(ie(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":U.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:H.monthsShort.map((e,t)=>/* @__PURE__ */g("button",{type:"button","aria-pressed":t===R.getMonth(),onClick:()=>{se(new Date(R.getFullYear(),t,1)),ee("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===R.getMonth()?"bg-blue-600 font-semibold text-white":T&&t===T.getMonth()&&R.getFullYear()===T.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":U.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=R.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */g("button",{type:"button","aria-pressed":e===R.getFullYear(),onClick:()=>{se(new Date(e,R.getMonth(),1)),ee("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===R.getFullYear()?"bg-blue-600 font-semibold text-white":e===T?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
11
+ /* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly":A||void 0,onKeyDown:e=>{const t=f(le)??T??R,r={ArrowLeft:()=>p(t,-1),ArrowRight:()=>p(t,1),ArrowUp:()=>p(t,-7),ArrowDown:()=>p(t,7),Home:()=>p(t,-(t.getDay()-J+7)%7),End:()=>p(t,6-(t.getDay()-J+7)%7),PageUp:()=>x(t,e.shiftKey?-12:-1),PageDown:()=>x(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),Z.current=!0,Q(b(a)),void(y(a)!==L&&se(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),A||re(le)||D(le))},hidden:"days"!==_,children:[
12
12
  /* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+J)%7).map(e=>
13
- /* @__PURE__ */g("div",{role:"columnheader","aria-label":U.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:U.weekdays[e],className:"no-underline",children:U.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-sm`,children:te.slice(7*t,7*t+7).map(e=>{const t=b(e),r=e.getMonth()!==V.getMonth(),a=t===h||"range"===N&&t===w,n=(e=>!("range"!==N||!h||!w)&&e>h&&e<w)(t),o=re(t),l=U.longDate(e.getFullYear(),e.getMonth(),e.getDate()),i=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"cursor-not-allowed text-gray-300":a?"bg-blue-600 font-semibold text-white":n?"bg-blue-100 text-blue-800":r?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),t!==H||a?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),s=P.has(t)&&/* @__PURE__ */g("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(a?"bg-white":r?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
14
- return g("div",{role:"gridcell","aria-selected":a,"aria-label":$?l:void 0,children:$?/* @__PURE__ */u("span",{"aria-hidden":"true",className:`grid place-items-center ${i(!1)}`,children:[e.getDate(),s]}):/* @__PURE__ */u("button",{type:"button","data-active":t===le,tabIndex:t===le?0:-1,disabled:o,"aria-label":l,"aria-current":t===H?"date":void 0,onClick:()=>{Q(t),D(t)},className:i(!0),children:[e.getDate(),s]})},t)})},t))]})]})}export{w as Calendar,f as fromKey,b as toKey};
13
+ /* @__PURE__ */g("div",{role:"columnheader","aria-label":H.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:H.weekdays[e],className:"no-underline",children:H.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-sm`,children:te.slice(7*t,7*t+7).map(e=>{const t=b(e),r=e.getMonth()!==R.getMonth(),a=t===h||"range"===N&&t===w,n=(e=>!("range"!==N||!h||!w)&&e>h&&e<w)(t),o=re(t),l=H.longDate(e.getFullYear(),e.getMonth(),e.getDate()),i=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"cursor-not-allowed text-gray-300":a?"bg-blue-600 font-semibold text-white":n?"bg-blue-100 text-blue-800":r?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),t!==K||a?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),s=O.has(t)&&/* @__PURE__ */g("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(a?"bg-white":r?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
14
+ return g("div",{role:"gridcell","aria-selected":a,"aria-label":A?l:void 0,children:A?/* @__PURE__ */u("span",{"aria-hidden":"true",className:`grid place-items-center ${i(!1)}`,children:[e.getDate(),s]}):/* @__PURE__ */u("button",{type:"button","data-active":t===le,tabIndex:t===le?0:-1,disabled:o,"aria-label":l,"aria-current":t===K?"date":void 0,onClick:()=>{Q(t),D(t)},className:i(!0),children:[e.getDate(),s]})},t)})},t))]})]})}export{w as Calendar,f as fromKey,b as toKey};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-2AHHM4SK.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
+ import{client_default as a}from"./chunk-RJ4KZGAT.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,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-4IU5BSVE.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.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__ */
1
+ import{Button_default as e}from"./chunk-4IU5BSVE.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.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{Segmented as e}from"./chunk-N6DTTOB6.js";import{ColorPicker as t}from"./chunk-G2MJTE6X.js";import{InputNumber_default as l}from"./chunk-HAIMJAI4.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{jsxs as a,Fragment as o,jsx as s}from"react/jsx-runtime";var i=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},S=(e,t,r,a,o,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(l,{value:a,onChange:i,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":t})}),C=n.map(j),O="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,A=null===O&&C.some(e=>null!==e),H=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",I=e=>j(e)??("number"==typeof d.width?d.width:null),T=d.style??u.style;/* @__PURE__ */
2
- return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[S("left",b.sides.left,h.left,I("left"),String(u.sides.left),e=>k("left",e)),S("top",b.sides.top,h.top,I("top"),String(u.sides.top),e=>k("top",e)),S("right",b.sides.right,h.right,I("right"),String(u.sides.right),e=>k("right",e)),S("bottom",b.sides.bottom,h.bottom,I("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):S("all",b.width,h.all,O,A?"–":H,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{block:!0,size:"sm",label:b.style,value:T,onChange:e=>{x||m({...d,style:e})},options:i.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
1
+ import{ColorPicker as e}from"./chunk-4OFD6ICH.js";import{InputNumber_default as t}from"./chunk-ZCHBOAPA.js";import{Segmented as l}from"./chunk-N6DTTOB6.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{jsxs as a,Fragment as o,jsx as s}from"react/jsx-runtime";var i=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},C=(e,l,r,a,o,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(t,{value:a,onChange:i,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":l})}),O=n.map(j),S="number"==typeof d.width?d.width:O.every(e=>null!==e&&e===O[0])?O[0]:null,F=null===S&&O.some(e=>null!==e),H=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",I=e=>j(e)??("number"==typeof d.width?d.width:null),z=d.style??u.style;/* @__PURE__ */
2
+ return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[C("left",b.sides.left,h.left,I("left"),String(u.sides.left),e=>k("left",e)),C("top",b.sides.top,h.top,I("top"),String(u.sides.top),e=>k("top",e)),C("right",b.sides.right,h.right,I("right"),String(u.sides.right),e=>k("right",e)),C("bottom",b.sides.bottom,h.bottom,I("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):C("all",b.width,h.all,S,F?"–":H,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(l,{block:!0,size:"sm",label:b.style,value:z,onChange:e=>{x||m({...d,style:e})},options:i.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
3
3
  /* @__PURE__ */s("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
4
- /* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"sm",disabled:x})})]})}export{i as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
4
+ /* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(e,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"sm",disabled:x})})]})}export{i as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
@@ -1,15 +1,15 @@
1
- import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-2SHYR3RA.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,R=a(r??null)??C,P=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[P,D,q,R+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-R)/i)),I=a(p??null)??D??R,j=Math.min(Math.max(y??I,R),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(R).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=L??F,G=L?a(L.date):F?R:null,z=$?a($.date):null,H=!!(E&&$&&null!=G&&null!=z&&j>G&&j<z);let J,U;if(H&&null!=G&&null!=z){const e=(j-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,J={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},U=E}else if(J=E??t[t.length-1]??null,J){const e=t.findIndex(e=>e.id===J.id);U=e>=0&&e<t.length-1?t[e+1]:null}else U=null;const Y={};for(const e of U?.items??[])Y[e.part_number]=e;const B=!(!d||J?.id===d),K=d?Math.min(a(p??null)??A,A):A,V=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:R,endMs:A,totalLeadDays:T,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:B,beforeAnchor:E,nextAfter:$,displayed:J,prevReport:U,prevByPN:Y,isInterpolated:H,playing:v,startPlay:()=>{if(v)return void N();if(K<=R)return void f(K);M(!0),f(R);let e=performance.now(),t=R;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:V,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
- return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:D,markers:R,poNumber:P,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),H=c().production,J=d(),U=_??H.heading,Y=e=>o(e,J);if(0===D.length&&0===R.length)return null;const B=R.filter(e=>"shipment"===e.kind),K=R.filter(e=>"inspection"===e.kind),V=R.filter(e=>"invoice"===e.kind),X=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=j?v(j):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
3
- /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?H.pause:H.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
- /* @__PURE__ */b("span",{children:z.playing?H.pause:H.play})]}),te=L&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??H.backTo(String(W))}):null,[re,ne]=p(H.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
1
+ import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,P=a(r??null)??C,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[R,D,q,P+i];return O||e.push(x),Math.max(...e)})(),I=Math.max(1,Math.round((A-P)/i)),T=a(p??null)??D??P,j=Math.min(Math.max(y??T,P),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(P).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=L??F,G=L?a(L.date):F?P:null,z=$?a($.date):null,J=!!(E&&$&&null!=G&&null!=z&&j>G&&j<z);let U,V;if(J&&null!=G&&null!=z){const e=(j-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,U={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},V=E}else if(U=E??t[t.length-1]??null,U){const e=t.findIndex(e=>e.id===U.id);V=e>=0&&e<t.length-1?t[e+1]:null}else V=null;const B={};for(const e of V?.items??[])B[e.part_number]=e;const H=!(!d||U?.id===d),K=d?Math.min(a(p??null)??A,A):A,X=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:P,endMs:A,totalLeadDays:I,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:E,nextAfter:$,displayed:U,prevReport:V,prevByPN:B,isInterpolated:J,playing:v,startPlay:()=>{if(v)return void N();if(K<=P)return void f(K);M(!0),f(P);let e=performance.now(),t=P;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:X,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
+ return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:D,markers:P,poNumber:R,startMs:O,endMs:q,totalLeadDays:A,scrubMs:I,setScrubMs:T,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),T,C),J=c().production,U=d(),V=_??J.heading,B=e=>o(e,U);if(0===D.length&&0===P.length)return null;const H=P.filter(e=>"shipment"===e.kind),K=P.filter(e=>"inspection"===e.kind),X=P.filter(e=>"invoice"===e.kind),Y=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=j?v(j):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
3
+ /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?J.pause:J.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
+ /* @__PURE__ */b("span",{children:z.playing?J.pause:J.play})]}),te=L&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??J.backTo(String(W))}):null,[re,ne]=p(J.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
5
5
  /* @__PURE__ */b("b",{className:"font-medium",children:N(j)}),e&&ne,
6
- /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(j.date).getTime())," · ",H.overall(Math.round(Z))," · ",H.inStock(X)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:H.noReport})});if("rail"===x){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:H.estimatedCompletion,dateText:Y(G)}:null;/* @__PURE__ */
6
+ /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",B(new Date(j.date).getTime())," · ",J.overall(Math.round(Z))," · ",J.inStock(Y)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:J.noReport})});if("rail"===x){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:J.estimatedCompletion,dateText:B(G)}:null;/* @__PURE__ */
7
7
  return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
8
- /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??H.start,end:M?.end??(e?H.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
8
+ /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:P,valueMs:I,activeId:j?.id??"",onChange:T,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??J.start,end:M?.end??(e?J.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>T(t),onProgress:f,onStop:z.stop}}),
9
9
  /* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
10
- return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:U,subject:P,meta:[`${Y(O)} → ${Y(q)}`,H.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
10
+ return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:V,subject:R,meta:[`${B(O)} → ${B(q)}`,J.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
11
11
  /* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[D.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
12
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),H.report]}),B.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),H.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),H.inspection]}),V.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),H.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
12
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),J.report]}),H.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),J.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),J.inspection]}),X.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),J.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:P,valueMs:I,activeId:j?.id??"",onChange:T,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>T(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
@@ -1,9 +1,9 @@
1
- import{ImageFocusPoint as e}from"./chunk-GATKJSGL.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Segmented as i}from"./chunk-N6DTTOB6.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-FMKTVZAO.js";import{TransferProgress as u}from"./chunk-S7VSXUKS.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-YDYDR72S.js";import{Icon as p}from"./chunk-2SHYR3RA.js";import{useShellStrings as b}from"./chunk-E6UCGCOC.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:U,hint:F,error:O,required:S,className:P,accept:$="image/*",maxSizeBytes:z,fit:V="cover",height:A=112,placeholder:B,cta:H,acceptHint:K,showFilename:T=!0,allowReplace:q=!0,allowRemove:D=!0,replaceLabel:G,removeLabel:Y,busy:I=!1,busyLabel:M,choosingLabel:W,pickFailedLabel:_,progress:E,disabled:J=!1,kind:Q,onKindChange:X,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,re=Q??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof Y&&Y?Y:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=I||ne,me=ne&&!I?W??ie.choosing:M??ie.uploading,he=O??(se?_??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=J||ue,ke=!!w&&(t(w,$)||w===ve),je=B??r($,ie),xe=G??(ke||"video"===re?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:K,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ce=w?o(w):"",Ue=!ke&&!!ee,Fe=J||!q&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[q&&/* @__PURE__ */k("button",{id:Ue?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{FormField as e}from"./chunk-MVQBVPWP.js";import{ImageFocusPoint as a}from"./chunk-GATKJSGL.js";import{Segmented as i}from"./chunk-N6DTTOB6.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-4Y4PWKMM.js";import{TransferProgress as u}from"./chunk-S7VSXUKS.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-YDYDR72S.js";import{Icon as p}from"./chunk-FSPFV4MI.js";import{useShellStrings as b}from"./chunk-E6UCGCOC.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:C,onFile:R,label:F,hint:U,error:P,required:S,className:O,accept:$="image/*",maxSizeBytes:z,fit:V="cover",height:B=112,placeholder:K,cta:M,acceptHint:q,showFilename:D=!0,allowReplace:G=!0,allowRemove:H=!0,replaceLabel:I,removeLabel:T,busy:W=!1,busyLabel:Y,choosingLabel:A,pickFailedLabel:_,progress:E,disabled:J=!1,kind:Q,onKindChange:X,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=M??ie.cta,re=Q??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof T&&T?T:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=W||ne,me=ne&&!W?A??ie.choosing:Y??ie.uploading,he=P??(se?_??ie.pickFailed:void 0),pe=e=>{if(!C)return;ce(!1);const a=C(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=J||ue,ke=!!w&&(t(w,$)||w===ve),je=K??r($,ie),xe=I??(ke||"video"===re?ie.changeVideo:ie.changeImage),Ne=e=>{C?pe(e):R?R(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:q,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Ce=()=>{ye||(C?pe():we.open())},Re=w?o(w):"",Fe=!ke&&!!ee,Ue=J||!G&&!H?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[G&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Ce(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
2
  /* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),D&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ue?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Ue?void 0:{height:A},children:[Ue?
4
- /* @__PURE__ */j(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:V}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:V,objectPosition:Z||void 0}}),T&&w&&/* @__PURE__ */j(n,{children:Ce}),Fe,ue&&/* @__PURE__ */j(l,{label:me,progress:E,rounded:"rounded-md"})]}),Se=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":S||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:A},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:E}):/* @__PURE__ */k(x,{children:[
3
+ /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),H&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Fe?void 0:{height:B},children:[Fe?
4
+ /* @__PURE__ */j(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Re||void 0,className:"h-full w-full",style:{objectFit:V}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Re,className:"h-full w-full",style:{objectFit:V,objectPosition:Z||void 0}}),D&&w&&/* @__PURE__ */j(n,{children:Re}),Ue,ue&&/* @__PURE__ */j(l,{label:me,progress:E,rounded:"rounded-md"})]}),Se=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Ce(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":S||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:B},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:E}):/* @__PURE__ */k(x,{children:[
5
5
  /* @__PURE__ */j("span",{className:"text-gray-400",children:/* @__PURE__ */j(s,{})}),
6
6
  /* @__PURE__ */j("span",{className:"px-3 text-xs text-gray-500",children:je}),
7
- /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),K&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:K})]})});/* @__PURE__ */
8
- return k(a,{label:U,htmlFor:be,hint:F,error:he,required:S,className:P,children:[X&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:re,onChange:e=>X(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof U&&U?U:ie.upload})}),w?Oe:Se,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
7
+ /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),q&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:q})]})});/* @__PURE__ */
8
+ return k(e,{label:F,htmlFor:be,hint:U,error:he,required:S,className:O,children:[X&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:re,onChange:e=>X(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),w?Pe:Se,!C&&/* @__PURE__ */j("input",{...we.inputProps}),
9
9
  /* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};