efficient-shell 16.6.0 → 16.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -4
- package/dist/{Browser-UHT6QSUN.js → Browser-TXL5U5PM.js} +13 -13
- package/dist/{Calculator-ZG5RX2HX.js → Calculator-VOZDVOYE.js} +22 -22
- package/dist/{CurrencyConverter-AHGYTGKM.js → CurrencyConverter-AMGFHBJE.js} +5 -5
- package/dist/{Files-4HJWEYDE.js → Files-2EE24L5G.js} +64 -64
- package/dist/{Notepad-GXKGVTNG.js → Notepad-L2WODBHG.js} +9 -9
- package/dist/{PomodoroTimer-GN2OSLJ6.js → PomodoroTimer-77VMHGDE.js} +4 -4
- package/dist/{Preview-EN4YCUH5.js → Preview-FWN44NN2.js} +1 -1
- package/dist/{Stock-44BSCZOL.js → Stock-PXLNR6A6.js} +3 -3
- package/dist/{Weather-GNGUF6A4.js → Weather-WGLPPZPX.js} +16 -16
- package/dist/{WorldClock-EBZJRH5F.js → WorldClock-UY4B5VKZ.js} +7 -7
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +8 -8
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-MS6IZF6E.js → chunk-2FLRIQ5V.js} +1 -1
- package/dist/{chunk-3C7JKJGL.js → chunk-2SOK37OP.js} +1 -1
- package/dist/{chunk-JKO4JZPO.js → chunk-36KGBTNC.js} +1 -1
- package/dist/chunk-E5WGELKZ.js +8 -0
- package/dist/{chunk-H6JJAVYL.js → chunk-EC6XKOAE.js} +1 -1
- package/dist/chunk-EJFJOHPZ.js +1 -0
- package/dist/{chunk-UQPVUPSS.js → chunk-FFCVC4ES.js} +1 -1
- package/dist/chunk-FUXGLHAA.js +1 -0
- package/dist/chunk-IJLXI67O.js +1 -0
- package/dist/{chunk-HOTIZZXC.js → chunk-LBXKYVM3.js} +1 -1
- package/dist/chunk-LO7LNWTZ.js +2 -0
- package/dist/chunk-MAQAP6SX.js +30 -0
- package/dist/chunk-MHKTBQ53.js +5 -0
- package/dist/{chunk-EJTAPBGB.js → chunk-MIHPFJCP.js} +13 -13
- package/dist/chunk-MWJNMENV.js +2 -0
- package/dist/{chunk-OLFYNMTD.js → chunk-PO7UCZSK.js} +1 -1
- package/dist/chunk-RO3M4JWS.js +1 -0
- package/dist/{chunk-ATTQTQJI.js → chunk-S24LTOBM.js} +4 -4
- package/dist/chunk-S3TQ3VOK.js +2 -0
- package/dist/chunk-XCTS44UZ.js +1 -0
- package/dist/{chunk-YYGA4Y6E.js → chunk-YAVIKKIQ.js} +1 -1
- package/dist/{chunk-DX24Q5OR.js → chunk-ZKXDWUNI.js} +1 -1
- package/dist/format/index.d.ts +84 -6
- package/dist/format/index.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/hooks/useMarquee.js +1 -1
- package/dist/icons/efficient-glyphs.d.ts +1 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +2 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +1 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +1 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/ScrollExpandIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollExpandIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/ScrollExpandMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollExpandMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollExpandSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollExpandSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +164 -164
- package/dist/map/index.d.ts +39 -35
- package/dist/map/index.js +12 -12
- package/dist/map-site.css +21 -0
- package/dist/motion/entrance.js +1 -1
- package/dist/motion/values.d.ts +7 -2
- package/dist/motion/values.js +1 -1
- package/dist/motion.css +28 -5
- package/dist/{names-CpcmfUzD.d.ts → names-Bw6ChIJl.d.ts} +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/utils/edgeScroll.d.ts +4 -1
- package/dist/utils/edgeScroll.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AIJ3G6BD.js +0 -1
- package/dist/chunk-EJMCK7E3.js +0 -8
- package/dist/chunk-LACL4MAR.js +0 -1
- package/dist/chunk-N7EZ2BFE.js +0 -30
- package/dist/chunk-OMOAD5LL.js +0 -1
- package/dist/chunk-WSQ73CRR.js +0 -2
- package/dist/chunk-YVXF7L66.js +0 -1
- /package/dist/{chunk-OQOWFHRZ.js → chunk-4B54NLXF.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-LBXKYVM3.js";import{subscribePomo as o,getPomoSnapshot as n,setPomoDurations as a,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,pomodoroToday as u,migratePomodoroTasksOnce as m,pomoSwitchMode as d,pomoPause as h,pomoStart as p,ALARM_OPTIONS as k,playAlarm as g,FOCUS_SOUND_OPTIONS as f,previewFocusSound as b}from"./chunk-DYJQIZX2.js";import{PLACEHOLDER_INK as x}from"./chunk-AYZY3YNC.js";import{formatTime as v}from"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import{pad2 as y}from"./chunk-LF27WIN2.js";import{useWidgetSettings as N}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as j}from"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import{Icon as C}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-VLT4ZEHT.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useSyncExternalStore as B,useEffect as S,useMemo as w,useState as M,useRef as T,useCallback as P}from"react";import{jsxs as I,Fragment as V,jsx as A}from"react/jsx-runtime";var D="pomodoro_appearance",L="pomodoro_active_task_id",R={focus:"Pomodoro",short:"Short Break",long:"Long Break"},H={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var J=25,W=5,Z=15,Y=!1,$=!1,F=4,O=!0,U=!0,E="bell",G=100,K=1,Q="none",X=50,_=(e,t,o,n)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):n;function z(){const t=B(o,n,n),{prefs:g,save:b}=j(),x=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:_(t.focusMinutes,1,120,J),shortBreakMinutes:_(t.shortBreakMinutes,1,120,W),longBreakMinutes:_(t.longBreakMinutes,1,120,Z),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:Y,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:$,longBreakInterval:_(t.longBreakInterval,1,20,F),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:O,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:U,alarmSound:k.some(e=>e.id===t.alarmSound)?t.alarmSound:E,alarmVolume:_(t.alarmVolume,0,100,G),alarmRepeat:_(t.alarmRepeat,1,5,K),focusSound:f.some(e=>e.id===t.focusSound)?t.focusSound:Q,focusVolume:_(t.focusVolume,0,100,X)}}(g.pomodoro_settings);S(()=>{a({focus:60*x.focusMinutes,short:60*x.shortBreakMinutes,long:60*x.longBreakMinutes})},[x.focusMinutes,x.shortBreakMinutes,x.longBreakMinutes]),S(()=>{r(x.alarmSound),s(x.alarmVolume,x.alarmRepeat)},[x.alarmSound,x.alarmVolume,x.alarmRepeat]),S(()=>{i({autoStartBreaks:x.autoStartBreaks,autoStartPomodoros:x.autoStartPomodoros,longBreakInterval:x.longBreakInterval})},[x.autoStartBreaks,x.autoStartPomodoros,x.longBreakInterval]),S(()=>{l(x.focusSound,x.focusVolume)},[x.focusSound,x.focusVolume]),S(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const z=c(),ee=z.tasks,te=w(()=>u(),[]),oe=function(e,t){return w(()=>t?(e=>{const t=[],o=[];for(const n of e)(n.done?o:t).push(n);return[...t,...o]})(e):e,[e,t])}(w(()=>ee.filter(e=>!!e.dueDate&&(e.dueDate===te||e.dueDate<te&&!e.done)),[ee,te]),x.checkToBottom),[ne,ae]=M(()=>localStorage.getItem(L)),[re,se]=M(!1),[ie,le]=M(null),ce=T(!1);S(()=>{ce.current||(ce.current=!0,m(ee,z.setAllTasks))},[]),S(()=>{try{ne?localStorage.setItem(L,ne):localStorage.removeItem(L)}catch{}},[ne]),S(()=>{if(!ie)return;const e=()=>le(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[ie]);const ue=T(t.streak);S(()=>{if(t.streak>ue.current&&ne){const e=ee.find(e=>e.id===ne);if(e){const t=(e.completed??0)+1,o=e.estimated??0,n=x.autoCheckTasks&&o>0&&t>=o;z.updateTask(ne,{completed:t,done:e.done||n})}}ue.current=t.streak},[t.streak,ne,x.autoCheckTasks,ee,z]);const de=oe.reduce((e,t)=>e+(t.completed??0),0),he=oe.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),pe=oe.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),ke=t.running&&"focus"===t.mode?t.remaining:0,ge=pe*x.focusMinutes*60+ke,fe=new Date(Date.now()+1e3*ge),be=v(fe.toISOString(),{clock:{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}}),xe=(ge/3600).toFixed(1),ve=ne?ee.find(e=>e.id===ne)??null:null,ye=y(Math.floor(t.remaining/60)),Ne=y(t.remaining%60),[je,Ce]=M(()=>e(D)),[Be,Se]=M(!1),[we,Me]=M(je),[Te,Pe]=M(x);N(P(()=>{Me({...je}),Pe({...x}),Se(!0)},[je,x]));const Ie="focus"!==t.mode,Ve=H[t.mode],Ae=Ie?(De=Ve,Le=je.activeOpacity/100,`rgba(${parseInt(De.slice(1,3),16)}, ${parseInt(De.slice(3,5),16)}, ${parseInt(De.slice(5,7),16)}, ${Le})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${je.activeOpacity/100})`;var De,Le;const Re={primary:Ie?"text-white":"text-gray-900",secondary:Ie?"text-white/85":"text-gray-700",muted:Ie?"text-white/65":"text-gray-500",tabActive:Ie?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Ie?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Ie?"border-white/30":"border-gray-200",softDivider:Ie?"border-white/20":"border-gray-200",iconBtn:Ie?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Ie?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},He=Ie?Ve:"#0f172a";/* @__PURE__ */
|
|
2
2
|
return I(V,{children:[
|
|
3
3
|
/* @__PURE__ */I("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Re.primary}`,style:{backgroundColor:Ae,backdropFilter:je.activeBlur>0?`blur(${je.activeBlur}px)`:void 0},children:[
|
|
4
4
|
/* @__PURE__ */A("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */A("button",{onClick:()=>d(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Re.tabActive:Re.tabInactive}`,children:R[e]},e))}),
|
|
5
5
|
/* @__PURE__ */I("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[ye,":",Ne]}),
|
|
6
|
-
/* @__PURE__ */A("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */A("button",{onClick:()=>t.running?h():p(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:
|
|
6
|
+
/* @__PURE__ */A("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */A("button",{onClick:()=>t.running?h():p(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:He,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
|
|
7
7
|
/* @__PURE__ */A("div",{className:"px-3 py-3 text-center",children:ve?/* @__PURE__ */I(V,{children:[
|
|
8
8
|
/* @__PURE__ */I("div",{className:`text-xs leading-tight ${Re.muted}`,children:["#",(ve.completed??0)+1]}),
|
|
9
9
|
/* @__PURE__ */A("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Re.primary}`,children:ve.name})]}):/* @__PURE__ */A("div",{className:`text-xs italic ${Re.muted}`,children:"No task selected"})}),
|
|
@@ -13,14 +13,14 @@ return I(V,{children:[
|
|
|
13
13
|
/* @__PURE__ */A("div",{className:`border-t mx-3 mt-2 ${Re.divider}`}),
|
|
14
14
|
/* @__PURE__ */I("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[oe.map(e=>{const t=e.id===ne;/* @__PURE__ */
|
|
15
15
|
return I("div",{onClick:()=>ae(e.id),className:"bg-surface text-ink-strong rounded-md flex items-center pr-2 py-3 shadow-sm cursor-pointer transition-shadow hover:shadow-(--elevation-panel) "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
|
|
16
|
-
/* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */A("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:
|
|
16
|
+
/* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */A("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:He},children:/* @__PURE__ */A("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */A("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */A("circle",{cx:"12",cy:"12",r:"10"})})}),
|
|
17
17
|
/* @__PURE__ */A("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
|
|
18
18
|
/* @__PURE__ */I("span",{className:"text-sm tabular-nums mr-2 shrink-0",children:[
|
|
19
19
|
/* @__PURE__ */A("span",{className:"font-bold text-gray-500",children:e.completed??0}),
|
|
20
20
|
/* @__PURE__ */A("span",{className:"text-gray-400",children:" / "}),
|
|
21
21
|
/* @__PURE__ */A("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
|
|
22
22
|
/* @__PURE__ */I("div",{className:"relative",children:[
|
|
23
|
-
/* @__PURE__ */A("button",{onClick:t=>{t.stopPropagation(),le(ie===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */A(C,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),ie===e.id&&/* @__PURE__ */A("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.removeTask(o),ne===o&&ae(null),le(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),re?/* @__PURE__ */A(me,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const n=z.addTask({name:o,estimated:t,completed:0,dueDate:te});ne||ae(n),se(!1)},onCancel:()=>se(!1),accentColor:
|
|
23
|
+
/* @__PURE__ */A("button",{onClick:t=>{t.stopPropagation(),le(ie===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */A(C,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),ie===e.id&&/* @__PURE__ */A("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.removeTask(o),ne===o&&ae(null),le(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),re?/* @__PURE__ */A(me,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const n=z.addTask({name:o,estimated:t,completed:0,dueDate:te});ne||ae(n),se(!1)},onCancel:()=>se(!1),accentColor:He}):/* @__PURE__ */I("button",{onClick:()=>se(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Re.addTaskBtn}`,children:[
|
|
24
24
|
/* @__PURE__ */A(C,{name:"add-circle",className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
|
|
25
25
|
/* @__PURE__ */I("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Re.softDivider}`,children:[
|
|
26
26
|
/* @__PURE__ */I("span",{className:Re.secondary,children:["Pomos: ",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PdfViewer as e,ToolbarSlotContext as t,PanelActions as n}from"./chunk-SWH3IEUT.js";import{ImageAnnotator_default as r}from"./chunk-OHRKENEP.js";import{AboutApp as s}from"./chunk-
|
|
1
|
+
import{PdfViewer as e,ToolbarSlotContext as t,PanelActions as n}from"./chunk-SWH3IEUT.js";import{ImageAnnotator_default as r}from"./chunk-OHRKENEP.js";import{AboutApp as s}from"./chunk-ZKXDWUNI.js";import{peekPdfPreviewStage as i,claimPdfPreviewStage as o,PDF_PREVIEW_UPDATE_EVENT as a,previewStepForKey as l}from"./chunk-I4RJAMLJ.js";import{WindowTitle as c}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import{getActiveModalId as d}from"./chunk-F3ZOO23R.js";import"./chunk-RO3M4JWS.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import{IconButton_default as u}from"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import{Icon as p}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{SpinnerRing as m,LoadingSpinner as h}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import{toast_default as f}from"./chunk-VLT4ZEHT.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import{useShellStrings as y,splitAround as g}from"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as b,useState as w,useEffect as v}from"react";import{jsxs as k,jsx as N,Fragment as C}from"react/jsx-runtime";var A=!1;function E(e,t){return e?.url&&e.url!==t.url&&e.url.startsWith("blob:")&&URL.revokeObjectURL(e.url),t}function L(){const n=b(void 0);void 0===n.current&&(n.current=i());const[r,m]=w(n.current?.data??null);v(()=>{const e=n.current;null!=e&&(o(e),m(t=>t===e.data?t:E(t,e.data)))},[]),v(()=>{const e=n.current?.token;if(null==e)return;const t=t=>{const n=t.detail;n&&n.token===e&&m(e=>E(e,n.data))};return window.addEventListener(a,t),()=>window.removeEventListener(a,t)},[]);const h=b(void 0);v(()=>{h.current=r?.url},[r?.url]);const x=b(null);v(()=>(null!==x.current&&(clearTimeout(x.current),x.current=null),()=>{const e=h.current;e?.startsWith("blob:")&&(x.current=setTimeout(()=>URL.revokeObjectURL(e),0))}),[]);const A=y().preview,L=r?.filename?(S=r.filename).length>24?`${S.slice(0,23)}…`:S:A.untitled;var S;const j=r?.position&&r.position.count>1?r.position:null,T=j?A.namedPosition(L,A.position(j.index+1,j.count)):L,R=b(null),D=b(null),[F,P]=w(null),[O,W]=w(!1),B=b(0),U=()=>R.current?.click(),X=()=>{B.current=0,W(!1)},G=e=>{const t=e.closest("[data-modal-id]");return!t||d()===t.dataset.modalId};v(()=>{const e=()=>X(),t=()=>X(),n=e=>{"Escape"===e.key&&X()};return window.addEventListener("dragend",e),window.addEventListener("drop",t),window.addEventListener("keydown",n),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",t),window.removeEventListener("keydown",n)}},[]);const V=b(r);v(()=>{V.current=r},[r]),v(()=>{const e=e=>{const t=D.current;if(!t)return;const n=t.closest("[data-modal-id]"),r=n?d()===n.dataset.modalId:t.contains(document.activeElement),s=l(e,{active:r,data:V.current});s&&(e.preventDefault(),"previous"===s?V.current?.onPrevious?.():V.current?.onNext?.())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[]);const Y=e=>{const t=(e.name.split(".").pop()||"").toLowerCase(),n="pdf"===t?"pdf":"dxf"===t?"dxf":["jpg","jpeg","png","gif","webp","svg","avif","bmp"].includes(t)?"image":["stp","step","stl","obj","gltf","glb","3mf","iges","igs","ply","fbx"].includes(t)?"3d":void 0;if(!n)return void("dwg"===t?f.error(A.dwgUnsupported):f.error(A.unsupportedType(t)));const r=URL.createObjectURL(e);m(t=>(t?.url?.startsWith("blob:")&&t.url!==r&&URL.revokeObjectURL(t.url),{url:r,filename:e.name,kind:n}))},_=/* @__PURE__ */k("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
2
2
|
/* @__PURE__ */N("input",{ref:R,type:"file",accept:".pdf,.dxf,.jpg,.jpeg,.png,.gif,.webp,.svg,.avif,.bmp,.stp,.step,.stl,.obj,.gltf,.glb,.3mf,.iges,.igs,.ply,.fbx",onChange:e=>{const t=e.target.files?.[0];t&&Y(t),R.current&&(R.current.value="")},className:"hidden"}),
|
|
3
3
|
/* @__PURE__ */k("button",{onClick:U,className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
|
|
4
4
|
/* @__PURE__ */N(p,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),A.open]}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-LBXKYVM3.js";import{useWidgetSettings as n}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as r,useCallback as c}from"react";import{jsxs as s,Fragment as i,jsx as a}from"react/jsx-runtime";var o=["AAPL","MSFT","GOOGL","TSLA","NVDA"],m="stock_symbols",h="stock_appearance",p={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},l=Object.keys(p);function u(){try{const t=JSON.parse(localStorage.getItem(m)||"");if(Array.isArray(t)&&t.length)return t.slice(0,8)}catch{}return o}var k=t=>`${t>=0?"+":""}${t.toFixed(2)}`;function d(){const[o,d]=r(u),[g,j]=r(()=>t(h)),[x,N]=r(!1),[b,f]=r([]),[y,P]=r(g),[A,v]=r(""),S=c(()=>{f([...o]),P({...g}),v(""),N(!0)},[o,g]);n(S);const O=()=>{const t=A.trim().toUpperCase();!t||b.includes(t)||b.length>=8||(f(e=>[...e,t]),v(""))},D=l.filter(t=>!b.includes(t));/* @__PURE__ */
|
|
2
2
|
return s(i,{children:[
|
|
3
3
|
/* @__PURE__ */a("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${g.activeOpacity/100})`,backdropFilter:g.activeBlur>0?`blur(${g.activeBlur}px)`:void 0},children:/* @__PURE__ */a("div",{className:"px-4 py-3",children:0===o.length?/* @__PURE__ */a("div",{className:"text-xs text-gray-500 text-center py-6",children:"No symbols yet — add some in settings."}):/* @__PURE__ */a("div",{className:"space-y-0.5",children:o.map(t=>{const e=p[t],n=(e?.change??0)>=0,r=e?e.change>0?"text-green-600":e.change<0?"text-red-600":"text-gray-500":"text-gray-400";/* @__PURE__ */
|
|
4
4
|
return s("div",{className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0",children:[
|
|
@@ -11,6 +11,6 @@ return s("div",{className:"flex items-center justify-between px-2 py-2 border-b
|
|
|
11
11
|
/* @__PURE__ */s("div",{className:"space-y-1 mb-2",children:[b.map((t,e)=>/* @__PURE__ */s("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
12
12
|
/* @__PURE__ */a("span",{className:"text-sm font-semibold text-gray-700",children:t}),
|
|
13
13
|
/* @__PURE__ */a("button",{onClick:()=>f(t=>t.filter((t,n)=>n!==e)),className:"text-red-400 hover:text-red-600",children:"×"})]},e)),0===b.length&&/* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest italic",children:"No symbols — add a ticker below."})]}),b.length<8?/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[
|
|
14
|
-
/* @__PURE__ */a("input",{value:A,onChange:t=>v(t.target.value),onKeyDown:t=>{"Enter"===t.key&&
|
|
15
|
-
/* @__PURE__ */a("button",{onClick:
|
|
14
|
+
/* @__PURE__ */a("input",{value:A,onChange:t=>v(t.target.value),onKeyDown:t=>{"Enter"===t.key&&O()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
|
|
15
|
+
/* @__PURE__ */a("button",{onClick:O,className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */s("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",8," symbols — remove one to add another."]}),D.length>0&&b.length<8&&/* @__PURE__ */a("div",{className:"flex flex-wrap gap-2 mt-2",children:D.map(t=>/* @__PURE__ */a("button",{onClick:()=>f(e=>e.length<8?[...e,t]:e),className:"text-2xs font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded px-2 py-0.5 transition-colors",children:t},t))}),
|
|
16
16
|
/* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest mt-2",children:"Demo prices — static sample data, no live feed."})]})})]})}export{d as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,cityClock as r,toFahrenheit as n}from"./chunk-HYHZEQMG.js";import{loadAppearance as i,WidgetSettingsModal as s}from"./chunk-
|
|
1
|
+
import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,cityClock as r,toFahrenheit as n}from"./chunk-HYHZEQMG.js";import{loadAppearance as i,WidgetSettingsModal as s}from"./chunk-LBXKYVM3.js";import{userZone as o}from"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import"./chunk-LF27WIN2.js";import{useWidgetSettings as l}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as d,useEffect as h,useCallback as p}from"react";import{jsx as u,jsxs as f,Fragment as y}from"react/jsx-runtime";var x="weather_city",g="weather_appearance",b={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function k(){const e="undefined"!=typeof localStorage?localStorage.getItem(x):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(x,e[0]),e[0]}catch{}return function(){const e=o();for(const[t,r]of Object.entries(a))if(r.tz===e)return t;return"London"}()}var w=n;function v(e,t=!1){const{time:a,ampm:n}=r(e,/* @__PURE__ */new Date,t);return n?`${a} ${n}`:a}function N(){/* @__PURE__ */
|
|
2
2
|
return f("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
3
3
|
/* @__PURE__ */u("div",{className:"absolute -top-5 -right-5 w-24 h-24",style:{animation:"wx-sun-rays 70s linear infinite"},children:/* @__PURE__ */u("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:Array.from({length:12}).map((e,t)=>/* @__PURE__ */u("rect",{x:49,y:3,width:2,height:14,rx:1,fill:"rgba(255, 232, 130, 0.55)",transform:`rotate(${30*t} 50 50)`},t))})}),
|
|
4
4
|
/* @__PURE__ */u("div",{className:"absolute top-1 right-1 w-10 h-10 rounded-full",style:{background:"radial-gradient(circle at 35% 35%, #fff8cc 0%, #ffd84a 55%, #ff9e2a 100%)",boxShadow:"0 0 18px 5px rgba(255, 200, 80, 0.55)",animation:"wx-sun-pulse 4.5s ease-in-out infinite"}})]})}function j(){const e=Array.from({length:16}).map((e,t)=>({left:(53*t+11)%95+"%",top:(37*t+9)%78+"%",size:1+13*t%3,delay:.41*t%4+"s",duration:2.5+7*t%5*.6+"s"}));/* @__PURE__ */
|
|
@@ -17,44 +17,44 @@ return f("div",{className:"absolute inset-0 overflow-hidden pointer-events-none"
|
|
|
17
17
|
return f("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
18
18
|
/* @__PURE__ */u("div",{className:"absolute",style:{top:"8%",animation:"wx-drift-cloud 42s linear infinite"},children:/* @__PURE__ */u(a,{scale:.9})}),
|
|
19
19
|
/* @__PURE__ */u("div",{className:"absolute",style:{top:"40%",animation:"wx-drift-cloud 60s linear -22s infinite",opacity:.85},children:/* @__PURE__ */u(a,{scale:1.25})}),
|
|
20
|
-
/* @__PURE__ */u("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */u(a,{scale:.75})})]})}function
|
|
21
|
-
return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */u("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function
|
|
22
|
-
return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:t.map((e,t)=>/* @__PURE__ */u("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:"-12px",width:e.size,height:e.size,opacity:e.opacity,boxShadow:"0 0 4px rgba(255,255,255,0.65)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`}},t))})}function
|
|
20
|
+
/* @__PURE__ */u("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */u(a,{scale:.75})})]})}function L({heavy:e=!1}){const t=e?26:16,a=["wx-rain-a","wx-rain-b","wx-rain-c"],r=Array.from({length:t}).map((e,r)=>({left:(100*r/t+11*r%7)%100+"%",delay:.087*r%1.3+"s",height:12+r%4*5+"px",duration:.7+r%3*.18+"s",variant:a[r%a.length]}));/* @__PURE__ */
|
|
21
|
+
return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */u("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function S(){const e=["wx-snow-a","wx-snow-b","wx-snow-c"],t=Array.from({length:16}).map((t,a)=>({left:(100*a/16+13*a%5)%100+"%",delay:.43*a%5+"s",duration:4.5+a%5+"s",size:3+a%4*1.4,opacity:.65+7*a%4*.08,variant:e[a%e.length]}));/* @__PURE__ */
|
|
22
|
+
return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:t.map((e,t)=>/* @__PURE__ */u("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:"-12px",width:e.size,height:e.size,opacity:e.opacity,boxShadow:"0 0 4px rgba(255,255,255,0.65)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`}},t))})}function B(){/* @__PURE__ */
|
|
23
23
|
return f("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
24
|
-
/* @__PURE__ */u(
|
|
24
|
+
/* @__PURE__ */u(L,{heavy:!0}),
|
|
25
25
|
/* @__PURE__ */u("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
|
|
26
|
-
/* @__PURE__ */u("div",{className:"absolute inset-y-0 right-1/3 flex items-center justify-center pointer-events-none",style:{animation:"wx-bolt 6s ease-out infinite"},children:/* @__PURE__ */u("svg",{viewBox:"0 0 18 60",className:"h-4/5",style:{filter:"drop-shadow(0 0 6px rgba(255, 240, 150, 0.95)) drop-shadow(0 0 14px rgba(255, 220, 90, 0.7))"},children:/* @__PURE__ */u("path",{d:"M11 0 L2 28 L8 30 L4 60 L16 24 L9 22 Z",fill:"rgba(255, 250, 200, 0.98)",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:.3})})})]})}function
|
|
27
|
-
return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */u("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function
|
|
28
|
-
/* @__PURE__ */u(H,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */u(H,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */u(
|
|
26
|
+
/* @__PURE__ */u("div",{className:"absolute inset-y-0 right-1/3 flex items-center justify-center pointer-events-none",style:{animation:"wx-bolt 6s ease-out infinite"},children:/* @__PURE__ */u("svg",{viewBox:"0 0 18 60",className:"h-4/5",style:{filter:"drop-shadow(0 0 6px rgba(255, 240, 150, 0.95)) drop-shadow(0 0 14px rgba(255, 220, 90, 0.7))"},children:/* @__PURE__ */u("path",{d:"M11 0 L2 28 L8 30 L4 60 L16 24 L9 22 Z",fill:"rgba(255, 250, 200, 0.98)",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:.3})})})]})}function A(){/* @__PURE__ */
|
|
27
|
+
return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */u("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function C({code:e,isDay:t}){return 0===e||1===e?/* @__PURE__ */u(t?N:j,{}):2===e?/* @__PURE__ */f(y,{children:[/* @__PURE__ */u(t?N:j,{}),
|
|
28
|
+
/* @__PURE__ */u(H,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */u(H,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */u(A,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */u(L,{}):[55,63,65,82].includes(e)?/* @__PURE__ */u(L,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */u(S,{}):[95,96,99].includes(e)?/* @__PURE__ */u(B,{}):null}function P(){const[r,n]=d(k),[o,N]=d(()=>i(g)),[j,H]=d(null),[L,S]=d(!0),[,B]=d(0);h(()=>{const e=setInterval(()=>B(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[A,P]=d(!1),[T,D]=d(r),[J,M]=d(o),{prefs:F,save:I}=c(),Z={...b,...F.weather_prefs??{}},[O,G]=d(Z);l(p(()=>{D(r),M({...o}),G({...Z}),P(!0)},[r,o,Z])),h(()=>{let t=!1;return S(!0),e(r).then(e=>{t||(H(e),S(!1))}),()=>{t=!0}},[r]);const R=e=>Z.useFahrenheit?`${w(e)}°F`:`${e}°`;if(L&&!j)/* @__PURE__ */
|
|
29
29
|
return u("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-on-accent/80 text-xs",style:{minHeight:110},children:/* @__PURE__ */u(m,{size:"sm",padding:"",label:"Loading"})});if(!j)/* @__PURE__ */
|
|
30
30
|
return u("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[V,$,Q]=t(j.code,j.isDay);/* @__PURE__ */
|
|
31
31
|
return f(y,{children:[
|
|
32
32
|
/* @__PURE__ */u("style",{children:"\n@keyframes wx-rain-a { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 0.95; } 100% { transform: translate(8px,140px); opacity: 0; } }\n@keyframes wx-rain-b { 0% { transform: translate(0,-20px); opacity: 0; } 12% { opacity: 0.85; } 100% { transform: translate(12px,140px); opacity: 0; } }\n@keyframes wx-rain-c { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(5px,140px); opacity: 0; } }\n@keyframes wx-snow-a { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(10px,55px) rotate(180deg); } 100% { transform: translate(-4px,140px) rotate(360deg); opacity: 0; } }\n@keyframes wx-snow-b { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.85; } 50% { transform: translate(-12px,55px) rotate(-180deg); } 100% { transform: translate(6px,140px) rotate(-360deg); opacity: 0; } }\n@keyframes wx-snow-c { 0% { transform: translate(0,-12px); opacity: 0; } 10% { opacity: 0.7; } 100% { transform: translate(2px,140px); opacity: 0; } }\n@keyframes wx-drift-cloud { 0% { transform: translateX(-40%); } 100% { transform: translateX(140%); } }\n@keyframes wx-twinkle { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }\n@keyframes wx-flash { 0%, 86%, 100% { opacity: 0; } 87% { opacity: 0.95; } 88% { opacity: 0.15; } 89% { opacity: 0.85; } 90% { opacity: 0; } }\n@keyframes wx-bolt { 0%, 86%, 90%, 100% { opacity: 0; } 87% { opacity: 1; } 89% { opacity: 0.85; } }\n@keyframes wx-sun-pulse { 0%, 100% { transform: scale(1); opacity: 0.65; } 50% { transform: scale(1.12); opacity: 0.95; } }\n@keyframes wx-sun-rays { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n@keyframes wx-fog-drift { 0% { transform: translateX(-25%); opacity: 0.3; } 50% { opacity: 0.65; } 100% { transform: translateX(25%); opacity: 0.3; } }\n@keyframes wx-shooting-star { 0%, 95% { opacity: 0; transform: translate(0,0) scale(0); } 96% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(40px,30px) scale(1); } }\n"}),
|
|
33
33
|
/* @__PURE__ */u("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${o.activeOpacity/100})`,backdropFilter:o.activeBlur>0?`blur(${o.activeBlur}px)`:void 0},children:/* @__PURE__ */f("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${Q}`,style:{height:110},children:[
|
|
34
|
-
/* @__PURE__ */u(
|
|
34
|
+
/* @__PURE__ */u(C,{code:j.code,isDay:j.isDay}),
|
|
35
35
|
/* @__PURE__ */f("div",{className:"relative z-10 px-3 py-3 flex flex-col h-full justify-between",children:[
|
|
36
36
|
/* @__PURE__ */f("div",{className:"flex items-start justify-between gap-2",children:[
|
|
37
37
|
/* @__PURE__ */f("div",{className:"min-w-0 flex-1",children:[
|
|
38
|
-
/* @__PURE__ */u("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),
|
|
38
|
+
/* @__PURE__ */u("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),Z.showLocalTime&&/* @__PURE__ */u("div",{className:"text-2xs opacity-90 leading-tight tabular-nums drop-shadow-sm",children:v(j.timezone,Z.use24Hour)})]}),
|
|
39
39
|
/* @__PURE__ */u("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:R(j.temp)})]}),
|
|
40
40
|
/* @__PURE__ */f("div",{className:"flex items-end justify-between gap-2",children:[
|
|
41
41
|
/* @__PURE__ */f("div",{className:"flex items-center gap-2 min-w-0",children:[
|
|
42
42
|
/* @__PURE__ */u("span",{className:"text-lg leading-none drop-shadow-sm",children:$}),
|
|
43
43
|
/* @__PURE__ */u("span",{className:"text-2xs font-medium drop-shadow-sm truncate",children:V})]}),
|
|
44
44
|
/* @__PURE__ */f("span",{className:"text-2xs opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",R(j.high)," L:",R(j.low)]})]})]})]})}),
|
|
45
|
-
/* @__PURE__ */f(s,{open:
|
|
45
|
+
/* @__PURE__ */f(s,{open:A,onClose:()=>P(!1),title:"Weather Settings",appearance:J,onAppearanceChange:M,onSave:()=>{n(T),N(J),I({weather_prefs:O}),localStorage.setItem(x,T),localStorage.setItem(g,JSON.stringify(J)),P(!1)},children:[
|
|
46
46
|
/* @__PURE__ */u("div",{className:"space-y-3",children:/* @__PURE__ */f("div",{children:[
|
|
47
47
|
/* @__PURE__ */u("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
48
48
|
/* @__PURE__ */f("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
49
49
|
/* @__PURE__ */u("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
|
|
50
|
-
/* @__PURE__ */u("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */u("button",{onClick:()=>
|
|
50
|
+
/* @__PURE__ */u("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */u("button",{onClick:()=>G(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
|
|
51
51
|
/* @__PURE__ */f("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
52
52
|
/* @__PURE__ */u("span",{className:"text-sm text-gray-600 w-24",children:"Time Format"}),
|
|
53
|
-
/* @__PURE__ */u("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */u("button",{onClick:()=>
|
|
53
|
+
/* @__PURE__ */u("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */u("button",{onClick:()=>G(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
|
|
54
54
|
/* @__PURE__ */f("label",{className:"flex items-center gap-2 cursor-pointer",children:[
|
|
55
|
-
/* @__PURE__ */u("input",{type:"checkbox",checked:
|
|
55
|
+
/* @__PURE__ */u("input",{type:"checkbox",checked:O.showLocalTime,onChange:e=>G(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
|
|
56
56
|
/* @__PURE__ */u("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
|
|
57
57
|
/* @__PURE__ */f("div",{children:[
|
|
58
58
|
/* @__PURE__ */u("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
|
|
59
|
-
/* @__PURE__ */u("select",{value:
|
|
60
|
-
/* @__PURE__ */u("p",{className:"mt-1 text-2xs text-ink-faintest",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{
|
|
59
|
+
/* @__PURE__ */u("select",{value:T,onChange:e=>D(e.target.value),className:"w-full bg-surface-sunken border border-line rounded px-2 h-8 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */u("option",{value:e,children:e},e))}),
|
|
60
|
+
/* @__PURE__ */u("p",{className:"mt-1 text-2xs text-ink-faintest",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{P as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{AVAILABLE_CITIES as e,fetchCityWeather as t,cityClock as r,getCondition as n,toFahrenheit as s}from"./chunk-HYHZEQMG.js";import{loadAppearance as i,WidgetSettingsModal as a}from"./chunk-
|
|
1
|
+
import{AVAILABLE_CITIES as e,fetchCityWeather as t,cityClock as r,getCondition as n,toFahrenheit as s}from"./chunk-HYHZEQMG.js";import{loadAppearance as i,WidgetSettingsModal as a}from"./chunk-LBXKYVM3.js";import"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import"./chunk-LF27WIN2.js";import{useWidgetSettings as c}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as o}from"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as h,useEffect as l,useCallback as p}from"react";import{jsxs as u,Fragment as k,jsx as d}from"react/jsx-runtime";var j="world_clock_appearance",g=["London","Shanghai","New York"];function x(){const{prefs:x,save:b}=o(),[N,f]=h(()=>i(j)),[y,v]=h(!1),[w,F]=h([]),[H,P]=h(N),J={useFahrenheit:!!x.weather_prefs?.useFahrenheit},[B,D]=h(J),[Z,C]=h(()=>/* @__PURE__ */new Date);l(()=>{const e=setInterval(()=>C(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const M=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),O=x.world_clocks,R=(()=>{if(!Array.isArray(O)||0===O.length)return g;const t=[];for(const r of O){const n=e[r]?r:M[r];n&&!t.includes(n)&&t.push(n)}return t.length?t:g})(),[V,G]=h({}),[L,T]=h(!0);l(()=>{let e=!1;return T(!0),(async()=>{const r={};await Promise.all(R.map(async e=>{const n=await t(e);n&&(r[e]=n)})),e||(G(r),T(!1))})(),()=>{e=!0}},[R.join(",")]),c(p(()=>{F([...R]),P({...N}),D({...J}),v(!0)},[R.join(","),N,J.useFahrenheit]));const Y=e=>J.useFahrenheit?`${s(e)}°`:`${e}°`;/* @__PURE__ */
|
|
2
2
|
return u(k,{children:[
|
|
3
|
-
/* @__PURE__ */d("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${N.activeOpacity/100})`,backdropFilter:N.activeBlur>0?`blur(${N.activeBlur}px)`:void 0},children:/* @__PURE__ */u("div",{className:"divide-y divide-gray-200",children:[
|
|
3
|
+
/* @__PURE__ */d("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${N.activeOpacity/100})`,backdropFilter:N.activeBlur>0?`blur(${N.activeBlur}px)`:void 0},children:/* @__PURE__ */u("div",{className:"divide-y divide-gray-200",children:[L&&R.every(e=>!V[e])&&/* @__PURE__ */d(m,{size:"sm",padding:"py-6",label:"Loading"}),R.map(t=>{const s=V[t],{time:i,ampm:a}=r(e[t]?.tz,Z);if(!s)/* @__PURE__ */
|
|
4
4
|
return u("div",{className:"px-4 py-3",children:[
|
|
5
5
|
/* @__PURE__ */u("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
6
6
|
/* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
|
|
@@ -10,7 +10,7 @@ return u("div",{className:"px-4 py-3",children:[
|
|
|
10
10
|
return u("div",{className:"px-4 py-3",children:[
|
|
11
11
|
/* @__PURE__ */u("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
12
12
|
/* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
|
|
13
|
-
/* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:
|
|
13
|
+
/* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:Y(s.temp)})]}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"flex items-center justify-between gap-2 mt-2 text-2xs",children:[
|
|
15
15
|
/* @__PURE__ */u("div",{className:"flex items-center gap-2 min-w-0 text-ink-faint",children:[
|
|
16
16
|
/* @__PURE__ */d("span",{className:"text-base leading-none shrink-0",children:o}),
|
|
@@ -18,15 +18,15 @@ return u("div",{className:"px-4 py-3",children:[
|
|
|
18
18
|
/* @__PURE__ */d("span",{className:"text-3xs font-medium ml-0.5 opacity-70",children:a})]}),
|
|
19
19
|
/* @__PURE__ */d("span",{className:"text-gray-300 shrink-0",children:"·"}),
|
|
20
20
|
/* @__PURE__ */d("span",{className:"truncate",children:c})]}),
|
|
21
|
-
/* @__PURE__ */u("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",
|
|
22
|
-
/* @__PURE__ */u(a,{open:y,onClose:()=>v(!1),title:"World Clock Settings",appearance:
|
|
21
|
+
/* @__PURE__ */u("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",Y(s.high)," L:",Y(s.low)]})]})]},t)})]})}),
|
|
22
|
+
/* @__PURE__ */u(a,{open:y,onClose:()=>v(!1),title:"World Clock Settings",appearance:H,onAppearanceChange:P,onSave:()=>{0!==w.length&&(b({world_clocks:w,weather_prefs:{...x.weather_prefs??{},useFahrenheit:B.useFahrenheit}}),f(H),localStorage.setItem(j,JSON.stringify(H)),v(!1))},children:[
|
|
23
23
|
/* @__PURE__ */u("div",{children:[
|
|
24
24
|
/* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
25
25
|
/* @__PURE__ */u("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
26
26
|
/* @__PURE__ */d("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
|
|
27
|
-
/* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>
|
|
27
|
+
/* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>D(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(B.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
|
|
28
28
|
/* @__PURE__ */d("p",{className:"text-2xs text-ink-faintest mt-1",children:"Shared with the Weather widget."})]}),
|
|
29
29
|
/* @__PURE__ */u("div",{children:[
|
|
30
30
|
/* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
|
|
31
31
|
/* @__PURE__ */d("div",{className:"grid grid-cols-2 gap-1 max-h-56 overflow-y-auto",children:Object.keys(e).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 text-sm py-1 cursor-pointer hover:bg-gray-50 rounded px-2",children:[
|
|
32
|
-
/* @__PURE__ */d("input",{type:"checkbox",checked:w.includes(e),onChange:()=>
|
|
32
|
+
/* @__PURE__ */d("input",{type:"checkbox",checked:w.includes(e),onChange:()=>F(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500 h-3.5 w-3.5"}),e]},e))})]})]})]})}export{x as default};
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { UIMessage, FileUIPart } from 'ai';
|
|
4
|
-
import { a as IconName } from '../names-
|
|
4
|
+
import { a as IconName } from '../names-Bw6ChIJl.js';
|
|
5
5
|
import { MarkdownTableAction } from '../shell/Markdown.js';
|
|
6
6
|
|
|
7
7
|
/** The conversation the server keeps for this chat. `guestToken` is set for an
|
package/dist/ai/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{StepChainItem as e,StepChain as t}from"../chunk-Z2Z653OO.js";import{Markdown as n}from"../chunk-NPBRNEMR.js";import{Divider as a}from"../chunk-DFOFEBYX.js";import{Avatar as r}from"../chunk-SCNQK5NF.js";import
|
|
2
|
+
import{StepChainItem as e,StepChain as t}from"../chunk-Z2Z653OO.js";import{Markdown as n}from"../chunk-NPBRNEMR.js";import{Divider as a}from"../chunk-DFOFEBYX.js";import{Avatar as r}from"../chunk-SCNQK5NF.js";import{useContextMenu as s,ContextMenu as o}from"../chunk-MF7OELXP.js";import{Banner as i}from"../chunk-OSMRYND3.js";import"../chunk-UJUTS6LJ.js";import"../chunk-Z5TE3MEG.js";import{AttachmentDropZone as l}from"../chunk-43YU7YWL.js";import{Input_default as c}from"../chunk-BYTQRQ5P.js";import{CloseGlyph as d}from"../chunk-TAIH2VIW.js";import"../chunk-TAB3K2WF.js";import"../chunk-AYZY3YNC.js";import{useFileIntake as u,humanSize as p,FileIntakeAlert as m}from"../chunk-TNGIXSTM.js";import{parseChartSpec as h}from"../chunk-CR7T435F.js";import{SpecChart as f}from"../chunk-CMEPDSYB.js";import{formatBytes as g}from"../chunk-OJI4ROSD.js";import{formatTime as x}from"../chunk-NHKT5IH6.js";import"../chunk-36BRD5J3.js";import"../chunk-JRQMX4PK.js";import"../chunk-LF27WIN2.js";import"../chunk-P5TSGXL4.js";import{FlowChart as b}from"../chunk-2EBHJGMM.js";import{parseFlowSpec as v}from"../chunk-FAERBT6Y.js";import"../chunk-SAMPXZF3.js";import"../chunk-CK2YOGUS.js";import"../chunk-A6TOHNJY.js";import"../chunk-VFC6QUEN.js";import"../chunk-AQVPWUJ3.js";import"../chunk-465RRWBY.js";import{ChartSkeleton as y}from"../chunk-MEFB2KGF.js";import"../chunk-CNYAHYE6.js";import"../chunk-NJY4HPNB.js";import"../chunk-PM6HY5BH.js";import"../chunk-DWGYC7OD.js";import{IconButton_default as w}from"../chunk-4YH7U7WL.js";import"../chunk-ABIWAS5K.js";import"../chunk-P56YLT73.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import{Button_default as k}from"../chunk-37FQVY2O.js";import"../chunk-TSZPGDU3.js";import{Icon as N}from"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import{SpinnerRing as A}from"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-FAPZFMS3.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import{createShellPortal as C}from"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-LYGIOJ3J.js";import"../chunk-MRJKZWWV.js";import"../chunk-S4RD6UJU.js";import"../chunk-LLSGIMLG.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as T}from"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{useShellStrings as j}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{useRef as S,useEffect as $,useState as R,Fragment as O,useId as _,useLayoutEffect as M,useCallback as D,useMemo as I}from"react";import{isToolUIPart as P,getToolName as L,DefaultChatTransport as z,lastAssistantMessageIsCompleteWithApprovalResponses as F}from"ai";import{jsx as B,jsxs as E,Fragment as U}from"react/jsx-runtime";import{useChat as q}from"@ai-sdk/react";function H(e){if(!P(e))return null;const t=e;return{toolName:L(e),toolCallId:t.toolCallId,state:t.state,input:t.input,output:t.output,errorText:t.errorText,approvalId:t.approval?.id,approved:t.approval?.approved}}function W(e){const t=/* @__PURE__ */new Map;for(const n of e.parts){if("data-tool-summary"!==n.type)continue;const e=n.data;e&&"string"==typeof e.tool_call_id&&Array.isArray(e.rows)&&e.rows.length>0&&t.set(e.tool_call_id,e)}return t}function Y(e){const t=/* @__PURE__ */new Map;for(const n of e.parts){if("data-file"!==n.type)continue;const e=n.data;e&&"string"==typeof e.id&&"string"==typeof e.filename&&t.set(e.id,e)}return[...t.values()]}function Q(e){return e.parts.map(e=>"text"===e.type?e.text:"").join("")}var J="efficient-attachment:";function G(e){return{type:"file",mediaType:e.content_type,filename:e.filename,url:`${J}${e.id}`,providerMetadata:{efficient:{size:e.size}}}}function Z(e){const t=[];for(const n of e.parts){if("file"!==n.type||!n.url.startsWith(J))continue;const e=n.providerMetadata?.efficient?.size;t.push({id:n.url.slice(21),filename:n.filename??"",content_type:n.mediaType,size:"number"==typeof e?e:0})}return t}var K=/* @__PURE__ */new Set(["data-conversation","data-plan","data-followups","data-choices","data-tool-summary","data-error","data-file","data-approval","data-busy"]);function V(e,t){const n=e[e.length-1];if(!n)throw new Error("assistant chat: no message to send");if("user"===n.role){const e=Q(n).trim();if(!e)throw new Error("assistant chat: empty message");const a=Z(n).map(e=>e.id),r=n.metadata?.replyTo?.id;return{conversation_id:t,text:e,approvals:[],...a.length>0?{attachments:a}:{},...r?{reply_to:r}:{}}}const a=function(e){const t=[];for(const n of e.parts){if(!P(n))continue;const e=n;if("approval-responded"!==e.state||!e.approval||"boolean"!=typeof e.approval.approved)continue;const a={approval_id:e.approval.id,approved:e.approval.approved};e.approval.reason&&(a.reason=e.approval.reason),t.push(a)}return t}(n);if(0===a.length)throw new Error("assistant chat: no approval decision to send");return{conversation_id:t,text:null,approvals:a}}var X=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function ee(e,t,n=""){const a=[t.trim(),n.trim()].filter(Boolean).map(X);return 0!==a.length&&new RegExp(`(^|[^\\p{L}\\p{N}_@])(?:${a.join("|")})(?![\\p{L}\\p{N}_@])`,"iu").test(e)}function te(e,t){const n=("string"==typeof t?[t]:[...t]).map(e=>e.trim()).filter(Boolean).sort((e,t)=>t.length-e.length);if(!n.length||!e)return e?[{text:e,mention:!1}]:[];const a=[];let r=0;const s=new RegExp(`(^|[^\\p{L}\\p{N}_@])(${n.map(X).join("|")})(?![\\p{L}\\p{N}_@])`,"giu");for(const t of e.matchAll(s)){const n=(t.index??0)+t[1].length;n>r&&a.push({text:e.slice(r,n),mention:!1}),a.push({text:t[2],mention:!0}),r=n+t[2].length}return r<e.length&&a.push({text:e.slice(r),mention:!1}),a}function ne(e,t){return ee(e,t)?e:`${t.trim()} ${e.trimStart()}`}function ae(e){const t=e.map(e=>e.name).filter(Boolean);return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}var re=/* @__PURE__ */new Set(["proposed","approved","running"]);function se(e){return re.has(e.status)}function oe(e){const t=[];for(const n of e.parts)"data-plan"===n.type&&t.push(n.data);return t}function ie(e){const t=/* @__PURE__ */new Map;for(const n of e)for(const e of oe(n))t.delete(e.id),t.set(e.id,e);return t}function le(e){const t=[...ie(e).values()],n=t[t.length-1];if(!n)return null;if(se(n))return n;const a=e[e.length-1];return a&&"assistant"===a.role&&oe(a).some(e=>e.id===n.id)?n:null}function ce(e){const t={};return e.source&&e.source!==e.role&&(t.source=e.source),e.author&&(t.author=e.author),e.asked_by&&(t.askedBy=e.asked_by),e.created_at&&(t.createdAt=e.created_at),e.reply_to&&(t.replyTo=e.reply_to),"assistant"===e.role&&e.run_id&&(t.run_id=e.run_id,t.rating=e.rating??null),Object.keys(t).length>0?{metadata:t}:{}}function de(e,t){const n=/* @__PURE__ */new Map;for(const a of e.parts){if("data-approval"!==a.type)continue;const e=a.data,r=e?.[t];"string"==typeof e?.approval_id&&"string"==typeof r&&r&&n.set(e.approval_id,r)}return n}function ue(e){const t=e.messages.filter(e=>e.text).map(e=>({id:e.id,role:e.role,parts:[...(e.attachments??[]).map(G),{type:"text",text:e.text},...(e.files??[]).map(e=>({type:"data-file",id:`file-${e.id}`,data:e})),...e.update?[{type:"data-update",id:`update-${e.update.id}`,data:e.update}]:[]],...ce(e)})),n=(e.plans??[]).filter(se);return(e.pending_approvals.length>0||n.length>0)&&t.push({id:`pending-approvals-${e.id}`,role:"assistant",parts:[...n.map(e=>({type:"data-plan",id:e.id,data:e})),...e.pending_approvals.map(e=>({type:`tool-${e.tool_name}`,toolCallId:e.tool_call_id??e.approval_id,state:"approval-requested",input:e.input,approval:{id:e.approval_id}})),...e.pending_approvals.filter(e=>e.expires_at||e.notice).map(e=>({type:"data-approval",id:e.approval_id,data:{approval_id:e.approval_id,expires_at:e.expires_at,...e.notice?{notice:e.notice}:{}}}))]}),t}function pe(e,t){const n=e?.message?.trim();if(!n)return t;if(n.startsWith("{")){try{const e=JSON.parse(n);for(const t of["detail","errorText","message","title","error"]){const n=e[t];if("string"==typeof n&&n.trim())return n.trim()}for(const t of Object.values(e)){const e=Array.isArray(t)?t[0]:void 0;if("string"==typeof e&&e.trim()&&e.length<=400)return e.trim()}}catch{return t}return t}return n.startsWith("<")||n.length>400?t:n}var me=/^(load failed|failed to fetch|network ?error( when attempting to fetch resource)?|(the )?network connection was lost|error in input stream|terminated)\.?$/i;function he(e){return!(!e||"AbortError"===e.name)&&me.test(e.message?.trim()??"")}var fe=/* @__PURE__ */new Set(["budget_reached","not_permitted"]);function ge(e,t,n){return he(e)?{text:n.connectionDropped,retryable:!0}:{text:pe(e,n.genericError),retryable:!(t&&fe.has(t))}}function xe(e){const t=e[e.length-1];if(!t)return!1;if("user"===t.role)return""!==Q(t).trim();const n=e[e.length-2];return!(!n||"user"!==n.role||!Q(n).trim())&&!t.parts.some(e=>void 0!==H(e)?.approvalId)}var be=["👍","✅","👀"],ve=["👍","👎","❤️","😂","😮","😢","🙏","🎉","✅","❌","👀","🔥","💯","🚀","👏","🙌","😀","😅","🤔","😬","🤝","💪","📦","🚚","📅","⏰","💰","📈","⚠️","❓","➕","👌"];function ye(e,t,n="You"){const a=e.names.map(a=>t&&a===t&&e.mine?n:a),r=e.mine?[n,...a.filter(e=>e!==n)]:a;return r.length<=1?r[0]??"":`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`}function we({onPick:e,onClose:t,label:n="Add reaction"}){const a=S(null);$(()=>{const e=e=>{a.current&&!a.current.contains(e.target)&&t()};return document.addEventListener("mousedown",e),a.current?.querySelector("button")?.focus(),()=>document.removeEventListener("mousedown",e)},[t]);/* @__PURE__ */
|
|
3
3
|
return B("div",{ref:a,role:"dialog","aria-label":n,className:"absolute z-20 mt-1 grid w-max grid-cols-8 gap-0.5 rounded-md border border-line bg-surface p-1 shadow-lg","data-emoji-picker":"",onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),t())},children:ve.map(n=>/* @__PURE__ */B("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-base hover:bg-surface-sunken focus-visible:bg-surface-sunken","aria-label":n,onClick:()=>{e(n),t()},children:n},n))})}function ke({onReact:e,label:t="Add reaction"}){const[n,a]=R(!1);/* @__PURE__ */
|
|
4
4
|
return E("span",{className:"relative flex items-center gap-0.5","data-reaction-bar":"",children:[be.map(t=>/* @__PURE__ */B("button",{type:"button",className:"flex h-6 w-6 items-center justify-center rounded text-sm hover:bg-surface-sunken","aria-label":`React ${t}`,title:`React ${t}`,onClick:()=>e(t),children:t},t)),
|
|
5
5
|
/* @__PURE__ */B(w,{size:"sm",variant:"ghost","aria-label":t,title:t,"aria-haspopup":"dialog",onClick:()=>a(e=>!e),children:/* @__PURE__ */B(N,{name:"face-smile",className:"h-3.5 w-3.5"})}),n&&/* @__PURE__ */B("span",{className:"absolute right-0 top-full",children:/* @__PURE__ */B(we,{label:t,onPick:e,onClose:()=>a(!1)})})]})}function Ne({reactions:e,onToggle:t,selfName:n,label:a="Add reaction"}){const[r,s]=R(!1);return e.length?/* @__PURE__ */E("div",{className:"relative mt-1 flex flex-wrap items-center gap-1","data-reactions":"",children:[e.map(e=>{const a=ye(e,n),r="inline-flex h-6 items-center gap-1 rounded-full border px-2 text-xs tabular-nums "+(e.mine?"border-accent-border bg-accent-tint text-accent-text":"border-line bg-surface text-ink");/* @__PURE__ */
|
|
@@ -49,12 +49,12 @@ return E("div",{className:"flex items-center gap-2 text-sm text-ink-faint","data
|
|
|
49
49
|
/* @__PURE__ */B("span",{className:"sr-only",children:r}),
|
|
50
50
|
/* @__PURE__ */B(Ke,{}),
|
|
51
51
|
/* @__PURE__ */B("span",{"aria-hidden":"true",className:"min-w-0 truncate",children:`${l}…`}),
|
|
52
|
-
/* @__PURE__ */B("span",{"aria-hidden":"true",className:"shrink-0 text-xs tabular-nums",children:a.replace("{seconds}",String(i))})]})}function Xe({labels:e,placeholder:t,busy:n,focusWhen:a,onSend:r,onStop:s,onNewChat:o,actions:i,attachments:
|
|
53
|
-
/* @__PURE__ */B("span",{role:"status",className:"min-w-0 flex-1 truncate "+(H?"text-accent-text":"text-ink-faint"),children:Y}),Q&&/* @__PURE__ */B(k,{type:"button",size:"sm",variant:"ghost",onClick:()=>{Q.onClick(),M.current?.focus()},children:Q.label})]}):null,G=/* @__PURE__ */E("form",{className:"flex items-end gap-1 p-1",onSubmit:e=>{e.preventDefault(),q()},children:[o&&/* @__PURE__ */B(w,{type:"button",variant:"ghost","aria-label":e.newChat,title:e.newChat,onClick:o,children:/* @__PURE__ */B(N,{name:"compose"})}),
|
|
54
|
-
/* @__PURE__ */B("textarea",{ref:M,"aria-label":e.inputLabel,placeholder:t,rows:1,value:C,onChange:e=>T(e.target.value),onInput:F,onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing)return e.preventDefault(),void q();"Escape"===e.key&&v&&y&&(e.preventDefault(),y())},className:"block max-h-48 min-w-0 flex-1 resize-none overflow-y-auto bg-transparent py-1 text-sm leading-6 text-ink-strong outline-none placeholder:text-[color:var(--ink-placeholder)] "+(o||
|
|
52
|
+
/* @__PURE__ */B("span",{"aria-hidden":"true",className:"shrink-0 text-xs tabular-nums",children:a.replace("{seconds}",String(i))})]})}function Xe({labels:e,placeholder:t,busy:n,focusWhen:a,onSend:r,onStop:s,onNewChat:o,actions:i,attachments:c,people:h,assistantDecides:f,deciding:g,quiet:x,onAskToReply:b,quote:v,onClearQuote:y}){const[C,T]=R(""),[O,_]=R(!1),M=S(null),I=function(e){const[t,n]=R([]),a=S(0),r=S(!0);$(()=>()=>{r.current=!1},[]);const s=e?.upload,o=D(e=>{if(s)for(const t of e){const e=a.current++;n(n=>[...n,{key:e,name:t.name,size:t.size}]),s(t).then(t=>{r.current&&n(n=>n.map(n=>n.key===e?{...n,attachment:t}:n))},t=>{const a=t instanceof Error&&t.message?t.message:String(t);r.current&&n(t=>t.map(t=>t.key===e?{...t,error:a}:t))})}},[s]),i=t.some(e=>!e.attachment&&!e.error),l=t.flatMap(e=>e.attachment?[e.attachment]:[]);return{pending:t,add:o,remove:e=>n(t=>t.filter(t=>t.key!==e)),clear:()=>n([]),uploading:i,ready:l}}(c),P=j().files,L=u({accept:c?.accept,maxSizeBytes:c?.maxSizeBytes,maxFiles:c?.maxFiles??5,acceptHint:c?.acceptHint,currentCount:I.pending.length,disabled:!c,onAccept:I.add});$(()=>{a&&M.current?.focus()},[a]);const z=v?.id;$(()=>{z&&M.current?.focus()},[z]);const F=()=>{const e=M.current;e&&(e.value&&0!==e.clientWidth?(e.style.height="auto",e.style.height=`${e.scrollHeight}px`):e.style.height="")};$(F,[C]),$(()=>{const e=M.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=e.clientWidth;const n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,F())});return n.observe(e),()=>n.disconnect()},[]);const U=n||g||I.uploading||!C.trim(),q=()=>{U||(r(C,I.ready,{peopleOnly:!!f&&O,...v?{reply_to:v.id}:{}}),T(""),I.clear(),L.clearRejections(),v&&y?.())},H=!!h&&(ee(C,e.assistantMention,e.assistantName)||I.pending.length>0),W=!!f&&!O,Y=H?e.toAssistant:W?e.assistantDecides:e.toPeople.replace("{names}",h??""),Q=H||g?null:f?{label:W?e.peopleOnly:e.letAssistantDecide,onClick:()=>_(W)}:{label:e.askAssistant,onClick:()=>T(t=>ne(t,e.assistantMention))},J=h?/* @__PURE__ */E("div",{className:"flex items-center gap-2 px-3 pt-1 text-xs",children:[
|
|
53
|
+
/* @__PURE__ */B("span",{role:"status",className:"min-w-0 flex-1 truncate "+(H?"text-accent-text":"text-ink-faint"),children:Y}),Q&&/* @__PURE__ */B(k,{type:"button",size:"sm",variant:"ghost",onClick:()=>{Q.onClick(),M.current?.focus()},children:Q.label})]}):null,G=/* @__PURE__ */E("form",{className:"flex items-end gap-1 p-1",onSubmit:e=>{e.preventDefault(),q()},children:[o&&/* @__PURE__ */B(w,{type:"button",variant:"ghost","aria-label":e.newChat,title:e.newChat,onClick:o,children:/* @__PURE__ */B(N,{name:"compose"})}),c&&/* @__PURE__ */B(w,{type:"button",variant:"ghost","aria-label":e.attach,title:e.attach,onClick:L.open,disabled:n,children:/* @__PURE__ */B(N,{name:"add"})}),
|
|
54
|
+
/* @__PURE__ */B("textarea",{ref:M,"aria-label":e.inputLabel,placeholder:t,rows:1,value:C,onChange:e=>T(e.target.value),onInput:F,onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing)return e.preventDefault(),void q();"Escape"===e.key&&v&&y&&(e.preventDefault(),y())},className:"block max-h-48 min-w-0 flex-1 resize-none overflow-y-auto bg-transparent py-1 text-sm leading-6 text-ink-strong outline-none placeholder:text-[color:var(--ink-placeholder)] "+(o||c?"px-1":"px-2")}),i?.map(e=>e.icon?/* @__PURE__ */B(w,{type:"button",variant:"ghost","aria-label":e.label,title:e.label,disabled:!C.trim(),onClick:()=>e.onSelect(C.trim()),children:/* @__PURE__ */B(N,{name:e.icon})},e.key):/* @__PURE__ */B(k,{type:"button",variant:"ghost",disabled:!C.trim(),onClick:()=>e.onSelect(C.trim()),children:e.label},e.key)),/* @__PURE__ */B(w,n?{type:"button",variant:"ghost","aria-label":e.stop,title:e.stop,onClick:s,children:/* @__PURE__ */B(N,{name:"stop-circle"})}:{type:"submit",variant:"ghost","aria-label":e.send,title:e.send,disabled:U,children:/* @__PURE__ */B(N,{name:"enter"})})]}),Z=h&&g?/* @__PURE__ */B("div",{className:"px-1 pb-1",children:/* @__PURE__ */B(Ve,{label:e.deciding,words:[],secondsLabel:e.waitingSeconds,steadyLabel:e.deciding})}):h&&x&&b?/* @__PURE__ */E("div",{className:"flex items-center gap-2 px-1 pb-1 text-xs text-ink-faint",children:[
|
|
55
55
|
/* @__PURE__ */B(Ke,{resting:!0}),
|
|
56
56
|
/* @__PURE__ */B("span",{role:"status",className:"min-w-0 flex-1 truncate",children:e.notReplied}),
|
|
57
|
-
/* @__PURE__ */B(k,{type:"button",size:"sm",variant:"secondary",onClick:b,children:e.askToReply})]}):null,K=v?/* @__PURE__ */B(We,{quote:v,labels:e,onClear:y?()=>{y(),M.current?.focus()}:void 0}):null,V="rounded-2xl border border-line bg-surface shadow-sm transition-colors focus-within:border-line-strong";return
|
|
57
|
+
/* @__PURE__ */B(k,{type:"button",size:"sm",variant:"secondary",onClick:b,children:e.askToReply})]}):null,K=v?/* @__PURE__ */B(We,{quote:v,labels:e,onClear:y?()=>{y(),M.current?.focus()}:void 0}):null,V="rounded-2xl border border-line bg-surface shadow-sm transition-colors focus-within:border-line-strong";return c?/* @__PURE__ */E(l,{intake:L,className:"px-3 pt-2 pb-3",children:[Z,
|
|
58
58
|
/* @__PURE__ */E("div",{className:V,children:[I.pending.length>0&&/* @__PURE__ */B("ul",{className:"flex flex-wrap gap-2 px-3 pt-3",children:I.pending.map(t=>/* @__PURE__ */E("li",{className:"flex max-w-full items-center gap-2 rounded-md border py-1 pl-2 pr-1 text-xs "+(t.error?"border-red-200 bg-red-50 text-red-700":"border-gray-200 bg-gray-50 text-gray-700"),children:[t.attachment||t.error?/* @__PURE__ */B(N,{name:"page",size:14,"aria-hidden":"true"}):/* @__PURE__ */B("span",{role:"status","aria-label":e.attaching,className:"inline-flex",children:/* @__PURE__ */B(A,{className:"h-3 w-3"})}),
|
|
59
59
|
/* @__PURE__ */B("span",{className:"min-w-0 truncate",title:t.error??t.name,children:t.name}),
|
|
60
60
|
/* @__PURE__ */B("span",{className:"shrink-0 tabular-nums text-gray-400",children:p(t.size,P)}),
|
|
@@ -97,11 +97,11 @@ return E("li",{children:[
|
|
|
97
97
|
/* @__PURE__ */B("div",{className:"font-medium text-gray-900",children:Mt(e,r)}),e.title&&/* @__PURE__ */B("div",{className:"text-xs text-gray-600",children:e.title}),t.length>0&&/* @__PURE__ */B("dl",{className:"mt-1 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-xs",children:t.map(e=>/* @__PURE__ */E("div",{className:"contents",children:[
|
|
98
98
|
/* @__PURE__ */B("dt",{className:"text-gray-500",children:e.label}),
|
|
99
99
|
/* @__PURE__ */B("dd",{className:"min-w-0 break-words text-gray-800",children:e.value})]},e.label))})]},e.key)})}),
|
|
100
|
-
/* @__PURE__ */B(Tt,{approvalId:e,expiresAt:o,expired:"expired"===t?.status,approveLabel:a.approvePlan,labels:a,onApprove:s})]})}function zt({choices:e,label:t,onAnswer:n}){return 0===e.length?null:/* @__PURE__ */B("div",{role:"group","aria-label":t,className:"flex flex-col items-start gap-2 pl-1",children:e.map(e=>/* @__PURE__ */B(k,{size:"sm",variant:"secondary",onClick:()=>n(e),children:e},e))})}function Ft({questions:e,label:t,onAsk:n}){return 0===e.length?null:/* @__PURE__ */B("div",{role:"group","aria-label":t,className:"flex flex-wrap gap-2 pl-1",children:e.map(e=>/* @__PURE__ */B(k,{size:"sm",variant:"secondary",onClick:()=>n(e),children:e},e))})}function Bt({initial:e,labels:t,onRate:n}){const[a,r]=R(e??null),[s,o]=R(!1),[i,
|
|
101
|
-
return B(w,{size:"sm","aria-label":n,title:n,"aria-pressed":a?.verdict===e,disabled:h,onClick:()=>{(async e=>{if(u(!1),a?.verdict===e)return o(!1),void await g(null);const t=await g({verdict:e,note:""});o(t&&"down"===e),
|
|
100
|
+
/* @__PURE__ */B(Tt,{approvalId:e,expiresAt:o,expired:"expired"===t?.status,approveLabel:a.approvePlan,labels:a,onApprove:s})]})}function zt({choices:e,label:t,onAnswer:n}){return 0===e.length?null:/* @__PURE__ */B("div",{role:"group","aria-label":t,className:"flex flex-col items-start gap-2 pl-1",children:e.map(e=>/* @__PURE__ */B(k,{size:"sm",variant:"secondary",onClick:()=>n(e),children:e},e))})}function Ft({questions:e,label:t,onAsk:n}){return 0===e.length?null:/* @__PURE__ */B("div",{role:"group","aria-label":t,className:"flex flex-wrap gap-2 pl-1",children:e.map(e=>/* @__PURE__ */B(k,{size:"sm",variant:"secondary",onClick:()=>n(e),children:e},e))})}function Bt({initial:e,labels:t,onRate:n}){const[a,r]=R(e??null),[s,o]=R(!1),[i,l]=R(""),[d,u]=R(!1),[p,m]=R(!1),[h,f]=R(!1),g=async e=>{const t=a;r(e),m(!1),f(!0);try{return await n(e),!0}catch{return r(t),m(!0),!1}finally{f(!1)}},x=e=>{const n="up"===e?t.rateUp:t.rateDown;/* @__PURE__ */
|
|
101
|
+
return B(w,{size:"sm","aria-label":n,title:n,"aria-pressed":a?.verdict===e,disabled:h,onClick:()=>{(async e=>{if(u(!1),a?.verdict===e)return o(!1),void await g(null);const t=await g({verdict:e,note:""});o(t&&"down"===e),l("")})(e)},children:/* @__PURE__ */B(N,{name:"hand-thumb-up",className:"down"===e?"h-3.5 w-3.5 rotate-180":"h-3.5 w-3.5"})})};/* @__PURE__ */
|
|
102
102
|
return E("div",{role:"group","aria-label":t.rateAnswer,className:"flex min-w-0 flex-1 flex-col gap-1",children:[
|
|
103
103
|
/* @__PURE__ */E("div",{className:"flex items-center gap-1",children:[x("up"),x("down"),d&&/* @__PURE__ */B("span",{role:"status",className:"px-1 text-xs text-gray-500",children:t.rateThanks}),p&&/* @__PURE__ */B("span",{role:"alert",className:"px-1 text-xs text-red-600",children:t.rateFailed})]}),s&&/* @__PURE__ */E("form",{className:"flex items-center gap-2",onSubmit:e=>{(async e=>{e.preventDefault();const t=i.trim();t&&!await g({verdict:"down",note:t})||(o(!1),u(Boolean(t)))})(e)},children:[
|
|
104
|
-
/* @__PURE__ */B("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */B(
|
|
104
|
+
/* @__PURE__ */B("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */B(c,{size:"sm","aria-label":t.rateNote,placeholder:t.rateNote,maxLength:500,value:i,onChange:e=>l(e.target.value),autoFocus:!0})}),
|
|
105
105
|
/* @__PURE__ */B(k,{type:"submit",size:"sm",variant:"secondary",disabled:h||!i.trim(),children:t.rateNoteSend}),
|
|
106
106
|
/* @__PURE__ */B(k,{type:"button",size:"sm",variant:"ghost",onClick:()=>o(!1),children:t.rateNoteSkip})]})]})}function Et(e,t){return n=>{if("chart"===n.lang){if(!n.closed)/* @__PURE__ */return B(y,{height:200});const e=h(n.code);return e?/* @__PURE__ */B(f,{spec:e}):null}if("flow"===n.lang){if(!n.closed)/* @__PURE__ */return B(y,{height:200});const a=v(n.code);return a?/* @__PURE__ */B(b,{spec:a,labels:{downloadPng:e.flowDownloadPng,downloadSvg:e.flowDownloadSvg,toPdf:e.flowToPdf},onToPdf:t?()=>t(e.flowToPdfText):void 0}):null}return null}}function Ut(e,t){return"approval-responded"===e.state&&t.some(t=>{return t.toolName===e.toolName&&"approval-requested"!==t.state&&(t.toolCallId===e.toolCallId||(n=t.input,a=e.input,JSON.stringify(n)===JSON.stringify(a)));var n,a})}function qt(e,t,n,a){const r=e.flatMap(e=>"tool"===e.kind?[$t(e.tool,n,a)]:[]);if(t){const e=r.find(e=>"running"===e.kind);return e?e.base:a.working}const s=[...new Set(r.map(e=>e.base))];return s.length>0?s.join(" · "):a.reasoning}function Ht({message:e,live:t,labels:n}){const a=Q(e),r=a.length>0,s=S(null),[o,i]=R(0);$(()=>{if(!t)return;null===s.current&&(s.current=performance.now());const e=setInterval(()=>i(performance.now()-(s.current??performance.now())),500);return()=>clearInterval(e)},[t]);const l=e.metadata?.usage;let c=null;return t?c=r?bt(a,o,n):null:l&&(c=xt(l,n)),c?/* @__PURE__ */B("div",{className:"px-1 text-xs leading-6 tabular-nums text-gray-500",children:c}):null}function Wt({files:e,labels:t,onOpen:n,start:a}){const r="flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-white px-2 py-1 text-xs text-gray-700";/* @__PURE__ */
|
|
107
107
|
return B("ul",{className:a?"mt-1 flex flex-wrap gap-2":"flex max-w-[85%] flex-wrap justify-end gap-2",children:e.map(e=>{const a=/* @__PURE__ */E(U,{children:[
|
package/dist/apps/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{
|
|
2
|
+
export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-WAUD3BFJ.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-ZKXDWUNI.js";import{setSpreadsheetPreview as e}from"../chunk-ST6FPYJ7.js";export{FILES_OFFICE_EXTENSIONS,FILES_ROLE_LABELS,FilesQuotaError,SPREADSHEET_PREVIEW_UPDATE_EVENT,claimSpreadsheetPreviewStage,createFileServerStore,filesRoleWrites,peekSpreadsheetPreviewStage,setFilesStore,setSpreadsheetPreview}from"../chunk-ST6FPYJ7.js";import{setPdfPreview as t}from"../chunk-I4RJAMLJ.js";export{setPdfPreview}from"../chunk-I4RJAMLJ.js";import"../chunk-MIHPFJCP.js";import"../chunk-VIPNHDD3.js";import"../chunk-KNUR2UEG.js";import"../chunk-JDCM2VHG.js";import"../chunk-PSVGB7KT.js";import"../chunk-5A7MWTXX.js";import"../chunk-YI4T5I5D.js";import"../chunk-TJ5YMXVB.js";import"../chunk-OLXUMB2V.js";import"../chunk-R7OZ2AQD.js";import"../chunk-ZLB5GRL6.js";import"../chunk-EIFNESXS.js";import"../chunk-PO2KNVCC.js";import"../chunk-CJ4OEY3T.js";import"../chunk-LLXI57MB.js";import"../chunk-NQWORKZD.js";import"../chunk-VWGWZY7A.js";import"../chunk-DBQNYJZ6.js";import"../chunk-L2WQOJ3T.js";import"../chunk-5VJVEKVM.js";import"../chunk-YPXONNBV.js";import"../chunk-4PJFL26P.js";import"../chunk-2QY5BJLA.js";import"../chunk-UGTRSRIW.js";import"../chunk-POBVGDZP.js";import"../chunk-F3ZOO23R.js";import"../chunk-RO3M4JWS.js";import"../chunk-NJY4HPNB.js";import"../chunk-PM6HY5BH.js";import"../chunk-DWGYC7OD.js";import"../chunk-4YH7U7WL.js";import"../chunk-ABIWAS5K.js";import"../chunk-P56YLT73.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-37FQVY2O.js";import"../chunk-TSZPGDU3.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-FAPZFMS3.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-STKJA4PV.js";import"../chunk-GZ4AMXEU.js";import"../chunk-M6UKCZHT.js";import"../chunk-3AUPCKBR.js";import{toast_default as o}from"../chunk-VLT4ZEHT.js";import"../chunk-LYGIOJ3J.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{currentShellStrings as n}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{lazy as i}from"react";function r(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var s=/* @__PURE__ */new Set(["csv","tsv"]),c=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),m=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),a=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function u(e){const t=r(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":s.has(t)?"csv":m.has(t)?"image":a.has(t)?"3d":null}function p(e){window.open(e,"_blank","noopener,noreferrer")}async function l(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const n=await fetch(e);if(!n.ok)throw new Error(`fetch failed: ${n.status}`);return n.text()}function h(e,t){return(e instanceof Error?e.message:"")||t}async function k(i,s,m={}){const a=n().attachment,k=i?.url||"",j=i?.filename||a.fallbackName;if(!k&&!m.fetchBlob)return void o.error(a.noLink);const f=u(j)??u(k);if("csv"===f){try{e({csv:await l(k,m,i),filename:j}),s("/spreadsheet")}catch{o.error(a.spreadsheetFailed),k&&p(k)}return}if(c.has(r(j)||r(k)))return o.error(a.workbookUnavailable),void(k&&p(k));if(!f)return k?(o.info(a.noViewer),void p(k)):void o.error(a.noLink);if(!m.fetchBlob)return t({url:k,filename:j,kind:f}),void s("/preview");const d=t({filename:j,kind:f,converting:!0,convertingMessage:m.loadingMessage||a.loading});s("/preview");try{const e=await m.fetchBlob(i);d.update({url:URL.createObjectURL(e),filename:j,kind:f})}catch(e){d.update({filename:j,kind:f,converting:!1,convertingMessage:h(e,a.loadFailed)})}}function j(e,t,o={}){const i=n().attachment,s=[];let m=-1;return e.forEach((e,n)=>{const a=e?.url||"";if(!a&&!o.fetchBlob)return;const p=e?.filename||i.fallbackName;if(c.has(r(p)||r(a)))return;const l=u(p)??u(a);l&&"csv"!==l&&(n===t&&(m=s.length),s.push({att:e,sourceIndex:n,filename:p,url:a,kind:l}))}),{items:s,start:m}}async function f(e,o,i,r={}){const{items:s,start:c}=j(e,o,r);if(c<0||s.length<2){const t=e[o];return void(t&&await k(t,i,r))}const m=n().attachment,a=s.length;let u=null,p=-1;const l=e=>({position:{index:e,count:a},onPrevious:e>0?()=>{d(e-1)}:void 0,onNext:e<a-1?()=>{d(e+1)}:void 0}),f=e=>{u?u.update(e):(u=t(e),i("/preview"))};async function d(e){p=e;const{att:t,filename:o,url:n,kind:i}=s[e];if(r.fetchBlob){f({filename:o,kind:i,converting:!0,convertingMessage:r.loadingMessage||m.loading,...l(e)});try{const n=await r.fetchBlob(t),s=URL.createObjectURL(n);if(p!==e)return void URL.revokeObjectURL(s);f({url:s,filename:o,kind:i,...l(e)})}catch(t){if(p!==e)return;f({filename:o,kind:i,converting:!1,convertingMessage:h(t,m.loadFailed),...l(e)})}}else f({url:n,filename:o,kind:i,...l(e)})}await d(c)}var d=i(()=>import("../Calculator-VOZDVOYE.js")),P=i(()=>import("../Weather-WGLPPZPX.js")),w=i(()=>import("../CurrencyConverter-AMGFHBJE.js")),g=i(()=>import("../PomodoroTimer-77VMHGDE.js")),v=i(()=>import("../Notepad-L2WODBHG.js")),S=i(()=>import("../WorldClock-UY4B5VKZ.js")),L=i(()=>import("../Stock-PXLNR6A6.js")),E=i(()=>import("../Preview-FWN44NN2.js")),F=i(()=>import("../PdfViewer-KS2BCFSA.js")),B=i(()=>import("../Files-2EE24L5G.js")),N=i(()=>import("../Browser-TXL5U5PM.js")),T={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/notepad":{component:v,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:P,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:w,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:g,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:S,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:L,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},R={"/preview":{component:E,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/files":{component:B,label:"Files",size:"xl",appStyle:!0}},U={"/browser":{component:N,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},b={...T,...R,...U};export{N as Browser,d as Calculator,w as CurrencyConverter,B as Files,v as Notepad,F as PdfViewer,g as PomodoroTimer,E as Preview,L as Stock,P as Weather,S as WorldClock,u as attachmentKind,b as bundledApps,R as documentApps,k as openAttachment,f as openAttachments,T as utilityApps,j as viewableAttachments,U as webApps};
|