efficient-shell 8.16.1 → 8.17.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 (189) hide show
  1. package/README.md +20 -1
  2. package/dist/{Browser-QBOH7J6X.js → Browser-GZXTAL7Z.js} +14 -14
  3. package/dist/Calculator-TYZWIYJW.js +29 -0
  4. package/dist/{CurrencyConverter-QTFV2RSB.js → CurrencyConverter-XK6SETYS.js} +6 -6
  5. package/dist/{Documents-7TUZDRPO.js → Documents-GXYD4UD2.js} +7 -7
  6. package/dist/{Files-4KRJX4CJ.js → Files-OYZXQMRA.js} +18 -18
  7. package/dist/{Notepad-GBSYEVOZ.js → Notepad-L4TKPWZ7.js} +10 -10
  8. package/dist/{PomodoroTimer-23O2CBIZ.js → PomodoroTimer-D37Y6TE7.js} +23 -23
  9. package/dist/{Preview-WEWO3FSN.js → Preview-MPDXIVGC.js} +21 -21
  10. package/dist/{Sidebar-NONBFVWE.js → Sidebar-F4LYK5XP.js} +34 -34
  11. package/dist/{Spreadsheet-SDDJ3EBT.js → Spreadsheet-JBPWIBDY.js} +13 -13
  12. package/dist/{Stock-AQ2SJRU6.js → Stock-ZUTJX6S6.js} +3 -3
  13. package/dist/{Weather-UHCDMFZE.js → Weather-4GPPPHK5.js} +18 -18
  14. package/dist/{WorldClock-TB3HCUIH.js → WorldClock-TW36BP7G.js} +6 -6
  15. package/dist/ai/index.js +15 -15
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/charts/ChordChart.js +1 -1
  20. package/dist/charts/RadarChart.js +1 -1
  21. package/dist/charts/SankeyChart.js +1 -1
  22. package/dist/charts/SunburstChart.js +1 -1
  23. package/dist/charts/TreemapChart.js +1 -1
  24. package/dist/chunk-2LXTJXWC.js +6 -0
  25. package/dist/{chunk-MNWYPP3F.js → chunk-2OTCFJCU.js} +1 -1
  26. package/dist/{chunk-I7GWKMYO.js → chunk-35DHYR37.js} +1 -1
  27. package/dist/chunk-3S52QOEP.js +20 -0
  28. package/dist/{chunk-J77ZVPF5.js → chunk-4EIGXW4U.js} +5 -5
  29. package/dist/{chunk-ELVFPH7Y.js → chunk-4G5M752L.js} +3 -3
  30. package/dist/{chunk-ABJ4LWOW.js → chunk-4TL3MRRE.js} +1 -1
  31. package/dist/{chunk-L42Q6GVA.js → chunk-5BLAPU7W.js} +1 -1
  32. package/dist/{chunk-BOGBLZKS.js → chunk-5SULG7D5.js} +1 -1
  33. package/dist/{chunk-H3XEO4LR.js → chunk-62LFDQGF.js} +6 -6
  34. package/dist/chunk-65HOBHY7.js +3 -0
  35. package/dist/{chunk-7JKFXRAR.js → chunk-6AKXEUZA.js} +5 -5
  36. package/dist/{chunk-UOOHE3FX.js → chunk-6EJ7G234.js} +7 -7
  37. package/dist/{chunk-DYSUTUH3.js → chunk-6TWRV44R.js} +11 -11
  38. package/dist/{chunk-EK3JM3J2.js → chunk-7KZ65FSA.js} +1 -1
  39. package/dist/{chunk-QMQVOUIV.js → chunk-7T3COEQK.js} +1 -1
  40. package/dist/{chunk-JZ7NBWGB.js → chunk-7UBV5MPQ.js} +1 -1
  41. package/dist/{chunk-7HPOALEV.js → chunk-AGPQEI3I.js} +7 -7
  42. package/dist/{chunk-6L7MMUMP.js → chunk-B3LWYJS7.js} +2 -2
  43. package/dist/{chunk-DKY6X24V.js → chunk-BMBQ3IX3.js} +1 -1
  44. package/dist/{chunk-HPW6QAAY.js → chunk-C6LV3HJW.js} +1 -1
  45. package/dist/{chunk-JGZWAEOJ.js → chunk-CD6PGAYP.js} +1 -1
  46. package/dist/{chunk-BF2G42QU.js → chunk-CHNYSP6K.js} +1 -1
  47. package/dist/{chunk-H62JMI7C.js → chunk-DVFMCVI5.js} +2 -2
  48. package/dist/{chunk-UAXP4A2A.js → chunk-E4YSP5RD.js} +2 -2
  49. package/dist/{chunk-7OC3L4VZ.js → chunk-EIUCHQI2.js} +1 -1
  50. package/dist/{chunk-EXU3ZXKB.js → chunk-EKFIRCNP.js} +8 -8
  51. package/dist/{chunk-LKSHI57C.js → chunk-EPGKTANF.js} +6 -6
  52. package/dist/{chunk-EZQXLIG3.js → chunk-FARRGETL.js} +1 -1
  53. package/dist/{chunk-ZSTBFMQE.js → chunk-GATOVTJT.js} +1 -1
  54. package/dist/chunk-GLCKZI3N.js +1 -0
  55. package/dist/chunk-GLUJS42B.js +1 -0
  56. package/dist/{chunk-7OLYHD4V.js → chunk-HEJTHEXN.js} +1 -1
  57. package/dist/{chunk-55IY2ZJY.js → chunk-HEM6NC23.js} +1 -1
  58. package/dist/chunk-HMZLRXLA.js +1 -0
  59. package/dist/{chunk-VX4OBI4U.js → chunk-HPQ56MKK.js} +1 -1
  60. package/dist/{chunk-4CXQX5AX.js → chunk-IH2DJOTW.js} +22 -22
  61. package/dist/{chunk-NRWIULLI.js → chunk-ION2GBY3.js} +13 -13
  62. package/dist/{chunk-LRM5XTDF.js → chunk-JHXYW542.js} +3 -3
  63. package/dist/{chunk-53XMYVJO.js → chunk-JIJOXLDJ.js} +1 -1
  64. package/dist/{chunk-4MHHPESC.js → chunk-KBHC4VLA.js} +1 -1
  65. package/dist/{chunk-2HLS7AGL.js → chunk-KIGGG3LT.js} +1 -1
  66. package/dist/{chunk-YL44UDNT.js → chunk-KLAZTKN2.js} +5 -5
  67. package/dist/{chunk-UONWIAII.js → chunk-KSYNJTVA.js} +20 -20
  68. package/dist/{chunk-5J6Y5TOO.js → chunk-LC52BB6N.js} +1 -1
  69. package/dist/{chunk-CQXV3SJA.js → chunk-LI7D6SMK.js} +1 -1
  70. package/dist/{chunk-2KOXALIK.js → chunk-LJSJFS2M.js} +11 -11
  71. package/dist/{chunk-VR5GVM3A.js → chunk-MV7WC6SL.js} +28 -28
  72. package/dist/{chunk-L6CG37L3.js → chunk-OHHJF547.js} +1 -1
  73. package/dist/{chunk-5K3QLWUX.js → chunk-OS57C5J7.js} +1 -1
  74. package/dist/{chunk-DSBLBBES.js → chunk-OU3ITBK5.js} +6 -6
  75. package/dist/{chunk-G34KXE2L.js → chunk-PEELLEPP.js} +6 -6
  76. package/dist/{chunk-BKWLFZHI.js → chunk-PK4ZY4GZ.js} +3 -3
  77. package/dist/{chunk-XSY22PWH.js → chunk-PRR2GXBV.js} +2 -2
  78. package/dist/{chunk-C4YTKSXY.js → chunk-PRXPLEVZ.js} +1 -1
  79. package/dist/{chunk-U6FORQTI.js → chunk-PSOHSTXL.js} +1 -1
  80. package/dist/{chunk-ZKRWJILC.js → chunk-QIEMOYTG.js} +1 -1
  81. package/dist/chunk-QP2S2K2Y.js +4 -0
  82. package/dist/{chunk-2LTB2DSA.js → chunk-QV2GME3Y.js} +6 -6
  83. package/dist/{chunk-WCAQWHFD.js → chunk-R6N26ITY.js} +5 -5
  84. package/dist/{chunk-MSCILVJB.js → chunk-R6XC7X63.js} +6 -6
  85. package/dist/{chunk-37S3WLBL.js → chunk-RECXXFYW.js} +8 -8
  86. package/dist/chunk-RKWGWBET.js +9 -0
  87. package/dist/chunk-RNBM5JZI.js +4 -0
  88. package/dist/{chunk-JF45HC5H.js → chunk-RQARJHDB.js} +1 -1
  89. package/dist/{chunk-B7IHOBK6.js → chunk-S2ONNZVX.js} +14 -14
  90. package/dist/{chunk-CXDJXNPZ.js → chunk-S3RTAWEU.js} +1 -1
  91. package/dist/chunk-SEFPZXO5.js +8 -0
  92. package/dist/{chunk-FDIJEOGV.js → chunk-SWSN3HZX.js} +2 -2
  93. package/dist/{chunk-Y5W6POQE.js → chunk-T2VNNW6Z.js} +6 -6
  94. package/dist/{chunk-7QLI3HAO.js → chunk-T6L6HQI5.js} +1 -1
  95. package/dist/{chunk-FEAOJLGA.js → chunk-TB3AK6XF.js} +2 -2
  96. package/dist/{chunk-3YNRFMIN.js → chunk-TLJCUUZU.js} +1 -1
  97. package/dist/{chunk-FSP63GKK.js → chunk-UDD7GB4F.js} +2 -2
  98. package/dist/{chunk-OSRLZZDO.js → chunk-WKSVUJZA.js} +3 -3
  99. package/dist/{chunk-C2FBUQJW.js → chunk-X3II54HU.js} +1 -1
  100. package/dist/chunk-Y4NIZQNT.js +8 -0
  101. package/dist/{chunk-2TPUNCT7.js → chunk-YO52QEKT.js} +8 -8
  102. package/dist/chunk-YYUICWSB.js +12 -0
  103. package/dist/{chunk-U5PXB4UW.js → chunk-ZOGEAYWJ.js} +5 -5
  104. package/dist/{client-DLm3Fvbc.d.ts → client-DZeDEyG1.d.ts} +30 -9
  105. package/dist/data/DataTable.js +1 -1
  106. package/dist/data/ListLoadError.js +1 -1
  107. package/dist/forms/AlignmentGrid.js +1 -1
  108. package/dist/forms/BorderInput.js +1 -1
  109. package/dist/forms/BrandAssetEditor.js +1 -1
  110. package/dist/forms/Button.js +1 -1
  111. package/dist/forms/ColorPicker.js +1 -1
  112. package/dist/forms/ComposerAttachments.js +1 -1
  113. package/dist/forms/CornersInput.js +1 -1
  114. package/dist/forms/DatePicker.js +1 -1
  115. package/dist/forms/DateRangePicker.js +1 -1
  116. package/dist/forms/DisplayChips.js +1 -1
  117. package/dist/forms/FilePicker.js +1 -1
  118. package/dist/forms/IconButton.js +1 -1
  119. package/dist/forms/IconPicker.js +1 -1
  120. package/dist/forms/InputNumber.js +1 -1
  121. package/dist/forms/LinkPicker.js +1 -1
  122. package/dist/forms/MediaUploadField.js +1 -1
  123. package/dist/forms/MediaUploadGrid.js +1 -1
  124. package/dist/forms/NumericKeypad.js +1 -1
  125. package/dist/forms/PictureTiles.js +1 -1
  126. package/dist/forms/PositionInput.js +1 -1
  127. package/dist/forms/Segmented.js +1 -1
  128. package/dist/forms/Select.js +1 -1
  129. package/dist/forms/SidesInput.js +1 -1
  130. package/dist/forms/Slider.js +1 -1
  131. package/dist/forms/Snippet.js +1 -1
  132. package/dist/forms/SplitButton.js +1 -1
  133. package/dist/forms/TagInput.js +1 -1
  134. package/dist/forms/TextToolbar.js +1 -1
  135. package/dist/forms/WidthsBar.js +1 -1
  136. package/dist/forms/dropdownPosition.js +1 -1
  137. package/dist/index.d.ts +2 -1
  138. package/dist/index.js +87 -87
  139. package/dist/map/index.js +6 -6
  140. package/dist/shell/AppUpdateBanner.js +1 -1
  141. package/dist/shell/ColoredBadge.js +1 -1
  142. package/dist/shell/ContextMenu.js +1 -1
  143. package/dist/shell/DropdownMenu.js +1 -1
  144. package/dist/shell/EditableGrid.js +1 -1
  145. package/dist/shell/FloatingBar.js +1 -1
  146. package/dist/shell/IconRail.js +1 -1
  147. package/dist/shell/LanguageSelect.js +1 -1
  148. package/dist/shell/MilestoneTimeline.js +1 -1
  149. package/dist/shell/Popover.js +1 -1
  150. package/dist/shell/ProductionTimeline.js +1 -1
  151. package/dist/shell/ResizeHandle.js +1 -1
  152. package/dist/shell/SearchableSelect.js +1 -1
  153. package/dist/shell/SettingReset.js +1 -1
  154. package/dist/shell/SidebarLayout.js +1 -1
  155. package/dist/shell/SortableList.js +1 -1
  156. package/dist/shell/StatusBadge.js +1 -1
  157. package/dist/shell/Tabs.js +1 -1
  158. package/dist/shell/TimelineTrack.js +1 -1
  159. package/dist/shell/Tooltip.js +1 -1
  160. package/dist/shell/TopNav.js +1 -1
  161. package/dist/shell/TransferProgress.js +1 -1
  162. package/dist/shell/Tree.js +1 -1
  163. package/dist/telemetry/index.d.ts +2 -1
  164. package/dist/telemetry/index.js +1 -1
  165. package/dist/templates/AuthScreen.js +1 -1
  166. package/dist/templates/ChatTemplate.js +1 -1
  167. package/dist/templates/CheckoutTemplate.js +1 -1
  168. package/dist/templates/DashboardTemplate.js +1 -1
  169. package/dist/templates/DataTablePage.js +1 -1
  170. package/dist/templates/EmailTemplate.js +1 -1
  171. package/dist/templates/ErrorBoundary.js +1 -1
  172. package/dist/templates/FormLayoutPage.js +1 -1
  173. package/dist/templates/GalleryTemplate.js +1 -1
  174. package/dist/ui/index.js +1 -1
  175. package/dist/version.js +1 -1
  176. package/package.json +1 -1
  177. package/dist/Calculator-KKB7EFVO.js +0 -29
  178. package/dist/chunk-3WV3CMSU.js +0 -1
  179. package/dist/chunk-7NEIYFM2.js +0 -8
  180. package/dist/chunk-DXQCNU5I.js +0 -12
  181. package/dist/chunk-EKHT4PDR.js +0 -4
  182. package/dist/chunk-FND3BDOO.js +0 -4
  183. package/dist/chunk-JHDWTYZ4.js +0 -1
  184. package/dist/chunk-JXOBORLD.js +0 -3
  185. package/dist/chunk-L3VD25XR.js +0 -8
  186. package/dist/chunk-OJ3RN3BG.js +0 -20
  187. package/dist/chunk-T53TXXOC.js +0 -1
  188. package/dist/chunk-Z3WKHMVB.js +0 -6
  189. package/dist/chunk-Z5UVBCEE.js +0 -9
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-3WV3CMSU.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=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,_),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)=>{Z(()=>{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())}))})},x=class{p;l;h(e){this.p?.(e)}},U=[2500,4e3],j=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var N=/^[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,W=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,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=t.getAccessToken();i&&n(t.endpoint??"/api/client-telemetry/web-batches/",{method:"POST",keepalive:!0,credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(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 d=n.fetch??window.fetch.bind(window),l=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),u=ne(n.routeKey()),f=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 v=!1;const m=()=>{for(const e of l.drain())oe(e,n,d)},C=e=>{v||(l.addError(e),l.size>=50&&m())},L=(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(W,"[url]").replace(V,"[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},k=e=>{v||(l.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,u,()=>ne(n.routeKey()),f)),l.size>=50&&m())},S=n.vitalsSampleRate??1;S>0&&(S>=1||(n.random??Math.random)()<S)&&(((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,x),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,U,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,U,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{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,U,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(k),R(k),((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))}))})(k),P(k),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,j,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,j,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,j,t.reportAllChanges),d(!0))})},t)}})})(k));const z=e=>{const{error:t,message:n,filename:i,lineno:a,colno:r}=e;if(null!=t)return void C(L(t,"onerror"));const o=i?ee(`at ${i}:${a??0}:${r??0}`):[];C({...L(n??"","onerror"),frames:o})},M=e=>C(L(e.reason,"unhandledrejection")),$=()=>{"hidden"===document.visibilityState&&m()};window.addEventListener("error",z),window.addEventListener("unhandledrejection",M),document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",m);const _=window.setInterval(m,n.flushIntervalMs??6e4),F=e(e=>C(L(e,"boundary"))),N={flush:m,reportError:e=>C(L(e,"boundary")),stop(){v||(m(),v=!0,window.removeEventListener("error",z),window.removeEventListener("unhandledrejection",M),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",m),window.clearInterval(_),F(),ae===N&&(ae=null))}};return ae=N,N}export{se as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-GLCKZI3N.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],N=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(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}},K=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,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,N,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,N,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,N,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(K,"[redacted]").replace(J,"[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{IconButton_default as e}from"./chunk-JHDWTYZ4.js";import{Icon as l}from"./chunk-VJPJNCB4.js";import{Tooltip as a}from"./chunk-Z3WKHMVB.js";import{useShellStrings as r}from"./chunk-OVNRVFWS.js";import{jsx as n,jsxs as o,Fragment as s}from"react/jsx-runtime";var i=e=>e.preventDefault(),t=e=>null!=e&&!1!==e,d=["bold","italic","underline","strike","link","sup","sub","code"],c=["left","center","right","justify"];function u(e,l,a){const r={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===r||0===l.length)return;const n=[...e.currentTarget.querySelectorAll('[role="radio"]')],o=n.findIndex(l=>l===e.target||l.contains(e.target));if(o<0)return;e.preventDefault();const s=n.length,i="first"===r?0:"last"===r?s-1:(o+r+s)%s;n[i].disabled||(a(l[i]),n[i].focus())}function h(e,l){const a=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:a,link:a+(l?1:0)}}function p({offered:e,color:l,last:a,alignment:r,list:n,letterCase:o}){const s=d.filter(l=>e.has(l)).length+(l?1:0)+(t(a)?1:0),i=(r?c.filter(e=>r.allow.includes(e)).length:0)+(n&&e.has("bullet")?1:0)+(n&&e.has("number")?1:0)+(e.has("quote")?1:0)+(o?3:0);return{words:s>0,paragraph:i>0,oneRow:s>0&&i>0&&s+1+i<=9,flow:s>0&&i>0&&s+1+i>9&&s<=7,cells:{words:s,paragraph:i}}}function b(e,l){/* @__PURE__ */
2
- return n(a,{content:e,children:l},l.key??void 0)}function m({offered:a,pressed:d,onMark:m,color:g,linkOpen:w=!1,last:f,alignment:k,list:v,letterCase:N,disabled:C=!1,"aria-label":y,windows:D,className:M="",layout:x="grid"}){const j=r().textToolbar,B=p({offered:a,color:g,last:f,alignment:k,list:v,letterCase:N});if(!B.words&&!B.paragraph)return null;const R=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,q=(l,r,o,s)=>a.has(l)?b(r,/* @__PURE__ */n(e,"link"===l?{pressed:w,className:R(w),"aria-label":r,"aria-haspopup":"dialog","aria-expanded":w,"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o}:{className:R(Boolean(d[l])),"aria-label":r,"aria-pressed":Boolean(d[l]),"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o},l)):null,A=[["left",j.alignLeft,/* @__PURE__ */n(l,{name:"align-left"})],["center",j.alignCenter,/* @__PURE__ */n(l,{name:"align-center"})],["right",j.alignRight,/* @__PURE__ */n(l,{name:"align-right"})],["justify",j.alignJustify,/* @__PURE__ */n(l,{name:"align-justify"})]],L=k?c.filter(e=>k.allow.includes(e)):[],S=k&&L.includes(k.value)?k.value:L[0],$=[["none",j.caseNone,/* @__PURE__ */n(l,{name:"case-normal"})],["upper",j.caseUpper,/* @__PURE__ */n(l,{name:"case-upper"})],["lower",j.caseLower,/* @__PURE__ */n(l,{name:"case-lower"})]],I=/* @__PURE__ */o(s,{children:[q("bold",j.bold,/* @__PURE__ */n(l,{name:"bold"}),"Meta+B"),q("italic",j.italic,/* @__PURE__ */n(l,{name:"italic"}),"Meta+I"),q("underline",j.underline,/* @__PURE__ */n(l,{name:"underline"}),"Meta+U"),q("strike",j.strike,/* @__PURE__ */n(l,{name:"strike"})),g?b(j.color,/* @__PURE__ */n(e,{pressed:g.open,className:R(g.open,"rosh-tb-color"),"aria-label":j.color,"aria-haspopup":"dialog","aria-expanded":g.open,disabled:C,style:g.run?{"--rosh-tb-run":g.run}:void 0,onMouseDown:i,onClick:g.onToggle,children:/* @__PURE__ */n(l,{name:"text-color"})},"color")):null,q("link",j.link,/* @__PURE__ */n(l,{name:"link"}),"Meta+K"),q("sup",j.sup,/* @__PURE__ */n(l,{name:"superscript"})),q("sub",j.sub,/* @__PURE__ */n(l,{name:"subscript"})),q("code",j.code,/* @__PURE__ */n(l,{name:"code"})),t(f)?f:null]}),J=/* @__PURE__ */o(s,{children:[k&&L.length>0?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.alignment,onKeyDown:e=>u(e,L,e=>k.onChange(e)),children:A.map(([l,a,r])=>k.allow.includes(l)?b(a,/* @__PURE__ */n(e,{role:"radio",pressed:k.value===l,className:R(k.value===l),"aria-checked":k.value===l,"aria-label":a,tabIndex:l===S?0:-1,disabled:C||k.disabled,onMouseDown:i,onClick:()=>k.onChange(l),children:r},l)):null)}):null,v&&a.has("bullet")?b(j.bullet,/* @__PURE__ */n(e,{className:R("bullet"===v.pressed),"aria-label":j.bullet,"aria-pressed":"bullet"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("bullet"),children:/* @__PURE__ */n(l,{name:"list"})},"bullet")):null,v&&a.has("number")?b(j.number,/* @__PURE__ */n(e,{className:R("number"===v.pressed),"aria-label":j.number,"aria-pressed":"number"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("number"),children:/* @__PURE__ */n(l,{name:"numbered-list"})},"number")):null,q("quote",j.quote,/* @__PURE__ */n(l,{name:"quote"})),N?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.letterCase,onKeyDown:e=>u(e,$.map(([e])=>e),e=>N.onChange(e)),children:$.map(([l,a,r])=>b(a,/* @__PURE__ */n(e,{role:"radio",pressed:N.value===l,className:R(N.value===l),"aria-checked":N.value===l,"aria-label":a,tabIndex:l===(N.value||"none")?0:-1,disabled:C||N.disabled,onMouseDown:i,onClick:()=>N.onChange(N.value===l?"":l),children:r},l)))}):null]}),K="row"===x,T=K?" is-row":B.flow?" is-flow":B.oneRow?" is-one-row":B.words&&void 0===f?" is-eight":"",V=h(a,Boolean(g)),H={"--rosh-tb-color-col":String(V.color),"--rosh-tb-link-col":String(V.link),...K?{"--rosh-tb-cells":String(B.cells.words+B.cells.paragraph),"--rosh-tb-groupgap":B.words&&B.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let U;return U=K?/* @__PURE__ */o("div",{className:"rosh-tb-row is-row",children:[B.words?/* @__PURE__ */n("div",{className:"rosh-tb-words",children:I}):null,B.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-para",children:J}):null]}):B.flow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-flow",children:[I,
3
- /* @__PURE__ */n("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),J]}):B.oneRow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-one-row",children:[
1
+ import{IconButton_default as e}from"./chunk-HMZLRXLA.js";import{Icon as l}from"./chunk-VJPJNCB4.js";import{Tooltip as a}from"./chunk-2LXTJXWC.js";import{useShellStrings as r}from"./chunk-OVNRVFWS.js";import{jsx as n,jsxs as o,Fragment as s}from"react/jsx-runtime";var i=e=>e.preventDefault(),t=e=>null!=e&&!1!==e,d=["bold","italic","underline","strike","link","sup","sub","code"],c=["left","center","right","justify"];function u(e,l,a){const r={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===r||0===l.length)return;const n=[...e.currentTarget.querySelectorAll('[role="radio"]')],o=n.findIndex(l=>l===e.target||l.contains(e.target));if(o<0)return;e.preventDefault();const s=n.length,i="first"===r?0:"last"===r?s-1:(o+r+s)%s;n[i].disabled||(a(l[i]),n[i].focus())}function h(e,l){const a=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:a,link:a+(l?1:0)}}function p({offered:e,color:l,last:a,alignment:r,list:n,letterCase:o}){const s=d.filter(l=>e.has(l)).length+(l?1:0)+(t(a)?1:0),i=(r?c.filter(e=>r.allow.includes(e)).length:0)+(n&&e.has("bullet")?1:0)+(n&&e.has("number")?1:0)+(e.has("quote")?1:0)+(o?3:0);return{words:s>0,paragraph:i>0,oneRow:s>0&&i>0&&s+1+i<=9,flow:s>0&&i>0&&s+1+i>9&&s<=7,cells:{words:s,paragraph:i}}}function b(e,l){/* @__PURE__ */
2
+ return n(a,{content:e,children:l},l.key??void 0)}function m({offered:a,pressed:d,onMark:m,color:g,linkOpen:w=!1,last:f,alignment:k,list:v,letterCase:N,disabled:C=!1,"aria-label":y,windows:M,className:D="",layout:x="grid"}){const j=r().textToolbar,L=p({offered:a,color:g,last:f,alignment:k,list:v,letterCase:N});if(!L.words&&!L.paragraph)return null;const R=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,A=(l,r,o,s)=>a.has(l)?b(r,/* @__PURE__ */n(e,"link"===l?{pressed:w,className:R(w),"aria-label":r,"aria-haspopup":"dialog","aria-expanded":w,"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o}:{className:R(Boolean(d[l])),"aria-label":r,"aria-pressed":Boolean(d[l]),"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o},l)):null,q=[["left",j.alignLeft,/* @__PURE__ */n(l,{name:"align-left"})],["center",j.alignCenter,/* @__PURE__ */n(l,{name:"align-center"})],["right",j.alignRight,/* @__PURE__ */n(l,{name:"align-right"})],["justify",j.alignJustify,/* @__PURE__ */n(l,{name:"align-justify"})]],B=k?c.filter(e=>k.allow.includes(e)):[],S=k&&B.includes(k.value)?k.value:B[0],$=[["none",j.caseNone,/* @__PURE__ */n(l,{name:"case-normal"})],["upper",j.caseUpper,/* @__PURE__ */n(l,{name:"case-upper"})],["lower",j.caseLower,/* @__PURE__ */n(l,{name:"case-lower"})]],I=/* @__PURE__ */o(s,{children:[A("bold",j.bold,/* @__PURE__ */n(l,{name:"bold"}),"Meta+B"),A("italic",j.italic,/* @__PURE__ */n(l,{name:"italic"}),"Meta+I"),A("underline",j.underline,/* @__PURE__ */n(l,{name:"underline"}),"Meta+U"),A("strike",j.strike,/* @__PURE__ */n(l,{name:"strike"})),g?b(j.color,/* @__PURE__ */n(e,{pressed:g.open,className:R(g.open,"rosh-tb-color"),"aria-label":j.color,"aria-haspopup":"dialog","aria-expanded":g.open,disabled:C,style:g.run?{"--rosh-tb-run":g.run}:void 0,onMouseDown:i,onClick:g.onToggle,children:/* @__PURE__ */n(l,{name:"text-color"})},"color")):null,A("link",j.link,/* @__PURE__ */n(l,{name:"link"}),"Meta+K"),A("sup",j.sup,/* @__PURE__ */n(l,{name:"superscript"})),A("sub",j.sub,/* @__PURE__ */n(l,{name:"subscript"})),A("code",j.code,/* @__PURE__ */n(l,{name:"code"})),t(f)?f:null]}),J=/* @__PURE__ */o(s,{children:[k&&B.length>0?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.alignment,onKeyDown:e=>u(e,B,e=>k.onChange(e)),children:q.map(([l,a,r])=>k.allow.includes(l)?b(a,/* @__PURE__ */n(e,{role:"radio",pressed:k.value===l,className:R(k.value===l),"aria-checked":k.value===l,"aria-label":a,tabIndex:l===S?0:-1,disabled:C||k.disabled,onMouseDown:i,onClick:()=>k.onChange(l),children:r},l)):null)}):null,v&&a.has("bullet")?b(j.bullet,/* @__PURE__ */n(e,{className:R("bullet"===v.pressed),"aria-label":j.bullet,"aria-pressed":"bullet"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("bullet"),children:/* @__PURE__ */n(l,{name:"list"})},"bullet")):null,v&&a.has("number")?b(j.number,/* @__PURE__ */n(e,{className:R("number"===v.pressed),"aria-label":j.number,"aria-pressed":"number"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("number"),children:/* @__PURE__ */n(l,{name:"numbered-list"})},"number")):null,A("quote",j.quote,/* @__PURE__ */n(l,{name:"quote"})),N?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.letterCase,onKeyDown:e=>u(e,$.map(([e])=>e),e=>N.onChange(e)),children:$.map(([l,a,r])=>b(a,/* @__PURE__ */n(e,{role:"radio",pressed:N.value===l,className:R(N.value===l),"aria-checked":N.value===l,"aria-label":a,tabIndex:l===(N.value||"none")?0:-1,disabled:C||N.disabled,onMouseDown:i,onClick:()=>N.onChange(N.value===l?"":l),children:r},l)))}):null]}),T="row"===x,K=T?" is-row":L.flow?" is-flow":L.oneRow?" is-one-row":L.words&&void 0===f?" is-eight":"",U=h(a,Boolean(g)),V={"--rosh-tb-color-col":String(U.color),"--rosh-tb-link-col":String(U.link),...T?{"--rosh-tb-cells":String(L.cells.words+L.cells.paragraph),"--rosh-tb-groupgap":L.words&&L.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let X;return X=T?/* @__PURE__ */o("div",{className:"rosh-tb-row is-row",children:[L.words?/* @__PURE__ */n("div",{className:"rosh-tb-words",children:I}):null,L.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-para",children:J}):null]}):L.flow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-flow",children:[I,
3
+ /* @__PURE__ */n("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),J]}):L.oneRow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-one-row",children:[
4
4
  /* @__PURE__ */n("div",{className:"rosh-tb-words",children:I}),
5
- /* @__PURE__ */n("div",{className:"rosh-tb-para",children:J})]}):/* @__PURE__ */o(s,{children:[B.words?/* @__PURE__ */n("div",{className:"rosh-tb-row"+(void 0===f?" is-eight":""),children:I}):null,B.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-row",children:J}):null]}),/* @__PURE__ */o("div",{className:`rosh-tb-wrap${T} ${M}`.trim(),style:H,children:[
6
- /* @__PURE__ */n("div",{className:"rosh-tb",role:"toolbar","aria-label":y??j.formatting,children:U}),D]})}export{m as TextToolbar,p as textToolbarRows,h as textToolbarWindowColumns};
5
+ /* @__PURE__ */n("div",{className:"rosh-tb-para",children:J})]}):/* @__PURE__ */o(s,{children:[L.words?/* @__PURE__ */n("div",{className:"rosh-tb-row"+(void 0===f?" is-eight":""),children:I}):null,L.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-row",children:J}):null]}),/* @__PURE__ */o("div",{className:`rosh-tb-wrap${K} ${D}`.trim(),style:V,children:[
6
+ /* @__PURE__ */n("div",{className:"rosh-tb",role:"toolbar","aria-label":y??j.formatting,children:X}),M]})}export{m as TextToolbar,p as textToolbarRows,h as textToolbarWindowColumns};
@@ -1,23 +1,23 @@
1
- import{Calendar as e,fromKey as t}from"./chunk-SNDYD76W.js";import{calendarNames as r}from"./chunk-5OTS2G3M.js";import{FILTER_ON as n,FILTER_ON_INK as a,FILTER_OFF as o}from"./chunk-JFSYWEHD.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-T53TXXOC.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-OVNRVFWS.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${D(e.getMonth()+1)}`,D=e=>String(e).padStart(2,"0");function W(e){return`${e.getFullYear()}-${D(e.getMonth()+1)}-${D(e.getDate())}`}function $(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:W(new Date(r,n,t.getDate()-14)),to:W(a)};case"lastMonth":return{from:W(l(1)),to:W(o)};case"last3Months":return{from:W(l(3)),to:W(o)};case"last6Months":return{from:W(l(6)),to:W(o)};case"last12Months":return{from:W(l(12)),to:W(o)}}}function M(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function O({from:D,to:W,onChange:O,formatDisplay:T,clearable:R,required:J=!1,name:Y,id:H,"aria-labelledby":E,"aria-label":B,weekStartsOn:L,placeholder:V,fullWidth:q=!1,min:G,max:I,disabled:U=!1,allowOpenEnd:X=!1}){const A=p().dateRange,P=h(),z=T??(P?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(P):S),K=V??A.placeholder,Z=R??!J,[Q,_]=f(!1),[ee,te]=f(D),[re,ne]=f(W),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Q,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Q||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Q||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!H&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!B||!!E||Ne,De=/* @__PURE__ */new Date,[We,$e]=f(()=>D?C(j(D)):M(De,G,I)),Me=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))($(e,De),G,I)),je=e=>e?z(e):"";x(()=>{if(!Q)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Q]),x(()=>{U&&_(!1)},[U]);const Se=()=>{O("",""),_(!1)},Fe=D&&W?`${je(D)} — ${je(W)}`:D?A.fromOnly(je(D)):W?A.toOnly(je(W)):"",Oe=r(P),Te=e=>{const r=t(e);return r?Oe.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Re=D&&W?A.range(Te(D),Te(W)):D?A.fromOnly(Te(D)):W?A.toOnly(Te(W)):K,Je=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Ye=/* @__PURE__ */v(w,{children:[Me.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=$(e,De);te(t.from),ne(t.to),oe(e),$e(t.from.slice(0,7))})(e),className:Je(e),"aria-label":he?A[e]:void 0,children:he?ye?A[e]:A[`${e}Short`]:A[e]},e)),
2
- /* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Je("Custom"),children:A.custom})]}),He=(e,t)=>X?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ee=e=>X&&le===e?" ring-1 ring-blue-400":"",Be=
3
- /* @__PURE__ */N(e,{mode:"range",min:G,max:I,value:ee||null,endValue:re||null,month:We,onMonthChange:$e,onSelect:e=>{oe("Custom"),X?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:L,"aria-label":A.dialog});/* @__PURE__ */
4
- return v("div",{className:"relative"+(q?" w-full":""),ref:se,children:[
5
- /* @__PURE__ */v("div",{className:`${q?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${D||W?`${n} ${a}`:o}${U?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{U||(te(D),ne(W),oe(null),ie(D&&!W?"to":"from"),$e(D?C(j(D)):M(De,G,I)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Q,id:H,disabled:U||void 0,"aria-label":B,"aria-labelledby":E,"aria-describedby":[Ce?ue:void 0,J?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Q?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(q?" min-w-0 flex-1 justify-start":""),children:[
1
+ import{Calendar as e,fromKey as t}from"./chunk-SNDYD76W.js";import{calendarNames as r}from"./chunk-5OTS2G3M.js";import{FILTER_ON as n,FILTER_ON_INK as a,FILTER_OFF as o}from"./chunk-JFSYWEHD.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-OVNRVFWS.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${D(e.getMonth()+1)}`,D=e=>String(e).padStart(2,"0");function W(e){return`${e.getFullYear()}-${D(e.getMonth()+1)}-${D(e.getDate())}`}function $(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:W(new Date(r,n,t.getDate()-14)),to:W(a)};case"lastMonth":return{from:W(l(1)),to:W(o)};case"last3Months":return{from:W(l(3)),to:W(o)};case"last6Months":return{from:W(l(6)),to:W(o)};case"last12Months":return{from:W(l(12)),to:W(o)}}}function M(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function O({from:D,to:W,onChange:O,formatDisplay:J,clearable:R,required:T=!1,name:Y,id:H,"aria-labelledby":B,"aria-label":E,weekStartsOn:L,placeholder:G,fullWidth:U=!1,min:V,max:q,disabled:I=!1,allowOpenEnd:A=!1}){const P=p().dateRange,z=h(),K=J??(z?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(z):S),X=G??P.placeholder,Z=R??!T,[Q,_]=f(!1),[ee,te]=f(D),[re,ne]=f(W),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Q,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Q||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Q||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!H&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!E||!!B||Ne,De=/* @__PURE__ */new Date,[We,$e]=f(()=>D?C(j(D)):M(De,V,q)),Me=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))($(e,De),V,q)),je=e=>e?K(e):"";x(()=>{if(!Q)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Q]),x(()=>{I&&_(!1)},[I]);const Se=()=>{O("",""),_(!1)},Fe=D&&W?`${je(D)} — ${je(W)}`:D?P.fromOnly(je(D)):W?P.toOnly(je(W)):"",Oe=r(z),Je=e=>{const r=t(e);return r?Oe.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Re=D&&W?P.range(Je(D),Je(W)):D?P.fromOnly(Je(D)):W?P.toOnly(Je(W)):X,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Ye=/* @__PURE__ */v(w,{children:[Me.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=$(e,De);te(t.from),ne(t.to),oe(e),$e(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?P[e]:void 0,children:he?ye?P[e]:P[`${e}Short`]:P[e]},e)),
2
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:P.custom})]}),He=(e,t)=>A?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Be=e=>A&&le===e?" ring-1 ring-blue-400":"",Ee=
3
+ /* @__PURE__ */N(e,{mode:"range",min:V,max:q,value:ee||null,endValue:re||null,month:We,onMonthChange:$e,onSelect:e=>{oe("Custom"),A?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:L,"aria-label":P.dialog});/* @__PURE__ */
4
+ return v("div",{className:"relative"+(U?" w-full":""),ref:se,children:[
5
+ /* @__PURE__ */v("div",{className:`${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${D||W?`${n} ${a}`:o}${I?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{I||(te(D),ne(W),oe(null),ie(D&&!W?"to":"from"),$e(D?C(j(D)):M(De,V,q)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Q,id:H,disabled:I||void 0,"aria-label":E,"aria-labelledby":B,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Q?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
7
7
  /* @__PURE__ */N(i,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */N("span",{className:"truncate",children:Fe||K})]}),Z&&!U&&(D||W)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":A.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Re}),J&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:A.required}),Y&&/* @__PURE__ */v(w,{children:[
9
- /* @__PURE__ */N("input",{type:"hidden",name:Y.from,value:D,disabled:U||void 0}),
10
- /* @__PURE__ */N("input",{type:"hidden",name:Y.to,value:W,disabled:U||void 0})]}),Q&&y(
11
- /* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":A.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
8
+ /* @__PURE__ */N("span",{className:"truncate",children:Fe||X})]}),Z&&!I&&(D||W)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":P.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Re}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:P.required}),Y&&/* @__PURE__ */v(w,{children:[
9
+ /* @__PURE__ */N("input",{type:"hidden",name:Y.from,value:D,disabled:I||void 0}),
10
+ /* @__PURE__ */N("input",{type:"hidden",name:Y.to,value:W,disabled:I||void 0})]}),Q&&y(
11
+ /* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":P.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
12
12
  /* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[He("from",/* @__PURE__ */v(w,{children:[
13
- /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:A.from}),
14
- /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Ee("from")}`,children:ee?je(ee):A.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),He("to",/* @__PURE__ */v(w,{children:[
15
- /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:A.to}),
16
- /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Ee("to")}`,children:re?je(re):A.end})]}))]}),he?/* @__PURE__ */v(w,{children:[Me.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:A.lastHeading}),
17
- /* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ye,Me.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:A[e]},e))]})]}),
18
- /* @__PURE__ */N("div",{className:"w-full",children:Be})]}):
13
+ /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:P.from}),
14
+ /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Be("from")}`,children:ee?je(ee):P.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),He("to",/* @__PURE__ */v(w,{children:[
15
+ /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:P.to}),
16
+ /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Be("to")}`,children:re?je(re):P.end})]}))]}),he?/* @__PURE__ */v(w,{children:[Me.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:P.lastHeading}),
17
+ /* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ye,Me.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:P[e]},e))]})]}),
18
+ /* @__PURE__ */N("div",{className:"w-full",children:Ee})]}):
19
19
  /* @__PURE__ */v("div",{ref:be,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */N("div",{className:"w-64",children:Be}),Me.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ye})]}),
21
- /* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[Z&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:l({variant:"ghost"}),children:A.clear}),
22
- /* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:A.cancel}),
23
- /* @__PURE__ */N("button",{type:"button",onClick:()=>{O(ee,re),_(!1)},disabled:X?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:A.apply})]})]}),document.body)]})}export{O as DateRangePicker,$ as presetRange,W as toISODate};
20
+ /* @__PURE__ */N("div",{className:"w-64",children:Ee}),Me.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ye})]}),
21
+ /* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[Z&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:l({variant:"ghost"}),children:P.clear}),
22
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:P.cancel}),
23
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>{O(ee,re),_(!1)},disabled:A?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:P.apply})]})]}),document.body)]})}export{O as DateRangePicker,$ as presetRange,W as toISODate};
@@ -1,3 +1,3 @@
1
- import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-FSP63GKK.js";import{useShellStrings as n}from"./chunk-OVNRVFWS.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
1
+ import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-UDD7GB4F.js";import{useShellStrings as n}from"./chunk-OVNRVFWS.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
2
2
  return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
3
3
  /* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
@@ -1,4 +1,4 @@
1
- import{TransferProgress as e}from"./chunk-EZQXLIG3.js";import{Icon as r}from"./chunk-VJPJNCB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-OVNRVFWS.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function u(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function c(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
1
+ import{TransferProgress as e}from"./chunk-FARRGETL.js";import{Icon as r}from"./chunk-VJPJNCB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-OVNRVFWS.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function u(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function c(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
2
2
  return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
3
3
  return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
4
4
  return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
@@ -1,15 +1,15 @@
1
- import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-4CXQX5AX.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-VJPJNCB4.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-OVNRVFWS.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,P=S.length?Math.max(...S):x,D=a(r??null)??C,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[R,P,q,D+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-D)/i)),I=a(p??null)??P??D,j=Math.min(Math.max(y??I,D),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(D).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),J=L??F,V=L?a(L.date):F?D:null,X=$?a($.date):null,z=!!(J&&$&&null!=V&&null!=X&&j>V&&j<X);let B,E;if(z&&null!=V&&null!=X){const e=(j-V)/Math.max(X-V,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of J?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(J?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):J?.est_completion_date||$?.est_completion_date||null,B={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},E=J}else if(B=J??t[t.length-1]??null,B){const e=t.findIndex(e=>e.id===B.id);E=e>=0&&e<t.length-1?t[e+1]:null}else E=null;const G={};for(const e of E?.items??[])G[e.part_number]=e;const H=!(!d||B?.id===d),K=d?Math.min(a(p??null)??A,A):A,Q=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:D,endMs:A,totalLeadDays:T,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:J,nextAfter:$,displayed:B,prevReport:E,prevByPN:G,isInterpolated:z,playing:v,startPlay:()=>{if(v)return void N();if(K<=D)return void f(K);M(!0),f(D);let e=performance.now(),t=D;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:Q,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),P=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
- return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:P,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:P,markers:D,poNumber:R,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:J,estCompletionMs:V}=n,X=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(P.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),z=c().production,B=d(),E=_??z.heading,G=e=>o(e,B);if(0===P.length&&0===D.length)return null;const H=D.filter(e=>"shipment"===e.kind),K=D.filter(e=>"inspection"===e.kind),Q=D.filter(e=>"invoice"===e.kind),U=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),W=j?v(j):0,Y=P.find(e=>e.id===F),Z=Y?N(Y):J,ee=
3
- /* @__PURE__ */h("button",{type:"button",onClick:X.toggle,"aria-pressed":X.playing,title:X.playing?z.pause:z.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[X.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
- /* @__PURE__ */b("span",{children:X.playing?z.pause:z.play})]}),te=L&&(S??Z)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{X.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??z.backTo(String(Z))}):null,[re,ne]=p(z.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
1
+ import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-IH2DJOTW.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-VJPJNCB4.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-OVNRVFWS.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),D=S.length?Math.min(...S):x,P=S.length?Math.max(...S):x,C=a(r??null)??D,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),T=(()=>{const e=[R,P,q,C+i];return O||e.push(x),Math.max(...e)})(),A=Math.max(1,Math.round((T-C)/i)),I=a(p??null)??P??C,j=Math.min(Math.max(y??I,C),T),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(C).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),J=L??F,V=L?a(L.date):F?C:null,z=$?a($.date):null,B=!!(J&&$&&null!=V&&null!=z&&j>V&&j<z);let E,H;if(B&&null!=V&&null!=z){const e=(j-V)/Math.max(z-V,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of J?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(J?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):J?.est_completion_date||$?.est_completion_date||null,E={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},H=J}else if(E=J??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);H=e>=0&&e<t.length-1?t[e+1]:null}else H=null;const W={};for(const e of H?.items??[])W[e.part_number]=e;const G=!(!d||E?.id===d),K=d?Math.min(a(p??null)??T,T):T,U=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:C,endMs:T,totalLeadDays:A,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:G,beforeAnchor:J,nextAfter:$,displayed:E,prevReport:H,prevByPN:W,isInterpolated:B,playing:v,startPlay:()=>{if(v)return void N();if(K<=C)return void f(K);M(!0),f(C);let e=performance.now(),t=C;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:U,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),D=N.map(({ms:e})=>e),P=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
+ return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:P,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:D,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:D}){const{reports:P,markers:C,poNumber:R,startMs:O,endMs:q,totalLeadDays:T,scrubMs:A,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:J,estCompletionMs:V}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(P.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,D),B=c().production,E=d(),H=_??B.heading,W=e=>o(e,E);if(0===P.length&&0===C.length)return null;const G=C.filter(e=>"shipment"===e.kind),K=C.filter(e=>"inspection"===e.kind),U=C.filter(e=>"invoice"===e.kind),X=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Y=j?v(j):0,Q=P.find(e=>e.id===F),Z=Q?N(Q):J,ee=
3
+ /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?B.pause:B.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
+ /* @__PURE__ */b("span",{children:z.playing?B.pause:B.play})]}),te=L&&(S??Z)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??B.backTo(String(Z))}):null,[re,ne]=p(B.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
5
5
  /* @__PURE__ */b("b",{className:"font-medium",children:N(j)}),e&&ne,
6
- /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",G(new Date(j.date).getTime())," · ",z.overall(Math.round(W))," · ",z.inStock(U)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:z.noReport})});if("rail"===x){const e=null!=V&&V>=q&&q>O,t=e?{key:"__estimate__",label:z.estimatedCompletion,dateText:G(V)}:null;/* @__PURE__ */
6
+ /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",W(new Date(j.date).getTime())," · ",B.overall(Math.round(Y))," · ",B.inStock(X)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:B.noReport})});if("rail"===x){const e=null!=V&&V>=q&&q>O,t=e?{key:"__estimate__",label:B.estimatedCompletion,dateText:W(V)}:null;/* @__PURE__ */
7
7
  return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
8
- /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:P,markers:D,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??z.start,end:M?.end??(e?z.estDone:void 0)},onDragStart:X.stop,playback:{playing:X.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:X.stop}}),
8
+ /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:P,markers:C,valueMs:A,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??B.start,end:M?.end??(e?B.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
9
9
  /* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
10
- return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:E,subject:R,meta:[`${G(O)} → ${G(q)}`,z.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
10
+ return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:H,subject:R,meta:[`${W(O)} → ${W(q)}`,B.leadTime(T)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
11
11
  /* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[P.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
12
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),z.report]}),H.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),z.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),z.inspection]}),Q.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),z.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:P,markers:D,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:X.stop,playback:{playing:X.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:X.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
12
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),B.report]}),G.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),B.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),B.inspection]}),U.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),B.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:P,markers:C,valueMs:A,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};