efficient-shell 8.34.0 → 8.35.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 (216) hide show
  1. package/README.md +9 -0
  2. package/dist/{Browser-QBAMRKYI.js → Browser-ERZNOFN7.js} +14 -14
  3. package/dist/Calculator-NXIOZMML.js +29 -0
  4. package/dist/{CurrencyConverter-S7LG5PMX.js → CurrencyConverter-57WUTV4H.js} +12 -12
  5. package/dist/{Documents-E3GMXALJ.js → Documents-POWS4L44.js} +19 -19
  6. package/dist/{Files-2DWPYRM5.js → Files-O44UH6ZF.js} +43 -43
  7. package/dist/{Notepad-VQ66RWLT.js → Notepad-66ZCGUHC.js} +10 -10
  8. package/dist/PdfViewer-KSLOYXMD.js +1 -0
  9. package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-GLYNCO4H.js} +17 -17
  10. package/dist/{Preview-VZYFOH2U.js → Preview-WZDFVBNJ.js} +23 -23
  11. package/dist/Sidebar-QQFJJWE2.js +43 -0
  12. package/dist/{Spreadsheet-4KXRJSHT.js → Spreadsheet-OYAVNRCT.js} +14 -14
  13. package/dist/{Stock-VNFYS73L.js → Stock-CIHUZOQS.js} +7 -7
  14. package/dist/{Weather-DS4YZ6SH.js → Weather-UKLNJ3VF.js} +13 -13
  15. package/dist/{WorldClock-7S4TITSF.js → WorldClock-OZ3I7D2M.js} +6 -6
  16. package/dist/ai/index.d.ts +47 -9
  17. package/dist/ai/index.js +38 -33
  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/charts/BoxPlotChart.js +1 -1
  23. package/dist/charts/CandlestickChart.js +1 -1
  24. package/dist/charts/CartesianPlot.js +1 -1
  25. package/dist/charts/ChordChart.js +1 -1
  26. package/dist/charts/ColumnChart.js +1 -1
  27. package/dist/charts/HeatmapChart.js +1 -1
  28. package/dist/charts/HistogramChart.js +1 -1
  29. package/dist/charts/RadarChart.js +1 -1
  30. package/dist/charts/RangeChart.js +1 -1
  31. package/dist/charts/SankeyChart.js +1 -1
  32. package/dist/charts/ScatterChart.js +1 -1
  33. package/dist/charts/SpecChart.js +1 -1
  34. package/dist/charts/SunburstChart.js +1 -1
  35. package/dist/charts/TimeSeriesChart.js +1 -1
  36. package/dist/charts/TreemapChart.js +1 -1
  37. package/dist/charts/WaterfallChart.js +1 -1
  38. package/dist/{chunk-L3NYH4QV.js → chunk-2AHHM4SK.js} +39 -39
  39. package/dist/{chunk-Z2YGQBLZ.js → chunk-2C6IG7LG.js} +1 -1
  40. package/dist/{chunk-7CFH6Y4T.js → chunk-2F7ZOMKK.js} +1 -1
  41. package/dist/chunk-2PWZNFFP.js +19 -0
  42. package/dist/{chunk-KIBL6M3T.js → chunk-2SHYR3RA.js} +4 -3
  43. package/dist/{chunk-G433MKIN.js → chunk-2U2GJCSP.js} +5 -5
  44. package/dist/{chunk-ZN3O2KJ7.js → chunk-2WL3Q7VW.js} +12 -12
  45. package/dist/{chunk-EYX6KLCZ.js → chunk-37CCKGHU.js} +1 -1
  46. package/dist/{chunk-XWLWG4HS.js → chunk-4GVH4ZUH.js} +1 -1
  47. package/dist/{chunk-GIM2422N.js → chunk-4HCRZHIX.js} +1 -1
  48. package/dist/{chunk-MXHEREC6.js → chunk-4MO375G3.js} +3 -3
  49. package/dist/{chunk-3BPF6PP3.js → chunk-4RNF6MNW.js} +2 -2
  50. package/dist/chunk-5FCEBKT2.js +7 -0
  51. package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
  52. package/dist/{chunk-KNVE7CMS.js → chunk-5OX6KXWY.js} +1 -1
  53. package/dist/{chunk-PNQ4EYYM.js → chunk-5YELPBUT.js} +3 -3
  54. package/dist/{chunk-QDOTMA3W.js → chunk-64ZHCEZN.js} +1 -1
  55. package/dist/{chunk-Y2D2YMFY.js → chunk-6ANFVX4M.js} +12 -12
  56. package/dist/{chunk-T5SEGUCJ.js → chunk-7ACSSYEZ.js} +13 -13
  57. package/dist/{chunk-GI7FOLDX.js → chunk-ACW3J77L.js} +1 -1
  58. package/dist/{chunk-ERMZ75FO.js → chunk-AF7R2MV4.js} +1 -1
  59. package/dist/{chunk-QQK3XS6H.js → chunk-AZU7YOES.js} +8 -8
  60. package/dist/{chunk-NFR4QZL2.js → chunk-BHMUOWAE.js} +4 -4
  61. package/dist/{chunk-TFMC2WAS.js → chunk-BKZGI76S.js} +1 -1
  62. package/dist/{chunk-UB4BTRSB.js → chunk-BYCOB6WT.js} +1 -1
  63. package/dist/chunk-BZMZTPS6.js +1 -0
  64. package/dist/chunk-CAMLFCGY.js +29 -0
  65. package/dist/{chunk-LCM5U6BY.js → chunk-CCPNMYCK.js} +1 -1
  66. package/dist/{chunk-RAAUW5OZ.js → chunk-DG2WU3BU.js} +2 -2
  67. package/dist/chunk-DIN3EFOM.js +14 -0
  68. package/dist/{chunk-WJ3XSJ6B.js → chunk-EBC4XFL2.js} +1 -1
  69. package/dist/{chunk-37JDUDCO.js → chunk-ECCUEG3J.js} +1 -1
  70. package/dist/{chunk-4C4SQ4YW.js → chunk-EM6BEHAD.js} +8 -8
  71. package/dist/{chunk-W5M6P4DZ.js → chunk-ETF7LAYZ.js} +5 -5
  72. package/dist/{chunk-LEC4SZIV.js → chunk-EVB35JP5.js} +1 -1
  73. package/dist/{chunk-FL2PUQX7.js → chunk-EW6FRPFJ.js} +1 -1
  74. package/dist/{chunk-JCMP5KMS.js → chunk-EZY4CO4A.js} +6 -6
  75. package/dist/{chunk-PJCVNFWM.js → chunk-FKZEGBLK.js} +10 -10
  76. package/dist/{chunk-DTSCO7VM.js → chunk-FMKTVZAO.js} +1 -1
  77. package/dist/{chunk-IZCODCSC.js → chunk-FTKKGGOQ.js} +1 -1
  78. package/dist/{chunk-FFJVCLGH.js → chunk-G2MJTE6X.js} +11 -11
  79. package/dist/{chunk-EZGY6CFN.js → chunk-GK3QH63P.js} +1 -1
  80. package/dist/{chunk-3WC6ITJ3.js → chunk-H33Z4ZIY.js} +6 -6
  81. package/dist/{chunk-CPXHU3Y2.js → chunk-HAIMJAI4.js} +2 -2
  82. package/dist/chunk-HMHL27AU.js +6 -0
  83. package/dist/{chunk-RSO67DWS.js → chunk-I4VD5D43.js} +4 -4
  84. package/dist/{chunk-BIYL7CEI.js → chunk-IFDW5QW6.js} +2 -2
  85. package/dist/{chunk-4AAGZQX7.js → chunk-IHEEJO5S.js} +1 -1
  86. package/dist/{chunk-WQNIXV4T.js → chunk-IUCIYWTT.js} +8 -8
  87. package/dist/chunk-JBQWR4SX.js +8 -0
  88. package/dist/{chunk-AX7KPMDV.js → chunk-JDKRQG7X.js} +2 -2
  89. package/dist/{chunk-LBLV64XG.js → chunk-JUGPTBMS.js} +1 -1
  90. package/dist/{chunk-BUGAWNOC.js → chunk-JVIOAZHW.js} +4 -4
  91. package/dist/{chunk-B2XDNBR3.js → chunk-L3G3YHVN.js} +1 -1
  92. package/dist/{chunk-ZEKM6HAA.js → chunk-M2AIC7IK.js} +2 -2
  93. package/dist/{chunk-KDZUWQEG.js → chunk-M2KV4WKR.js} +1 -1
  94. package/dist/{chunk-H3BC4KDE.js → chunk-M2LLVSBR.js} +1 -1
  95. package/dist/{chunk-SAKHGHF5.js → chunk-MC43PRTL.js} +1 -1
  96. package/dist/{chunk-USYNZGY4.js → chunk-MICWRC72.js} +7 -7
  97. package/dist/{chunk-WTY3SXO7.js → chunk-MY755PTJ.js} +1 -1
  98. package/dist/chunk-NKZNPYDB.js +3 -0
  99. package/dist/{chunk-YSFLXPUS.js → chunk-NUSSZJF2.js} +5 -5
  100. package/dist/{chunk-RGBX3EVC.js → chunk-O2YAB6WK.js} +8 -8
  101. package/dist/{chunk-3J5QUHPO.js → chunk-OFKWTOXK.js} +3 -3
  102. package/dist/{chunk-ZT5Y5JZB.js → chunk-P42YNSKI.js} +4 -4
  103. package/dist/{chunk-KKSW5IZ7.js → chunk-PCKYNZ5Y.js} +5 -5
  104. package/dist/{chunk-YW2DH6YQ.js → chunk-QPWD5CCS.js} +5 -5
  105. package/dist/{chunk-RUQEB2ZC.js → chunk-R4C3GGCS.js} +3 -3
  106. package/dist/{chunk-3V5Z2BJY.js → chunk-RB2F65YJ.js} +12 -12
  107. package/dist/{chunk-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
  108. package/dist/{chunk-XC55NMXR.js → chunk-S4IW5OL3.js} +1 -1
  109. package/dist/{chunk-PBMZJXSZ.js → chunk-S4J4B7LY.js} +5 -5
  110. package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
  111. package/dist/{chunk-BQ2IPQNR.js → chunk-SWHRP52Y.js} +1 -1
  112. package/dist/{chunk-NWP6IJYK.js → chunk-TANR67XF.js} +2 -2
  113. package/dist/{chunk-4F3IKYUO.js → chunk-TOVHLONK.js} +6 -6
  114. package/dist/{chunk-JOIWDQRJ.js → chunk-TRD22FC7.js} +6 -6
  115. package/dist/{chunk-YGZMD6TZ.js → chunk-TTY62G5D.js} +16 -16
  116. package/dist/{chunk-YCQVEJOT.js → chunk-TW6WYYBC.js} +2 -2
  117. package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
  118. package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
  119. package/dist/{chunk-V4KQUOUP.js → chunk-WKRFD4E4.js} +8 -8
  120. package/dist/{chunk-PDXD6DT7.js → chunk-WME5DFB6.js} +1 -1
  121. package/dist/{chunk-OSA24YH6.js → chunk-WSPO4N72.js} +14 -14
  122. package/dist/{chunk-3C67XRVJ.js → chunk-XB2YPUKR.js} +8 -8
  123. package/dist/{chunk-VB7Z3HXO.js → chunk-XDDTFV32.js} +1 -1
  124. package/dist/{chunk-UQBPKZUR.js → chunk-XZL3HCWH.js} +1 -1
  125. package/dist/{chunk-CRYEG7OT.js → chunk-YBB56N6X.js} +1 -1
  126. package/dist/{chunk-FRPNTDP4.js → chunk-ZNCU3UIW.js} +4 -4
  127. package/dist/{chunk-ZOSIPTXM.js → chunk-ZNXBKFV7.js} +5 -5
  128. package/dist/{chunk-RCMP37VO.js → chunk-ZRHQGFO5.js} +3 -3
  129. package/dist/{chunk-MEFXMUWI.js → chunk-ZXSMSVLU.js} +3 -3
  130. package/dist/data/ListLoadError.js +1 -1
  131. package/dist/format/index.js +1 -1
  132. package/dist/forms/BorderInput.js +1 -1
  133. package/dist/forms/BrandAssetEditor.js +1 -1
  134. package/dist/forms/Calendar.js +1 -1
  135. package/dist/forms/ColorPicker.js +1 -1
  136. package/dist/forms/ComposerAttachments.js +1 -1
  137. package/dist/forms/CornersInput.js +1 -1
  138. package/dist/forms/DatePicker.js +1 -1
  139. package/dist/forms/DateRangePicker.js +1 -1
  140. package/dist/forms/DisplayChips.js +1 -1
  141. package/dist/forms/FilePicker.js +1 -1
  142. package/dist/forms/IconPicker.js +1 -1
  143. package/dist/forms/InputNumber.js +1 -1
  144. package/dist/forms/LinkPicker.js +1 -1
  145. package/dist/forms/MediaLibrary.js +1 -1
  146. package/dist/forms/MediaUploadField.js +1 -1
  147. package/dist/forms/MediaUploadGrid.js +1 -1
  148. package/dist/forms/MediaUsedInList.js +1 -1
  149. package/dist/forms/PositionInput.js +1 -1
  150. package/dist/forms/Select.js +1 -1
  151. package/dist/forms/SidesInput.js +1 -1
  152. package/dist/forms/Slider.js +1 -1
  153. package/dist/forms/Snippet.js +1 -1
  154. package/dist/forms/SplitButton.js +1 -1
  155. package/dist/forms/TagInput.js +1 -1
  156. package/dist/forms/TextToolbar.js +1 -1
  157. package/dist/forms/WidthsBar.js +1 -1
  158. package/dist/forms/mediaLibraryMenu.js +1 -1
  159. package/dist/forms/textAlign.js +1 -1
  160. package/dist/icons/index.js +1 -1
  161. package/dist/index.js +139 -139
  162. package/dist/map/index.js +6 -6
  163. package/dist/markdown/index.js +1 -1
  164. package/dist/page-tabs/index.js +5 -5
  165. package/dist/pdf/index.js +1 -1
  166. package/dist/shell/Accordion.js +1 -1
  167. package/dist/shell/AppUpdateBanner.js +1 -1
  168. package/dist/shell/Banner.js +1 -1
  169. package/dist/shell/Breadcrumbs.js +1 -1
  170. package/dist/shell/ColoredBadge.js +1 -1
  171. package/dist/shell/ConfirmDialog.js +1 -1
  172. package/dist/shell/ContextMenu.js +1 -1
  173. package/dist/shell/Dialog.js +1 -1
  174. package/dist/shell/Drawer.js +1 -1
  175. package/dist/shell/DropdownMenu.js +1 -1
  176. package/dist/shell/EmptyState.js +1 -1
  177. package/dist/shell/HelpCenter.js +1 -1
  178. package/dist/shell/ImageLightbox.js +1 -1
  179. package/dist/shell/LanguageSelect.js +1 -1
  180. package/dist/shell/Markdown.js +1 -1
  181. package/dist/shell/PageHeader.js +1 -1
  182. package/dist/shell/PopupMenu.js +1 -1
  183. package/dist/shell/ProductionTimeline.js +1 -1
  184. package/dist/shell/Result.js +1 -1
  185. package/dist/shell/SearchableSelect.js +1 -1
  186. package/dist/shell/SettingReset.js +1 -1
  187. package/dist/shell/SettingRow.js +1 -1
  188. package/dist/shell/SidebarLayout.js +1 -1
  189. package/dist/shell/SidebarNav.js +1 -1
  190. package/dist/shell/SortableList.js +1 -1
  191. package/dist/shell/StepChain.js +1 -1
  192. package/dist/shell/Stepper.js +1 -1
  193. package/dist/shell/TopNav.js +1 -1
  194. package/dist/shell/Tree.js +1 -1
  195. package/dist/telemetry/index.js +1 -1
  196. package/dist/templates/AuthScreen.js +1 -1
  197. package/dist/templates/ChatTemplate.js +1 -1
  198. package/dist/templates/CheckoutTemplate.js +1 -1
  199. package/dist/templates/DashboardTemplate.js +1 -1
  200. package/dist/templates/DataTablePage.js +1 -1
  201. package/dist/templates/EmailTemplate.js +1 -1
  202. package/dist/templates/FormLayoutPage.js +1 -1
  203. package/dist/ui/index.js +1 -1
  204. package/dist/version.js +1 -1
  205. package/package.json +1 -1
  206. package/dist/Calculator-4JDJKSA7.js +0 -29
  207. package/dist/PdfViewer-67VBUIRD.js +0 -1
  208. package/dist/Sidebar-YB4OVUG5.js +0 -43
  209. package/dist/chunk-3JJFBUK6.js +0 -3
  210. package/dist/chunk-57SJKYA4.js +0 -29
  211. package/dist/chunk-AS4CTEZD.js +0 -8
  212. package/dist/chunk-HSOREHQB.js +0 -1
  213. package/dist/chunk-JJXFPGX4.js +0 -6
  214. package/dist/chunk-LYYR5DSP.js +0 -14
  215. package/dist/chunk-RERNKFEW.js +0 -19
  216. package/dist/chunk-W7S56JZ7.js +0 -7
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-HSOREHQB.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},R=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},Z=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{R(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],H=e=>{document.prerendering?C(()=>H(e)):"complete"!==document.readyState?addEventListener("load",()=>H(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,U=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;R(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),F(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);H(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&U.test(e.app),n="string"==typeof e.release&&U.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:U.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-BZMZTPS6.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -1,6 +1,6 @@
1
- import{FormField as e}from"./chunk-MVQBVPWP.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-DTSCO7VM.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-YDYDR72S.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},C){const O=m(),$=l().files,z=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),M=j?`${O}-error`:N?`${O}-hint`:void 0;/* @__PURE__ */
1
+ import{FormField as e}from"./chunk-MVQBVPWP.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-FMKTVZAO.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-YDYDR72S.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},C){const O=m(),$=l().files,z=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),F=j?`${O}-error`:N?`${O}-hint`:void 0;/* @__PURE__ */
2
2
  return o(e,{label:g,htmlFor:O,hint:N,error:j,required:k,className:v,children:[
3
- /* @__PURE__ */o("button",{ref:C,type:"button",id:O,disabled:y,onClick:z.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":M,...z.zoneProps,className:t(z.dragOver,y,a(y),"px-4 py-6"),children:[
3
+ /* @__PURE__ */o("button",{ref:C,type:"button",id:O,disabled:y,onClick:z.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":F,...z.zoneProps,className:t(z.dragOver,y,a(y),"px-4 py-6"),children:[
4
4
  /* @__PURE__ */o("span",{children:[
5
5
  /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?$.chooseMany:$.chooseOne}),
6
6
  /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?$.dragMany:$.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
@@ -1,7 +1,7 @@
1
- import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-3PGK3VFS.js";import{Icon as i}from"./chunk-KIBL6M3T.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
- return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:P,rowRef:B,className:D=""}){const K=x||!!p,I=n(u),T=l(null),$=s(),A=[P?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,M=P?.tabIndex;a(()=>{const e=T.current;if(!e||void 0!==M)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const S="comfortable"===I?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},q=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
1
+ import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-3PGK3VFS.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
+ return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:P,rowRef:D,className:A=""}){const B=x||!!p,K=n(u),R=l(null),S=s(),$=[P?.["aria-describedby"],j?S:void 0].filter(Boolean).join(" ")||void 0,H=P?.tabIndex;a(()=>{const e=R.current;if(!e||void 0!==H)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const I="comfortable"===K?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},T=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
3
3
  /* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
4
- return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":K||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-white transition-colors duration-(--motion-fast)",w?"":K?"border-blue-300":"border-gray-200 hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${S[k]}`}),
5
- /* @__PURE__ */c("div",{...P,ref:e=>{var r,t;T.current=e,t=e,"function"==typeof(r=B)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":P?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":A,onKeyDown:e=>{if(P?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",D].filter(Boolean).join(" "),children:[
6
- /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[q&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[q,
7
- /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:q})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
4
+ return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":B||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-white transition-colors duration-(--motion-fast)",w?"":B?"border-blue-300":"border-gray-200 hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${I[k]}`}),
5
+ /* @__PURE__ */c("div",{...P,ref:e=>{var r,t;R.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":P?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":$,onKeyDown:e=>{if(P?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",A].filter(Boolean).join(" "),children:[
6
+ /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[T&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[T,
7
+ /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:T})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:S})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
@@ -1,11 +1,11 @@
1
- import{MediaUploadField as e}from"./chunk-JCMP5KMS.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-4IU5BSVE.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[C,R]=l(""),[I,E]=l(""),[H,O]=l(!1),[S,A]=l(!1),B=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),F=t().brandAsset,G=C||d||g||"",P=L?null:d?o:h,M=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const $=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
- return n("section",{"aria-label":F.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
1
+ import{MediaUploadField as e}from"./chunk-EZY4CO4A.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-4IU5BSVE.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[C,R]=l(""),[E,I]=l(""),[O,A]=l(!1),[H,B]=l(!1),F=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),G=t().brandAsset,S=C||d||g||"",P=L?null:d?o:h,$=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const z=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
+ return n("section",{"aria-label":G.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
3
3
  /* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
4
- /* @__PURE__ */c(e,{value:G,onChange:()=>{},onFile:e=>{if(k)return;$();const r=URL.createObjectURL(e);j.current=r,U(e),R(r),E("")},label:p,hint:I||F.usedFor(b),error:I||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:H||S,disabled:k}),
4
+ /* @__PURE__ */c(e,{value:S,onChange:()=>{},onFile:e=>{if(k)return;z();const r=URL.createObjectURL(e);j.current=r,U(e),R(r),I("")},label:p,hint:E||G.usedFor(b),error:E||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:O||H,disabled:k}),
5
5
  /* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
6
- /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!H){O(!0),E("");try{await x(L),$(),U(null),R("")}catch(e){E(e instanceof Error?e.message:F.saveFailed(B,p))}finally{O(!1)}}},disabled:!L||k,loading:H,children:F.save(B,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!S){if(L)return $(),U(null),R(""),void E("");if(d){A(!0),E("");try{await f()}catch(e){E(e instanceof Error?e.message:F.removeFailed(B,p))}finally{A(!1)}}}},disabled:k,loading:S,children:L?F.discard:F.remove(B,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":F.previews(p),children:[
7
- /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:F.preview}),
8
- /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:G,alt:F.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:M,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
6
+ /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!O){A(!0),I("");try{await x(L),z(),U(null),R("")}catch(e){I(e instanceof Error?e.message:G.saveFailed(F,p))}finally{A(!1)}}},disabled:!L||k,loading:O,children:G.save(F,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!H){if(L)return z(),U(null),R(""),void I("");if(d){B(!0),I("");try{await f()}catch(e){I(e instanceof Error?e.message:G.removeFailed(F,p))}finally{B(!1)}}}},disabled:k,loading:H,children:L?G.discard:G.remove(F,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":G.previews(p),children:[
7
+ /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:G.preview}),
8
+ /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:S,alt:G.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:$,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
9
9
  return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
10
10
  /* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
11
11
  /* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
@@ -1,28 +1,28 @@
1
- import{useCopyText as e,CopyGlyph as t}from"./chunk-FL2PUQX7.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as i}from"./chunk-PJCVNFWM.js";import{Icon as l}from"./chunk-KIBL6M3T.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as o,useMemo as s,useRef as d,useEffect as c,Fragment as u,useLayoutEffect as m}from"react";import{jsxs as f,jsx as p,Fragment as y}from"react/jsx-runtime";function h(e){const t=[];let n=0;for(;n<e.length;){const r=e[n].group;let i=n;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;t.push(i>n?{group:r,start:n,end:i}:{start:n,end:n}),n=i+1}return t}function g(e,t){return e.find(e=>t>=e.start&&t<=e.end)}function b(e,t,n,r){const i=e.findIndex(e=>e.key===t.key);let l=e.findIndex(e=>e.key===n);if(i<0||l<0)return null;const a=h(e),o=g(a,i),s="group"===t.kind&&void 0!==o.group?e.slice(o.start,o.end+1).map(e=>e.key):[t.key];if(s.includes(n))return null;const d=g(a,l);if("tab"===t.kind&&void 0!==o.group){if(d!==o)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function k(e,t,n,r){const i=b(e,t,n,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),a=l.indexOf(i.key)+("after"===i.side?1:0),o=[...l.slice(0,a),...i.moving,...l.slice(a)];return o.every((t,n)=>t===e[n].key)?null:o}var x="flex-[0_1_15rem]",v=x,w="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function N(){/* @__PURE__ */
1
+ import{useCopyText as e,CopyGlyph as t}from"./chunk-EW6FRPFJ.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as i}from"./chunk-FKZEGBLK.js";import{Icon as l}from"./chunk-2SHYR3RA.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as o,useMemo as s,useRef as d,useEffect as c,Fragment as u,useLayoutEffect as m}from"react";import{jsxs as f,jsx as p,Fragment as y}from"react/jsx-runtime";function h(e){const t=[];let n=0;for(;n<e.length;){const r=e[n].group;let i=n;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;t.push(i>n?{group:r,start:n,end:i}:{start:n,end:n}),n=i+1}return t}function g(e,t){return e.find(e=>t>=e.start&&t<=e.end)}function b(e,t,n,r){const i=e.findIndex(e=>e.key===t.key);let l=e.findIndex(e=>e.key===n);if(i<0||l<0)return null;const a=h(e),o=g(a,i),s="group"===t.kind&&void 0!==o.group?e.slice(o.start,o.end+1).map(e=>e.key):[t.key];if(s.includes(n))return null;const d=g(a,l);if("tab"===t.kind&&void 0!==o.group){if(d!==o)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function k(e,t,n,r){const i=b(e,t,n,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),a=l.indexOf(i.key)+("after"===i.side?1:0),o=[...l.slice(0,a),...i.moving,...l.slice(a)];return o.every((t,n)=>t===e[n].key)?null:o}var x="flex-[0_1_15rem]",v=x,w="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function N(){/* @__PURE__ */
2
2
  return p(l,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function C({text:n,label:r,copiedLabel:i}){const{copied:l,copy:a}=e(n);/* @__PURE__ */
3
- return p("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */p(t,{copied:l,className:"size-3.5"})})}function $({node:e}){const t=d(null);return m(()=>{const n=t.current;if(n)return n.appendChild(e),()=>{e.parentNode===n&&n.removeChild(e)}},[e]),/* @__PURE__ */p("span",{ref:t,className:"ml-1 flex shrink-0 items-center"})}function z({tabs:e,activeKey:t,idFor:m,panelMounted:g,onActivate:z,onClose:I,onCloseMany:j,label:D,className:T,activeClassName:M,end:A,afterPinned:E,onIconMenu:_,menuItems:B,sizing:K="even",tall:L=!1,onReorder:O,groupInfo:R}){const S=a().pageTabs,[F,P]=o(null),W=L?"h-[34px]":"h-8",X=s(()=>e.map(e=>({key:e.key,group:R?e.group:void 0})),[e,R]),U=s(()=>h(X),[X]),[V,G]=o(()=>/* @__PURE__ */new Set),H=e=>G(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),J=s(()=>{const n=[];for(const r of U)for(let i=r.start;i<=r.end;i++)void 0!==r.group&&V.has(r.group)&&e[i].key!==t||n.push(e[i]);return n},[U,V,e,t]),Q=d(null),[Y,q]=o(null),Z=(t,n)=>O?{draggable:!0,onDragStart:n=>{Q.current=t,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",e.find(e=>e.key===t.key)?.title??"")},onDragOver:e=>{const r=Q.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=n!==t.key||"tab"===t.kind?e.clientX<i.left+i.width/2?"before":"after":"before",a=k(X,r,n,l)?b(X,r,n,l):null;a?(e.preventDefault(),e.dataTransfer.dropEffect="move",Y?.key===a.key&&Y.side===a.side||q({key:a.key,side:a.side})):Y&&q(null)},onDrop:e=>{const t=Q.current;if(!t||!Y)return;e.preventDefault();const n=k(X,t,Y.key,Y.side);Q.current=null,q(null),n&&O(n)},onDragEnd:()=>{Q.current=null,q(null)}}:{},ee=s(()=>new Set(U.filter(e=>void 0!==e.group&&R).map(t=>e[t.start].key)),[U,e,R]),te=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ne=e=>Y?.key===e&&!("before"===Y.side&&ee.has(e))&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:te(Y.side)}),re=e.length;c(()=>{if(!t)return;const e=document.getElementById(m(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[m,t,re]);const ie=E?J.findIndex(e=>!e.pinned):-1,le=J.some(e=>e.key===t)?t:J[0]?.key,ae=e=>{const t=J[(e+J.length)%J.length];t&&document.getElementById(m(t.key,"tab"))?.focus()},oe=(e,t)=>{const n=J[e+t];if(!O||!n)return;const r=k(X,{kind:"tab",key:J[e].key},n.key,t<0?"before":"after");r&&(O(r),setTimeout(()=>document.getElementById(m(J[e].key,"tab"))?.focus(),0))},se=F?e.find(e=>e.key===F.key):void 0,de=se&&B?B(se.key):[],ce=se?e.indexOf(se):-1,ue=e=>e.some(e=>!e.pinned),me=e=>()=>{P(null),e()},fe=(e,n)=>{const r=e.key===t,i=!!e.dirty,a=e.icon,o=r?M??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!n&&!r&&n.key!==t,d={type:"button",role:"tab",id:m(e.key,"tab"),"aria-selected":r,"aria-controls":g?.(e.key)?m(e.key,"panel"):void 0,tabIndex:e.key===le?0:-1,title:e.title,onClick:()=>z(e.key)},c={onContextMenu:t=>((e,t)=>{e.preventDefault(),P({x:e.clientX,y:e.clientY,key:t.key})})(t,e),onAuxClick:t=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),I(t.key))})(t,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},y=a&&
3
+ return p("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */p(t,{copied:l,className:"size-3.5"})})}function $({node:e}){const t=d(null);return m(()=>{const n=t.current;if(n)return n.appendChild(e),()=>{e.parentNode===n&&n.removeChild(e)}},[e]),/* @__PURE__ */p("span",{ref:t,className:"ml-1 flex shrink-0 items-center"})}function z({tabs:e,activeKey:t,idFor:m,panelMounted:g,onActivate:z,onClose:I,onCloseMany:j,label:D,className:E,activeClassName:A,end:R,afterPinned:T,onIconMenu:_,menuItems:B,sizing:K="even",tall:M=!1,onReorder:O,groupInfo:S}){const F=a().pageTabs,[L,W]=o(null),G=M?"h-[34px]":"h-8",H=s(()=>e.map(e=>({key:e.key,group:S?e.group:void 0})),[e,S]),P=s(()=>h(H),[H]),[X,Y]=o(()=>/* @__PURE__ */new Set),J=e=>Y(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),U=s(()=>{const n=[];for(const r of P)for(let i=r.start;i<=r.end;i++)void 0!==r.group&&X.has(r.group)&&e[i].key!==t||n.push(e[i]);return n},[P,X,e,t]),V=d(null),[Z,q]=o(null),Q=(t,n)=>O?{draggable:!0,onDragStart:n=>{V.current=t,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",e.find(e=>e.key===t.key)?.title??"")},onDragOver:e=>{const r=V.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=n!==t.key||"tab"===t.kind?e.clientX<i.left+i.width/2?"before":"after":"before",a=k(H,r,n,l)?b(H,r,n,l):null;a?(e.preventDefault(),e.dataTransfer.dropEffect="move",Z?.key===a.key&&Z.side===a.side||q({key:a.key,side:a.side})):Z&&q(null)},onDrop:e=>{const t=V.current;if(!t||!Z)return;e.preventDefault();const n=k(H,t,Z.key,Z.side);V.current=null,q(null),n&&O(n)},onDragEnd:()=>{V.current=null,q(null)}}:{},ee=s(()=>new Set(P.filter(e=>void 0!==e.group&&S).map(t=>e[t.start].key)),[P,e,S]),te=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ne=e=>Z?.key===e&&!("before"===Z.side&&ee.has(e))&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:te(Z.side)}),re=e.length;c(()=>{if(!t)return;const e=document.getElementById(m(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[m,t,re]);const ie=T?U.findIndex(e=>!e.pinned):-1,le=U.some(e=>e.key===t)?t:U[0]?.key,ae=e=>{const t=U[(e+U.length)%U.length];t&&document.getElementById(m(t.key,"tab"))?.focus()},oe=(e,t)=>{const n=U[e+t];if(!O||!n)return;const r=k(H,{kind:"tab",key:U[e].key},n.key,t<0?"before":"after");r&&(O(r),setTimeout(()=>document.getElementById(m(U[e].key,"tab"))?.focus(),0))},se=L?e.find(e=>e.key===L.key):void 0,de=se&&B?B(se.key):[],ce=se?e.indexOf(se):-1,ue=e=>e.some(e=>!e.pinned),me=e=>()=>{W(null),e()},fe=(e,n)=>{const r=e.key===t,i=!!e.dirty,a=e.icon,o=r?A??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!n&&!r&&n.key!==t,d={type:"button",role:"tab",id:m(e.key,"tab"),"aria-selected":r,"aria-controls":g?.(e.key)?m(e.key,"panel"):void 0,tabIndex:e.key===le?0:-1,title:e.title,onClick:()=>z(e.key)},c={onContextMenu:t=>((e,t)=>{e.preventDefault(),W({x:e.clientX,y:e.clientY,key:t.key})})(t,e),onAuxClick:t=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),I(t.key))})(t,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},y=a&&
4
4
  /* @__PURE__ */f("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[a,i&&!r&&!e.pinned&&
5
- /* @__PURE__ */p("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!_&&!!a;return e.pinned?/* @__PURE__ */f("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${W} ${a?"w-10":""} ${o}`,...c,...Z({kind:"tab",key:e.key},e.key),children:[ne(e.key),
5
+ /* @__PURE__ */p("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!_&&!!a;return e.pinned?/* @__PURE__ */f("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${G} ${a?"w-10":""} ${o}`,...c,...Q({kind:"tab",key:e.key},e.key),children:[ne(e.key),
6
6
  /* @__PURE__ */f("button",{...d,className:`flex h-full items-center justify-center rounded-t-md ${a?"w-full":"px-3"} ${w}`,children:[y,
7
7
  /* @__PURE__ */p("span",{className:a?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */f(u,{children:[s&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
8
- /* @__PURE__ */f("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${W} ${"active-full"===K&&r?"":"@container"} ${"active-full"===K?r?"flex-[1_0_auto] min-w-[20rem] max-w-[40rem]":v:r&&(e.copy||h)?"flex-[0_1_20rem]":x} ${r?"active-full"===K?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${o}`,...c,...Z({kind:"tab",key:e.key},e.key),children:[ne(e.key),h&&
9
- /* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":S.tabMenu,title:S.tabMenu,onClick:t=>{const n=t.currentTarget.getBoundingClientRect();_?.(e.key,n.left,n.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${w}`,children:y}),
8
+ /* @__PURE__ */f("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${G} ${"active-full"===K&&r?"":"@container"} ${"active-full"===K?r?"flex-[1_0_auto] min-w-[20rem] max-w-[40rem]":v:r&&(e.copy||h)?"flex-[0_1_20rem]":x} ${r?"active-full"===K?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${o}`,...c,...Q({kind:"tab",key:e.key},e.key),children:[ne(e.key),h&&
9
+ /* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":F.tabMenu,title:F.tabMenu,onClick:t=>{const n=t.currentTarget.getBoundingClientRect();_?.(e.key,n.left,n.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${w}`,children:y}),
10
10
  /* @__PURE__ */f("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${h?"pl-2":"pl-3"} ${w} ${r?h?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!h&&y,
11
11
  /* @__PURE__ */f("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===K&&r?"pr-4":""} ${a?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
12
- /* @__PURE__ */p("span",{role:"img","aria-label":S.favorite,title:S.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */p(l,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */p($,{node:e.actions}),r&&e.copy&&/* @__PURE__ */p(C,{text:e.copy,label:S.copy(e.copy),copiedLabel:S.copied}),
13
- /* @__PURE__ */f("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */p("span",{role:"img","aria-label":S.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
14
- /* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-label":S.closeTab?.(e.title)??`${S.close} ${e.title}`,onClick:()=>I(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */p(N,{})})]})]})]},e.key)},pe=[];let ye,he=0,ge=!E;for(const t of U){const n=J.filter(n=>{const r=e.indexOf(n);return r>=t.start&&r<=t.end});if(ge||he!==ie||(ge=!0,pe.push(/* @__PURE__ */p(u,{children:E},"rosh-after-pinned")),ye=void 0),he+=n.length,void 0===t.group||!R){for(const e of n)pe.push(fe(e,ye)),ye=e;continue}ye=void 0;const r=t.group,i=R(r),a=t.end-t.start+1,o=!V.has(r),s=e[t.start].key;pe.push(
12
+ /* @__PURE__ */p("span",{role:"img","aria-label":F.favorite,title:F.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */p(l,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */p($,{node:e.actions}),r&&e.copy&&/* @__PURE__ */p(C,{text:e.copy,label:F.copy(e.copy),copiedLabel:F.copied}),
13
+ /* @__PURE__ */f("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */p("span",{role:"img","aria-label":F.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
14
+ /* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-label":F.closeTab?.(e.title)??`${F.close} ${e.title}`,onClick:()=>I(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */p(N,{})})]})]})]},e.key)},pe=[];let ye,he=0,ge=!T;for(const t of P){const n=U.filter(n=>{const r=e.indexOf(n);return r>=t.start&&r<=t.end});if(ge||he!==ie||(ge=!0,pe.push(/* @__PURE__ */p(u,{children:T},"rosh-after-pinned")),ye=void 0),he+=n.length,void 0===t.group||!S){for(const e of n)pe.push(fe(e,ye)),ye=e;continue}ye=void 0;const r=t.group,i=S(r),a=t.end-t.start+1,o=!X.has(r),s=e[t.start].key;pe.push(
15
15
  /* @__PURE__ */f("div",{role:"group","aria-label":i.label,"data-tab-group":r,className:"relative mx-1 flex shrink-0 items-end first:ml-0 min-w-0",children:[
16
- /* @__PURE__ */f("button",{type:"button",tabIndex:-1,"aria-expanded":o,title:S.groupToggle(i.label,a),onClick:()=>H(r),...Z({kind:"group",key:s},s),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${w}`,children:[
16
+ /* @__PURE__ */f("button",{type:"button",tabIndex:-1,"aria-expanded":o,title:F.groupToggle(i.label,a),onClick:()=>J(r),...Q({kind:"group",key:s},s),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${w}`,children:[
17
17
  /* @__PURE__ */p(l,{name:o?"chevron-down":"chevron-right","aria-hidden":"true",className:"size-3",strokeWidth:2}),i.icon&&/* @__PURE__ */p("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:i.icon}),
18
18
  /* @__PURE__ */p("span",{className:"max-w-[8rem] truncate",children:i.label}),
19
- /* @__PURE__ */p("span",{className:"tabular-nums text-blue-600",children:a})]}),Y?.key===s&&"before"===Y.side&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:te("before")}),n.map((e,t)=>fe(e,t>0?n[t-1]:void 0)),
20
- /* @__PURE__ */p("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-0.5 bg-blue-500"})]},`rosh-group-${s}`))}return ge||pe.push(/* @__PURE__ */p(u,{children:E},"rosh-after-pinned")),/* @__PURE__ */f("div",{className:T??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
19
+ /* @__PURE__ */p("span",{className:"tabular-nums text-blue-600",children:a})]}),Z?.key===s&&"before"===Z.side&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:te("before")}),n.map((e,t)=>fe(e,t>0?n[t-1]:void 0)),
20
+ /* @__PURE__ */p("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-0.5 bg-blue-500"})]},`rosh-group-${s}`))}return ge||pe.push(/* @__PURE__ */p(u,{children:T},"rosh-after-pinned")),/* @__PURE__ */f("div",{className:E??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
21
21
  /* @__PURE__ */p("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
22
- /* @__PURE__ */p("div",{role:"tablist","aria-label":D,onKeyDown:e=>{const t=J.findIndex(t=>document.getElementById(m(t.key,"tab"))===e.target);if(t<0)return;const n=e.shiftKey&&(e.ctrlKey||e.metaKey);if(n&&"ArrowRight"===e.key)oe(t,1);else if(n&&"ArrowLeft"===e.key)oe(t,-1);else if("ArrowRight"===e.key)ae(t+1);else if("ArrowLeft"===e.key)ae(t-1);else if("Home"===e.key)ae(0);else if("End"===e.key)ae(J.length-1);else{if("Delete"!==e.key||J[t].pinned)return;I(J[t].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:pe}),A&&/* @__PURE__ */p("div",{className:"flex shrink-0 items-center gap-2 self-center",children:A}),F&&se&&/* @__PURE__ */f(n,{portal:!0,style:{left:F.x,top:F.y},onClose:()=>P(null),children:[de.length>0&&/* @__PURE__ */f(y,{children:[de.map((e,t)=>/* @__PURE__ */f(r,{onClick:me(e.onSelect),children:[e.icon,e.label]},t)),
22
+ /* @__PURE__ */p("div",{role:"tablist","aria-label":D,onKeyDown:e=>{const t=U.findIndex(t=>document.getElementById(m(t.key,"tab"))===e.target);if(t<0)return;const n=e.shiftKey&&(e.ctrlKey||e.metaKey);if(n&&"ArrowRight"===e.key)oe(t,1);else if(n&&"ArrowLeft"===e.key)oe(t,-1);else if("ArrowRight"===e.key)ae(t+1);else if("ArrowLeft"===e.key)ae(t-1);else if("Home"===e.key)ae(0);else if("End"===e.key)ae(U.length-1);else{if("Delete"!==e.key||U[t].pinned)return;I(U[t].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:pe}),R&&/* @__PURE__ */p("div",{className:"flex shrink-0 items-center gap-2 self-center",children:R}),L&&se&&/* @__PURE__ */f(n,{portal:!0,style:{left:L.x,top:L.y},onClose:()=>W(null),children:[de.length>0&&/* @__PURE__ */f(y,{children:[de.map((e,t)=>/* @__PURE__ */f(r,{onClick:me(e.onSelect),children:[e.icon,e.label]},t)),
23
23
  /* @__PURE__ */p(i,{})]}),
24
- /* @__PURE__ */p(r,{disabled:se.pinned,onClick:me(()=>I(se.key)),children:S.close}),
24
+ /* @__PURE__ */p(r,{disabled:se.pinned,onClick:me(()=>I(se.key)),children:F.close}),
25
25
  /* @__PURE__ */p(i,{}),
26
- /* @__PURE__ */p(r,{disabled:!ue(e.filter(e=>e.key!==se.key)),onClick:me(()=>j("others",se.key)),children:S.closeOthers}),
27
- /* @__PURE__ */p(r,{disabled:!ue(e.slice(ce+1)),onClick:me(()=>j("right",se.key)),children:S.closeRight}),
28
- /* @__PURE__ */p(r,{disabled:!ue(e),onClick:me(()=>j("all",null)),children:S.closeAll})]})]})}export{z as TabStrip};
26
+ /* @__PURE__ */p(r,{disabled:!ue(e.filter(e=>e.key!==se.key)),onClick:me(()=>j("others",se.key)),children:F.closeOthers}),
27
+ /* @__PURE__ */p(r,{disabled:!ue(e.slice(ce+1)),onClick:me(()=>j("right",se.key)),children:F.closeRight}),
28
+ /* @__PURE__ */p(r,{disabled:!ue(e),onClick:me(()=>j("all",null)),children:F.closeAll})]})]})}export{z as TabStrip};
@@ -1,3 +1,3 @@
1
- import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as a}from"./chunk-KIBL6M3T.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as u}from"react/jsx-runtime";var f={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function h({open:h,onClose:x,title:p,description:b,role:g="dialog",children:v,footer:y,blocking:k=!1,size:N="md",initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":L,className:W=""}){const U=n(null),D=d(),G=d(),I=!k,K=d(),T=s().dialog;return r(h),i(U,h,j),t(h),c(()=>{if(h)return o(()=>(k||x(),!0),()=>U.current)},[h,k,x]),h?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
1
+ import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as a}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as u}from"react/jsx-runtime";var f={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function h({open:h,onClose:x,title:p,description:b,role:g="dialog",children:v,footer:y,blocking:k=!1,size:N="md",initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":W,className:L=""}){const U=n(null),A=d(),D=d(),G=!k,R=d(),z=s().dialog;return r(h),i(U,h,j),t(h),c(()=>{if(h)return o(()=>(k||x(),!0),()=>U.current)},[h,k,x]),h?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
2
2
  /* @__PURE__ */u("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
- /* @__PURE__ */u("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:k?void 0:e=>{e.target===e.currentTarget&&x()},children:/* @__PURE__ */m("div",{ref:U,...e({role:g,modal:!0,titleId:p?K:void 0,labelledBy:C,label:w}),"aria-describedby":L??(b?G:v?D:void 0),className:`relative max-h-full w-full ${f[N]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${W}`.trim(),children:[p&&/* @__PURE__ */u("h2",{id:K,className:(I?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:p}),b&&/* @__PURE__ */u("p",{id:G,className:((p?"mt-1":I?"pr-8":"")+" text-sm text-gray-500").trim(),children:b}),v&&/* @__PURE__ */u("div",{id:D,className:"mt-2 text-sm text-gray-600",children:v}),y&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:y}),I&&/* @__PURE__ */u("button",{type:"button",onClick:x,"aria-label":T.close,className:"absolute right-3 top-3 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__ */u(a,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}export{h as Dialog};
3
+ /* @__PURE__ */u("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:k?void 0:e=>{e.target===e.currentTarget&&x()},children:/* @__PURE__ */m("div",{ref:U,...e({role:g,modal:!0,titleId:p?R:void 0,labelledBy:C,label:w}),"aria-describedby":W??(b?D:v?A:void 0),className:`relative max-h-full w-full ${f[N]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${L}`.trim(),children:[p&&/* @__PURE__ */u("h2",{id:R,className:(G?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:p}),b&&/* @__PURE__ */u("p",{id:D,className:((p?"mt-1":G?"pr-8":"")+" text-sm text-gray-500").trim(),children:b}),v&&/* @__PURE__ */u("div",{id:A,className:"mt-2 text-sm text-gray-600",children:v}),y&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:y}),G&&/* @__PURE__ */u("button",{type:"button",onClick:x,"aria-label":z.close,className:"absolute right-3 top-3 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__ */u(a,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}export{h as Dialog};
@@ -1,4 +1,4 @@
1
- import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-PJCVNFWM.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
1
+ import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-FKZEGBLK.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
2
2
  return n("div",{role:"separator",children:/* @__PURE__ */n(e,{})},d.key);if("label"===d.type)/* @__PURE__ */
3
3
  return n("div",{id:`${y}-label-${k}`,children:/* @__PURE__ */n(l,{children:d.label})},d.key);if("status"===d.type)/* @__PURE__ */
4
4
  return n("div",{id:c(y,k),className:"text-xs",style:t(),children:d.label},d.key);if("submenu"===d.type)/* @__PURE__ */
@@ -7,4 +7,4 @@ return s("button",{type:"button",role:"menuitemcheckbox","aria-checked":d.checke
7
7
  /* @__PURE__ */n(r,{kind:"checkbox",checked:d.checked}),d.icon,d.label]},d.key)}if("radio"===d.type){const e=a(!1,d.disabled,"");/* @__PURE__ */
8
8
  return s("button",{type:"button",role:"menuitemradio","aria-checked":d.checked,disabled:d.disabled,className:e.className,style:e.style,onClick:()=>b(d),...m(k,d),children:[
9
9
  /* @__PURE__ */n(r,{kind:"radio",checked:d.checked}),d.icon,d.label]},d.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(d)){const e=a(!1,d.disabled,"no-underline "+(d.current?"font-medium":""));return d.disabled?/* @__PURE__ */s("a",{role:"menuitem","aria-disabled":"true",className:e.className,style:e.style,...m(k,d),children:[d.icon,d.label]},d.key):/* @__PURE__ */s(f,{href:d.href,role:"menuitem","aria-current":d.current?"page":void 0,className:e.className,style:e.style,onClick:p,...m(k,d),children:[d.icon,d.label]},d.key)}const v=a(d.danger,d.disabled,"");/* @__PURE__ */
10
- return s("button",{type:"button",role:"menuitem",disabled:d.disabled,className:v.className,style:v.style,onClick:()=>b(d),...m(k,d),children:[d.icon,d.label]},d.key)},N=[];for(let e=0;e<d.length;){const l=d[e];if("radio"!==l.type&&"checkbox"!==l.type){N.push(v(l,e)),e+=1;continue}const t=l.type,i=e,a=[];for(;e<d.length&&d[e].type===t;)a.push(v(d[e],e)),e+=1;const r="label"===d[i-1]?.type?`${y}-label-${i-1}`:void 0;N.push(/* @__PURE__ */n("div",{role:"group","aria-labelledby":r,children:a},`group:${l.key}`))}return N}export{d as isFocusableEntry,o as menuStatusIds,u as renderMenuEntries};
10
+ return s("button",{type:"button",role:"menuitem",disabled:d.disabled,className:v.className,style:v.style,onClick:()=>b(d),...m(k,d),children:[d.icon,d.label]},d.key)},g=[];for(let e=0;e<d.length;){const l=d[e];if("radio"!==l.type&&"checkbox"!==l.type){g.push(v(l,e)),e+=1;continue}const t=l.type,i=e,a=[];for(;e<d.length&&d[e].type===t;)a.push(v(d[e],e)),e+=1;const r="label"===d[i-1]?.type?`${y}-label-${i-1}`:void 0;g.push(/* @__PURE__ */n("div",{role:"group","aria-labelledby":r,children:a},`group:${l.key}`))}return g}export{d as isFocusableEntry,o as menuStatusIds,u as renderMenuEntries};
@@ -1 +1 @@
1
- import{requestFilesTrashView as n}from"./chunk-RAAUW5OZ.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
1
+ import{requestFilesTrashView as n}from"./chunk-DG2WU3BU.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
@@ -1,14 +1,14 @@
1
- import{FormField as e}from"./chunk-MVQBVPWP.js";import{zoneFocusClass as r,mediaPromptLine as t,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-DTSCO7VM.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-YDYDR72S.js";import{ColoredBadge as m}from"./chunk-XWLWG4HS.js";import{MENU_ON_MEDIA_ATTR as u}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-KIBL6M3T.js";import{Tooltip as h}from"./chunk-22S6LG6D.js";import{useShellStrings as f}from"./chunk-E6UCGCOC.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function w({items:p,onPick:k,onFiles:w,onRemove:N,onReorder:j,dragType:C,dropType:K,onDropData:T,label:S,hint:L,error:I,required:P,className:A,accept:F="image/*",maxSizeBytes:M,maxFiles:O,fit:z="cover",thumbSize:$=96,placeholder:E,cta:H,acceptHint:W,showCover:B=!1,coverLabel:R,busy:G=!1,busyLabel:Q,progress:V,disabled:q=!1,readOnly:U=!1,selected:Y,onItemClick:X,onItemDoubleClick:J,onItemContextMenu:Z,menuOnMedia:_=!1}){const ee=f().media,re=H??ee.cta,te=R??ee.cover,ae=Q??ee.uploading,ne=g(),[le,ie]=b(null),oe=q||G,se=!(!k&&!w||oe||U),de=!!N&&!oe&&!U,ce=!!j&&!oe&&!U,me=!!C&&!q&&!ce,ue=!(!K||!T||oe||U),pe=r(oe),he=E??t(F,ee),fe=d({accept:F,maxSizeBytes:M,maxFiles:O,acceptHint:W,multiple:!0,disabled:!se,currentCount:p.length,onAccept:e=>{if(w)w(e);else for(const r of e)k(r)}}),[ge,be]=b(!1),ye=y(0),ve=e=>ue&&Array.from(e.dataTransfer?.types??[]).includes(K),xe=fe.zoneProps,ke={onDragEnter:e=>{if(!ve(e))return xe.onDragEnter?.(e);e.preventDefault(),ye.current+=1,be(!0)},onDragOver:e=>{if(!ve(e))return xe.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",ge||be(!0)},onDragLeave:e=>{if(!ve(e))return xe.onDragLeave?.(e);ye.current=Math.max(0,ye.current-1),0===ye.current&&be(!1)},onDrop:e=>{if(!ve(e))return xe.onDrop?.(e);e.preventDefault(),ye.current=0,be(!1);const r=e.dataTransfer.getData(K);r&&T(r)}},De=fe.dragOver||ge,we=()=>{se&&(k?k():fe.open())},Ne={width:$,height:$},je=null==Y?null:new Set(Y),Ce=!!X,Ke=$<112,Te=(e,r)=>{const t=e.kind?"video"===e.kind:i(e.url,F),a=e.name??o(e.url),n=B&&(e.cover??0===r);/* @__PURE__ */
2
- return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},..._?{[u]:""}:{},"aria-selected":je?je.has(e.id):void 0,onClick:Ce?r=>{r.target.closest?.("button")||X(e.id,{ctrlKey:r.ctrlKey,metaKey:r.metaKey,shiftKey:r.shiftKey})}:void 0,onDoubleClick:J?()=>J(e.id):void 0,onContextMenu:Z?r=>Z(e.id,r):void 0,draggable:ce||me&&!!e.dragData||void 0,onDragStart:ce?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),ie(r)}:me&&e.dragData?r=>{r.dataTransfer.effectAllowed="link",r.dataTransfer.setData(C,e.dragData)}:void 0,onDragEnd:ce?()=>ie(null):void 0,onDragOver:ce?e=>{null!=le&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ce?e=>{null!=le&&(e.preventDefault(),e.stopPropagation(),le!==r&&j(le,r),ie(null))}:void 0,tabIndex:ce||Ce?0:void 0,"aria-label":ce?ee.reorder(a,r+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ce?r=>{r.target!==r.currentTarget||"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),X(e.id,{ctrlKey:r.ctrlKey,metaKey:r.metaKey,shiftKey:r.shiftKey}))}:ce?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?r>0&&(e.preventDefault(),j(r,r-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||r<p.length-1&&(e.preventDefault(),j(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",pe,le===r?"opacity-50":"",je?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...Ne,cursor:ce?"move":void 0},children:[t?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:z}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:z}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:te}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-white",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
1
+ import{FormField as e}from"./chunk-MVQBVPWP.js";import{zoneFocusClass as r,mediaPromptLine as t,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-FMKTVZAO.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-YDYDR72S.js";import{ColoredBadge as m}from"./chunk-4GVH4ZUH.js";import{MENU_ON_MEDIA_ATTR as u}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-2SHYR3RA.js";import{Tooltip as h}from"./chunk-22S6LG6D.js";import{useShellStrings as f}from"./chunk-E6UCGCOC.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function w({items:p,onPick:k,onFiles:w,onRemove:N,onReorder:j,dragType:C,dropType:K,onDropData:T,label:A,hint:S,error:F,required:P,className:I,accept:L="image/*",maxSizeBytes:O,maxFiles:z,fit:H="cover",thumbSize:M=96,placeholder:$,cta:E,acceptHint:R,showCover:V=!1,coverLabel:B,busy:G=!1,busyLabel:Q,progress:U,disabled:W=!1,readOnly:Y=!1,selected:q,onItemClick:Z,onItemDoubleClick:J,onItemContextMenu:X,menuOnMedia:_=!1}){const ee=f().media,re=E??ee.cta,te=B??ee.cover,ae=Q??ee.uploading,ne=g(),[le,ie]=b(null),oe=W||G,se=!(!k&&!w||oe||Y),de=!!N&&!oe&&!Y,ce=!!j&&!oe&&!Y,me=!!C&&!W&&!ce,ue=!(!K||!T||oe||Y),pe=r(oe),he=$??t(L,ee),fe=d({accept:L,maxSizeBytes:O,maxFiles:z,acceptHint:R,multiple:!0,disabled:!se,currentCount:p.length,onAccept:e=>{if(w)w(e);else for(const r of e)k(r)}}),[ge,be]=b(!1),ye=y(0),ve=e=>ue&&Array.from(e.dataTransfer?.types??[]).includes(K),xe=fe.zoneProps,ke={onDragEnter:e=>{if(!ve(e))return xe.onDragEnter?.(e);e.preventDefault(),ye.current+=1,be(!0)},onDragOver:e=>{if(!ve(e))return xe.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",ge||be(!0)},onDragLeave:e=>{if(!ve(e))return xe.onDragLeave?.(e);ye.current=Math.max(0,ye.current-1),0===ye.current&&be(!1)},onDrop:e=>{if(!ve(e))return xe.onDrop?.(e);e.preventDefault(),ye.current=0,be(!1);const r=e.dataTransfer.getData(K);r&&T(r)}},De=fe.dragOver||ge,we=()=>{se&&(k?k():fe.open())},Ne={width:M,height:M},je=null==q?null:new Set(q),Ce=!!Z,Ke=M<112,Te=(e,r)=>{const t=e.kind?"video"===e.kind:i(e.url,L),a=e.name??o(e.url),n=V&&(e.cover??0===r);/* @__PURE__ */
2
+ return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},..._?{[u]:""}:{},"aria-selected":je?je.has(e.id):void 0,onClick:Ce?r=>{r.target.closest?.("button")||Z(e.id,{ctrlKey:r.ctrlKey,metaKey:r.metaKey,shiftKey:r.shiftKey})}:void 0,onDoubleClick:J?()=>J(e.id):void 0,onContextMenu:X?r=>X(e.id,r):void 0,draggable:ce||me&&!!e.dragData||void 0,onDragStart:ce?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),ie(r)}:me&&e.dragData?r=>{r.dataTransfer.effectAllowed="link",r.dataTransfer.setData(C,e.dragData)}:void 0,onDragEnd:ce?()=>ie(null):void 0,onDragOver:ce?e=>{null!=le&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ce?e=>{null!=le&&(e.preventDefault(),e.stopPropagation(),le!==r&&j(le,r),ie(null))}:void 0,tabIndex:ce||Ce?0:void 0,"aria-label":ce?ee.reorder(a,r+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ce?r=>{r.target!==r.currentTarget||"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),Z(e.id,{ctrlKey:r.ctrlKey,metaKey:r.metaKey,shiftKey:r.shiftKey}))}:ce?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?r>0&&(e.preventDefault(),j(r,r-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||r<p.length-1&&(e.preventDefault(),j(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",pe,le===r?"opacity-50":"",je?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...Ne,cursor:ce?"move":void 0},children:[t?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:H}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:te}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-white",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
3
3
  /* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-white p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ke?
4
4
  /* @__PURE__ */x(h,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${pe}`,children:/* @__PURE__ */x(m,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
5
- /* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(m,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),de&&/* @__PURE__ */x("button",{type:"button",onClick:()=>N(e.id),"aria-label":e.removeLabel??ee.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${pe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Se=se&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":ee.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${pe}`,style:Ne,children:[
5
+ /* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(m,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),de&&/* @__PURE__ */x("button",{type:"button",onClick:()=>N(e.id),"aria-label":e.removeLabel??ee.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${pe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ae=se&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":ee.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${pe}`,style:Ne,children:[
6
6
  /* @__PURE__ */x(a,{className:"h-5 w-5"}),
7
- /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:ee.add})]}),Le=se?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:ee.upload,className:n(De,!1,pe),style:{minHeight:$+32},children:[
7
+ /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:ee.add})]}),Se=se?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:ee.upload,className:n(De,!1,pe),style:{minHeight:M+32},children:[
8
8
  /* @__PURE__ */x("span",{className:"text-gray-400",children:/* @__PURE__ */x(a,{})}),
9
9
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-gray-500",children:he}),
10
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),W&&/* @__PURE__ */x("span",{className:"text-xs text-gray-400",children:W})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:G?"invisible":void 0,children:ee.empty})});/* @__PURE__ */
11
- return v(e,{label:S,labelId:S?`${ne}-label`:void 0,htmlFor:ne,hint:L,error:I,required:P,className:A,children:[
12
- /* @__PURE__ */v("div",{id:ne,role:"group","aria-labelledby":S?`${ne}-label`:void 0,"aria-describedby":I?`${ne}-error`:L?`${ne}-hint`:void 0,"aria-busy":G||void 0,...fe.zoneProps,...ue?ke:{},className:"relative rounded-lg transition-colors",style:{...oe?{opacity:.6}:{},...De?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Le:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
13
- /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!je||void 0,"aria-label":"string"==typeof S?S:ee.files,className:"contents",children:p.map(Te)}):p.map(Te),Se]}),G&&/* @__PURE__ */x(l,{label:ae,progress:V})]}),!k&&w&&/* @__PURE__ */x("input",{...fe.inputProps}),
10
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),R&&/* @__PURE__ */x("span",{className:"text-xs text-gray-400",children:R})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:M+32},children:/* @__PURE__ */x("span",{className:G?"invisible":void 0,children:ee.empty})});/* @__PURE__ */
11
+ return v(e,{label:A,labelId:A?`${ne}-label`:void 0,htmlFor:ne,hint:S,error:F,required:P,className:I,children:[
12
+ /* @__PURE__ */v("div",{id:ne,role:"group","aria-labelledby":A?`${ne}-label`:void 0,"aria-describedby":F?`${ne}-error`:S?`${ne}-hint`:void 0,"aria-busy":G||void 0,...fe.zoneProps,...ue?ke:{},className:"relative rounded-lg transition-colors",style:{...oe?{opacity:.6}:{},...De?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Se:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
13
+ /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!je||void 0,"aria-label":"string"==typeof A?A:ee.files,className:"contents",children:p.map(Te)}):p.map(Te),Ae]}),G&&/* @__PURE__ */x(l,{label:ae,progress:U})]}),!k&&w&&/* @__PURE__ */x("input",{...fe.inputProps}),
14
14
  /* @__PURE__ */x(c,{rejections:fe.rejections})]})}export{k as FULL_BADGE_TILE_PX,w as MediaUploadGrid};
@@ -1,4 +1,4 @@
1
- import{IconButton_default as e}from"./chunk-4CANQ3B3.js";import{Icon as t}from"./chunk-KIBL6M3T.js";import{Tooltip as r}from"./chunk-22S6LG6D.js";import{useShellStrings as o}from"./chunk-E6UCGCOC.js";import{useId as i}from"react";import{jsxs as n,jsx as a}from"react/jsx-runtime";var s=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function d({label:d,onReset:l,view:c="desktop",detail:b,disabled:m}){const f=o().settingView,u=i(),p="desktop"===c,h=p?f.resetName(d):f.inheritName(d),k=b?f.backTo(b):p?f.backToDefault:f.backToAuto;
1
+ import{IconButton_default as e}from"./chunk-4CANQ3B3.js";import{Icon as t}from"./chunk-2SHYR3RA.js";import{Tooltip as r}from"./chunk-22S6LG6D.js";import{useShellStrings as o}from"./chunk-E6UCGCOC.js";import{useId as i}from"react";import{jsxs as n,jsx as a}from"react/jsx-runtime";var s=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function d({label:d,onReset:l,view:c="desktop",detail:b,disabled:m}){const f=o().settingView,u=i(),p="desktop"===c,h=p?f.resetName(d):f.inheritName(d),k=b?f.backTo(b):p?f.backToDefault:f.backToAuto;
2
2
  /* @__PURE__ */
3
3
  return n(r,{content:f.tip(h,k),describe:!1,children:[
4
4
  /* @__PURE__ */a(e,{size:"sm","aria-label":h,"aria-describedby":u,disabled:m,className:"relative before:absolute before:-top-2.5 before:-bottom-2.5 before:-left-1 before:-right-4",onClick:e=>{l(),function(e){const t=e.currentTarget,r=t.closest("[data-setting-reset]")??t;let o=r.parentElement;for(let e=0;o&&e<4;e+=1,o=o.parentElement){const e=[...o.querySelectorAll(s)].find(e=>!r.contains(e)&&!e.closest('[aria-hidden="true"]'));if(e)return void e.focus()}}(e)},children:/* @__PURE__ */a(t,{name:"revert",size:16,"aria-hidden":"true"})}),
@@ -1,19 +1,19 @@
1
- import{ChartDot as t}from"./chunk-CK2YOGUS.js";import{stepPath as e,curvePath as a,areaBetween as r,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as o,fillFor as s,dashFor as c,maskId as h}from"./chunk-465RRWBY.js";import{ChartSkeleton as m}from"./chunk-Y4MI6NRI.js";import{useHighlight as d,highlightOpacity as u}from"./chunk-CNYAHYE6.js";import{ChartTooltip as f}from"./chunk-P5BOTIJU.js";import{tooltipBesideBand as p}from"./chunk-MG7A3R75.js";import{pairedAxes as g,niceAxis as k,niceMax as y,linearScale as x,axisGutter as v,bandScale as b,ladderScale as M}from"./chunk-2JWPNR2U.js";import{usePlotWidth as N}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as j}from"./chunk-TWVUQUUD.js";import{ChartBrush as $}from"./chunk-EYKUKN32.js";import{resolveSeriesColor as w,CHART_INK as A,STATUS_VARS as R}from"./chunk-TZFACUMR.js";import{useShellStrings as V,useShellLocale as C}from"./chunk-E6UCGCOC.js";import{formatPercent as L,formatPlain as U}from"./chunk-C3QOHMR6.js";import{useRef as W,useState as z,useId as E,useEffect as I}from"react";import{jsx as S,jsxs as D}from"react/jsx-runtime";var O=12,Y=16,B=26,F=52,P=t=>"number"==typeof t&&Number.isFinite(t);function T({series:T,labels:K,height:G=200,stacked:Q=!1,stackMode:H="value",levels:J,curve:Z="linear",tension:X=0,max:q,yTickCount:_=4,formatValue:tt,formatTooltipValue:et,tooltipLabels:at,yAxisLabel:rt,referenceLines:lt,labelEndpoints:nt=!1,dots:it,dotVariant:ot="border",pulse:st=!1,brush:ct=!1,range:ht,onRangeChange:mt,loading:dt=!1,animate:ut=!0,reveal:ft="left-to-right",fillVariant:pt="gradient",gridStyle:gt="solid",width:kt,className:yt,emptyLabel:xt}){const vt=V().charts,bt=C(),Mt=tt??(t=>U(t,bt)),Nt=et??Mt,jt=xt??vt.noData,$t=W(null),wt=N($t),At=kt??wt,[Rt,Vt]=z(null),[Ct,Lt]=z(null),{highlighted:Ut}=d(),Wt=E();if(I(()=>{if(null!==Rt)return j(t=>"Escape"===t.key&&(Vt(null),!0))},[Rt]),dt)/* @__PURE__ */
2
- return S("div",{className:yt,ref:$t,children:/* @__PURE__ */S(m,{height:G,width:kt??wt})});const zt=K,Et=ht??Ct??[0,Math.max(0,zt.length-1)],[It,St]=Et,Dt=t=>ct?t.slice(It,St+1):t,Ot=T.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(P)).map(t=>({...t,data:Dt(t.data)}));if(K=Dt(zt),0===Ot.length||0===K.length)/* @__PURE__ */
3
- return S("div",{className:yt,ref:$t,children:/* @__PURE__ */S("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:G},children:jt})});const Yt=K.map((t,e)=>Ot.reduce((t,a)=>t+(P(a.data[e])?a.data[e]:0),0)),Bt=(t,e)=>Yt[e]>0?t/Yt[e]:null,Ft=[];if(Q){let t=K.map(()=>0);for(const e of Ot)t=t.map((t,a)=>t+(P(e.data[a])?e.data[a]:0)),Ft.push("percent"===H?t.map((t,e)=>Bt(t,e)):[...t])}const Pt=!!J&&J.length>0,Tt=t=>"right"===t.axis,Kt=!Q&&!Pt&&void 0===q&&Ot.some(Tt)&&Ot.some(t=>!Tt(t)),Gt=Kt?Ot.filter(t=>!Tt(t)):Ot,Qt=Kt?Ot.filter(Tt).flatMap(t=>t.data.filter(P)):[],Ht=Q?(Ft.at(-1)??[]).filter(P):Gt.flatMap(t=>t.data.filter(P)),Jt=Kt?g([Math.min(0,...Ht),Math.max(0,...Ht)],[Math.min(0,...Qt),Math.max(0,...Qt)],{intervals:_+1,integerLeft:Ht.every(Number.isInteger),integerRight:Qt.every(Number.isInteger)}):null,Zt=Jt?Jt.left:Q&&"percent"===H||Pt||void 0!==q?null:k(Q?0:Math.min(0,...Ht),Math.max(0,...Ht),{intervals:_+1,integer:Ht.every(Number.isInteger)}),Xt=Zt?Zt.lo:0,qt=Q&&"percent"===H?1:Zt?Zt.hi:q??y(Math.max(...Ht,0)),_t=Q&&"percent"===H?t=>L(Math.round(100*t),0,bt):Mt,te=Pt?J:Zt?Zt.ticks:x([Xt,qt],{from:0,to:1}).ticks(_+1),ee=v(te.map(_t),F),ae=Jt?v(Jt.right.ticks.map(Mt),Y):Y,re={left:ee,right:Math.max(ee+1,At-ae),top:O,bottom:G-B},le=b(K.length,{from:re.left,to:re.right}),ne=Pt?M(J,{from:re.bottom,to:re.top}):null,ie=x([Xt,qt],{from:re.bottom,to:re.top}),oe=ie(Math.max(Xt,0)),se=t=>ne?ne(t):ie(t),ce=Jt?x([Jt.right.lo,Jt.right.hi],{from:re.bottom,to:re.top}):null,he=t=>ce&&Tt(t)?ce:se,me=ne?ne.levels.map(t=>({value:t,y:ne(t)})):te.map(t=>({value:t,y:ie(t)})),de=t=>e=>{e.preventDefault(),Vt(e=>{const a=(e??0)+t;return Math.min(K.length-1,Math.max(0,a))})},ue=Math.max(1,Math.ceil(K.length/Math.max(1,Math.floor(At/96))));/* @__PURE__ */
1
+ import{ChartBrush as t}from"./chunk-EYKUKN32.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as l,areaFrom as n}from"./chunk-VFC6QUEN.js";import{ChartDefs as i,MOTION as o,stagger as s,fillFor as c,dashFor as h,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as d}from"./chunk-Y4MI6NRI.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{ChartTooltip as p}from"./chunk-P5BOTIJU.js";import{tooltipBesideBand as g}from"./chunk-MG7A3R75.js";import{pairedAxes as k,niceAxis as y,niceMax as x,linearScale as v,axisGutter as b,bandScale as M,ladderScale as N}from"./chunk-2JWPNR2U.js";import{usePlotWidth as j}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as $,CHART_INK as w,STATUS_VARS as A}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as R}from"./chunk-TWVUQUUD.js";import{useShellStrings as V,useShellLocale as C}from"./chunk-E6UCGCOC.js";import{formatPercent as L,formatPlain as U}from"./chunk-C3QOHMR6.js";import{useRef as W,useState as z,useId as E,useEffect as I}from"react";import{jsx as S,jsxs as D}from"react/jsx-runtime";var O=12,Y=16,B=26,F=52,P=t=>"number"==typeof t&&Number.isFinite(t);function T({series:T,labels:K,height:G=200,stacked:Q=!1,stackMode:H="value",levels:J,curve:Z="linear",tension:X=0,max:q,yTickCount:_=4,formatValue:tt,formatTooltipValue:et,tooltipLabels:at,yAxisLabel:rt,referenceLines:lt,labelEndpoints:nt=!1,dots:it,dotVariant:ot="border",pulse:st=!1,brush:ct=!1,range:ht,onRangeChange:mt,loading:dt=!1,animate:ut=!0,reveal:ft="left-to-right",fillVariant:pt="gradient",gridStyle:gt="solid",width:kt,className:yt,emptyLabel:xt}){const vt=V().charts,bt=C(),Mt=tt??(t=>U(t,bt)),Nt=et??Mt,jt=xt??vt.noData,$t=W(null),wt=j($t),At=kt??wt,[Rt,Vt]=z(null),[Ct,Lt]=z(null),{highlighted:Ut}=u(),Wt=E();if(I(()=>{if(null!==Rt)return R(t=>"Escape"===t.key&&(Vt(null),!0))},[Rt]),dt)/* @__PURE__ */
2
+ return S("div",{className:yt,ref:$t,children:/* @__PURE__ */S(d,{height:G,width:kt??wt})});const zt=K,Et=ht??Ct??[0,Math.max(0,zt.length-1)],[It,St]=Et,Dt=t=>ct?t.slice(It,St+1):t,Ot=T.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(P)).map(t=>({...t,data:Dt(t.data)}));if(K=Dt(zt),0===Ot.length||0===K.length)/* @__PURE__ */
3
+ return S("div",{className:yt,ref:$t,children:/* @__PURE__ */S("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:G},children:jt})});const Yt=K.map((t,e)=>Ot.reduce((t,a)=>t+(P(a.data[e])?a.data[e]:0),0)),Bt=(t,e)=>Yt[e]>0?t/Yt[e]:null,Ft=[];if(Q){let t=K.map(()=>0);for(const e of Ot)t=t.map((t,a)=>t+(P(e.data[a])?e.data[a]:0)),Ft.push("percent"===H?t.map((t,e)=>Bt(t,e)):[...t])}const Pt=!!J&&J.length>0,Tt=t=>"right"===t.axis,Kt=!Q&&!Pt&&void 0===q&&Ot.some(Tt)&&Ot.some(t=>!Tt(t)),Gt=Kt?Ot.filter(t=>!Tt(t)):Ot,Qt=Kt?Ot.filter(Tt).flatMap(t=>t.data.filter(P)):[],Ht=Q?(Ft.at(-1)??[]).filter(P):Gt.flatMap(t=>t.data.filter(P)),Jt=Kt?k([Math.min(0,...Ht),Math.max(0,...Ht)],[Math.min(0,...Qt),Math.max(0,...Qt)],{intervals:_+1,integerLeft:Ht.every(Number.isInteger),integerRight:Qt.every(Number.isInteger)}):null,Zt=Jt?Jt.left:Q&&"percent"===H||Pt||void 0!==q?null:y(Q?0:Math.min(0,...Ht),Math.max(0,...Ht),{intervals:_+1,integer:Ht.every(Number.isInteger)}),Xt=Zt?Zt.lo:0,qt=Q&&"percent"===H?1:Zt?Zt.hi:q??x(Math.max(...Ht,0)),_t=Q&&"percent"===H?t=>L(Math.round(100*t),0,bt):Mt,te=Pt?J:Zt?Zt.ticks:v([Xt,qt],{from:0,to:1}).ticks(_+1),ee=b(te.map(_t),F),ae=Jt?b(Jt.right.ticks.map(Mt),Y):Y,re={left:ee,right:Math.max(ee+1,At-ae),top:O,bottom:G-B},le=M(K.length,{from:re.left,to:re.right}),ne=Pt?N(J,{from:re.bottom,to:re.top}):null,ie=v([Xt,qt],{from:re.bottom,to:re.top}),oe=ie(Math.max(Xt,0)),se=t=>ne?ne(t):ie(t),ce=Jt?v([Jt.right.lo,Jt.right.hi],{from:re.bottom,to:re.top}):null,he=t=>ce&&Tt(t)?ce:se,me=ne?ne.levels.map(t=>({value:t,y:ne(t)})):te.map(t=>({value:t,y:ie(t)})),de=t=>e=>{e.preventDefault(),Vt(e=>{const a=(e??0)+t;return Math.min(K.length-1,Math.max(0,a))})},ue=Math.max(1,Math.ceil(K.length/Math.max(1,Math.floor(At/96))));/* @__PURE__ */
4
4
  return D("div",{className:`relative ${yt??""}`,ref:$t,children:[
5
5
  /* @__PURE__ */D("svg",{width:"100%",height:G,viewBox:`0 0 ${At} ${G}`,role:"img","aria-label":vt.overIntervals(Ot.map(t=>t.label),K.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Vt(null),onBlur:()=>Vt(null),onKeyDown:t=>{"ArrowRight"===t.key&&de(1)(t),"ArrowLeft"===t.key&&de(-1)(t)},children:[
6
6
  /* @__PURE__ */S("defs",{children:/* @__PURE__ */S("clipPath",{id:Wt,children:/* @__PURE__ */S("rect",{x:re.left,y:re.top,width:re.right-re.left,height:re.bottom-re.top})})}),
7
- /* @__PURE__ */S(n,{id:Wt,fills:Ot.map((t,e)=>({color:w(t.slot,t.color,t.tone),variant:t.fillVariant??pt})),fadeFrom:Q?.42:.3,reveal:!!ut&&ft}),me.map(t=>/* @__PURE__ */S("line",{x1:re.left,y1:t.y,x2:re.right,y2:t.y,stroke:A.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===gt?"3 3":void 0},`grid-${t.value}`)),
8
- /* @__PURE__ */S("line",{x1:re.left,y1:oe,x2:re.right,y2:oe,stroke:A.axis,strokeWidth:1,shapeRendering:"crispEdges"}),me.map(t=>/* @__PURE__ */S("text",{x:re.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:_t(t.value)},`ytick-${t.value}`)),Jt&&me.map((t,e)=>/* @__PURE__ */S("text",{x:re.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Jt.right.ticks[e])},`ytick-r-${t.value}`)),rt&&/* @__PURE__ */S("text",{x:12,y:(re.top+re.bottom)/2,transform:`rotate(-90 12 ${(re.top+re.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:A.label,children:rt}),
9
- /* @__PURE__ */S("g",{clipPath:`url(#${Wt})`,mask:ut&&ft?`url(#${h(Wt)})`:void 0,children:Ot.map((t,n)=>{const h=w(t.slot,t.color,t.tone),m=t.mode??(Q?"area":"line"),d=u(t.key,Ut);if("step"===m){const a=K.map((e,a)=>({start:le(a),end:le.end(a),value:t.data[a]})).filter(t=>P(t.value)).map(e=>({start:e.start,end:e.end,y:he(t)(e.value)}));/* @__PURE__ */
10
- return S("path",{d:e(a),fill:"none",stroke:h,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:d??void 0,className:"rosh-viz-mark"},t.key)}const f=K.map((e,a)=>{const r=Q?Ft[n]?.[a]:t.data[a];return P(r)?[le.center(a),he(t)(r)]:null}).filter(t=>null!==t);if(0===f.length)return null;if("column"===m){const e=Math.max(1,.62*le.bandwidth),a="solid"===t.fillVariant,r=he(t);/* @__PURE__ */
11
- return S("g",{opacity:d??void 0,className:"rosh-viz-mark",children:K.map((l,s)=>{const c=Q?Ft[n]?.[s]:t.data[s];if(!P(c))return null;const m=r(c);/* @__PURE__ */
12
- return S("rect",{x:le.center(s)-e/2,y:Math.min(m,oe),width:e,height:Math.abs(oe-m),rx:2,fill:h,fillOpacity:a?1:.35,className:ut?i.rise:void 0,style:ut?o(s,26):void 0},s)})},t.key)}const p=a(f,Z,X),g=Q&&n>0?K.map((t,e)=>[le.center(e),se(Ft[n-1]?.[e]??0)-2]):null,k=g?r(p,g):l(p,f,oe);/* @__PURE__ */
7
+ /* @__PURE__ */S(i,{id:Wt,fills:Ot.map((t,e)=>({color:$(t.slot,t.color,t.tone),variant:t.fillVariant??pt})),fadeFrom:Q?.42:.3,reveal:!!ut&&ft}),me.map(t=>/* @__PURE__ */S("line",{x1:re.left,y1:t.y,x2:re.right,y2:t.y,stroke:w.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===gt?"3 3":void 0},`grid-${t.value}`)),
8
+ /* @__PURE__ */S("line",{x1:re.left,y1:oe,x2:re.right,y2:oe,stroke:w.axis,strokeWidth:1,shapeRendering:"crispEdges"}),me.map(t=>/* @__PURE__ */S("text",{x:re.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:w.label,style:{fontVariantNumeric:"tabular-nums"},children:_t(t.value)},`ytick-${t.value}`)),Jt&&me.map((t,e)=>/* @__PURE__ */S("text",{x:re.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:w.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Jt.right.ticks[e])},`ytick-r-${t.value}`)),rt&&/* @__PURE__ */S("text",{x:12,y:(re.top+re.bottom)/2,transform:`rotate(-90 12 ${(re.top+re.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:w.label,children:rt}),
9
+ /* @__PURE__ */S("g",{clipPath:`url(#${Wt})`,mask:ut&&ft?`url(#${m(Wt)})`:void 0,children:Ot.map((t,e)=>{const i=$(t.slot,t.color,t.tone),m=t.mode??(Q?"area":"line"),d=f(t.key,Ut);if("step"===m){const e=K.map((e,a)=>({start:le(a),end:le.end(a),value:t.data[a]})).filter(t=>P(t.value)).map(e=>({start:e.start,end:e.end,y:he(t)(e.value)}));/* @__PURE__ */
10
+ return S("path",{d:a(e),fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:d??void 0,className:"rosh-viz-mark"},t.key)}const u=K.map((a,r)=>{const l=Q?Ft[e]?.[r]:t.data[r];return P(l)?[le.center(r),he(t)(l)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*le.bandwidth),r="solid"===t.fillVariant,l=he(t);/* @__PURE__ */
11
+ return S("g",{opacity:d??void 0,className:"rosh-viz-mark",children:K.map((n,c)=>{const h=Q?Ft[e]?.[c]:t.data[c];if(!P(h))return null;const m=l(h);/* @__PURE__ */
12
+ return S("rect",{x:le.center(c)-a/2,y:Math.min(m,oe),width:a,height:Math.abs(oe-m),rx:2,fill:i,fillOpacity:r?1:.35,className:ut?o.rise:void 0,style:ut?s(c,26):void 0},c)})},t.key)}const p=r(u,Z,X),g=Q&&e>0?K.map((t,a)=>[le.center(a),se(Ft[e-1]?.[a]??0)-2]):null,k=g?l(p,g):n(p,u,oe);/* @__PURE__ */
13
13
  return D("g",{opacity:d??void 0,className:"rosh-viz-mark",children:[("area"===m||Q)&&
14
- /* @__PURE__ */S("path",{d:k,fill:s(Wt,n,t.fillVariant??pt,h),stroke:"none"}),
15
- /* @__PURE__ */S("path",{d:p,fill:"none",stroke:h,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:c(t.stroke??(t.forecast?"animated-dashed":"solid")),className:ut&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),lt?.map((t,e)=>{const a=t.color??R[t.tone??"critical"],r=se(t.value);/* @__PURE__ */
14
+ /* @__PURE__ */S("path",{d:k,fill:c(Wt,e,t.fillVariant??pt,i),stroke:"none"}),
15
+ /* @__PURE__ */S("path",{d:p,fill:"none",stroke:i,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:h(t.stroke??(t.forecast?"animated-dashed":"solid")),className:ut&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?o.march:void 0})]},t.key)})}),lt?.map((t,e)=>{const a=t.color??A[t.tone??"critical"],r=se(t.value);/* @__PURE__ */
16
16
  return D("g",{children:[
17
- /* @__PURE__ */S("line",{x1:re.left,y1:r,x2:re.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */S("text",{x:re.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(it??(nt?"last":"none"))&&Ot.map((e,a)=>{if("column"===e.mode)return null;const r=it??(nt?"last":"none"),l=w(e.slot,e.color,e.tone),n=[...e.data].map(P).lastIndexOf(!0),i="all"===r?K.map((t,e)=>e).filter(t=>P(Q?Ft[a]?.[t]:e.data[t])):n>=0?[n]:[];/* @__PURE__ */
18
- return D("g",{children:[i.map(r=>{const i=Q?Ft[a]?.[r]:e.data[r];return P(i)?/* @__PURE__ */S(t,{cx:le.center(r),cy:he(e)(i),color:l,variant:ot,pulse:st&&r===n,title:`${K[r]}: ${e.label} ${Mt(i)}`},r):null}),nt&&n>=0&&P(Q?Ft[a]?.[n]:e.data[n])&&/* @__PURE__ */S("text",{x:le.center(n)-10,y:he(e)(Q?Ft[a]?.[n]:e.data[n])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Q?Ft[a]?.[n]:e.data[n])})]},`dots-${e.key}`)}),K.map((t,e)=>e%ue===0?/* @__PURE__ */S("text",{x:le.center(e),y:G-8,textAnchor:"middle",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Rt&&/* @__PURE__ */S("line",{x1:le.center(Rt),y1:re.top,x2:le.center(Rt),y2:re.bottom,stroke:A.axis,strokeWidth:1}),K.map((t,e)=>/* @__PURE__ */S("rect",{x:le(e),y:re.top,width:Math.max(1,le.bandwidth),height:re.bottom-re.top,fill:"transparent",onMouseEnter:()=>Vt(e)},`hit-${e}`))]}),ct&&zt.length>2&&/* @__PURE__ */S($,{className:"mt-1",labels:zt,width:At,data:T[0]?.data??[],range:Et,onRangeChange:t=>{mt?mt(t):Lt(t)}}),null!==Rt&&
19
- /* @__PURE__ */S("div",{className:"pointer-events-none absolute top-2 z-10",style:p(le.center(Rt),le.bandwidth,At),children:/* @__PURE__ */S(f,{title:at?.[Rt]??K[Rt],rows:Ot.map((t,e)=>({key:t.key,label:t.label,color:w(t.slot,t.color,t.tone),value:P(t.data[Rt])?Q&&"percent"===H?`${L(100*(Bt(t.data[Rt],Rt)??0),1,bt)} · ${Nt(t.data[Rt])}`:Nt(t.data[Rt]):void 0})),footnote:Q&&"percent"===H?vt.inBucket(Nt(Yt[Rt])):void 0})})]})}export{T as TimeSeriesChart};
17
+ /* @__PURE__ */S("line",{x1:re.left,y1:r,x2:re.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */S("text",{x:re.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(it??(nt?"last":"none"))&&Ot.map((t,a)=>{if("column"===t.mode)return null;const r=it??(nt?"last":"none"),l=$(t.slot,t.color,t.tone),n=[...t.data].map(P).lastIndexOf(!0),i="all"===r?K.map((t,e)=>e).filter(e=>P(Q?Ft[a]?.[e]:t.data[e])):n>=0?[n]:[];/* @__PURE__ */
18
+ return D("g",{children:[i.map(r=>{const i=Q?Ft[a]?.[r]:t.data[r];return P(i)?/* @__PURE__ */S(e,{cx:le.center(r),cy:he(t)(i),color:l,variant:ot,pulse:st&&r===n,title:`${K[r]}: ${t.label} ${Mt(i)}`},r):null}),nt&&n>=0&&P(Q?Ft[a]?.[n]:t.data[n])&&/* @__PURE__ */S("text",{x:le.center(n)-10,y:he(t)(Q?Ft[a]?.[n]:t.data[n])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:w.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Q?Ft[a]?.[n]:t.data[n])})]},`dots-${t.key}`)}),K.map((t,e)=>e%ue===0?/* @__PURE__ */S("text",{x:le.center(e),y:G-8,textAnchor:"middle",fontSize:11,fill:w.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Rt&&/* @__PURE__ */S("line",{x1:le.center(Rt),y1:re.top,x2:le.center(Rt),y2:re.bottom,stroke:w.axis,strokeWidth:1}),K.map((t,e)=>/* @__PURE__ */S("rect",{x:le(e),y:re.top,width:Math.max(1,le.bandwidth),height:re.bottom-re.top,fill:"transparent",onMouseEnter:()=>Vt(e)},`hit-${e}`))]}),ct&&zt.length>2&&/* @__PURE__ */S(t,{className:"mt-1",labels:zt,width:At,data:T[0]?.data??[],range:Et,onRangeChange:t=>{mt?mt(t):Lt(t)}}),null!==Rt&&
19
+ /* @__PURE__ */S("div",{className:"pointer-events-none absolute top-2 z-10",style:g(le.center(Rt),le.bandwidth,At),children:/* @__PURE__ */S(p,{title:at?.[Rt]??K[Rt],rows:Ot.map((t,e)=>({key:t.key,label:t.label,color:$(t.slot,t.color,t.tone),value:P(t.data[Rt])?Q&&"percent"===H?`${L(100*(Bt(t.data[Rt],Rt)??0),1,bt)} · ${Nt(t.data[Rt])}`:Nt(t.data[Rt]):void 0})),footnote:Q&&"percent"===H?vt.inBucket(Nt(Yt[Rt])):void 0})})]})}export{T as TimeSeriesChart};
@@ -1,9 +1,9 @@
1
- import{toISODate as e}from"./chunk-BZV4K6GR.js";import{Calendar as t}from"./chunk-3V5Z2BJY.js";import{inputClasses as r,PLACEHOLDER_INK as a}from"./chunk-PF3ANJFI.js";import{calendarNames as n}from"./chunk-5OTS2G3M.js";import{Icon as i}from"./chunk-KIBL6M3T.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-E6UCGCOC.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as x}from"react/jsx-runtime";var N=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(N.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!N.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function B(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var F=f(function({value:f,onChange:N,min:F,max:C,invalid:E,size:I,native:O,weekStartsOn:S,className:T="","aria-label":$,"aria-describedby":q,"aria-labelledby":G,id:J,name:L,disabled:M,placeholder:U,required:W,clearable:z,form:P,title:V,tabIndex:K,autoFocus:R,onFocus:Y,onBlur:Z,...A},H){const Q=z??!W,X=w(f),_=w(F),ee=w(C),te=c().datePicker,re=m(),ae=n(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!J&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!$&&(!!G||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),O)/* @__PURE__ */
2
- return y("input",{ref:H,type:"date",lang:re,id:J,name:L,disabled:M,"aria-label":$,"aria-describedby":q,"aria-invalid":E||void 0,value:X,min:_||void 0,max:ee||void 0,onChange:e=>N?.(D(e.target.value)),className:r({invalid:E,size:I,className:T}),"aria-labelledby":G,required:W,form:P,title:V,tabIndex:K,autoFocus:R,onFocus:Y,onBlur:Z,...A});const he=Object.fromEntries(Object.entries(A).filter(([e])=>k.test(e)&&!j.has(e))),ve=A["aria-required"],ge=!!W||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,q].filter(Boolean).join(" ")||void 0,xe=e(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=U??te.placeholder;/* @__PURE__ */
1
+ import{toISODate as e}from"./chunk-RPJ2GC3K.js";import{Calendar as t}from"./chunk-RB2F65YJ.js";import{inputClasses as r,PLACEHOLDER_INK as a}from"./chunk-PF3ANJFI.js";import{calendarNames as n}from"./chunk-5OTS2G3M.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-E6UCGCOC.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as x}from"react/jsx-runtime";var N=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(N.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!N.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function F(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var C=f(function({value:f,onChange:N,min:C,max:B,invalid:S,size:E,native:J,weekStartsOn:O,className:$="","aria-label":q,"aria-describedby":G,"aria-labelledby":I,id:R,name:T,disabled:U,placeholder:W,required:z,clearable:L,form:M,title:P,tabIndex:Y,autoFocus:A,onFocus:H,onBlur:K,...Q},V){const X=L??!z,Z=w(f),_=w(C),ee=w(B),te=c().datePicker,re=m(),ae=n(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!R&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!q&&(!!I||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),J)/* @__PURE__ */
2
+ return y("input",{ref:V,type:"date",lang:re,id:R,name:T,disabled:U,"aria-label":q,"aria-describedby":G,"aria-invalid":S||void 0,value:Z,min:_||void 0,max:ee||void 0,onChange:e=>N?.(D(e.target.value)),className:r({invalid:S,size:E,className:$}),"aria-labelledby":I,required:z,form:M,title:P,tabIndex:Y,autoFocus:A,onFocus:H,onBlur:K,...Q});const he=Object.fromEntries(Object.entries(Q).filter(([e])=>k.test(e)&&!j.has(e))),ve=Q["aria-required"],ge=!!z||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,G].filter(Boolean).join(" ")||void 0,xe=e(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=W??te.placeholder;/* @__PURE__ */
3
3
  return x("div",{ref:oe,className:"relative",children:[
4
- /* @__PURE__ */y("input",{ref:H,type:"hidden",name:L,form:P,value:X}),
5
- /* @__PURE__ */x("button",{ref:le,type:"button",...he,id:J,disabled:M,title:V,tabIndex:K,autoFocus:R,onFocus:Y,onBlur:Z,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":G,"aria-describedby":ye,"aria-label":$?`${$}${X?`, ${B(X,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${r({invalid:E,size:I,className:T})} flex items-center justify-between text-left`,children:[
6
- /* @__PURE__ */y("span",{className:X?"text-gray-900":a,children:X?B(X,ae):ke}),
7
- /* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:X?B(X,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
8
- /* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":$??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
9
- /* @__PURE__ */y(t,{value:X||null,min:_||null,max:ee||null,weekStartsOn:S,onSelect:e=>{ie(!1),le.current?.focus(),N?.(D(e))}}),(Q||Ne)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[Q&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{F as DatePicker_default};
4
+ /* @__PURE__ */y("input",{ref:V,type:"hidden",name:T,form:M,value:Z}),
5
+ /* @__PURE__ */x("button",{ref:le,type:"button",...he,id:R,disabled:U,title:P,tabIndex:Y,autoFocus:A,onFocus:H,onBlur:K,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":I,"aria-describedby":ye,"aria-label":q?`${q}${Z?`, ${F(Z,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${r({invalid:S,size:E,className:$})} flex items-center justify-between text-left`,children:[
6
+ /* @__PURE__ */y("span",{className:Z?"text-gray-900":a,children:Z?F(Z,ae):ke}),
7
+ /* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:Z?F(Z,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
8
+ /* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":q??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
9
+ /* @__PURE__ */y(t,{value:Z||null,min:_||null,max:ee||null,weekStartsOn:O,onSelect:e=>{ie(!1),le.current?.focus(),N?.(D(e))}}),(X||Ne)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[X&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{C as DatePicker_default};
@@ -1,4 +1,4 @@
1
- import{InputNumber_default as e}from"./chunk-CPXHU3Y2.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{Tooltip as i}from"./chunk-22S6LG6D.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const b=s[f],N=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
1
+ import{InputNumber_default as e}from"./chunk-HAIMJAI4.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{Tooltip as i}from"./chunk-22S6LG6D.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const b=s[f],N=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
2
2
  return t("div",{"data-side":a.join("-"),className:"min-w-0",children:/* @__PURE__ */t(e,{value:"mixed"===d?null:d,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(a,e),min:h,max:p,step:u,snap:!0,precision:0,steppers:"compact",readOnly:g,placeholder:f,prefix:o,suffix:c.unit,"aria-label":n})})};/* @__PURE__ */
3
3
  return t("div",{role:"group","aria-label":a,"data-sides":d?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */n(o,d?{children:[N(["left"],c.sides.left,b.left),N(["top"],c.sides.top,b.top),N(["right"],c.sides.right,b.right),N(["bottom"],c.sides.bottom,b.bottom)]}:{children:[N(["left","right"],c.horizontal,b.horizontal),N(["top","bottom"],c.vertical,b.vertical)]})})}function p({each:e,onChange:r,label:n,disabled:o}){/* @__PURE__ */
4
4
  return t(i,{content:n,children:/* @__PURE__ */t(a,{size:"sm","aria-label":n,"aria-pressed":e,disabled:o,onClick:()=>r(!e),children:l})})}export{p as SidesEachToggle,h as SidesInput,c as sidesStartEach};
@@ -1,4 +1,4 @@
1
- import{Icon as t}from"./chunk-KIBL6M3T.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";var e=t=>Array.isArray(t.options);function o(t){const n=[];for(const r of t)e(r)?n.push(...r.options):n.push(r);return n}function i(t,n){const r=[];for(const o of t){if(!e(o)){n(o)&&r.push(o);continue}const t=o.options.filter(n);t.length&&r.push({...o,options:t})}return r}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!e(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
1
+ import{Icon as t}from"./chunk-2SHYR3RA.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";var e=t=>Array.isArray(t.options);function o(t){const n=[];for(const r of t)e(r)?n.push(...r.options):n.push(r);return n}function i(t,n){const r=[];for(const o of t){if(!e(o)){n(o)&&r.push(o);continue}const t=o.options.filter(n);t.length&&r.push({...o,options:t})}return r}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!e(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
2
2
  /* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
3
3
  /* @__PURE__ */r("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
4
4
  return r(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a}from"./chunk-CPXHU3Y2.js";import{Icon as e}from"./chunk-KIBL6M3T.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-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__ */
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};