efficient-shell 13.16.0 → 13.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 (99) hide show
  1. package/README.md +1 -0
  2. package/dist/{Browser-4KWGT3FG.js → Browser-547OGMQH.js} +15 -15
  3. package/dist/Calculator-4UBMDAJO.js +29 -0
  4. package/dist/{CurrencyConverter-X5ENBDLK.js → CurrencyConverter-H3HHXXKT.js} +6 -6
  5. package/dist/{Files-NT76VUHQ.js → Files-GPPTZPDS.js} +68 -68
  6. package/dist/{Notepad-6AMNAYQQ.js → Notepad-GAZ7CZQB.js} +9 -9
  7. package/dist/PdfViewer-EELX35ZI.js +1 -0
  8. package/dist/{PomodoroTimer-KDXH5M3Q.js → PomodoroTimer-JVCYYGRD.js} +16 -16
  9. package/dist/{Preview-QNJD5PVD.js → Preview-GSD54EUE.js} +21 -21
  10. package/dist/{Stock-JR77FPOD.js → Stock-S266KGAF.js} +4 -4
  11. package/dist/{Weather-MGSDU3M5.js → Weather-TE4TTTQA.js} +19 -19
  12. package/dist/{WorldClock-GGAYPYIO.js → WorldClock-5TPBHBYA.js} +6 -6
  13. package/dist/ai/index.js +116 -116
  14. package/dist/apps/ImageAnnotator.js +1 -1
  15. package/dist/apps/index.js +1 -1
  16. package/dist/bin/browser-check.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/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/CartesianPlot.js +1 -1
  22. package/dist/charts/ColumnChart.js +1 -1
  23. package/dist/charts/FunnelChart.js +1 -1
  24. package/dist/charts/HeatmapChart.js +1 -1
  25. package/dist/charts/HistogramChart.js +1 -1
  26. package/dist/charts/PieChart.js +1 -1
  27. package/dist/charts/RadarChart.js +1 -1
  28. package/dist/charts/RadialBarChart.js +1 -1
  29. package/dist/charts/RangeChart.js +1 -1
  30. package/dist/charts/SankeyChart.js +1 -1
  31. package/dist/charts/ScatterChart.js +1 -1
  32. package/dist/charts/SpecChart.js +1 -1
  33. package/dist/charts/TimeSeriesChart.js +1 -1
  34. package/dist/charts/TreemapChart.js +1 -1
  35. package/dist/charts/WaterfallChart.js +1 -1
  36. package/dist/{chunk-QE2JX7D4.js → chunk-34HRPEQD.js} +1 -1
  37. package/dist/{chunk-OWAYSIQH.js → chunk-42DF7CDB.js} +5 -5
  38. package/dist/{chunk-IJJNJJ6I.js → chunk-5EHIWKUZ.js} +1 -1
  39. package/dist/{chunk-OEPQIIYL.js → chunk-63E4ZZYI.js} +1 -1
  40. package/dist/{chunk-CKTFXTJL.js → chunk-6OCA7RKQ.js} +1 -1
  41. package/dist/{chunk-VYHVIKP6.js → chunk-7SVSHJOO.js} +10 -10
  42. package/dist/{chunk-IJNQ2BUY.js → chunk-CILE3ZCC.js} +2 -2
  43. package/dist/{chunk-XHD6Q6JV.js → chunk-EFO72DEI.js} +1 -1
  44. package/dist/chunk-FRTDUHQF.js +1 -0
  45. package/dist/{chunk-YDFDTRZF.js → chunk-G7SILKUY.js} +5 -5
  46. package/dist/{chunk-J6QC45OS.js → chunk-HC5KQZFG.js} +5 -5
  47. package/dist/{chunk-OLSA36VX.js → chunk-KSK4VZIM.js} +6 -6
  48. package/dist/{chunk-N5KJLHYI.js → chunk-LADP6AJY.js} +5 -5
  49. package/dist/{chunk-W6NGPSMM.js → chunk-LGGATDPH.js} +17 -17
  50. package/dist/{chunk-PBSCF2ML.js → chunk-LNCAIY64.js} +5 -5
  51. package/dist/{chunk-IG3K6AGW.js → chunk-LUCO5PS6.js} +1 -1
  52. package/dist/chunk-M6UKCZHT.js +2 -0
  53. package/dist/{chunk-GNXAVDZD.js → chunk-OOGUQEPT.js} +1 -1
  54. package/dist/chunk-OUYGLDQN.js +24 -0
  55. package/dist/{chunk-NISLELJF.js → chunk-P4J26R5P.js} +1 -1
  56. package/dist/{chunk-NW5NSV7N.js → chunk-POQUUMRS.js} +2 -2
  57. package/dist/chunk-PTYB2GGI.js +1 -0
  58. package/dist/{chunk-7TJZ5AJE.js → chunk-QNXTVDIC.js} +6 -6
  59. package/dist/{chunk-PY4DTB6Y.js → chunk-QSJMLHBD.js} +1 -1
  60. package/dist/chunk-SM3N5UJ2.js +69 -0
  61. package/dist/{chunk-J4KPBR5B.js → chunk-TKCCJRPE.js} +1 -1
  62. package/dist/{chunk-YTDMCUL7.js → chunk-U5RG34NE.js} +10 -10
  63. package/dist/{chunk-23LK4PLJ.js → chunk-UGEA3C5C.js} +5 -5
  64. package/dist/chunk-VLX7L2AM.js +1 -0
  65. package/dist/{chunk-P5C7DI5A.js → chunk-WPGSU4QG.js} +5 -5
  66. package/dist/{chunk-75R3EKWZ.js → chunk-XD3M5ZXM.js} +3 -3
  67. package/dist/{chunk-WLBWACKP.js → chunk-XU4I2DMR.js} +2 -2
  68. package/dist/chunk-ZI2FDUYJ.js +99 -0
  69. package/dist/forms/MediaLibrary.js +1 -1
  70. package/dist/icons/brands.node.js +1 -1
  71. package/dist/icons/efficient-glyphs.js +1 -1
  72. package/dist/icons/efficient-looks.js +1 -1
  73. package/dist/icons/efficient.js +1 -1
  74. package/dist/icons/looks/map.js +1 -1
  75. package/dist/icons/payment.js +1 -1
  76. package/dist/icons/sets.js +1 -1
  77. package/dist/index.d.ts +1 -0
  78. package/dist/index.js +334 -334
  79. package/dist/pdf/index.js +1 -1
  80. package/dist/shell/FitFrame.d.ts +46 -0
  81. package/dist/shell/FitFrame.js +2 -0
  82. package/dist/shell/SidebarLayout.js +1 -1
  83. package/dist/telemetry/index.js +1 -1
  84. package/dist/templates/ChatTemplate.js +1 -1
  85. package/dist/templates/DashboardTemplate.js +1 -1
  86. package/dist/templates/EmailTemplate.js +1 -1
  87. package/dist/ui/index.d.ts +1 -0
  88. package/dist/ui/index.js +1 -1
  89. package/dist/version.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/Calculator-VURS4NAT.js +0 -29
  92. package/dist/PdfViewer-PFQGQRQX.js +0 -1
  93. package/dist/chunk-6QKTQOEV.js +0 -69
  94. package/dist/chunk-74SCWPQF.js +0 -1
  95. package/dist/chunk-JFOMAXD2.js +0 -99
  96. package/dist/chunk-OMOAD5LL.js +0 -1
  97. package/dist/chunk-QAAHFU2I.js +0 -1
  98. package/dist/chunk-YGKLZBWC.js +0 -24
  99. /package/dist/{chunk-VG6BT2UG.js → chunk-YRQ5WGOM.js} +0 -0
package/README.md CHANGED
@@ -5303,6 +5303,7 @@ itself where the kit has an answer:
5303
5303
  | `ellipsis-label` | a button, link or menu label that ends in `…` or `...`: the text of `button`, `a`, `option`, `Button`, `IconButton`, `SplitButton`, `Link`, `NavLink`, `PopupMenuItem`, `PopupMenuLabel`, `DropdownMenuItem`, `MenuItem`, `ContextMenuItem` (through any spans inside), a `label` or `aria-label`, and a `label:` in an object. Each branch of a `?:` is read, and so is the English phrase handed to `say()` or `t()` (a key such as `team:menu.remove` has no dots of its own); no other call's result is. A `…` with no word of its own in the same string is a truncation's and is not counted. Not counted yet, by name in `ELLIPSIS_EXEMPT` until the sweep that clears each: `busy` (a listed first word such as Saving, Loading, and the Chinese busy forms), `placeholder` (`placeholder`, `searchPlaceholder`, `emptyOptionLabel`, `blankLabel`) and `prompt` (an `<option value="">` or `{ value: '', label }`) | the label without the dots, saying what it does ("Extend trial"). `…` means only "the words are cut" (owner ruling 2026-10-14) |
5304
5304
  | `colour` | a literal colour, in a script string (`.ts` and `.tsx`) or a stylesheet declaration (`.css`, `.scss`, which this kind alone reads): a hex; an `rgb()` / `rgba()` / `hsl()` / `hsla()` / `hwb()` / `oklch()` / `oklab()` / `lab()` / `lch()` with a number in it; a Tailwind palette class (a colour utility with a hue and a step, or `white` / `black`, under any variant and alpha); a `--color-<hue>-<step>` variable; a named colour as the value of a colour property; and a palette class in `@apply`. A `var()` fallback counts (a fallback is a second palette). Not counted: a role or token, `transparent`, `currentColor`, `url(#…)`, a `#` in a link or id, a comment, a `mask` declaration (its black is alpha) | a colour role: its utility (`text-ink`, `bg-surface`, `border-line`, `bg-accent-fill` …) or `var(--role)`; `COLOUR_ROLES` lists them. A merchant site reads the site theme. A colour a frame needs because the shell's stylesheet cannot reach it is an `allow` entry with its reason (owner ruling 2026-10-23) |
5305
5305
  | `dialog-frame` | a `className` on a shell `Dialog`, `PopupForm` or `ConfirmDialog` (bare or namespaced) that redraws its frame (a string or a template literal): a zero padding on any side, named or `[0]` / `[0px]`; a width or height cap taken off or set (`none`, `screen`, `full`, any arbitrary value); a height of `full`, `screen` or a viewport unit (`dvh`, `svh` …); an arbitrary width or height in viewport units, a percentage or a `calc()`; a minimum height of the screen. Not counted: a class held in a variable (`className={cls}`), and a `style` prop | a `Dialog` size: `size="full"` for a chooser laid out like a window, with `headerActions` beside the cross |
5306
+ | `scaled-frame` | a drawing scaled from the top left by hand: a top-left transform origin (`top left`, `left top`, `0 0`, `0% 0%`, `0px 0px`) as a style key or a DOM write, in CSS text inside a string, or as the Tailwind origin class for the top left (named or an arbitrary zero). Not counted: an origin held in a variable, a stylesheet file, and a scale from the centre moved back with a translate | `FitFrame` (a preview drawn at a logical size), or `fitScale` / `fitBoxScale` / `fitFrameStyle`, from `efficient-shell/ui` |
5306
5307
 
5307
5308
  Known gaps: `rgb()` / `hsl()` colours, colours in `.ts` maps, and
5308
5309
  `createElement('button')` are not counted.
@@ -1,32 +1,32 @@
1
- import{InputEndActionButton as e}from"./chunk-3SIRRK3F.js";import"./chunk-EX3DARI3.js";import"./chunk-VQBKRBBR.js";import"./chunk-NWS5G7FE.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-NW5NSV7N.js";import{WindowTitle as n}from"./chunk-JFOMAXD2.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-FBZUEZK7.js";import"./chunk-BG3C4ALM.js";import{confirm as s}from"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-QAAHFU2I.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,R]=l(w),[S,W]=l([w]),[U,z]=l(0),[D,F]=l(0),[A,E]=l(x),[T,H]=l(!1),[L,I]=l(null),O=i(null),Q=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(A))}catch{}},[A]);const V=e=>{const t=f(e);t&&(v(t),R(t),W(e=>{const o=e.slice(0,U+1);return o.push(t),o}),z(e=>e+1),H(!1))},G=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},J=()=>{const e=L?.trim();e?(E(t=>[...t,{label:e,url:w}]),I(null)):I(null)};c(()=>{if(null===L)return;O.current?.focus(),O.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||I(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==L]);const M=e=>{E(t=>t.filter((t,o)=>o!==e))},Z=U>0,B=U<S.length-1,Y=A.some(e=>e.url===w),K="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-3SIRRK3F.js";import"./chunk-EX3DARI3.js";import"./chunk-VQBKRBBR.js";import"./chunk-NWS5G7FE.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-POQUUMRS.js";import{WindowTitle as n}from"./chunk-ZI2FDUYJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-FBZUEZK7.js";import"./chunk-BG3C4ALM.js";import{confirm as s}from"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-FRTDUHQF.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,R]=l(w),[S,U]=l([w]),[W,D]=l(0),[F,z]=l(0),[T,E]=l(x),[H,A]=l(!1),[L,I]=l(null),M=i(null),O=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(T))}catch{}},[T]);const Q=e=>{const t=f(e);t&&(v(t),R(t),U(e=>{const o=e.slice(0,W+1);return o.push(t),o}),D(e=>e+1),A(!1))},Z=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},G=()=>{const e=L?.trim();e?(E(t=>[...t,{label:e,url:w}]),I(null)):I(null)};c(()=>{if(null===L)return;M.current?.focus(),M.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||I(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==L]);const J=e=>{E(t=>t.filter((t,o)=>o!==e))},V=W>0,Y=W<S.length-1,B=T.some(e=>e.url===w),K="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
- /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
3
+ /* @__PURE__ */u(n,{title:`Browser - ${j(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(U>0){const e=U-1;z(e),v(S[e]),R(S[e]),H(!1)}},disabled:!Z,className:K,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(U<S.length-1){const e=U+1;z(e),v(S[e]),R(S[e]),H(!1)}},disabled:!B,className:K,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>F(e=>e+1),className:K,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>V(b),className:K,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),V(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(W>0){const e=W-1;D(e),v(S[e]),R(S[e]),A(!1)}},disabled:!V,className:K,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(W<S.length-1){const e=W+1;D(e),v(S[e]),R(S[e]),A(!1)}},disabled:!Y,className:K,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>z(e=>e+1),className:K,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>Q(b),className:K,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),Q(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
13
  /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>R(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>Y?M(A.findIndex(e=>e.url===w)):void I(N(w)),className:K+" "+(Y?"text-yellow-500":""),title:Y?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:Y?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:G,className:K,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>H(e=>!e),className:K,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==L&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>B?J(T.findIndex(e=>e.url===w)):void I(j(w)),className:K+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:Z,className:K,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>A(e=>!e),className:K,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==L&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:O,type:"text",value:L,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key?J():"Escape"===e.key&&I(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:M,type:"text",value:L,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key?G():"Escape"===e.key&&I(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
21
  /* @__PURE__ */u("button",{onClick:()=>I(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:J,disabled:!L.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===A.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),A.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>V(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&M(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
22
+ /* @__PURE__ */u("button",{onClick:G,disabled:!L.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===T.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>Q(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&J(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:D,iframeRef:Q,openExternal:G,showHelp:T,dismissHelp:()=>H(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=l(!1);c(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(N,{url:w,iframeKey:F,iframeRef:O,openExternal:Z,showHelp:H,dismissHelp:()=>A(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=l(!1);c(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
- /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
29
+ /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[j(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
31
31
  /* @__PURE__ */u("span",{className:"font-mono text-xs",children:"X-Frame-Options"})," ","or ",
32
32
  /* @__PURE__ */u("span",{className:"font-mono text-xs",children:"Content-Security-Policy"})," header that refuses iframe embedding. The browser blocks the load before our app can do anything about it."]}),
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-QSJMLHBD.js";import{useWidgetSettings as n}from"./chunk-ZI2FDUYJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-FBZUEZK7.js";import"./chunk-BG3C4ALM.js";import"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[S,U]=c(()=>e(h)),[F,T]=c(!1),[E,A]=c(S),D=i(null);n(o(()=>{A({...S}),T(!0)},[S]));const W=o(e=>{C(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),Z=o(()=>{k("0"),d(null),g(null),N(!1)},[]),J=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),R=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=J(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,J]),M=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=J(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),C(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,J]),Q=o(()=>{k(e=>String(parseFloat(e)/100))},[]),V=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?W(e.key):"."===e.key?W("."):"+"===e.key?R("+"):"-"===e.key?R("-"):"*"===e.key?R("×"):"/"===e.key?(e.preventDefault(),R("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&D.current?.contains(e.target)&&e.preventDefault(),M()):"Escape"===e.key?Z():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&Q())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[W,R,M,Z,Q]);const w="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",H=`${w} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,O=`${w} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,B=`${w} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,G=`${w} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:D,className:"flex flex-col h-full",style:{opacity:S.activeOpacity/100,backdropFilter:S.activeBlur>0?`blur(${S.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:Z,className:B,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:V,className:B,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:Q,className:B,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${O} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>W("7"),className:H,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>W("8"),className:H,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>W("9"),className:H,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${O} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>W("4"),className:H,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>W("5"),className:H,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>W("6"),className:H,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${O} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>W("1"),className:H,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>W("2"),className:H,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>W("3"),className:H,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${O} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>W("0"),className:`${H} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>W("."),className:H,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:M,className:G,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:F,onClose:()=>T(!1),title:"Calculator Settings",appearance:E,onAppearanceChange:A,onSave:()=>{U(E),localStorage.setItem(h,JSON.stringify(E)),T(!1)}})]})}export{m as default};
@@ -1,6 +1,6 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-PY4DTB6Y.js";import{useWidgetSettings as r}from"./chunk-JFOMAXD2.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-FBZUEZK7.js";import"./chunk-BG3C4ALM.js";import"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[S,y]=s({}),[b,D]=s(!1),[U,C]=s(!1),[v,J]=s([]),[A,R]=s(f),[F,O]=s("USD"),[B,Y]=s("CNY");r(o(()=>{J([...u]),R({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){D(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(y(r),D(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-QSJMLHBD.js";import{useWidgetSettings as r}from"./chunk-ZI2FDUYJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-FBZUEZK7.js";import"./chunk-BG3C4ALM.js";import"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,S]=s(()=>t(h)),[x,y]=s({}),[b,D]=s(!1),[U,C]=s(!1),[v,J]=s([]),[A,R]=s(f),[F,B]=s("USD"),[H,I]=s("CNY");r(o(()=>{J([...u]),R({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){D(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(y(r),D(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
- /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=S[t]?.[e];/* @__PURE__ */
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=x[t]?.[e];/* @__PURE__ */
4
4
  return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:U,onClose:()=>C(!1),title:"Currency Settings",appearance:A,onAppearanceChange:R,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),x(A),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(A)),C(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:U,onClose:()=>C(!1),title:"Currency Settings",appearance:A,onAppearanceChange:R,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),S(A),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(A)),C(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
14
  /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
15
15
  /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:v.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
17
17
  /* @__PURE__ */m("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:F,onChange:t=>O(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
18
+ /* @__PURE__ */m("select",{value:F,onChange:t=>B(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:B,onChange:t=>Y(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{F!==B&&v.length<4&&J(t=>[...t,[F,B]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */m("select",{value:H,onChange:t=>I(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{F!==H&&v.length<4&&J(t=>[...t,[F,H]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};