@remit/web-client-dist 0.0.569 → 0.0.571
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/assets/{BriefPane-C4qdevvj.js → BriefPane-C-AXD_S1.js} +1 -1
- package/assets/{CalendarComposePane-DYTk75gD.js → CalendarComposePane-ZInEcl83.js} +1 -1
- package/assets/{CalendarComposeSeed-DHxzgOBp.js → CalendarComposeSeed-BXablasw.js} +1 -1
- package/assets/{CalendarShell-urPv2Ap7.js → CalendarShell-D8PXYY5k.js} +1 -1
- package/assets/{EmptyState-DW9m2lvX.js → EmptyState-BdQOG7lh.js} +1 -1
- package/assets/{ErrorState-BRKdts_G.js → ErrorState-yTshApcZ.js} +1 -1
- package/assets/{FlaggedPane-DJzefBDR.js → FlaggedPane-DBMd-f82.js} +1 -1
- package/assets/{FullCompose-Da6so-wh.js → FullCompose-DFM5SSTD.js} +1 -1
- package/assets/MailListHeader-DixjeKWo.js +7 -0
- package/assets/{MailNav-DtB-SFXW.js → MailNav-B16LaKDW.js} +1 -1
- package/assets/{MailShell-ChH4WH5p.js → MailShell-D2tbOLnz.js} +1 -1
- package/assets/{MailViewChrome-DUkQ3XCS.js → MailViewChrome-B2e9uACs.js} +1 -1
- package/assets/{MailboxPane-AlIsjTqd.js → MailboxPane-CfT2HmEK.js} +1 -1
- package/assets/{NavMenuButton-Cd-vQTHA.js → NavMenuButton-DbwB8-EE.js} +1 -1
- package/assets/{OnboardingWizard-BrSKsD27.js → OnboardingWizard-BwDNIpbV.js} +1 -1
- package/assets/{OpenCalendarEvent-OnyM5Gmr.js → OpenCalendarEvent-Cp3Xxt88.js} +1 -1
- package/assets/{OutboxPane-DCvckDm-.js → OutboxPane-CW2jpqSm.js} +1 -1
- package/assets/_calendarObjectId-Bhzj_LOc.js +1 -0
- package/assets/_mailboxId-7CeQdqXt.js +1 -0
- package/assets/_messageId-9yyd8JQa.js +1 -0
- package/assets/_messageId-BjT0iqtE.js +1 -0
- package/assets/_messageId-DIrX2-NC.js +1 -0
- package/assets/_outboxMessageId-5Hilxc-o.js +1 -0
- package/assets/_recurrenceId-9zc7QOUi.js +1 -0
- package/assets/_threadId-BLPnJQ1O.js +1 -0
- package/assets/_threadId-Cj-AqWpe.js +1 -0
- package/assets/_threadId-DmnNT1YW.js +1 -0
- package/assets/{_view._date-JHbRwoWF.js → _view._date-vmYhsMe2.js} +1 -1
- package/assets/{accounts-B7u97VqP.js → accounts-B5b2n325.js} +1 -1
- package/assets/{advanced-CPfvy6Af.js → advanced-V_8Vc7Op.js} +1 -1
- package/assets/{appearance-Br9Kr3ss.js → appearance-B0Z3Sg7A.js} +1 -1
- package/assets/{attachment-file-C4FSwgIv.js → attachment-file-D1lRTIpJ.js} +1 -1
- package/assets/{attendee-row-D6gUCjbn.js → attendee-row-BY_sZYga.js} +1 -1
- package/assets/{avatar-DQ2Za_b5.js → avatar-Dc7q-vE0.js} +1 -1
- package/assets/{bottom-sheet-DeTeDdhV.js → bottom-sheet-Dj78OKpl.js} +1 -1
- package/assets/{brief-C4ZJVvSI.js → brief-Di6IdjaO.js} +1 -1
- package/assets/brief-pYORS2EQ.js +1 -0
- package/assets/{browser-ponyfill-DJl-hvK0.js → browser-ponyfill-Lmz1LgWx.js} +1 -1
- package/assets/{bug-D4vthdmR.js → bug-BCJlsHb-.js} +1 -1
- package/assets/{calendar-DETOK5EU.js → calendar-Cdtx6qRv.js} +1 -1
- package/assets/{calendar-color-CnMzTK_9.js → calendar-color-CREaSNOF.js} +1 -1
- package/assets/{calendar-event-chip-RDM5bPZZ.js → calendar-event-chip-PRMkWtmn.js} +1 -1
- package/assets/{calendars-D07uwzeX.js → calendars-BfHi1c8f.js} +1 -1
- package/assets/{card-DB95JOXm.js → card-Blb5LxlW.js} +1 -1
- package/assets/chevron-left-B5q2zkoV.js +1 -0
- package/assets/{circle-check-DTL_gl9V.js → circle-check-DQceIvPw.js} +1 -1
- package/assets/{circle-check-big-w157yjgs.js → circle-check-big-DrsWjtbF.js} +1 -1
- package/assets/{circle-help-D2hLsX4d.js → circle-help-C90h4Gxl.js} +1 -1
- package/assets/{clock-BAt8YXWX.js → clock-DJx8eT0h.js} +1 -1
- package/assets/compose._-_outboxMessageId_-Bx3jTrEX.js +1 -0
- package/assets/compose._-_outboxMessageId_-CCL9Z9Rr.js +1 -0
- package/assets/compose._-_outboxMessageId_-J5Xr0VYM.js +1 -0
- package/assets/compose._-_outboxMessageId_-OYQ8wE-O.js +1 -0
- package/assets/{config-import-qvff-XOD.js → config-import-zWUhkyrx.js} +1 -1
- package/assets/{confirm-dialog-DmMkRipf.js → confirm-dialog-BnvctSkU.js} +1 -1
- package/assets/{copy-BRGwXYIX.js → copy-CPegVmmX.js} +1 -1
- package/assets/{credential-steps-AWLHMdlu.js → credential-steps-03ZiFb9S.js} +1 -1
- package/assets/{download-BRMxQZ9H.js → download-DCjKcyoD.js} +1 -1
- package/assets/{file-json-t63BljCM.js → file-json-Bp9PxrXB.js} +1 -1
- package/assets/{filters-BTt3lCAB.js → filters-Cz6ACP3x.js} +1 -1
- package/assets/{flagged-DUGVCsxq.js → flagged-CVe-xaZ6.js} +1 -1
- package/assets/flagged-bqIrcL0D.js +1 -0
- package/assets/{folders-D9quIn8u.js → folders-D0RCMVTd.js} +1 -1
- package/assets/{help-copy-BJma-HMH.js → help-copy-Xy5HlVm9.js} +1 -1
- package/assets/{import-CZZBWvTv.js → import-DntPPUzf.js} +1 -1
- package/assets/index-4TyPLW-n.js +1 -0
- package/assets/index-9yyd8JQa.js +1 -0
- package/assets/index-BjT0iqtE.js +1 -0
- package/assets/index-BpsjtF88.js +1 -0
- package/assets/index-C-j9H2jQ.js +1 -0
- package/assets/index-CfHR_Ae8.js +1 -0
- package/assets/index-CmmqbTph.js +1 -0
- package/assets/{index-BstTD6DD.js → index-Dy5D6YkV.js} +4 -4
- package/assets/{index-s6tBUhDn.js → index-DyF2fU1Q.js} +1 -1
- package/assets/{index-COXmbPoi.js → index-ELhtBEwQ.js} +4 -4
- package/assets/index-drC6ZRdd.js +1 -0
- package/assets/index-iaeEYdB7.js +1 -0
- package/assets/{kbd-D6gO0HEI.js → kbd-6xrqVw1K.js} +1 -1
- package/assets/{labels-XYM303bf.js → labels-eMbeaPk4.js} +1 -1
- package/assets/{mail-BV5VD-Ar.js → mail-1kAZ-hEc.js} +1 -1
- package/assets/{mail-7UArrUpq.js → mail-w8cRSHpe.js} +1 -1
- package/assets/{map-pin-LNJtyvro.js → map-pin-pA2YiBQX.js} +1 -1
- package/assets/{menu-gXDy9USt.js → menu-BBzSZjBL.js} +1 -1
- package/assets/{new-D_pe05i6.js → new-a4cb6vhA.js} +1 -1
- package/assets/onboarding-B6cLhnyh.js +1 -0
- package/assets/{onboarding-completion-Bpw8967t.js → onboarding-completion-DPHalyAM.js} +1 -1
- package/assets/outbox-BMQSynaj.js +1 -0
- package/assets/{pencil-BQZnwNLu.js → pencil-DWkVPRF_.js} +1 -1
- package/assets/{refresh-cw-ZsadNdnS.js → refresh-cw-N6rrepD7.js} +1 -1
- package/assets/{rich-text-DzYAidk-.js → rich-text-CIfc5KKH.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-Bc5w98Dp.js → rich-text-spellcheck-worker-provider-B-dYPpIy.js} +1 -1
- package/assets/{rotate-ccw-M23y8ejM.js → rotate-ccw-Cq64A4JR.js} +1 -1
- package/assets/{roving-focus-DRUyjNlS.js → roving-focus-BOWQw34Y.js} +1 -1
- package/assets/{row-actions-DXchPOTt.js → row-actions-CHU1lTnr.js} +1 -1
- package/assets/{search-mirror-CZpxvipk.js → search-mirror-D__KCGFD.js} +1 -1
- package/assets/{search-token-index-B8GTncCY.js → search-token-index-RpS46UX-.js} +1 -1
- package/assets/{sections-DCf8ouIL.js → sections-DpPFeJvC.js} +1 -1
- package/assets/{senders-CXRiHhmT.js → senders-BzofDilD.js} +1 -1
- package/assets/{settings-screen-c-ew_2vr.js → settings-screen-CEtuw85p.js} +1 -1
- package/assets/settings-t8hjTuQb.js +1 -0
- package/assets/{shield-check-tsdxv3RF.js → shield-check-C-xWv7tn.js} +1 -1
- package/assets/{suggested-vips-B-ZJ_oSz.js → suggested-vips-D-TCsoQ_.js} +1 -1
- package/assets/{useCalendarData-DGI79lVd.js → useCalendarData-tBA8O6aY.js} +1 -1
- package/assets/{useCalendars-BTLkNtty.js → useCalendars-DmOIJuzJ.js} +1 -1
- package/assets/{useDebouncedValue-nhypL9_o.js → useDebouncedValue-cgYnkNgs.js} +1 -1
- package/assets/{useFilters-DorOGFhJ.js → useFilters-toZUnuEV.js} +1 -1
- package/assets/{useLabels-CUd5gWwV.js → useLabels-CuITaMaj.js} +1 -1
- package/assets/{useLayoutTier-wxSo1nDc.js → useLayoutTier-BiCLmmpl.js} +1 -1
- package/assets/{useMessageBodyContent-D8al5oah.js → useMessageBodyContent-Dqn8BKJN.js} +1 -1
- package/assets/{useQueries-BycE_mig.js → useQueries-BuVSZIL7.js} +1 -1
- package/assets/{useRefreshControl-DIWeCjZ5.js → useRefreshControl-BY8dJRFq.js} +1 -1
- package/assets/{useResultFolderIndex-jR4vl6Wy.js → useResultFolderIndex-Bh5N3vbq.js} +1 -1
- package/assets/useSearchTokenContext-BDaT1iE0.js +84 -0
- package/assets/{useSemanticSearch-C2nf4lR9.js → useSemanticSearch-Cr2T-SJl.js} +1 -1
- package/assets/{useSignature-WkO_w4sf.js → useSignature-Do1zcP6k.js} +1 -1
- package/assets/{window-jws2aQZO.js → window-BeKH_DgL.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/MailListHeader-CtLJO_kX.js +0 -7
- package/assets/_calendarObjectId-BTNDF6Go.js +0 -1
- package/assets/_mailboxId-DdOnexSL.js +0 -1
- package/assets/_messageId-BJI9HI_Y.js +0 -1
- package/assets/_messageId-DBf1JHiD.js +0 -1
- package/assets/_messageId-VgUm24uu.js +0 -1
- package/assets/_outboxMessageId-_ZBaATuU.js +0 -1
- package/assets/_recurrenceId-C83vhhhO.js +0 -1
- package/assets/_threadId-BKiZCs6r.js +0 -1
- package/assets/_threadId-CxJHY37y.js +0 -1
- package/assets/_threadId-DZiwTD8V.js +0 -1
- package/assets/brief-BUv_Vayt.js +0 -1
- package/assets/chevron-left-BGyOlrhE.js +0 -1
- package/assets/compose._-_outboxMessageId_-BLfWiKmz.js +0 -1
- package/assets/compose._-_outboxMessageId_-C2-ZvUCw.js +0 -1
- package/assets/compose._-_outboxMessageId_-CjcPajfp.js +0 -1
- package/assets/compose._-_outboxMessageId_-NBmfRz6x.js +0 -1
- package/assets/flagged-CPTPXLqu.js +0 -1
- package/assets/index-BESinRwS.js +0 -1
- package/assets/index-BJI9HI_Y.js +0 -1
- package/assets/index-BWinfpFM.js +0 -1
- package/assets/index-BbLX1tpD.js +0 -1
- package/assets/index-CWf3j_Bd.js +0 -1
- package/assets/index-D8UvRySx.js +0 -1
- package/assets/index-DBf1JHiD.js +0 -1
- package/assets/index-DOT9iKNA.js +0 -1
- package/assets/index-ef9ZOerK.js +0 -1
- package/assets/onboarding-Bes4tj0x.js +0 -1
- package/assets/outbox-DlE7p5GU.js +0 -1
- package/assets/settings-ejtLzHlz.js +0 -1
- package/assets/useSearchTokenContext-Q-PYaS79.js +0 -84
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import{cq as Y,r as h,j as a,t as b,I as X,h as Z,au as J,i as ee,aw as te,cG as se,bP as re,ac as ne,a0 as ae,X as oe,c$ as _,d0 as $,C as ie,ck as ce}from"./index-Dy5D6YkV.js";import{K as A}from"./kbd-6xrqVw1K.js";import{B as le,b as de}from"./useMessageBodyContent-Dqn8BKJN.js";import{i as ue}from"./search-scope-B5-OK3Cq.js";const me=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},fe=()=>`
|
|
2
|
+
/* Zero the UA default body margin and clamp the document to the iframe width so
|
|
3
|
+
wide author markup can't push the body (and the page) past the viewport. */
|
|
4
|
+
html, body {
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
}
|
|
9
|
+
body {
|
|
10
|
+
overflow-wrap: anywhere;
|
|
11
|
+
word-break: break-word;
|
|
12
|
+
}
|
|
13
|
+
/* Media never wider than the frame; keep aspect ratio when width is capped. */
|
|
14
|
+
img, video, iframe, svg, canvas {
|
|
15
|
+
max-width: 100% !important;
|
|
16
|
+
height: auto;
|
|
17
|
+
}
|
|
18
|
+
/* Fixed-width author tables (\`<table width="600">\`) collapse to fit. */
|
|
19
|
+
table {
|
|
20
|
+
max-width: 100% !important;
|
|
21
|
+
table-layout: auto;
|
|
22
|
+
}
|
|
23
|
+
/* Cells carry the fixed widths in real newsletters (\`<td width="600">\`);
|
|
24
|
+
cap them too or the table can't actually shrink. */
|
|
25
|
+
td, th {
|
|
26
|
+
max-width: 100% !important;
|
|
27
|
+
}
|
|
28
|
+
/* \`max-width\` alone can't beat an inline \`min-width\`; zeroing the min lets
|
|
29
|
+
flex / grid / table children actually collapse to the clamped width. */
|
|
30
|
+
* {
|
|
31
|
+
min-width: 0;
|
|
32
|
+
}
|
|
33
|
+
/* An author \`nowrap\` assumes a viewport as wide as the line. The frame is the
|
|
34
|
+
pane's width whatever the mail is, so a pinned paragraph turns reading one
|
|
35
|
+
sentence into a sideways drag — and inside an author \`overflow:hidden\` it is
|
|
36
|
+
cut mid-character with nothing left to scroll at all. Flowing text wraps. The
|
|
37
|
+
\`i\` flag is load-bearing: Outlook and older generators emit \`WHITE-SPACE:
|
|
38
|
+
NOWRAP\`, and an attribute value match is case-sensitive without it. */
|
|
39
|
+
[nowrap]:not(pre, code, pre *, code *),
|
|
40
|
+
[style*="nowrap" i]:not(pre, code, pre *, code *) {
|
|
41
|
+
white-space: normal !important;
|
|
42
|
+
}
|
|
43
|
+
/* Long unbroken strings (URLs, tokens) wrap instead of forcing a wide line. */
|
|
44
|
+
pre, code {
|
|
45
|
+
white-space: pre-wrap;
|
|
46
|
+
overflow-wrap: anywhere;
|
|
47
|
+
word-break: break-word;
|
|
48
|
+
}
|
|
49
|
+
/* Preformatted text keeps its spacing even where a nowrap is declared — on the
|
|
50
|
+
block or on a span inside it. \`normal\` would collapse the runs of spaces that
|
|
51
|
+
are the entire content of a \`pre\`, and the un-important rule above cannot
|
|
52
|
+
defend an inline style, so this wraps to \`pre-wrap\` instead of unwrapping. */
|
|
53
|
+
:is(pre, code, pre *, code *):is([nowrap], [style*="nowrap" i]) {
|
|
54
|
+
white-space: pre-wrap !important;
|
|
55
|
+
}
|
|
56
|
+
`,he=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},ge=/^(none|transparent|inherit|initial|unset)\s*$/i,I=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},pe=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!ge.test(r))return!0;s=t.exec(e)}return!1},be=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of I(e))if(pe(t))return!0;return!1},ye=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),xe=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),we=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),N=e=>{const t=e.toLowerCase();if(!t||ye.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},ve=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},ke=(e,t)=>{if(e&&we.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some(N):ve(s).some(N):!1},C=e=>{for(const t of B(e).matchAll(xe))if(ke(t[1],t[2]))return!0;return!1},O=new Set(["blockquote"]),Ae=e=>e.replace(/<!--[\s\S]*?-->/g,""),Se=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const d of o.matchAll(r))t.push({tag:n.toLowerCase(),style:d[1]??d[2]??""});return t},Ee=e=>[...B(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ne=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},Ce=e=>e.split(",").every(t=>O.has(Ne(t))),Te=e=>{const t=I(e),s=Ae(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of Se(s))if(!O.has(r)&&C(n))return!0;for(const r of t)for(const n of Ee(r))if(!Ce(n.selector)&&C(n.body))return!0;return!1},je=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],Le=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],Re="data:image/svg+xml,"+encodeURIComponent(`
|
|
57
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
|
58
|
+
<rect fill="#f0f0f0" width="100" height="100"/>
|
|
59
|
+
<text x="50" y="50" text-anchor="middle" dy=".3em" fill="#999" font-size="12">
|
|
60
|
+
Image blocked
|
|
61
|
+
</text>
|
|
62
|
+
</svg>
|
|
63
|
+
`),_e=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),$e=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Ie=(e={})=>{const t=Y(),s={FORBID_TAGS:je,FORBID_ATTR:Le,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(e.allowExternalImages||(r.tagName==="IMG"&&r.removeAttribute("srcset"),r.tagName==="SOURCE"&&(r.removeAttribute("srcset"),r.removeAttribute("src")),r.tagName==="VIDEO"&&r.removeAttribute("poster")),r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const d=n.slice(4).replace(/^<|>$/g,""),g=e.resolveCid?.(d);g&&(r.setAttribute("src",g),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",Re),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",_e(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=$e(o)}}),r=>{const n=be(r),o=Te(r),d=t.sanitize(r,s);return{html:`<style>${fe()}</style>${d}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},Be='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',k={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},Oe={background:!1,spacing:!1},Me="16px",De=()=>`html{padding:0}body{padding:${Me};box-sizing:border-box}`,ze=()=>"html{overflow:hidden}body{overflow-x:auto}",Pe=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,Ke='<meta name="viewport" content="width=device-width, initial-scale=1">',Fe=e=>{const t=e?k.dark:k.light;return`
|
|
64
|
+
/* Plain-email base: UI font-stack + theme-aware colors (#424) */
|
|
65
|
+
html, body {
|
|
66
|
+
font-family: ${Be};
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
line-height: 1.6;
|
|
69
|
+
color: ${t.fg};
|
|
70
|
+
background-color: ${t.canvas};
|
|
71
|
+
margin: 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
/* Strip author unreadable text colors and element backgrounds, scoped to body
|
|
75
|
+
descendants so the themed html/body surface above survives this reset. */
|
|
76
|
+
body * {
|
|
77
|
+
color: inherit !important;
|
|
78
|
+
background-color: transparent !important;
|
|
79
|
+
}
|
|
80
|
+
a, a:visited {
|
|
81
|
+
color: ${t.accent} !important;
|
|
82
|
+
text-decoration: underline;
|
|
83
|
+
}
|
|
84
|
+
`},E="invert(0.92) hue-rotate(180deg)",T=`img,picture,video,svg,canvas,[style*='background-image'],[background]{filter:${E}}`,He=(e,t,s)=>{const r=e?k.dark.canvas:k.light.canvas;return s?e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:#ffffff;filter:${E}}body{margin:0}${T}`:"html,body{margin:0;background-color:#ffffff;color-scheme:light}":e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:${r}}body{margin:0;filter:${E}}${T}`:`html,body{margin:0;background-color:${r};color-scheme:light}`},Ge=(e,t,s,r=Oe)=>{const n=t==="plain"?Fe(s):He(s,Pe.test(e),r.background),o=r.spacing?"":De();return`${Ke}<style>${n}</style>${e}<style>${ze()}${o}</style>`},Ue=5e4,We="allow-same-origin allow-popups allow-popups-to-escape-sandbox",Ve=(e,t,s)=>Math.min(Math.ceil(Math.max(e,t)),s),Qe=new Set(["Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),qe=e=>e===" "?!1:e.length===1?!0:Qe.has(e),S=e=>{if(e.metaKey||e.ctrlKey||e.altKey||!qe(e.key))return;const t=e.currentTarget??e.target,s=t?.defaultView?.parent;!s||s===t?.defaultView||s.dispatchEvent(new KeyboardEvent("keydown",{key:e.key,code:e.code,shiftKey:e.shiftKey,bubbles:!0,cancelable:!0}))},j=({html:e,variant:t="framed",isDark:s=!1,declares:r,className:n})=>{const o=h.useRef(null),[d,g]=h.useState(0),i=h.useMemo(()=>Ge(e,t,s,r),[e,t,s,r]);return h.useEffect(()=>{const c=o.current;if(!c)return;const u=()=>{const l=c.contentDocument;if(!l?.body)return;const x=l.documentElement,w=Ve(l.body.scrollHeight,x?.scrollHeight??0,Ue);g(y=>y===w?y:w)};let m,f;const p=()=>{u(),m?.disconnect(),m=void 0,f?.removeEventListener("keydown",S),f?.removeEventListener("load",u,!0),f=void 0;const l=c.contentDocument;l?.body&&(m=new ResizeObserver(u),m.observe(l.body),l.documentElement&&m.observe(l.documentElement),l.addEventListener("load",u,!0),l.fonts?.ready.then(u),l.addEventListener("keydown",S),f=l)};return c.addEventListener("load",p),()=>{c.removeEventListener("load",p),f?.removeEventListener("keydown",S),f?.removeEventListener("load",u,!0),m?.disconnect()}},[]),a.jsx("iframe",{ref:o,title:"Email content",sandbox:We,srcDoc:i,className:n,style:{width:"100%",border:"none",display:"block",height:d===0?"1px":`${d}px`,colorScheme:"normal"}})},L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Et=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ye=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:d,renderBlockedNotice:g})=>{const i=h.useMemo(()=>!e||typeof document>"u"?null:Ie({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=i?.html??null,{framed:u,isPlain:m}=me(r,i?.hasAuthorBackground??!1),f=h.useMemo(()=>({background:i?.hasAuthorBackground??!1,spacing:i?.hasAuthorSpacing??!1}),[i?.hasAuthorBackground,i?.hasAuthorSpacing]),p=h.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",d),children:a.jsx(L,{})}):a.jsxs("div",{className:b("message-body",d),children:[p>0&&a.jsx("div",{children:g?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:u?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(j,{html:c,variant:"framed",isDark:s,declares:f})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(j,{html:c,variant:m?"plain":"framed",isDark:s,declares:f})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(L,{})]})};function Nt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(X,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(A,{children:"j"})," / ",a.jsx(A,{children:"k"})," to move, ",a.jsx(A,{children:"Enter"})," to open"]})]})}function M(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Xe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ze(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Xe(s),rawValue:s}}const Je=e=>/[\s"]/.test(e),et=e=>Je(e)?`"${e.replace(/"/g,"")}"`:e,Ct=(e,t)=>`${e}:${et(t)}`,D=(e,t=Date.now())=>({value:e,setAt:t}),tt=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=D(!0,r):delete n.trusted,{...e,flags:n}},st=(e,t,s,r)=>{const n=o=>o.map(d=>tt(d,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},rt=({messageId:e})=>{const t=Z(),{pushError:s}=J(),{mutate:r,isPending:n,error:o,reset:d}=ee({...re(),onMutate:async i=>{const c=i.path.addressId,m=i.body.flags?.trusted?.value===!0,f=se({path:{messageId:e}});await t.cancelQueries({queryKey:f});const p=t.getQueriesData({queryKey:f}).filter(l=>l[1]!==void 0).map(([l,x])=>({queryKey:l,data:x}));return t.setQueriesData({queryKey:f},l=>l&&st(l,c,m)),{describePrefix:f,previous:p}},onError:(i,c,u)=>{if(u)for(const m of u.previous)t.setQueryData(m.queryKey,m.data);s(te("Couldn't trust sender","The change wasn't saved.",i))},onSettled:(i,c,u,m)=>{m&&t.invalidateQueries({queryKey:m.describePrefix})}});return{toggleTrusted:(i,c)=>{r({path:{addressId:i},body:{flags:{trusted:D(!c)}}})},isPending:n,error:o,reset:d}},nt=()=>{const[e,t]=h.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return h.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},at=(e,t)=>{const s=`${e} image${e>1?"s":""}`;return t?`${s} hidden — you blocked this sender`:`${s} blocked for privacy`},ot=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,isSenderBlocked:r,onLoadOnce:n,onAlwaysTrust:o})=>a.jsxs("div",{"data-testid":"blocked-images-notice",className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsx("span",{className:"text-fg-muted",children:at(e,r)}),!r&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:o,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),it=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},ct=e=>e instanceof le?e.reason:"generic",lt=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",dt=({error:e,onRetry:t})=>{const s=ct(e),r=lt(e),{title:n,detail:o}=it(s,r),[d,g]=h.useState(!1),{Account:i}=ne();return d?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(ae,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(i,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>g(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(oe,{className:"size-4","aria-hidden":"true"})})]})]})},ut=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),R=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Tt=({bodyParts:e,html:t,text:s,isTrusted:r=!1,isBlocked:n=!1,messageId:o,fromAddressId:d,category:g,className:i})=>{const[c,u]=h.useState(!1),[m,f]=h.useState(o);m!==o&&(f(o),u(!1));const p=!n&&(r||c),l=nt(),{toggleTrusted:x,isPending:w}=rt({messageId:o??""}),y=!!e&&e.length>0,{picked:z,data:v,isLoading:P,isError:K,error:F,refetch:H}=de({messageId:o,bodyParts:e,enabled:y}),G=h.useMemo(()=>he(e??[]),[e]),U=y&&v?.kind==="html"?v.body:t,W=y&&v?.kind==="text"?v.body:s;if(y){if(P)return a.jsx("div",{className:b("message-body",i),children:a.jsx(ut,{})});if(K)return a.jsx("div",{className:b("message-body",i),children:a.jsx(dt,{error:F,onRetry:()=>H()})});if(!z)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})});const V=!!(d&&o),Q=()=>{!d||w||(u(!0),x(d,!1))};return a.jsx(Ye,{className:i,html:U,text:W,isDark:l,category:g,allowImages:p,resolveCid:G,renderBlockedNotice:q=>a.jsx(ot,{blockedImageCount:q,canAlwaysTrust:V,isTrustPending:w,isSenderBlocked:n,onLoadOnce:()=>u(!0),onAlwaysTrust:Q})})},mt=Object.values(_).map(e=>({value:e,label:$[e]})),ft={unclassified:"uncategorized"},ht=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:mt},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],gt=new Map(ht.map(e=>[e.name,e])),jt=e=>gt.get(e.toLowerCase()),pt=/^\d{4}-\d{2}-\d{2}$/;function bt(e,t,s){if(!pt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function yt(e){const t=e.toLowerCase(),s=ft[t];return s||Object.values(_).find(n=>n===t)}function xt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function wt(e,t){const s=Ze(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=yt(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return xt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return bt(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Lt(e,t={}){const s=[],r=[];for(const n of M(e)){const o=wt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Rt(e,t){return M(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function _t(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${$[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function $t(){const{mailboxNameIndex:e,accountNameIndex:t}=ie(),s=ce();return{...ue(s)?{}:{mailboxesByName:e},accountsByName:t}}export{Et as M,Nt as R,ht as S,Ye as a,rt as b,Tt as c,jt as d,M as e,Ze as f,Ct as g,Lt as p,Rt as r,_t as s,$t as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as T,au as L,i as k,E as I,F as E,cC as A,ef as R,r as v,dr as j,j as p,eg as h,eh as w,ei as D,C as _,ck as N,c as Q,dM as z,c$ as O}from"./index-
|
|
1
|
+
import{h as T,au as L,i as k,E as I,F as E,cC as A,ef as R,r as v,dr as j,j as p,eg as h,eh as w,ei as D,C as _,ck as N,c as Q,dM as z,c$ as O}from"./index-Dy5D6YkV.js";import{P}from"./attachment-file-D1lRTIpJ.js";import{aj as U}from"./MailListHeader-DixjeKWo.js";import{a as q}from"./useLabels-CuITaMaj.js";import{n as B}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-BDaT1iE0.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},$=e=>{const{mailboxId:t,messages:s}=e,n=T(),{pushError:l}=L(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(U(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&j(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=q(e),{applyLabel:l}=$({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${w(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(P,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const K=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=K},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},V=20,Y=new Set(Object.values(O)),J=e=>e!==void 0&&Y.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=_(),n=G(),l=N(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),g=i.find(o=>o.type==="after"),b=i.find(o=>o.type==="before"),x=i.find(o=>o.type==="in"),S=F({browsed:l,callerMailboxId:e,inTokenMailboxId:x?.mailboxId}),{data:C,isLoading:M}=Q({...z({query:{query:a,mailboxId:S,limit:V,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...g?{sentDateFrom:g.epochSeconds}:{},...b?{sentDateTo:b.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:C?.items??[],isLoading:r&&M}}export{re as L,ne as r,ie as s,ce as t,le as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as g,au as p,c as f,d as m,r,i as y,aw as T,o as E,l as d}from"./index-
|
|
1
|
+
import{h as g,au as p,c as f,d as m,r,i as y,aw as T,o as E,l as d}from"./index-Dy5D6YkV.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as d,eD as g,r as u,eE as y,bV as m,u as D,cj as b,eC as C}from"./index-
|
|
1
|
+
import{aa as d,eD as g,r as u,eE as y,bV as m,u as D,cj as b,eC as C}from"./index-Dy5D6YkV.js";const i="/calendar/$view/$date";function I(){const e=d({from:i,shouldThrow:!1}),a=g({from:i,shouldThrow:!1}),t=e?.view??"",n=e?.date??"",r=a?.calendarId;return u.useMemo(()=>({...y({view:t,date:n},m(new Date)),calendarIds:r??[]}),[t,n,r])}function j(){const e=d({from:"/calendar/$view/$date/$calendarObjectId",shouldThrow:!1}),a=d({from:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",shouldThrow:!1}),t=e?.calendarObjectId,n=a?.recurrenceId;return u.useMemo(()=>t?{calendarObjectId:t,recurrenceId:n}:void 0,[t,n])}function z(){return d({from:"/calendar/$view/$date/new",shouldThrow:!1})!==void 0}function A(){const e=D(),a=b(),{view:t,date:n}=I(),r=u.useCallback(s=>{e({to:i,params:s,search:!0,hash:a})},[e,a]);return u.useMemo(()=>({goToView:s=>r({view:s,date:n}),step:s=>r({view:t,date:C(n,t,s)}),goToToday:()=>r({view:t,date:m(new Date)}),setAnchorDate:s=>e({to:i,params:{view:t,date:s},search:!0,hash:a,replace:!0}),zoomToDay:s=>r({view:"day",date:s}),openEvent:(s,o)=>e(o===void 0||o===""?{to:"/calendar/$view/$date/$calendarObjectId",params:{view:t,date:n,calendarObjectId:s},search:!0,hash:a}:{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:t,date:n,calendarObjectId:s,recurrenceId:o},search:!0,hash:a}),closeEvent:()=>r({view:t,date:n}),openComposer:()=>e({to:"/calendar/$view/$date/new",params:{view:t,date:n},search:!0,hash:a})}),[r,e,a,t,n])}const c=e=>String(e).padStart(2,"0"),N=e=>`${e.getUTCFullYear()}-${c(e.getUTCMonth()+1)}-${c(e.getUTCDate())}`,p=e=>{const a=e<0?"-":"+",t=Math.abs(e);return`${a}${c(Math.floor(t/60))}:${c(t%60)}`};function w(e,a){const t=new Date(`${e}T${a}:00`);return`${e}T${a}:00${p(-t.getTimezoneOffset())}`}const l=new Map;function O(e){if(l.has(e))return l.get(e);let a;try{a=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{a=void 0}return l.set(e,a),a}function $(e,a){const t=O(e);if(!t)return Number.NaN;const n=t.formatToParts(new Date(a)),r=T=>Number(n.find(v=>v.type===T)?.value),s=r("hour")%24;return(Date.UTC(r("year"),r("month")-1,r("day"),s,r("minute"),r("second"))-a)/6e4}function P(e,a,t){if(t==="")return`${e}T${a}:00+00:00`;const n=Date.parse(`${e}T${a}:00Z`),r=$(t,n);if(Number.isNaN(r))return w(e,a);const s=$(t,n-r*6e4);return`${e}T${a}:00${p(Number.isNaN(s)?r:s)}`}const h=e=>w(e,"00:00");function f(e,a){const[t,n,r]=e.split("-").map(Number);return N(new Date(Date.UTC(t,n-1,r+a)))}function U(e){const[a,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(a,t-1,n));return f(e,-((r.getUTCDay()+6)%7))}function E(e,a){const[t,n]=a.split("-").map(Number);if(e==="year")return[`${t}-01-01`,`${t+1}-01-01`];if(e==="month"){const s=`${t}-${c(n)}-01`,o=n===12?`${t+1}-01-01`:`${t}-${c(n+1)}-01`;return[s,o]}if(e==="day")return[a,f(a,1)];const r=U(a);return[r,f(r,7)]}function S(e,a){const[t,n]=E(e,a);return{from:h(t),to:h(n)}}export{f as a,A as b,S as c,j as d,z as e,P as i,I as u};
|
package/index.html
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
} catch (_) {}
|
|
39
39
|
})();
|
|
40
40
|
</script>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-Dy5D6YkV.js"></script>
|
|
42
42
|
<link rel="stylesheet" crossorigin href="/assets/index-BqWgpRnh.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|