@remit/web-client-dist 0.0.635 → 0.0.636
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-CcPGCsdQ.js → BriefPane-D75cGk9R.js} +1 -1
- package/assets/{CalendarComposePane-CS0JzQe5.js → CalendarComposePane-CQPTeieA.js} +1 -1
- package/assets/{CalendarComposeSeed-DiWHEwyG.js → CalendarComposeSeed-YcnTcc9q.js} +1 -1
- package/assets/{CalendarShell-B3kqh203.js → CalendarShell-C5-6_oQz.js} +1 -1
- package/assets/{EmptyState-D0-8vkl7.js → EmptyState-CwwN8uxT.js} +1 -1
- package/assets/{ErrorState-VVAbrV2n.js → ErrorState-DWzQfscg.js} +1 -1
- package/assets/{FlaggedPane-C10WBIzH.js → FlaggedPane-Jts36qML.js} +1 -1
- package/assets/{FullCompose-BPnHusXz.js → FullCompose-CPT2R-pn.js} +1 -1
- package/assets/{MailListHeader-nOmDteIr.js → MailListHeader-BVdr1xz_.js} +1 -1
- package/assets/{MailNav-CgR3wyoa.js → MailNav-CmvgCpY4.js} +1 -1
- package/assets/{MailShell-Pr322jmK.js → MailShell-DpEV7moX.js} +1 -1
- package/assets/{MailViewChrome-BQ6rm7E7.js → MailViewChrome-DO8IvQ0g.js} +1 -1
- package/assets/{MailboxPane-BXtDimzQ.js → MailboxPane-BsR7VsfJ.js} +1 -1
- package/assets/{NavMenuButton-RbQrIxF8.js → NavMenuButton-6SG5syJx.js} +1 -1
- package/assets/{OnboardingWizard-BFedeDPT.js → OnboardingWizard-CSUHbolo.js} +1 -1
- package/assets/{OpenCalendarEvent-BHw5I86C.js → OpenCalendarEvent-CeB7apup.js} +1 -1
- package/assets/{OutboxPane-CTseFzTa.js → OutboxPane-y8lpgoA7.js} +1 -1
- package/assets/_calendarObjectId-CIuW-Ie5.js +1 -0
- package/assets/_mailboxId-5RNGPJGS.js +1 -0
- package/assets/_messageId-BuD0qcm0.js +1 -0
- package/assets/_messageId-DUkglFhL.js +1 -0
- package/assets/_messageId-DfTFQr44.js +1 -0
- package/assets/_outboxMessageId-jTJb98_M.js +1 -0
- package/assets/_recurrenceId-CKRdebZ4.js +1 -0
- package/assets/_threadId-9TH68C7M.js +1 -0
- package/assets/_threadId-BzUUgT3O.js +1 -0
- package/assets/_threadId-CqA1Cn_c.js +1 -0
- package/assets/_view._date-DZANiEIP.js +1 -0
- package/assets/{accounts-CJxJvm7i.js → accounts-BNbNVL6a.js} +1 -1
- package/assets/{advanced-DlUXSovP.js → advanced-jKFdPJg9.js} +1 -1
- package/assets/{appearance-C974dCog.js → appearance-szgjdrBE.js} +1 -1
- package/assets/{attendee-row-DjEgLprV.js → attendee-row-BMb3eM14.js} +1 -1
- package/assets/{avatar-C2fjt5Oo.js → avatar-BI9-h2CG.js} +1 -1
- package/assets/{bell-off-DAf1mpP9.js → bell-off-CC53fBB2.js} +1 -1
- package/assets/{bottom-sheet-V9w5p7mb.js → bottom-sheet-D8oEb9Zv.js} +1 -1
- package/assets/brief-Bd33YTD_.js +1 -0
- package/assets/{brief-B0ofNfT2.js → brief-DE8_cylr.js} +1 -1
- package/assets/{browser-ponyfill-BQRK5_Us.js → browser-ponyfill-CRcfJGCX.js} +2 -2
- package/assets/{bug-ChX59CrI.js → bug-Dh0UIzTd.js} +1 -1
- package/assets/{calendar-CJmjuskA.js → calendar-DI1uSMAF.js} +1 -1
- package/assets/{calendar-clash-strip-DFE2SLBf.js → calendar-clash-strip-BeF8DhB-.js} +1 -1
- package/assets/{calendar-format-DLCAmYF3.js → calendar-format-nYSxDVLX.js} +1 -1
- package/assets/{calendar-report--e3n3TXF.js → calendar-report-_QLAbdRS.js} +1 -1
- package/assets/{calendar-suggestion-Bey-p_uQ.js → calendar-suggestion-E9w2nRWu.js} +1 -1
- package/assets/{calendars-IOjKgVC9.js → calendars-Boz0CIFB.js} +1 -1
- package/assets/{card-DR5Bp3Kv.js → card-BmYyqZU8.js} +1 -1
- package/assets/{checkbox-rzdV9G0C.js → checkbox-CZD6i6IR.js} +1 -1
- package/assets/chevron-left-B1U3lovQ.js +1 -0
- package/assets/{circle-check-BniV5uth.js → circle-check-Bpm-cdIg.js} +1 -1
- package/assets/{circle-check-big-DdHuPOQ8.js → circle-check-big-CA-bYUtr.js} +1 -1
- package/assets/{circle-help-CxYf0rqb.js → circle-help-gF5YAjts.js} +1 -1
- package/assets/{clock-DMOwCMnh.js → clock-CHCFgl4d.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BH8gcpDj.js +1 -0
- package/assets/compose._-_outboxMessageId_-D3WpZSA8.js +1 -0
- package/assets/compose._-_outboxMessageId_-DI8h85aO.js +1 -0
- package/assets/compose._-_outboxMessageId_-WBhljHnY.js +1 -0
- package/assets/{config-import-xKkBqDs3.js → config-import-D9ehhdRH.js} +1 -1
- package/assets/{confirm-dialog-Cfujg7eJ.js → confirm-dialog-CocDko9U.js} +1 -1
- package/assets/{copy-CkTTUrrp.js → copy-DgGekFwr.js} +1 -1
- package/assets/{credential-steps-DRNC_g97.js → credential-steps-C6B4LLDZ.js} +1 -1
- package/assets/{download-BQh_pCga.js → download-CHu9yf-9.js} +1 -1
- package/assets/{file-json-BlL9tl5c.js → file-json-lCoJ4MMG.js} +1 -1
- package/assets/{filters-DOtkcHka.js → filters-CgNi0_GK.js} +1 -1
- package/assets/flagged-BRQyqp_w.js +1 -0
- package/assets/{flagged-BrPpE3Sc.js → flagged-C06PvFbr.js} +1 -1
- package/assets/{folders-DurPEuZa.js → folders-BC2O8pN-.js} +1 -1
- package/assets/{help-copy-uYovF378.js → help-copy-0vW7Uvdo.js} +1 -1
- package/assets/{import-DMXkiU6R.js → import-BJiWqnIA.js} +1 -1
- package/assets/index-6DAZlug3.js +1 -0
- package/assets/index-B4H0cbaA.js +1 -0
- package/assets/{index-BZsbyrwY.css → index-BOf0CjTQ.css} +1 -1
- package/assets/index-BuD0qcm0.js +1 -0
- package/assets/index-CEzeDIpM.js +1 -0
- package/assets/{index-DIEie7Yj.js → index-CTrN7dU7.js} +59 -59
- package/assets/index-CdEqoUhn.js +1 -0
- package/assets/index-CxnKAlnw.js +1 -0
- package/assets/{index-Bsm5MTTG.js → index-DMA0YSsS.js} +4 -4
- package/assets/{index-B3zzgv4e.js → index-DdmJVTyk.js} +1 -1
- package/assets/index-DfTFQr44.js +1 -0
- package/assets/index-XCWyX4Nu.js +1 -0
- package/assets/index-jeAFdPQ9.js +1 -0
- package/assets/{kbd-lDzxHVCS.js → kbd-DNmTK9ke.js} +1 -1
- package/assets/{labels-DNITzKN5.js → labels-1K3nCcmA.js} +1 -1
- package/assets/{mail-1A5f6iAE.js → mail-2Lzca0sU.js} +1 -1
- package/assets/{mail-BeoUl3Ta.js → mail-DverAFVu.js} +1 -1
- package/assets/{menu-C21gm-LC.js → menu-AiRz5rLS.js} +1 -1
- package/assets/minus-QLsR9rVM.js +1 -0
- package/assets/{new-DnBb5DN4.js → new-DHyHJz8l.js} +1 -1
- package/assets/onboarding-CRGGfEXZ.js +1 -0
- package/assets/{onboarding-completion-Bmd-HN_3.js → onboarding-completion-Bgona01R.js} +1 -1
- package/assets/outbox-egss0WYm.js +1 -0
- package/assets/{pane-header-B3IIk3fJ.js → pane-header-C6F97UxO.js} +1 -1
- package/assets/{pencil-D2ugaHF8.js → pencil-DpZEcc9Q.js} +1 -1
- package/assets/{popover-menu-BzPU2XRv.js → popover-menu-I_p7C4RX.js} +1 -1
- package/assets/{refresh-cw-Ckd0XdaA.js → refresh-cw-CrSEtN0j.js} +1 -1
- package/assets/{rich-text-Rzrxb7e0.js → rich-text-BY2WyJzR.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-CqKdM7_E.js → rich-text-spellcheck-worker-provider-C53QtR8U.js} +1 -1
- package/assets/{rotate-ccw-BeK7IKWo.js → rotate-ccw-BwoJPdTA.js} +1 -1
- package/assets/{roving-focus-CB0KLgKq.js → roving-focus-BYBMU9YM.js} +1 -1
- package/assets/{row-actions-Dig-tNEz.js → row-actions-M9Ety9op.js} +1 -1
- package/assets/{search-mirror-Bt_QYWap.js → search-mirror-C1R24HUl.js} +1 -1
- package/assets/{search-token-index-CclyV_x2.js → search-token-index-BinolOMC.js} +1 -1
- package/assets/{sections-n58EA842.js → sections-CfTDsSEu.js} +1 -1
- package/assets/{senders-WSsq5WoC.js → senders-CxFpOLNR.js} +1 -1
- package/assets/settings-I6fzE2gz.js +1 -0
- package/assets/{settings-screen-xG7ySj9h.js → settings-screen-BVPfYXKu.js} +1 -1
- package/assets/{shield-check-Bl7sJ69b.js → shield-check-B8NtyqSa.js} +1 -1
- package/assets/{suggested-vips-Bl6VCH8I.js → suggested-vips-CvGUhfMR.js} +1 -1
- package/assets/{undo-2-CXpll-5G.js → undo-2-DafMLJl8.js} +1 -1
- package/assets/{useCalendarData-CBlxoUbW.js → useCalendarData-CEqOF86-.js} +1 -1
- package/assets/{useCalendarWrites-LDB7-Ss2.js → useCalendarWrites-B66T9V8C.js} +1 -1
- package/assets/{useCalendars-CLOowhmo.js → useCalendars-DSVgnNGS.js} +1 -1
- package/assets/{useDebouncedValue-CkCDwwGn.js → useDebouncedValue-DgoW2gtH.js} +1 -1
- package/assets/{useFilters-Dog2qi1C.js → useFilters-CI6nPI8A.js} +1 -1
- package/assets/{useLabels-BJtlozty.js → useLabels-BLAR4UCi.js} +1 -1
- package/assets/{useLayoutTier-nR-X4oh4.js → useLayoutTier-Cs2hRSyr.js} +1 -1
- package/assets/{useMessageBodyContent-DaCPQpX3.js → useMessageBodyContent-C6WheWR5.js} +1 -1
- package/assets/{useQueries-DfoafMCX.js → useQueries-8ibIA6jj.js} +1 -1
- package/assets/{useRefreshControl-CHw1FCdw.js → useRefreshControl-BHFXn1pg.js} +1 -1
- package/assets/{useResultFolderIndex-BwoZm495.js → useResultFolderIndex-BhA2C88T.js} +1 -1
- package/assets/{useSearchTokenContext-MVchIFCF.js → useSearchTokenContext-BZ3hasAQ.js} +3 -3
- package/assets/{useSemanticSearch-BVBm7ORD.js → useSemanticSearch-BPL9gQ__.js} +1 -1
- package/assets/{useSignature-D4rel0VO.js → useSignature-COUd5paq.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/_calendarObjectId-DJdM4tzN.js +0 -1
- package/assets/_mailboxId-BLQlyM6f.js +0 -1
- package/assets/_messageId-B04z2hI3.js +0 -1
- package/assets/_messageId-CB5hv97O.js +0 -1
- package/assets/_messageId-LXUUSaOB.js +0 -1
- package/assets/_outboxMessageId-B9tYWk_8.js +0 -1
- package/assets/_recurrenceId-BiHsfCKf.js +0 -1
- package/assets/_threadId-6k0O2tZu.js +0 -1
- package/assets/_threadId-BQm-zwWW.js +0 -1
- package/assets/_threadId-oj5Cr5Su.js +0 -1
- package/assets/_view._date-D-aH9vb8.js +0 -1
- package/assets/brief-jd-FT6Hv.js +0 -1
- package/assets/chevron-left-wWboU2sl.js +0 -1
- package/assets/compose._-_outboxMessageId_-BiXse-xz.js +0 -1
- package/assets/compose._-_outboxMessageId_-DGECiGv0.js +0 -1
- package/assets/compose._-_outboxMessageId_-Oje2LYqv.js +0 -1
- package/assets/compose._-_outboxMessageId_-jGe5jfaP.js +0 -1
- package/assets/flagged-C4VIjSex.js +0 -1
- package/assets/index-B1vstv9o.js +0 -1
- package/assets/index-BMDcfxBa.js +0 -1
- package/assets/index-BhWy8P2E.js +0 -1
- package/assets/index-Bu1epPot.js +0 -1
- package/assets/index-CB5hv97O.js +0 -1
- package/assets/index-CbT_w2eV.js +0 -1
- package/assets/index-CvYaSCJa.js +0 -1
- package/assets/index-D6xImJHd.js +0 -1
- package/assets/index-LXUUSaOB.js +0 -1
- package/assets/minus-BYvW5VdR.js +0 -1
- package/assets/onboarding-D_uulq54.js +0 -1
- package/assets/outbox-Dc0K4OF8.js +0 -1
- package/assets/settings-kGy860Jm.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var g=s.join(":").trim();try{t.append(o,g)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:G(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",g)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,_.exports=d})(E,E.exports)),E.exports}var S=J();const
|
|
1
|
+
import{eX as A,N as X}from"./index-CTrN7dU7.js";function $(_,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const l in y)if(l!=="default"&&!(l in _)){const p=Object.getOwnPropertyDescriptor(y,l);p&&Object.defineProperty(_,l,p.get?p:{enumerable:!0,get:()=>y[l]})}}}return Object.freeze(Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},H;function J(){return H||(H=1,(function(_,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof A<"u"&&A,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(h){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof A<"u"&&A||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function F(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=v(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[v(e)]},i.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},i.prototype.set=function(e,t){this.map[v(e)]=T(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function O(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function L(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function R(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&F(e)?(this._bodyArrayBuffer=R(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C(e))?this._bodyArrayBuffer=R(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(e){var t=e.toUpperCase();return N.indexOf(t)>-1?t:e}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=k(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in a){var o=new AbortController;return o.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function z(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function G(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var g=s.join(":").trim();try{t.append(o,g)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:G(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",g)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,_.exports=d})(E,E.exports)),E.exports}var S=J();const Z=X(S),Q=$({__proto__:null,default:Z},[S]);export{Q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"./index-
|
|
1
|
+
import{e as a}from"./index-CTrN7dU7.js";const p=a("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);export{p as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as g,a as x,b as h,r as i,p as O,c as j,d as y,j as e,O as C}from"./index-
|
|
1
|
+
import{u as g,a as x,b as h,r as i,p as O,c as j,d as y,j as e,O as C}from"./index-CTrN7dU7.js";import{C as N}from"./CalendarShell-C5-6_oQz.js";import{M as P}from"./MailNav-CmvgCpY4.js";import{E}from"./ErrorState-DWzQfscg.js";import{i as S,u as b}from"./useLayoutTier-Cs2hRSyr.js";import"./roving-focus-BYBMU9YM.js";import"./bell-off-CC53fBB2.js";import"./useQueries-8ibIA6jj.js";import"./folder-failure-CqkVSsrb.js";import"./outbox-status-BlKn6P0x.js";import"./bug-Dh0UIzTd.js";function W(){const t=g(),c=S(b()),a=x(),r=h(),l=a.includes("nav"),n=i.useCallback(v=>{r(O(a,v?"nav":void 0))},[a,r]),{data:o,isLoading:u,isError:p,error:m,refetch:f}=j({...y(),staleTime:1/0}),s=!!(o&&(o.accounts?.length??0)===0);i.useEffect(()=>{s&&t({to:"/onboarding",replace:!0})},[s,t]);const d=o?.accounts??[];return p?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(E,{title:"Couldn't load your account",error:m,onRetry:()=>{f()}})}):e.jsx(N,{chrome:{isSinglePane:c,isLoading:u||s,nav:e.jsx(P,{accounts:d,onMailboxSelect:()=>n(!1)}),navOpen:l,onOpenNav:()=>n(!0),onCloseNav:()=>n(!1)},children:e.jsx(C,{})})}export{W as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aB as n,t as a,ar as d}from"./index-
|
|
1
|
+
import{j as e,aB as n,t as a,ar as d}from"./index-CTrN7dU7.js";function x({clashes:s,clearText:i="Nothing else is booked over it.",className:t}){return s.length===0?e.jsxs("p",{className:a("flex items-center gap-2 rounded-md border border-line bg-surface-sunken p-2 text-xs text-fg-muted",t),children:[e.jsx(n,{className:"size-3.5 shrink-0 text-positive","aria-hidden":!0}),i]}):e.jsxs("div",{className:a("flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft p-2",t),children:[e.jsx(d,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs font-semibold text-danger",children:s.length===1?"This clashes with something you have already agreed to.":`This clashes with ${s.length} things you have already agreed to.`}),e.jsx("ul",{className:"mt-1 flex flex-col gap-0.5",children:s.map(r=>e.jsx("li",{className:"text-xs text-fg",children:r.label},r.id))})]})]})}export{x as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as N,u as
|
|
1
|
+
import{e as N,u as E,r as f,a9 as y,eA as A,eB as _,bZ as k,cm as j,eC as O,c as R,eD as $,h as W,s as B}from"./index-CTrN7dU7.js";import{u as U}from"./useQueries-8ibIA6jj.js";import{e as F}from"./useCalendars-DSVgnNGS.js";const st=N("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]),p=480,m=1320,M=90;function w(t){return Number(t.slice(11,13))*60+Number(t.slice(14,16))}function ct(t){const a=Math.max(0,Math.min(1440,Math.round(t)));return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`}function it(t){const a=Math.round(t);if(a<60)return`${a}m`;const n=Math.floor(a/60),e=a%60;return e===0?`${n}h`:`${n}h ${e}m`}function x(t,a){const n=new Date(`${t}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()+a),n.toISOString().slice(0,10)}function lt(t,a){return Math.round((Date.parse(`${a}T00:00:00Z`)-Date.parse(`${t}T00:00:00Z`))/864e5)}function ut(t){const a=t.start.slice(0,10),n=t.end.slice(0,10);if(!t.allDay)return n;const e=x(n,-1);return e<a?a:e}function dt(t,a){const n=[];for(let e=t;e<=a;e=x(e,1))n.push(e);return n}function ft(t){const[a,n,e]=t.split("-").map(Number);return new Date(a,n-1,e).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function mt(t){const[a,n,e]=t.split("-").map(Number);return new Date(a,n-1,e).toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function ht(t){const[a,n,e]=t.split("-").map(Number);return new Date(a,n-1,e).toLocaleDateString("en-GB",{weekday:"long"})}function pt(t,a){const[n,e,o]=t.split("-").map(Number),[r,s,c]=a.split("-").map(Number),u=new Date(n,e-1,o),l=new Date(r,s-1,c),i=u.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",...e===s?{}:{month:"short"}}),g=l.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"});return`${i} – ${g}`}function G(t){const[a,n,e]=t.split("-").map(Number);return new Date(a,n-1,e).toLocaleDateString("en-GB",{weekday:"short"})}function d(t){return new Date(t).getTime()}function Z(t,a){return t.allDay?a>=t.start.slice(0,10)&&a<t.end.slice(0,10):t.start.slice(0,10)===a}function P(t,a){return d(t.start)<d(a.end)&&d(a.start)<d(t.end)}function Y(t){const a=t.map(r=>[d(r.start),d(r.end)]).sort((r,s)=>r[0]-s[0]);let n=0,e=0,o=0;for(const[r,s]of a){if(r>o){n+=o-e,e=r,o=s;continue}o=Math.max(o,s)}return n+=o-e,Math.round(n/6e4)}function q(t){const a=[];for(const n of t){const e=t.filter(r=>r.id===n.id||P(n,r)).map(r=>r.id).sort();if(e.length<2)continue;const o=e.join("|");a.some(r=>r.join("|")===o)||a.push(e)}return a.filter(n=>!a.some(e=>e!==n&&n.every(o=>e.includes(o))))}function yt(t,a,n){const e=a.filter(r=>Z(r,t)),o=e.filter(r=>!r.allDay).sort((r,s)=>d(r.start)-d(s.start));return{date:t,weekdayLabel:G(t),dayNumber:Number(t.slice(8)),isToday:t===n,timed:o,allDay:e.filter(r=>r.allDay),busyMinutes:Y(o),conflicts:q(o)}}function Q(t){return t.timed.length===0&&t.allDay.length===0}function K(t){return I(t.timed.map(a=>({from:w(a.start),to:w(a.end)})))}function I(t){const a=[...t].sort((e,o)=>e.from-o.from),n=[];for(const e of a){const o=n[n.length-1];if(o&&e.from<=o.to){o.to=Math.max(o.to,e.to);continue}n.push({...e})}return n}function C(t){return Math.min(Math.max(t,p),m)}function V(t,a,n=M){const e=I(a);if(e.length===0)return[{date:t,startMinute:p,endMinute:m,minutes:m-p,wholeDay:!0}];const o=[];let r=p;for(const s of e){const c=C(s.from),u=C(s.to);c-r>=n&&o.push({date:t,startMinute:r,endMinute:c,minutes:c-r,wholeDay:!1}),r=Math.max(r,c,u)}return m-r>=n&&o.push({date:t,startMinute:r,endMinute:m,minutes:m-r,wholeDay:!1}),o}function z(t,a=M){return V(t.date,K(t),a)}function Dt(t,a,{ignoreIds:n=[]}={}){const e=Date.parse(t.start),o=Date.parse(t.end);return a.filter(r=>r.allDay||r.myRsvp==="declined"||n.includes(r.id)?!1:Date.parse(r.start)<o&&e<Date.parse(r.end))}function gt(t,a){const n=[];let e=[];const o=()=>{e.length!==0&&(e.length===1?n.push({kind:"day",key:e[0].date,day:e[0]}):n.push({kind:"run",key:`run_${e[0].date}`,from:e[0].date,to:e[e.length-1].date,days:e.length}),e=[])};for(const r of t){if(Q(r)&&!a.includes(r.date)){e.push(r);continue}o(),n.push({kind:"day",key:r.date,day:r})}return o(),n}function bt(t){const a=[];for(const n of t){const e=a[a.length-1],o=e?Math.max(...e.map(r=>Date.parse(r.end))):0;if(e&&Date.parse(n.start)<o){e.push(n);continue}a.push([n])}return a}function wt(t,a){const n=Date.parse(a),e=a.slice(0,10),o=t.flatMap(l=>l.timed).sort((l,i)=>Date.parse(l.start)-Date.parse(i.start)),r=o.filter(l=>Date.parse(l.start)<=n&&Date.parse(l.end)>n),s=o.filter(l=>Date.parse(l.start)>n),c=s[0],u=r.filter(l=>l.start.slice(0,10)===e).length+s.filter(l=>l.start.slice(0,10)===e).length;return{running:r,next:c,minutesUntilNext:c?Math.round((Date.parse(c.start)-n)/6e4):0,after:s[1],restOfDay:u,free:H(t,a,1)[0]}}function H(t,a,n){const e=a.slice(0,10),o=w(a),r=[];for(const s of t)if(!(s.date<e))for(const c of z(s)){if(s.date>e)r.push(c);else{const u=Math.max(c.startMinute,o);if(c.endMinute-u<M)continue;r.push({...c,startMinute:u,minutes:c.endMinute-u,wholeDay:c.wholeDay&&u===c.startMinute})}if(r.length===n)return r}return r}const J={"cal-1":{solid:"bg-cal-1",soft:"bg-cal-1-soft",text:"text-cal-1",border:"border-cal-1",rail:"border-l-cal-1"},"cal-2":{solid:"bg-cal-2",soft:"bg-cal-2-soft",text:"text-cal-2",border:"border-cal-2",rail:"border-l-cal-2"},"cal-3":{solid:"bg-cal-3",soft:"bg-cal-3-soft",text:"text-cal-3",border:"border-cal-3",rail:"border-l-cal-3"},"cal-4":{solid:"bg-cal-4",soft:"bg-cal-4-soft",text:"text-cal-4",border:"border-cal-4",rail:"border-l-cal-4"},"cal-5":{solid:"bg-cal-5",soft:"bg-cal-5-soft",text:"text-cal-5",border:"border-cal-5",rail:"border-l-cal-5"},"cal-6":{solid:"bg-cal-6",soft:"bg-cal-6-soft",text:"text-cal-6",border:"border-cal-6",rail:"border-l-cal-6"}};function $t(t){return J[t]}const D="/calendar/$view/$date";function X(){const t=y({from:D,shouldThrow:!1}),a=A({from:D,shouldThrow:!1}),n=t?.view??"",e=t?.date??"",o=a?.calendarId;return f.useMemo(()=>({..._({view:n,date:e},k(new Date)),calendarIds:o??[]}),[n,e,o])}function Mt(){const t=y({from:"/calendar/$view/$date/$calendarObjectId",shouldThrow:!1}),a=y({from:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",shouldThrow:!1}),n=t?.calendarObjectId,e=a?.recurrenceId;return f.useMemo(()=>n?{calendarObjectId:n,recurrenceId:e}:void 0,[n,e])}function Tt(){return y({from:"/calendar/$view/$date/new",shouldThrow:!1})!==void 0}function vt(){const t=E(),a=j(),{view:n,date:e}=X(),o=f.useCallback(r=>{t({to:D,params:r,search:!0,hash:a})},[t,a]);return f.useMemo(()=>({goToView:r=>o({view:r,date:e}),step:r=>o({view:n,date:O(e,n,r)}),goToToday:()=>o({view:n,date:k(new Date)}),setAnchorDate:r=>t({to:D,params:{view:n,date:r},search:!0,hash:a,replace:!0}),zoomToDay:r=>o({view:"day",date:r}),openEvent:(r,s)=>t(s===void 0||s===""?{to:"/calendar/$view/$date/$calendarObjectId",params:{view:n,date:e,calendarObjectId:r},search:!0,hash:a}:{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:n,date:e,calendarObjectId:r,recurrenceId:s},search:!0,hash:a}),closeEvent:()=>o({view:n,date:e}),openComposer:()=>t({to:"/calendar/$view/$date/new",params:{view:n,date:e},search:!0,hash:a})}),[o,t,a,n,e])}function Ct(){const t=E();return f.useCallback((a,n,e)=>{if(e===""){t({to:"/calendar/$view/$date/$calendarObjectId",params:{view:"day",date:a,calendarObjectId:n}});return}t({to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:"day",date:a,calendarObjectId:n,recurrenceId:e}})},[t])}const S=B(400,404),T=5*6e4,v=({from:t,to:a,calendarIds:n})=>({query:n.length===0?{from:t,to:a}:{from:t,to:a,calendarId:[...n]}});function Et(t){const{data:a,isLoading:n,error:e,refetch:o}=R({...$(v(t)),meta:S,staleTime:T,enabled:t.enabled??!0});return{instances:a?.items??[],isLoading:n,error:e,refetch:()=>{o()}}}function kt(t,a,n){const e=U({queries:t.map(i=>({...$(v({...i,calendarIds:a})),meta:S,staleTime:T,enabled:n}))}),o=t.map(i=>i.from).join("|"),r=e.map(i=>i.data),s=e.map(i=>i.isPending).join("|"),c=e.find(i=>i.error)?.error??null,u=f.useMemo(()=>r.flatMap(i=>i?.items??[]),[o,s]),l=f.useMemo(()=>{const i=new Set;return t.forEach((g,L)=>{e[L]?.isPending&&i.add(g.from)}),i},[o,s]);return{instances:u,pendingWindows:l,error:c,refetch:()=>{for(const i of e)i.error&&i.refetch()}}}function Ot(t,a,n,e){const o=W(),r=[...n].join(",");f.useEffect(()=>{if(!e)return;const s=r===""?[]:r.split(",");for(const c of[-1,1]){const u=F(t,O(a,t,c));o.prefetchQuery({...$(v({...u,calendarIds:s})),staleTime:T})}},[o,t,a,r,e])}const b=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long"}),h=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}),tt=new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"}),et=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long",timeZone:"UTC"});function at(t){return et.format(new Date(`${t}T00:00:00Z`))}function xt(t){if(t.allDay)return`${at(t.start.slice(0,10))}, all day`;const a=new Date(t.start),n=new Date(t.end),e=b.format(a);return b.format(n)===e?`${e}, ${h.format(a)} – ${h.format(n)}`:`${e}, ${h.format(a)} – ${b.format(n)}, ${h.format(n)}`}function It(t){return tt.format(new Date(`${t}T00:00:00Z`))}function St(t){return h.format(new Date(`1970-01-01T${t}:00`))}function Lt(t){return h.format(new Date(t))}export{dt as A,V as B,T as C,p as D,at as E,xt as F,St as G,Ot as H,lt as I,ut as J,Dt as K,st as R,pt as a,gt as b,$t as c,w as d,ct as e,z as f,bt as g,K as h,m as i,it as j,x as k,mt as l,ft as m,vt as n,Mt as o,kt as p,yt as q,wt as r,Tt as s,Ct as t,X as u,Et as v,ht as w,Lt as x,It as y,I as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as r,aH as a,aI as t}from"./index-
|
|
1
|
+
import{e as r,aH as a,aI as t}from"./index-CTrN7dU7.js";const c=r("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const i=r("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);function o(e){return a(t({title:`Calendar invitation: ${e}`,errorMessage:e}))}function l(e){return a(t({title:`Calendar event: ${e}`,errorMessage:e}))}export{c as G,i as M,l as a,o as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as V,t as f,j as s,ar as $,r as p,W as ee,X as te,dp as se,f as R,aQ as ne,ah as ae,b_ as k,eu as re,s as W,c as U,ev as ie,h as oe,i as A,ew as le,ex as ce,ey as de,ez as ue}from"./index-DIEie7Yj.js";import{c as me,R as fe,z as xe,A as pe,B as G,C as he,x as F,E as z,F as ge,e as _,G as L,y as ye}from"./calendar-format-DLCAmYF3.js";import{M}from"./mail-1A5f6iAE.js";import{G as q}from"./calendar-report--e3n3TXF.js";import{u as be}from"./useQueries-DfoafMCX.js";import{f as ve}from"./ErrorState-VVAbrV2n.js";import{b as y,e as Q}from"./useCalendars-CLOowhmo.js";const Ne=V("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);function je(e){const t=me(e.color),n=e.rsvp==="tentative"||e.status==="tentative";return f("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",t.soft,t.text,t.rail,e.layout==="column"||e.stacked?"flex-col":"items-center gap-1.5",n&&"border-y border-r border-dashed",n&&t.border,e.rsvp==="declined"&&"opacity-60",e.selected&&"ring-2 ring-ring",e.density==="compact"?"text-2xs":"text-xs")}function Se({title:e,timeText:t,layout:n,rsvp:a,hasThread:i,isRecurring:l,zoneCertainty:c,trailing:r,detail:u}){const o=n==="column",d=c==="ambiguous",m=!o&&u!==void 0,x=s.jsxs("span",{className:f("flex min-w-0 items-center gap-1",o&&"w-full",a==="declined"&&"line-through"),children:[t!==""&&s.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:t}),s.jsx("span",{className:"truncate font-medium",children:e})]}),g=(l||i||d)&&s.jsxs("span",{className:f("flex shrink-0 items-center gap-1",o&&"mt-0.5",!o&&r===void 0&&"ml-auto"),children:[l&&s.jsx(fe,{className:"size-2.5","aria-label":"Repeats"}),i&&s.jsx(M,{className:"size-2.5","aria-label":"From mail"}),d&&s.jsx(q,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),b=r!==void 0&&s.jsx("span",{className:f("shrink-0 opacity-80",!o&&"ml-auto"),children:r});return s.jsxs(s.Fragment,{children:[m?s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[x,g,b]}):s.jsxs(s.Fragment,{children:[x,g,b]}),u]})}function Je({title:e,timeText:t,color:n,layout:a,density:i,rsvp:l,status:c,hasThread:r,isRecurring:u,zoneCertainty:o,selected:d,onClick:m,leading:x,trailing:g,detail:b}){const j=a==="column";return s.jsxs("button",{type:"button",onClick:m,"aria-pressed":d,className:f("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",j?"h-full":"items-start",x!==void 0&&"gap-2"),children:[x,s.jsx("span",{className:f(je({color:n,layout:a,density:i,rsvp:l,status:c,selected:d,stacked:b!==void 0}),"flex-1",j&&"h-full"),children:s.jsx(Se,{title:e,timeText:t,layout:a,rsvp:l,hasThread:r,isRecurring:u,zoneCertainty:o,trailing:g,detail:b})})]})}function Ve({text:e,reportHref:t,className:n}){return s.jsxs("div",{role:"alert",className:f("flex items-start gap-1.5 rounded-md border border-danger/40 bg-danger-soft p-2 text-xs text-danger",n),children:[s.jsx($,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"min-w-0 flex-1",children:[e,t&&s.jsxs(s.Fragment,{children:[" ",s.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]})]})]})}const P=96;function et({children:e,hasCard:t,onConfirm:n,onReject:a,blocked:i,blockedReason:l,remaining:c,confirmLabel:r="Add",emptyText:u="Nothing in your mail is waiting on a decision about time.",className:o}){const[d,m]=p.useState(0),[x,g]=p.useState(null);if(!t)return s.jsxs("div",{className:f("flex flex-col items-center gap-2 p-6 text-center",o),children:[s.jsx(ee,{className:"size-6 text-fg-subtle","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:u})]});const b=Math.abs(d)>P,j=d>0;return s.jsxs("div",{className:f("flex flex-col gap-3",o),children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"touch-pan-y select-none",style:{transform:`translateX(${d}px) rotate(${d/40}deg)`,transition:x===null?"transform 180ms ease-out":"none"},onPointerDown:v=>{v.currentTarget.setPointerCapture(v.pointerId),g(v.clientX)},onPointerMove:v=>{x!==null&&m(v.clientX-x)},onPointerUp:()=>{Math.abs(d)>P&&(d>0&&!i&&n(),d<0&&a()),g(null),m(0)},onPointerCancel:()=>{g(null),m(0)},children:e}),b&&s.jsx("span",{className:f("pointer-events-none absolute top-3 rounded-md px-2 py-1 text-xs font-semibold",j?"right-3 bg-accent-soft text-accent":"left-3 bg-danger-soft text-danger"),children:j?i?l:r:"Not this"})]}),s.jsxs("p",{className:"text-center text-2xs text-fg-subtle",children:[c," left · swipe right to accept, left to drop, or use the buttons"]})]})}const Ce="Pick a clock first. The mail never said, and the reader will not choose for you.";function ke(e,t){const n=e.zoneOptions;return n===void 0?{settled:!0,timeZone:""}:n.some(a=>a.timeZone===t)?{settled:!0,timeZone:t}:{settled:!1,reason:Ce}}function B(e){return e.threadSubject===""?e.sender:`${e.sender} — ${e.threadSubject}`}function Ee(e){return e>=.85?"Read cleanly":e>=.6?"Read with gaps":"Barely read"}function tt({suggestion:e,whenText:t,onAdd:n,onReview:a,onDismiss:i,onOpenThread:l,busy:c=!1,addBlocked:r=!1,zoneChoice:u,onZoneChoice:o,addLabel:d="Add",touch:m,className:x}){const[g,b]=p.useState(""),[j,v]=p.useState(!1),w=p.useId(),D=u??g,J=h=>{v(!1),o?o(h):b(h)},N=ke(e,D),T=h=>()=>{if(!N.settled){v(!0);return}h(N.timeZone)};return s.jsxs("article",{"aria-label":e.title,className:f("flex flex-col gap-2 rounded-lg border border-dashed border-line-strong bg-surface-sunken p-3",x),children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:["Suggested from mail · ",Ee(e.confidence)]}),s.jsx("span",{className:"block truncate text-sm font-medium text-fg",children:e.title}),s.jsx("span",{className:"block text-xs text-fg-muted",children:t}),e.location!==""&&s.jsx("span",{className:"block truncate text-xs text-fg-muted",children:e.location})]}),s.jsx("button",{type:"button","aria-label":"Dismiss suggestion",onClick:i,disabled:c,className:f("flex shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",m?"size-11":"size-7"),children:s.jsx(te,{className:"size-4"})})]}),e.ambiguity!==""&&s.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-warning",children:[s.jsx($,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),e.ambiguity]}),l?s.jsxs("button",{type:"button",onClick:l,className:"flex w-full min-w-0 items-center gap-1.5 rounded-sm text-left text-2xs text-accent-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(M,{className:"size-3 shrink-0"}),s.jsx("span",{className:"truncate",children:B(e)})]}):s.jsxs("p",{className:"flex w-full min-w-0 items-center gap-1.5 text-2xs text-fg-subtle",children:[s.jsx(M,{className:"size-3 shrink-0"}),s.jsx("span",{className:"truncate",children:B(e)})]}),e.zoneOptions&&s.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-warning/40 p-2",children:[s.jsxs("p",{className:"flex items-center gap-1.5 text-2xs font-semibold text-warning",children:[s.jsx(q,{className:"size-3 shrink-0","aria-hidden":!0}),"Which clock is this on?"]}),e.zoneOptions.map(h=>s.jsxs("button",{type:"button","aria-pressed":D===h.timeZone,onClick:()=>J(h.timeZone),className:f("rounded-md border px-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",m&&"min-h-11",D===h.timeZone?"border-accent bg-accent-soft":"border-line bg-surface hover:border-line-strong"),children:[s.jsx("span",{className:"block text-xs font-medium text-fg",children:h.label}),s.jsx("span",{className:"block text-2xs text-fg-subtle",children:h.note})]},h.timeZone))]}),!N.settled&&s.jsx(se,{id:w,reason:N.reason,nudged:j,className:"text-2xs text-warning"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(R,{variant:"primary",size:m?"md":"sm",icon:s.jsx(ne,{className:"size-3.5"}),onClick:T(n),disabled:c||r,"aria-describedby":N.settled?void 0:w,className:f(m&&"min-h-11 flex-1",!N.settled&&"opacity-55"),children:d}),a&&s.jsx(R,{variant:"secondary",size:m?"md":"sm",icon:s.jsx(Ne,{className:"size-3.5"}),onClick:T(a),disabled:c,"aria-describedby":N.settled?void 0:w,className:f(m&&"min-h-11",!N.settled&&"opacity-55"),children:"Change first"})]})]})}function st(e){return e.defaultCalendarId!==""?"ready":e.error!==null?"failed":e.isLoading?"loading":"none"}function nt(e,t){if(e!=="ready")return e==="loading"?"Reading your calendars…":e==="failed"?s.jsxs(s.Fragment,{children:["Couldn't read your calendars, so there is nowhere to add this yet. Reload to try again."," ",s.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]}):s.jsxs(s.Fragment,{children:["You have no calendar yet, so there is nowhere to add this."," ",s.jsx(ae,{to:"/settings/calendars",className:"font-medium text-accent hover:underline",children:"Create a calendar"})]})}const we=24,H=7,De=52,E=De*7,Ae=e=>({from:y(e,-10),to:y(e,we),floor:y(e,-E),ceiling:y(e,E)}),ze=e=>e.from<=e.floor,Ie=e=>e.to>=e.ceiling,Oe=(e,t)=>e>t?e:t,Me=(e,t)=>e<t?e:t,Te=e=>ze(e)?e:{...e,from:Oe(y(e.from,-H),e.floor)},Re=e=>Ie(e)?e:{...e,to:Me(y(e.to,H),e.ceiling)},at=e=>Te({...e,floor:y(e.from,-E)}),rt=e=>Re({...e,ceiling:y(e.to,E)});function it(e,t){return t>=e.from&&t<=e.to?e:Ae(t)}function ot(e){const t=new Map;for(const n of e){const a=Q("week",n);t.has(a.from)||t.set(a.from,a)}return[...t.values()]}const lt=e=>Q("week",e).from,Fe=1440,Z=e=>e.getHours()*60+e.getMinutes();function K(e,t){const n=new Set(e),a=new Map;for(const i of t){const l=new Date(i.start),c=new Date(i.end);if(Number.isNaN(l.getTime())||Number.isNaN(c.getTime())||c.getTime()<=l.getTime())continue;const r=k(l),u=k(new Date(c.getTime()-1));for(let o=r;o<=u;o=y(o,1)){if(!n.has(o))continue;const d=o===r?Z(l):0,m=k(c)===o?Z(c):Fe;if(m<=d)continue;const x=a.get(o);x?x.push({from:d,to:m}):a.set(o,[{from:d,to:m}])}}for(const[i,l]of a)a.set(i,xe(l));return a}function ct(e,t){const n=K(e,t);return new Map(e.map(a=>[a,G(a,n.get(a)??[])]))}const dt=e=>pe(e.from,e.to),_e=W(400,404);function ut(e){const t=be({queries:e.map(r=>({...re({query:{from:r.from,to:r.to}}),meta:_e,staleTime:he}))}),n=e.map(r=>r.from).join("|"),a=t.map(r=>r.data),i=t.map(r=>r.isPending).join("|"),l=p.useMemo(()=>a.flatMap(r=>r?.items??[]),[n,i]),c=p.useMemo(()=>{const r=new Set;return e.forEach((u,o)=>{t[o]?.isPending&&r.add(u.from)}),r},[n,i]);return{spans:l,pendingWindows:c,error:t.find(r=>r.error)?.error??null,refetch:()=>{for(const r of t)r.error&&r.refetch()}}}const S=W(400,404),Le=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),Pe=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Le.has(a)}});function mt(e){const{data:t,isLoading:n,error:a}=U({...ie({path:{messageId:e}}),meta:S});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function ft(){const{data:e,isLoading:t,error:n}=U({...ue({query:{state:"Pending"}}),meta:S});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const I={kind:"answered"},O=e=>({kind:"refused",message:ve(e)});function xt(){const e=oe(),t=p.useCallback(()=>Pe(e),[e]),n=A({...le(),meta:S,onSuccess:t}),a=A({...ce(),meta:S,onSuccess:t}),i=A({...de(),meta:S,onSuccess:t}),l=p.useCallback((u,o)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:o}}).then(()=>I).catch(O),[n]),c=p.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>I).catch(O),[a]),r=p.useCallback((u,o)=>i.mutateAsync({path:{suggestionId:u},body:{muteSender:o}}).then(()=>I).catch(O),[i]);return p.useMemo(()=>({accept:l,decline:c,dismiss:r,isAnswering:n.isPending||a.isPending||i.isPending}),[l,c,r,n.isPending,a.isPending,i.isPending])}const C=30,Be=6,X={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},Ze="The invitation named a time zone nothing could resolve, so this time may be hours out.";function pt(e){if(e.state!=="Dismissed")return e.method==="Cancel"?e.state==="Pending"?{state:"cancelled",rsvp:"noReply"}:void 0:e.state==="Superseded"?{state:"superseded",rsvp:"noReply"}:e.state==="Accepted"?{state:"answered",rsvp:"accepted"}:e.state==="Declined"?{state:"answered",rsvp:"declined"}:e.state==="Tentative"?{state:"answered",rsvp:"tentative"}:{state:"pending",rsvp:"noReply"}}const $e=e=>e.source!=="TextHeuristic";function ht(e){return e.allDay?e.dtStart.slice(0,10):k(new Date(e.dtStart))}const Y=e=>e.summary===""?"Untitled event":e.summary;function gt(e){if(e.allDay){const t=e.dtStart.slice(0,10),n=e.dtEnd.slice(0,10),a=n>t?y(n,-1):t;return a===t?`${z(t)}, all day`:`${z(t)} – ${z(a)}, all day`}return ge({start:e.dtStart,end:e.dtEnd,allDay:e.allDay})}function We(e,t){return{id:e.suggestionId,calendarId:t.calendarId,title:Y(e),start:e.dtStart,end:e.dtEnd,allDay:e.allDay,location:e.location,notes:"",attendees:[],myRsvp:"noReply",threadId:t.threadId,threadSubject:t.threadSubject,timeZone:"",zoneCertainty:X[e.zoneCertainty],recurrenceRule:"",seriesId:"",seriesException:!1,status:"confirmed"}}function yt(e,t,n){const a=e.organizer===""?n.senderName:e.organizer;return{id:e.suggestionId,threadId:n.threadId,proposed:We(e,n),organizerName:a===""?"The sender":a,organizerEmail:e.organizer,method:"ics",evidence:"",state:t,sequence:e.sequence}}function bt(e,t){return{id:e.suggestionId,title:Y(e),start:e.dtStart,end:e.dtEnd,allDay:e.allDay,location:e.location,threadId:t.threadId,threadSubject:t.threadSubject,sender:t.sender,senderAddress:e.organizer,confidence:$e(e)?1:.6,ambiguity:e.zoneCertainty==="Ambiguous"?Ze:"",suggestedCalendarId:t.calendarId,timeZone:"",zoneCertainty:X[e.zoneCertainty]}}const Ue=(e,t)=>Date.parse(t.start)<Date.parse(e.end)&&Date.parse(t.end)>Date.parse(e.start);function vt(e,t){return t.filter(n=>Ue(e,n)).map(n=>({id:`${n.start}/${n.end}`,label:`Busy ${F(n.start)} – ${F(n.end)}`}))}function Nt(e,t){const n=K([e],t).get(e)??[],a=[];for(const i of G(e,n,C))for(let l=i.startMinute;l+C<=i.endMinute&&a.length<Be;l+=C)a.push({date:e,endDate:e,startTime:_(l),endTime:_(l+C),allDay:!1});return a}function jt(e,t,n){const a=t.filter(i=>n.includes(i.startTime)).map(i=>`${L(i.startTime)} – ${L(i.endTime)}`);return`${ye(e)}: ${a.join(", ")}`}export{pt as A,ht as B,Je as C,vt as D,tt as E,yt as F,Nt as G,jt as H,Ce as Z,Se as a,it as b,je as c,dt as d,lt as e,ct as f,Te as g,Re as h,rt as i,Ie as j,ze as k,at as l,Ve as m,et as n,ft as o,xt as p,gt as q,Ae as r,ke as s,bt as t,ut as u,nt as v,ot as w,st as x,mt as y,$e as z};
|
|
1
|
+
import{e as V,t as f,j as s,ar as $,r as p,W as ee,X as te,dn as se,f as R,aQ as ne,ah as ae,bZ as k,et as re,s as W,c as U,eu as ie,h as oe,i as A,ev as le,ew as ce,ex as de,ey as ue}from"./index-CTrN7dU7.js";import{c as me,R as fe,z as xe,A as pe,B as G,C as he,x as F,E as z,F as ge,e as L,G as _,y as ye}from"./calendar-format-nYSxDVLX.js";import{M}from"./mail-2Lzca0sU.js";import{G as q}from"./calendar-report-_QLAbdRS.js";import{u as be}from"./useQueries-8ibIA6jj.js";import{f as ve}from"./ErrorState-DWzQfscg.js";import{b as y,e as Q}from"./useCalendars-DSVgnNGS.js";const Ne=V("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);function je(e){const t=me(e.color),n=e.rsvp==="tentative"||e.status==="tentative";return f("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",t.soft,t.text,t.rail,e.layout==="column"||e.stacked?"flex-col":"items-center gap-1.5",n&&"border-y border-r border-dashed",n&&t.border,e.rsvp==="declined"&&"opacity-60",e.selected&&"ring-2 ring-ring",e.density==="compact"?"text-2xs":"text-xs")}function Se({title:e,timeText:t,layout:n,rsvp:a,hasThread:i,isRecurring:l,zoneCertainty:c,trailing:r,detail:u}){const o=n==="column",d=c==="ambiguous",m=!o&&u!==void 0,x=s.jsxs("span",{className:f("flex min-w-0 items-center gap-1",o&&"w-full",a==="declined"&&"line-through"),children:[t!==""&&s.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:t}),s.jsx("span",{className:"truncate font-medium",children:e})]}),g=(l||i||d)&&s.jsxs("span",{className:f("flex shrink-0 items-center gap-1",o&&"mt-0.5",!o&&r===void 0&&"ml-auto"),children:[l&&s.jsx(fe,{className:"size-2.5","aria-label":"Repeats"}),i&&s.jsx(M,{className:"size-2.5","aria-label":"From mail"}),d&&s.jsx(q,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),b=r!==void 0&&s.jsx("span",{className:f("shrink-0 opacity-80",!o&&"ml-auto"),children:r});return s.jsxs(s.Fragment,{children:[m?s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[x,g,b]}):s.jsxs(s.Fragment,{children:[x,g,b]}),u]})}function Je({title:e,timeText:t,color:n,layout:a,density:i,rsvp:l,status:c,hasThread:r,isRecurring:u,zoneCertainty:o,selected:d,onClick:m,leading:x,trailing:g,detail:b}){const j=a==="column";return s.jsxs("button",{type:"button",onClick:m,"aria-pressed":d,className:f("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",j?"h-full":"items-start",x!==void 0&&"gap-2"),children:[x,s.jsx("span",{className:f(je({color:n,layout:a,density:i,rsvp:l,status:c,selected:d,stacked:b!==void 0}),"flex-1",j&&"h-full"),children:s.jsx(Se,{title:e,timeText:t,layout:a,rsvp:l,hasThread:r,isRecurring:u,zoneCertainty:o,trailing:g,detail:b})})]})}function Ve({text:e,reportHref:t,className:n}){return s.jsxs("div",{role:"alert",className:f("flex items-start gap-1.5 rounded-md border border-danger/40 bg-danger-soft p-2 text-xs text-danger",n),children:[s.jsx($,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"min-w-0 flex-1",children:[e,t&&s.jsxs(s.Fragment,{children:[" ",s.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]})]})]})}const P=96;function et({children:e,hasCard:t,onConfirm:n,onReject:a,blocked:i,blockedReason:l,remaining:c,confirmLabel:r="Add",emptyText:u="Nothing in your mail is waiting on a decision about time.",className:o}){const[d,m]=p.useState(0),[x,g]=p.useState(null);if(!t)return s.jsxs("div",{className:f("flex flex-col items-center gap-2 p-6 text-center",o),children:[s.jsx(ee,{className:"size-6 text-fg-subtle","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:u})]});const b=Math.abs(d)>P,j=d>0;return s.jsxs("div",{className:f("flex flex-col gap-3",o),children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"touch-pan-y select-none",style:{transform:`translateX(${d}px) rotate(${d/40}deg)`,transition:x===null?"transform 180ms ease-out":"none"},onPointerDown:v=>{v.currentTarget.setPointerCapture(v.pointerId),g(v.clientX)},onPointerMove:v=>{x!==null&&m(v.clientX-x)},onPointerUp:()=>{Math.abs(d)>P&&(d>0&&!i&&n(),d<0&&a()),g(null),m(0)},onPointerCancel:()=>{g(null),m(0)},children:e}),b&&s.jsx("span",{className:f("pointer-events-none absolute top-3 rounded-md px-2 py-1 text-xs font-semibold",j?"right-3 bg-accent-soft text-accent":"left-3 bg-danger-soft text-danger"),children:j?i?l:r:"Not this"})]}),s.jsxs("p",{className:"text-center text-2xs text-fg-subtle",children:[c," left · swipe right to accept, left to drop, or use the buttons"]})]})}const Ce="Pick a clock first. The mail never said, and the reader will not choose for you.";function ke(e,t){const n=e.zoneOptions;return n===void 0?{settled:!0,timeZone:""}:n.some(a=>a.timeZone===t)?{settled:!0,timeZone:t}:{settled:!1,reason:Ce}}function B(e){return e.threadSubject===""?e.sender:`${e.sender} — ${e.threadSubject}`}function Ee(e){return e>=.85?"Read cleanly":e>=.6?"Read with gaps":"Barely read"}function tt({suggestion:e,whenText:t,onAdd:n,onReview:a,onDismiss:i,onOpenThread:l,busy:c=!1,addBlocked:r=!1,zoneChoice:u,onZoneChoice:o,addLabel:d="Add",touch:m,className:x}){const[g,b]=p.useState(""),[j,v]=p.useState(!1),w=p.useId(),D=u??g,J=h=>{v(!1),o?o(h):b(h)},N=ke(e,D),T=h=>()=>{if(!N.settled){v(!0);return}h(N.timeZone)};return s.jsxs("article",{"aria-label":e.title,className:f("flex flex-col gap-2 rounded-lg border border-dashed border-line-strong bg-surface-sunken p-3",x),children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:["Suggested from mail · ",Ee(e.confidence)]}),s.jsx("span",{className:"block truncate text-sm font-medium text-fg",children:e.title}),s.jsx("span",{className:"block text-xs text-fg-muted",children:t}),e.location!==""&&s.jsx("span",{className:"block truncate text-xs text-fg-muted",children:e.location})]}),s.jsx("button",{type:"button","aria-label":"Dismiss suggestion",onClick:i,disabled:c,className:f("flex shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",m?"size-11":"size-7"),children:s.jsx(te,{className:"size-4"})})]}),e.ambiguity!==""&&s.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-warning",children:[s.jsx($,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),e.ambiguity]}),l?s.jsxs("button",{type:"button",onClick:l,className:"flex w-full min-w-0 items-center gap-1.5 rounded-sm text-left text-2xs text-accent-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(M,{className:"size-3 shrink-0"}),s.jsx("span",{className:"truncate",children:B(e)})]}):s.jsxs("p",{className:"flex w-full min-w-0 items-center gap-1.5 text-2xs text-fg-subtle",children:[s.jsx(M,{className:"size-3 shrink-0"}),s.jsx("span",{className:"truncate",children:B(e)})]}),e.zoneOptions&&s.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-warning/40 p-2",children:[s.jsxs("p",{className:"flex items-center gap-1.5 text-2xs font-semibold text-warning",children:[s.jsx(q,{className:"size-3 shrink-0","aria-hidden":!0}),"Which clock is this on?"]}),e.zoneOptions.map(h=>s.jsxs("button",{type:"button","aria-pressed":D===h.timeZone,onClick:()=>J(h.timeZone),className:f("rounded-md border px-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",m&&"min-h-11",D===h.timeZone?"border-accent bg-accent-soft":"border-line bg-surface hover:border-line-strong"),children:[s.jsx("span",{className:"block text-xs font-medium text-fg",children:h.label}),s.jsx("span",{className:"block text-2xs text-fg-subtle",children:h.note})]},h.timeZone))]}),!N.settled&&s.jsx(se,{id:w,reason:N.reason,nudged:j,className:"text-2xs text-warning"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(R,{variant:"primary",size:m?"md":"sm",icon:s.jsx(ne,{className:"size-3.5"}),onClick:T(n),disabled:c||r,"aria-describedby":N.settled?void 0:w,className:f(m&&"min-h-11 flex-1",!N.settled&&"opacity-55"),children:d}),a&&s.jsx(R,{variant:"secondary",size:m?"md":"sm",icon:s.jsx(Ne,{className:"size-3.5"}),onClick:T(a),disabled:c,"aria-describedby":N.settled?void 0:w,className:f(m&&"min-h-11",!N.settled&&"opacity-55"),children:"Change first"})]})]})}function st(e){return e.defaultCalendarId!==""?"ready":e.error!==null?"failed":e.isLoading?"loading":"none"}function nt(e,t){if(e!=="ready")return e==="loading"?"Reading your calendars…":e==="failed"?s.jsxs(s.Fragment,{children:["Couldn't read your calendars, so there is nowhere to add this yet. Reload to try again."," ",s.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]}):s.jsxs(s.Fragment,{children:["You have no calendar yet, so there is nowhere to add this."," ",s.jsx(ae,{to:"/settings/calendars",className:"font-medium text-accent hover:underline",children:"Create a calendar"})]})}const we=24,H=7,De=52,E=De*7,Ae=e=>({from:y(e,-10),to:y(e,we),floor:y(e,-E),ceiling:y(e,E)}),ze=e=>e.from<=e.floor,Ie=e=>e.to>=e.ceiling,Oe=(e,t)=>e>t?e:t,Me=(e,t)=>e<t?e:t,Te=e=>ze(e)?e:{...e,from:Oe(y(e.from,-H),e.floor)},Re=e=>Ie(e)?e:{...e,to:Me(y(e.to,H),e.ceiling)},at=e=>Te({...e,floor:y(e.from,-E)}),rt=e=>Re({...e,ceiling:y(e.to,E)});function it(e,t){return t>=e.from&&t<=e.to?e:Ae(t)}function ot(e){const t=new Map;for(const n of e){const a=Q("week",n);t.has(a.from)||t.set(a.from,a)}return[...t.values()]}const lt=e=>Q("week",e).from,Fe=1440,Z=e=>e.getHours()*60+e.getMinutes();function K(e,t){const n=new Set(e),a=new Map;for(const i of t){const l=new Date(i.start),c=new Date(i.end);if(Number.isNaN(l.getTime())||Number.isNaN(c.getTime())||c.getTime()<=l.getTime())continue;const r=k(l),u=k(new Date(c.getTime()-1));for(let o=r;o<=u;o=y(o,1)){if(!n.has(o))continue;const d=o===r?Z(l):0,m=k(c)===o?Z(c):Fe;if(m<=d)continue;const x=a.get(o);x?x.push({from:d,to:m}):a.set(o,[{from:d,to:m}])}}for(const[i,l]of a)a.set(i,xe(l));return a}function ct(e,t){const n=K(e,t);return new Map(e.map(a=>[a,G(a,n.get(a)??[])]))}const dt=e=>pe(e.from,e.to),Le=W(400,404);function ut(e){const t=be({queries:e.map(r=>({...re({query:{from:r.from,to:r.to}}),meta:Le,staleTime:he}))}),n=e.map(r=>r.from).join("|"),a=t.map(r=>r.data),i=t.map(r=>r.isPending).join("|"),l=p.useMemo(()=>a.flatMap(r=>r?.items??[]),[n,i]),c=p.useMemo(()=>{const r=new Set;return e.forEach((u,o)=>{t[o]?.isPending&&r.add(u.from)}),r},[n,i]);return{spans:l,pendingWindows:c,error:t.find(r=>r.error)?.error??null,refetch:()=>{for(const r of t)r.error&&r.refetch()}}}const S=W(400,404),_e=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),Pe=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&_e.has(a)}});function mt(e){const{data:t,isLoading:n,error:a}=U({...ie({path:{messageId:e}}),meta:S});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function ft(){const{data:e,isLoading:t,error:n}=U({...ue({query:{state:"Pending"}}),meta:S});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const I={kind:"answered"},O=e=>({kind:"refused",message:ve(e)});function xt(){const e=oe(),t=p.useCallback(()=>Pe(e),[e]),n=A({...le(),meta:S,onSuccess:t}),a=A({...ce(),meta:S,onSuccess:t}),i=A({...de(),meta:S,onSuccess:t}),l=p.useCallback((u,o)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:o}}).then(()=>I).catch(O),[n]),c=p.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>I).catch(O),[a]),r=p.useCallback((u,o)=>i.mutateAsync({path:{suggestionId:u},body:{muteSender:o}}).then(()=>I).catch(O),[i]);return p.useMemo(()=>({accept:l,decline:c,dismiss:r,isAnswering:n.isPending||a.isPending||i.isPending}),[l,c,r,n.isPending,a.isPending,i.isPending])}const C=30,Be=6,X={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},Ze="The invitation named a time zone nothing could resolve, so this time may be hours out.";function pt(e){if(e.state!=="Dismissed")return e.method==="Cancel"?e.state==="Pending"?{state:"cancelled",rsvp:"noReply"}:void 0:e.state==="Superseded"?{state:"superseded",rsvp:"noReply"}:e.state==="Accepted"?{state:"answered",rsvp:"accepted"}:e.state==="Declined"?{state:"answered",rsvp:"declined"}:e.state==="Tentative"?{state:"answered",rsvp:"tentative"}:{state:"pending",rsvp:"noReply"}}const $e=e=>e.source!=="TextHeuristic";function ht(e){return e.allDay?e.dtStart.slice(0,10):k(new Date(e.dtStart))}const Y=e=>e.summary===""?"Untitled event":e.summary;function gt(e){if(e.allDay){const t=e.dtStart.slice(0,10),n=e.dtEnd.slice(0,10),a=n>t?y(n,-1):t;return a===t?`${z(t)}, all day`:`${z(t)} – ${z(a)}, all day`}return ge({start:e.dtStart,end:e.dtEnd,allDay:e.allDay})}function We(e,t){return{id:e.suggestionId,calendarId:t.calendarId,title:Y(e),start:e.dtStart,end:e.dtEnd,allDay:e.allDay,location:e.location,notes:"",attendees:[],myRsvp:"noReply",threadId:t.threadId,threadSubject:t.threadSubject,timeZone:"",zoneCertainty:X[e.zoneCertainty],recurrenceRule:"",seriesId:"",seriesException:!1,status:"confirmed"}}function yt(e,t,n){const a=e.organizer===""?n.senderName:e.organizer;return{id:e.suggestionId,threadId:n.threadId,proposed:We(e,n),organizerName:a===""?"The sender":a,organizerEmail:e.organizer,method:"ics",evidence:"",state:t,sequence:e.sequence}}function bt(e,t){return{id:e.suggestionId,title:Y(e),start:e.dtStart,end:e.dtEnd,allDay:e.allDay,location:e.location,threadId:t.threadId,threadSubject:t.threadSubject,sender:t.sender,senderAddress:e.organizer,confidence:$e(e)?1:.6,ambiguity:e.zoneCertainty==="Ambiguous"?Ze:"",suggestedCalendarId:t.calendarId,timeZone:"",zoneCertainty:X[e.zoneCertainty]}}const Ue=(e,t)=>Date.parse(t.start)<Date.parse(e.end)&&Date.parse(t.end)>Date.parse(e.start);function vt(e,t){return t.filter(n=>Ue(e,n)).map(n=>({id:`${n.start}/${n.end}`,label:`Busy ${F(n.start)} – ${F(n.end)}`}))}function Nt(e,t){const n=K([e],t).get(e)??[],a=[];for(const i of G(e,n,C))for(let l=i.startMinute;l+C<=i.endMinute&&a.length<Be;l+=C)a.push({date:e,endDate:e,startTime:L(l),endTime:L(l+C),allDay:!1});return a}function jt(e,t,n){const a=t.filter(i=>n.includes(i.startTime)).map(i=>`${_(i.startTime)} – ${_(i.endTime)}`);return`${ye(e)}: ${a.join(", ")}`}export{pt as A,ht as B,Je as C,vt as D,tt as E,yt as F,Nt as G,jt as H,Ce as Z,Se as a,it as b,je as c,dt as d,lt as e,ct as f,Te as g,Re as h,rt as i,Ie as j,ze as k,at as l,Ve as m,et as n,ft as o,xt as p,gt as q,Ae as r,ke as s,bt as t,ut as u,nt as v,ot as w,st as x,mt as y,$e as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as k,h as z,r,bb as $,i as y,bc as _,bd as H,be as X,s as A,j as e,ay as q,az as N,B as j,f,aQ as J,a3 as G,g as Q,bf as M,aB as Y,bg as ee,c as se,bh as ae,aJ as L,bi as te,bj as ne,bk as re,u as ie,aP as de,aR as oe}from"./index-DIEie7Yj.js";import{S as le}from"./settings-screen-xG7ySj9h.js";import{C as P,a as D,b as R,c as O}from"./card-DR5Bp3Kv.js";import{U as S,u as ce}from"./useCalendars-CLOowhmo.js";import{C as B}from"./confirm-dialog-Cfujg7eJ.js";import{f as w,E as ue}from"./ErrorState-VVAbrV2n.js";import{R as me}from"./refresh-cw-Ckd0XdaA.js";import{C as he}from"./copy-CkTTUrrp.js";import{u as V}from"./useCalendarWrites-LDB7-Ss2.js";import{s as pe}from"./calendar-subscription-B-aAc2Gy.js";import"./avatar-C2fjt5Oo.js";import"./chevron-left-wWboU2sl.js";import"./menu-C21gm-LC.js";import"./circle-help-CxYf0rqb.js";const xe=k("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);const be=k("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const ge=k("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const fe=k("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ve=k("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),T=A(400,404),I={kind:"written"},F=s=>({kind:"refused",message:w(s)});function W(){const s=z(),n=V(),t=r.useCallback(()=>s.invalidateQueries({queryKey:$()}),[s]),a=r.useCallback(()=>(n(),t()),[n,t]),i=y({..._(),meta:T,onSuccess:t}),d=y({...H(),meta:T,onSuccess:a}),o=y({...X(),meta:T,onSuccess:a}),l=r.useCallback(c=>i.mutateAsync({body:c}).then(()=>I).catch(F),[i]),m=r.useCallback((c,x)=>d.mutateAsync({path:{calendarId:c},body:x}).then(()=>I).catch(F),[d]),h=r.useCallback(c=>o.mutateAsync({path:{calendarId:c}}).then(()=>I).catch(F),[o]);return r.useMemo(()=>({createCalendar:l,updateCalendar:m,deleteCalendar:h,isWriting:i.isPending||d.isPending||o.isPending}),[l,m,h,i.isPending,d.isPending,o.isPending])}const E=Intl.supportedValuesOf("timeZone");function K({id:s,value:n,disabled:t,onChange:a}){const i=n===S||E.includes(n)?E:[n,...E];return e.jsxs(q,{id:s,value:n,disabled:t,onChange:d=>a(d.target.value),children:[e.jsx("option",{value:S,children:"None (read as UTC)"}),i.map(d=>e.jsx("option",{value:d,children:d},d))]})}const ye=s=>({title:`Delete ${s}?`,description:`This removes ${s} and every event in it, and any subscription address stops working. It cannot be undone.`}),je=s=>s.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);function Ce({isBusy:s,problem:n,onCreate:t}){const[a,i]=r.useState(""),[d,o]=r.useState(void 0),[l,m]=r.useState(S),h=r.useId(),c=r.useId(),x=r.useId(),u=r.useId(),p=d??je(a),b=a.trim()!==""&&p.trim()!=="";return e.jsxs(P,{className:"max-w-xl",role:"region","aria-labelledby":h,children:[e.jsx(D,{children:e.jsx(R,{id:h,children:"New calendar"})}),e.jsx(O,{children:e.jsxs("form",{className:"space-y-3",onSubmit:g=>{g.preventDefault(),b&&t({displayName:a.trim(),urlSegment:p.trim(),timezone:l}).then(v=>{v&&(i(""),o(void 0),m(S))})},children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:c,className:"text-xs font-medium text-fg-muted",children:"Name"}),e.jsx(N,{id:c,value:a,maxLength:140,disabled:s,onChange:g=>i(g.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:x,className:"text-xs font-medium text-fg-muted",children:"Address"}),e.jsx(N,{id:x,value:p,maxLength:64,disabled:s,onChange:g=>o(g.target.value)})]}),e.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[e.jsx("label",{htmlFor:u,className:"text-xs font-medium text-fg-muted",children:"Time zone"}),e.jsx(K,{id:u,value:l,disabled:s,onChange:m})]})]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"The address names the calendar for CalDAV clients and cannot be changed later. The name and zone can."}),n!==""&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsx("p",{className:"font-medium",children:"The calendar was not added."}),e.jsx("p",{className:"mt-0.5 break-words",children:n})]}),e.jsx(f,{type:"submit",variant:"primary",size:"sm",disabled:s||!b,icon:e.jsx(J,{className:"size-3.5"}),children:s?"Adding…":"Add calendar"})]})})]})}function Ne({calendarName:s,timezone:n,isBusy:t,problem:a,onSave:i,onDelete:d}){const[o,l]=r.useState(s),[m,h]=r.useState(n),[c,x]=r.useState(!1),u=r.useId(),p=r.useId(),b=o.trim(),g=b!==s||m!==n,v=ye(s);return e.jsxs(e.Fragment,{children:[e.jsxs("form",{className:"space-y-3",onSubmit:C=>{C.preventDefault(),!(!g||b==="")&&i({displayName:b,timezone:m})},children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:u,className:"text-xs font-medium text-fg-muted",children:"Name"}),e.jsx(N,{id:u,value:o,maxLength:140,disabled:t,onChange:C=>l(C.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:p,className:"text-xs font-medium text-fg-muted",children:"Time zone"}),e.jsx(K,{id:p,value:m,disabled:t,onChange:h})]})]}),a!==""&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:[s," was not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:a})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{type:"submit",variant:"secondary",size:"sm",disabled:t||!g||b==="",icon:e.jsx(ve,{className:"size-3.5"}),children:"Save changes"}),e.jsx(f,{type:"button",variant:"danger",size:"sm",disabled:t,icon:e.jsx(G,{className:"size-3.5"}),onClick:()=>x(!0),children:"Delete calendar"})]})]}),e.jsx(B,{isOpen:c,title:v.title,description:v.description,confirmLabel:"Delete calendar",destructive:!0,onConfirm:()=>{x(!1),d()},onCancel:()=>x(!1)})]})}const ke=s=>({title:`Replace the address for ${s}?`,description:"Every client already subscribed to the current address stops updating and has to be pointed at the new one. The new address is shown once."}),Se=s=>({title:`Stop sharing ${s}?`,description:"The address stops working immediately and every client subscribed to it stops updating. Sharing again mints a different address."});function we({calendarName:s,url:n,onDismiss:t}){const[a,i]=r.useState(!1),[d,o]=r.useState(!1),l=r.useRef(0);r.useEffect(()=>()=>window.clearTimeout(l.current),[]);const m=()=>{navigator.clipboard.writeText(n).then(()=>{o(!1),i(!0),l.current=window.setTimeout(()=>i(!1),2e3)}).catch(()=>o(!0))};return e.jsxs("div",{className:"mt-3 space-y-2 rounded-sm border border-accent-2/40 bg-accent-2/10 px-3 py-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Subscribe with this address. It is shown once and cannot be read back."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("input",{readOnly:!0,value:n,"aria-label":`Subscription address for ${s}`,onFocus:h=>h.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg"}),e.jsx(f,{variant:"primary",size:"sm",icon:a?e.jsx(Y,{className:"size-3.5"}):e.jsx(he,{className:"size-3.5"}),onClick:m,children:a?"Copied":"Copy address"})]}),d&&e.jsx(j,{tone:"warning",variant:"soft",children:"The address could not be copied to the clipboard. Select it above and copy it by hand before leaving this page."}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Anyone holding this address can read every event in this calendar, without signing in. Rotate it if it reaches the wrong person."}),e.jsx(f,{variant:"ghost",size:"sm",onClick:t,children:"I've saved it"})]})}function Te({createdAt:s,rotatedAt:n,isBusy:t,onRotate:a,onRevoke:i}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Q,{tone:"positive",children:"shared"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Address created ",M(s,"medium"),n>0?`, last replaced ${M(n,"medium")}`:""]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"The address itself is not stored in readable form, so it cannot be shown again. Replace it if you no longer know where it went."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{variant:"secondary",size:"sm",disabled:t,icon:e.jsx(me,{className:"size-3.5"}),onClick:a,children:"Replace address"}),e.jsx(f,{variant:"danger",size:"sm",disabled:t,icon:e.jsx(G,{className:"size-3.5"}),onClick:i,children:"Stop sharing"})]})]})}function Ie({calendarName:s,details:n,state:t,mintedUrl:a,isBusy:i,actionError:d,onMint:o,onRevoke:l,onDismissMinted:m,onRetry:h}){const[c,x]=r.useState("none"),u=r.useId(),p=()=>{const g=c;x("none"),g==="rotate"&&o(),g==="revoke"&&l()},b=c==="revoke"?Se(s):ke(s);return e.jsxs(P,{className:"max-w-xl",role:"region","aria-labelledby":u,children:[e.jsx(D,{children:e.jsx(R,{id:u,children:s})}),e.jsxs(O,{children:[n&&e.jsx("div",{className:"mb-4 border-b border-line pb-4",children:n}),t.status==="loading"&&a===""&&e.jsx("div",{className:"h-12 animate-pulse rounded-sm bg-surface-sunken","aria-busy":"true","aria-label":`Loading the subscription address for ${s}`}),t.status==="unreadable"&&a===""&&e.jsx(ue,{variant:"inline",title:`Couldn't read whether ${s} is shared`,error:t.error,onRetry:h}),t.status==="absent"&&a===""&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Give this calendar a secret address and Apple Calendar, Google Calendar, Outlook and Thunderbird can subscribe to it read-only. Nobody signs in — the address is the credential, so treat it like a password."}),e.jsx(f,{variant:"primary",size:"sm",disabled:i,icon:e.jsx(be,{className:"size-3.5"}),onClick:o,children:i?"Creating…":"Create subscription address"})]}),t.status==="active"&&e.jsx(Te,{createdAt:t.createdAt,rotatedAt:t.rotatedAt,isBusy:i,onRotate:()=>x("rotate"),onRevoke:()=>x("revoke")}),d!=null&&e.jsxs(j,{tone:"danger",variant:"soft",className:"mt-3",children:[e.jsxs("p",{className:"font-medium",children:["The subscription address for ",s," was not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:w(d)})]}),a!==""&&e.jsx(we,{calendarName:s,url:a,onDismiss:m})]}),e.jsx(B,{isOpen:c!=="none",title:b.title,description:b.description,confirmLabel:c==="revoke"?"Stop sharing":"Replace address",destructive:!0,onConfirm:p,onCancel:()=>x("none")})]})}const Fe="/feeds/calendar/",Ee=".ics",Me=(s,n)=>`webcal://${s}${Fe}${n}${Ee}`;function ze(s){const n=z(),[t,a]=r.useState(""),i=ee({path:{calendarId:s}}),d=se({...ae({path:{calendarId:s}}),meta:A(404,403),retry:!1}),o=()=>{n.invalidateQueries({queryKey:i})},l=r.useRef(()=>{}),m=y({...te(),meta:L,onMutate:()=>{l.current()},onSuccess:()=>{a(""),o()}}),h=y({...ne(),meta:L,gcTime:0,onMutate:()=>{m.reset()},onSuccess:Z=>{a(Me(window.location.host,Z.feedToken)),o()}});l.current=h.reset;const{mutate:c,reset:x}=h,{mutate:u}=m,p=r.useCallback(()=>{c({path:{calendarId:s}})},[s,c]),b=r.useCallback(()=>{u({path:{calendarId:s}})},[s,u]),g=r.useCallback(()=>{a(""),x()},[x]),{refetch:v}=d,C=r.useCallback(()=>{v()},[v]);return{state:Ae(d),mintedUrl:t,isBusy:h.isPending||m.isPending,actionError:h.error??m.error,mint:p,revoke:b,dismissMinted:g,retry:C}}function Ae(s){return s.error?re(s.error)?{status:"absent"}:{status:"unreadable",error:s.error}:s.isPending?{status:"loading"}:s.data?{status:"active",createdAt:s.data.createdAt,rotatedAt:s.data.rotatedAt}:{status:"absent"}}function Pe({calendarId:s,calendarName:n,details:t}){const a=ze(s);return e.jsx(Ie,{calendarName:n,details:t,state:a.state,mintedUrl:a.mintedUrl,isBusy:a.isBusy,actionError:a.actionError,onMint:a.mint,onRevoke:a.revoke,onDismissMinted:a.dismissMinted,onRetry:a.retry})}function De({calendarId:s,calendarName:n,timezone:t,subscription:a}){const{updateCalendar:i,deleteCalendar:d,isWriting:o}=W(),[l,m]=r.useState(""),h=c=>m(c.kind==="refused"?c.message:"");return e.jsx(Pe,{calendarId:s,calendarName:n,details:e.jsxs(e.Fragment,{children:[a,e.jsx(Ne,{calendarName:n,timezone:t,isBusy:o,problem:l,onSave:c=>{m(""),i(s,c).then(h)},onDelete:()=>{m(""),d(s).then(h)}},`${n}\0${t}`)]})})}const Re="Subscribe to a calendar";function Oe({isBusy:s,error:n,onSubscribe:t}){const a=r.useId(),i=r.useId(),d=r.useId(),[o,l]=r.useState(""),[m,h]=r.useState(""),c=o.trim()!==""&&m.trim()!=="",x=u=>{u.preventDefault(),c&&t({displayName:o,url:m},()=>{l(""),h("")})};return e.jsxs(P,{className:"max-w-xl",role:"region","aria-labelledby":a,children:[e.jsx(D,{children:e.jsx(R,{id:a,children:Re})}),e.jsx(O,{children:e.jsxs("form",{className:"space-y-3",onSubmit:x,children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Paste the secret iCal address from Google Calendar, a published Outlook calendar or any other feed. It shows here read-only and refreshes on its own."}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:i,className:"text-sm font-medium text-fg",children:"Calendar name"}),e.jsx(N,{id:i,value:o,onChange:u=>l(u.target.value),placeholder:"Team rota",autoComplete:"off"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:d,className:"text-sm font-medium text-fg",children:"Calendar address"}),e.jsx(N,{id:d,value:m,onChange:u=>h(u.target.value),placeholder:"https://calendar.google.com/calendar/ical/…/basic.ics",autoComplete:"off",spellCheck:!1,inputMode:"url"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"For Google Calendar the address is the password to the calendar. Reader never shows it in full again."})]}),e.jsx(f,{type:"submit",variant:"primary",size:"sm",disabled:!c||s,icon:e.jsx(xe,{className:"size-3.5"}),children:s?"Subscribing…":"Subscribe"}),n!=null&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsx("p",{className:"font-medium",children:"The calendar was not added."}),e.jsx("p",{className:"mt-0.5 break-words",children:w(n)})]})]})})]})}function Le({calendarName:s,subscriptionUrl:n,enabled:t,fetchedAt:a,error:i,isBusy:d,actionError:o,onSetEnabled:l}){return e.jsxs("div",{className:"mb-4 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Q,{tone:t?"positive":"neutral",children:t?"subscribed":"paused"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Read-only, from ",pe(n),a>0?`. Last updated ${M(a,"medium")}`:""]})]}),i!==""&&e.jsxs(j,{tone:"warning",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:[s," was not refreshed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:i})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:t?"Events are read from the feed on a schedule and cannot be edited here.":"Updates are paused. The events already here stay until you resume or remove the calendar."}),e.jsx(f,{variant:"secondary",size:"sm",disabled:d,icon:t?e.jsx(ge,{className:"size-3.5"}):e.jsx(fe,{className:"size-3.5"}),onClick:()=>l(!t),children:t?"Pause updates":"Resume updates"}),o!=null&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:["Updates for ",s," were not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:w(o)})]})]})}const U=A(400,404),Ue=()=>`subscribed-${crypto.randomUUID().slice(0,8)}`;function $e(){const s=z(),n=V(),t=()=>{s.invalidateQueries({queryKey:$()}),n()},a=y({..._(),meta:U,onSuccess:t}),i=y({...H(),meta:U,onSuccess:t}),{mutate:d}=a,o=r.useCallback((h,c)=>{d({body:{urlSegment:Ue(),displayName:h.displayName.trim(),subscriptionUrl:h.url.trim()}},{onSuccess:c})},[d]),{mutate:l}=i,m=r.useCallback((h,c)=>{l({path:{calendarId:h},body:{subscriptionEnabled:c}})},[l]);return{subscribe:o,isSubscribing:a.isPending,subscribeError:a.error,setEnabled:m,togglingCalendarId:i.isPending?i.variables?.path.calendarId??"":"",toggleFailure:{calendarId:i.variables?.path.calendarId??"",error:i.error}}}const _e=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each calendar has a name, a time zone its floating times are read in, and an address CalDAV clients reach it by. The address is fixed when the calendar is added; the name and zone can change. Deleting a calendar deletes every event in it. The default calendar is where accepted invitations land, so it cannot be deleted."}),e.jsx("p",{children:"A subscription address lets Apple Calendar, Google Calendar, Outlook and Thunderbird show a calendar from here, read-only and kept up to date."}),e.jsx("p",{children:"Those clients never sign in, so the address itself is the credential. Anyone who has it can read the calendar; nobody who has it can change anything."}),e.jsx("p",{children:"Only a hash of the address is stored, so it is shown once and cannot be looked up later. Replacing it breaks every subscription built on the old one, which is how a shared address is taken back."}),e.jsx("p",{children:"Subscribing works the other way round: paste another calendar's iCal address and its events show here, read-only, refreshed on a schedule."})]});function as(){const s=ie(),[n,t]=r.useState(!0),{calendars:a,collections:i,timeZoneByCalendarId:d,isLoading:o}=ce(),l=$e(),{createCalendar:m,isWriting:h}=W(),[c,x]=r.useState("");return e.jsx(le,{items:de,activeId:"calendars",title:"Calendars",description:"Add, rename and delete calendars, subscribe to a calendar feed, and share one with any client that can subscribe to a URL.",help:_e,helpOpen:n,onToggleHelp:()=>t(u=>!u),onSelect:u=>{const p=oe[u];p&&s({to:p})},onBackToMail:()=>{s({to:"/mail"})},children:o?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading calendars"}):e.jsxs("div",{className:"space-y-4",children:[a.map(u=>{const p=i.find(b=>b.calendarId===u.id);return e.jsx(De,{calendarId:u.id,calendarName:u.name,timezone:d[u.id]??"",subscription:p?.source==="Subscribed"&&e.jsx(Le,{calendarName:p.displayName,subscriptionUrl:p.subscriptionUrl,enabled:p.subscriptionEnabled,fetchedAt:p.subscriptionFetchedAt,error:p.subscriptionError,isBusy:l.togglingCalendarId===u.id,actionError:l.toggleFailure.calendarId===u.id?l.toggleFailure.error:void 0,onSetEnabled:b=>l.setEnabled(u.id,b)})},u.id)}),e.jsx(Oe,{isBusy:l.isSubscribing,error:l.subscribeError,onSubscribe:l.subscribe}),e.jsx(Ce,{isBusy:h,problem:c,onCreate:u=>(x(""),m(u).then(p=>p.kind==="written"?!0:(x(p.message),!1)))})]})})}export{as as component};
|
|
1
|
+
import{e as k,h as z,r,bb as $,i as y,bc as _,bd as H,be as X,s as A,j as e,ay as q,az as N,B as j,f,aQ as J,a3 as G,g as Q,bf as M,aB as Y,bg as ee,c as se,bh as ae,aJ as L,bi as te,bj as ne,bk as re,u as ie,aP as de,aR as oe}from"./index-CTrN7dU7.js";import{S as le}from"./settings-screen-BVPfYXKu.js";import{C as P,a as D,b as R,c as O}from"./card-BmYyqZU8.js";import{U as S,u as ce}from"./useCalendars-DSVgnNGS.js";import{C as B}from"./confirm-dialog-CocDko9U.js";import{f as w,E as ue}from"./ErrorState-DWzQfscg.js";import{R as me}from"./refresh-cw-CrSEtN0j.js";import{C as he}from"./copy-DgGekFwr.js";import{u as V}from"./useCalendarWrites-B66T9V8C.js";import{s as pe}from"./calendar-subscription-B-aAc2Gy.js";import"./avatar-BI9-h2CG.js";import"./chevron-left-B1U3lovQ.js";import"./menu-AiRz5rLS.js";import"./circle-help-gF5YAjts.js";const xe=k("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);const be=k("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const ge=k("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const fe=k("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ve=k("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),T=A(400,404),I={kind:"written"},F=s=>({kind:"refused",message:w(s)});function W(){const s=z(),n=V(),t=r.useCallback(()=>s.invalidateQueries({queryKey:$()}),[s]),a=r.useCallback(()=>(n(),t()),[n,t]),i=y({..._(),meta:T,onSuccess:t}),d=y({...H(),meta:T,onSuccess:a}),o=y({...X(),meta:T,onSuccess:a}),l=r.useCallback(c=>i.mutateAsync({body:c}).then(()=>I).catch(F),[i]),m=r.useCallback((c,x)=>d.mutateAsync({path:{calendarId:c},body:x}).then(()=>I).catch(F),[d]),h=r.useCallback(c=>o.mutateAsync({path:{calendarId:c}}).then(()=>I).catch(F),[o]);return r.useMemo(()=>({createCalendar:l,updateCalendar:m,deleteCalendar:h,isWriting:i.isPending||d.isPending||o.isPending}),[l,m,h,i.isPending,d.isPending,o.isPending])}const E=Intl.supportedValuesOf("timeZone");function K({id:s,value:n,disabled:t,onChange:a}){const i=n===S||E.includes(n)?E:[n,...E];return e.jsxs(q,{id:s,value:n,disabled:t,onChange:d=>a(d.target.value),children:[e.jsx("option",{value:S,children:"None (read as UTC)"}),i.map(d=>e.jsx("option",{value:d,children:d},d))]})}const ye=s=>({title:`Delete ${s}?`,description:`This removes ${s} and every event in it, and any subscription address stops working. It cannot be undone.`}),je=s=>s.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);function Ce({isBusy:s,problem:n,onCreate:t}){const[a,i]=r.useState(""),[d,o]=r.useState(void 0),[l,m]=r.useState(S),h=r.useId(),c=r.useId(),x=r.useId(),u=r.useId(),p=d??je(a),b=a.trim()!==""&&p.trim()!=="";return e.jsxs(P,{className:"max-w-xl",role:"region","aria-labelledby":h,children:[e.jsx(D,{children:e.jsx(R,{id:h,children:"New calendar"})}),e.jsx(O,{children:e.jsxs("form",{className:"space-y-3",onSubmit:g=>{g.preventDefault(),b&&t({displayName:a.trim(),urlSegment:p.trim(),timezone:l}).then(v=>{v&&(i(""),o(void 0),m(S))})},children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:c,className:"text-xs font-medium text-fg-muted",children:"Name"}),e.jsx(N,{id:c,value:a,maxLength:140,disabled:s,onChange:g=>i(g.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:x,className:"text-xs font-medium text-fg-muted",children:"Address"}),e.jsx(N,{id:x,value:p,maxLength:64,disabled:s,onChange:g=>o(g.target.value)})]}),e.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[e.jsx("label",{htmlFor:u,className:"text-xs font-medium text-fg-muted",children:"Time zone"}),e.jsx(K,{id:u,value:l,disabled:s,onChange:m})]})]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"The address names the calendar for CalDAV clients and cannot be changed later. The name and zone can."}),n!==""&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsx("p",{className:"font-medium",children:"The calendar was not added."}),e.jsx("p",{className:"mt-0.5 break-words",children:n})]}),e.jsx(f,{type:"submit",variant:"primary",size:"sm",disabled:s||!b,icon:e.jsx(J,{className:"size-3.5"}),children:s?"Adding…":"Add calendar"})]})})]})}function Ne({calendarName:s,timezone:n,isBusy:t,problem:a,onSave:i,onDelete:d}){const[o,l]=r.useState(s),[m,h]=r.useState(n),[c,x]=r.useState(!1),u=r.useId(),p=r.useId(),b=o.trim(),g=b!==s||m!==n,v=ye(s);return e.jsxs(e.Fragment,{children:[e.jsxs("form",{className:"space-y-3",onSubmit:C=>{C.preventDefault(),!(!g||b==="")&&i({displayName:b,timezone:m})},children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:u,className:"text-xs font-medium text-fg-muted",children:"Name"}),e.jsx(N,{id:u,value:o,maxLength:140,disabled:t,onChange:C=>l(C.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:p,className:"text-xs font-medium text-fg-muted",children:"Time zone"}),e.jsx(K,{id:p,value:m,disabled:t,onChange:h})]})]}),a!==""&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:[s," was not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:a})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{type:"submit",variant:"secondary",size:"sm",disabled:t||!g||b==="",icon:e.jsx(ve,{className:"size-3.5"}),children:"Save changes"}),e.jsx(f,{type:"button",variant:"danger",size:"sm",disabled:t,icon:e.jsx(G,{className:"size-3.5"}),onClick:()=>x(!0),children:"Delete calendar"})]})]}),e.jsx(B,{isOpen:c,title:v.title,description:v.description,confirmLabel:"Delete calendar",destructive:!0,onConfirm:()=>{x(!1),d()},onCancel:()=>x(!1)})]})}const ke=s=>({title:`Replace the address for ${s}?`,description:"Every client already subscribed to the current address stops updating and has to be pointed at the new one. The new address is shown once."}),Se=s=>({title:`Stop sharing ${s}?`,description:"The address stops working immediately and every client subscribed to it stops updating. Sharing again mints a different address."});function we({calendarName:s,url:n,onDismiss:t}){const[a,i]=r.useState(!1),[d,o]=r.useState(!1),l=r.useRef(0);r.useEffect(()=>()=>window.clearTimeout(l.current),[]);const m=()=>{navigator.clipboard.writeText(n).then(()=>{o(!1),i(!0),l.current=window.setTimeout(()=>i(!1),2e3)}).catch(()=>o(!0))};return e.jsxs("div",{className:"mt-3 space-y-2 rounded-sm border border-accent-2/40 bg-accent-2/10 px-3 py-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Subscribe with this address. It is shown once and cannot be read back."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("input",{readOnly:!0,value:n,"aria-label":`Subscription address for ${s}`,onFocus:h=>h.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg"}),e.jsx(f,{variant:"primary",size:"sm",icon:a?e.jsx(Y,{className:"size-3.5"}):e.jsx(he,{className:"size-3.5"}),onClick:m,children:a?"Copied":"Copy address"})]}),d&&e.jsx(j,{tone:"warning",variant:"soft",children:"The address could not be copied to the clipboard. Select it above and copy it by hand before leaving this page."}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Anyone holding this address can read every event in this calendar, without signing in. Rotate it if it reaches the wrong person."}),e.jsx(f,{variant:"ghost",size:"sm",onClick:t,children:"I've saved it"})]})}function Te({createdAt:s,rotatedAt:n,isBusy:t,onRotate:a,onRevoke:i}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Q,{tone:"positive",children:"shared"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Address created ",M(s,"medium"),n>0?`, last replaced ${M(n,"medium")}`:""]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"The address itself is not stored in readable form, so it cannot be shown again. Replace it if you no longer know where it went."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{variant:"secondary",size:"sm",disabled:t,icon:e.jsx(me,{className:"size-3.5"}),onClick:a,children:"Replace address"}),e.jsx(f,{variant:"danger",size:"sm",disabled:t,icon:e.jsx(G,{className:"size-3.5"}),onClick:i,children:"Stop sharing"})]})]})}function Ie({calendarName:s,details:n,state:t,mintedUrl:a,isBusy:i,actionError:d,onMint:o,onRevoke:l,onDismissMinted:m,onRetry:h}){const[c,x]=r.useState("none"),u=r.useId(),p=()=>{const g=c;x("none"),g==="rotate"&&o(),g==="revoke"&&l()},b=c==="revoke"?Se(s):ke(s);return e.jsxs(P,{className:"max-w-xl",role:"region","aria-labelledby":u,children:[e.jsx(D,{children:e.jsx(R,{id:u,children:s})}),e.jsxs(O,{children:[n&&e.jsx("div",{className:"mb-4 border-b border-line pb-4",children:n}),t.status==="loading"&&a===""&&e.jsx("div",{className:"h-12 animate-pulse rounded-sm bg-surface-sunken","aria-busy":"true","aria-label":`Loading the subscription address for ${s}`}),t.status==="unreadable"&&a===""&&e.jsx(ue,{variant:"inline",title:`Couldn't read whether ${s} is shared`,error:t.error,onRetry:h}),t.status==="absent"&&a===""&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Give this calendar a secret address and Apple Calendar, Google Calendar, Outlook and Thunderbird can subscribe to it read-only. Nobody signs in — the address is the credential, so treat it like a password."}),e.jsx(f,{variant:"primary",size:"sm",disabled:i,icon:e.jsx(be,{className:"size-3.5"}),onClick:o,children:i?"Creating…":"Create subscription address"})]}),t.status==="active"&&e.jsx(Te,{createdAt:t.createdAt,rotatedAt:t.rotatedAt,isBusy:i,onRotate:()=>x("rotate"),onRevoke:()=>x("revoke")}),d!=null&&e.jsxs(j,{tone:"danger",variant:"soft",className:"mt-3",children:[e.jsxs("p",{className:"font-medium",children:["The subscription address for ",s," was not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:w(d)})]}),a!==""&&e.jsx(we,{calendarName:s,url:a,onDismiss:m})]}),e.jsx(B,{isOpen:c!=="none",title:b.title,description:b.description,confirmLabel:c==="revoke"?"Stop sharing":"Replace address",destructive:!0,onConfirm:p,onCancel:()=>x("none")})]})}const Fe="/feeds/calendar/",Ee=".ics",Me=(s,n)=>`webcal://${s}${Fe}${n}${Ee}`;function ze(s){const n=z(),[t,a]=r.useState(""),i=ee({path:{calendarId:s}}),d=se({...ae({path:{calendarId:s}}),meta:A(404,403),retry:!1}),o=()=>{n.invalidateQueries({queryKey:i})},l=r.useRef(()=>{}),m=y({...te(),meta:L,onMutate:()=>{l.current()},onSuccess:()=>{a(""),o()}}),h=y({...ne(),meta:L,gcTime:0,onMutate:()=>{m.reset()},onSuccess:Z=>{a(Me(window.location.host,Z.feedToken)),o()}});l.current=h.reset;const{mutate:c,reset:x}=h,{mutate:u}=m,p=r.useCallback(()=>{c({path:{calendarId:s}})},[s,c]),b=r.useCallback(()=>{u({path:{calendarId:s}})},[s,u]),g=r.useCallback(()=>{a(""),x()},[x]),{refetch:v}=d,C=r.useCallback(()=>{v()},[v]);return{state:Ae(d),mintedUrl:t,isBusy:h.isPending||m.isPending,actionError:h.error??m.error,mint:p,revoke:b,dismissMinted:g,retry:C}}function Ae(s){return s.error?re(s.error)?{status:"absent"}:{status:"unreadable",error:s.error}:s.isPending?{status:"loading"}:s.data?{status:"active",createdAt:s.data.createdAt,rotatedAt:s.data.rotatedAt}:{status:"absent"}}function Pe({calendarId:s,calendarName:n,details:t}){const a=ze(s);return e.jsx(Ie,{calendarName:n,details:t,state:a.state,mintedUrl:a.mintedUrl,isBusy:a.isBusy,actionError:a.actionError,onMint:a.mint,onRevoke:a.revoke,onDismissMinted:a.dismissMinted,onRetry:a.retry})}function De({calendarId:s,calendarName:n,timezone:t,subscription:a}){const{updateCalendar:i,deleteCalendar:d,isWriting:o}=W(),[l,m]=r.useState(""),h=c=>m(c.kind==="refused"?c.message:"");return e.jsx(Pe,{calendarId:s,calendarName:n,details:e.jsxs(e.Fragment,{children:[a,e.jsx(Ne,{calendarName:n,timezone:t,isBusy:o,problem:l,onSave:c=>{m(""),i(s,c).then(h)},onDelete:()=>{m(""),d(s).then(h)}},`${n}\0${t}`)]})})}const Re="Subscribe to a calendar";function Oe({isBusy:s,error:n,onSubscribe:t}){const a=r.useId(),i=r.useId(),d=r.useId(),[o,l]=r.useState(""),[m,h]=r.useState(""),c=o.trim()!==""&&m.trim()!=="",x=u=>{u.preventDefault(),c&&t({displayName:o,url:m},()=>{l(""),h("")})};return e.jsxs(P,{className:"max-w-xl",role:"region","aria-labelledby":a,children:[e.jsx(D,{children:e.jsx(R,{id:a,children:Re})}),e.jsx(O,{children:e.jsxs("form",{className:"space-y-3",onSubmit:x,children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Paste the secret iCal address from Google Calendar, a published Outlook calendar or any other feed. It shows here read-only and refreshes on its own."}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:i,className:"text-sm font-medium text-fg",children:"Calendar name"}),e.jsx(N,{id:i,value:o,onChange:u=>l(u.target.value),placeholder:"Team rota",autoComplete:"off"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:d,className:"text-sm font-medium text-fg",children:"Calendar address"}),e.jsx(N,{id:d,value:m,onChange:u=>h(u.target.value),placeholder:"https://calendar.google.com/calendar/ical/…/basic.ics",autoComplete:"off",spellCheck:!1,inputMode:"url"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"For Google Calendar the address is the password to the calendar. Reader never shows it in full again."})]}),e.jsx(f,{type:"submit",variant:"primary",size:"sm",disabled:!c||s,icon:e.jsx(xe,{className:"size-3.5"}),children:s?"Subscribing…":"Subscribe"}),n!=null&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsx("p",{className:"font-medium",children:"The calendar was not added."}),e.jsx("p",{className:"mt-0.5 break-words",children:w(n)})]})]})})]})}function Le({calendarName:s,subscriptionUrl:n,enabled:t,fetchedAt:a,error:i,isBusy:d,actionError:o,onSetEnabled:l}){return e.jsxs("div",{className:"mb-4 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Q,{tone:t?"positive":"neutral",children:t?"subscribed":"paused"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Read-only, from ",pe(n),a>0?`. Last updated ${M(a,"medium")}`:""]})]}),i!==""&&e.jsxs(j,{tone:"warning",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:[s," was not refreshed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:i})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:t?"Events are read from the feed on a schedule and cannot be edited here.":"Updates are paused. The events already here stay until you resume or remove the calendar."}),e.jsx(f,{variant:"secondary",size:"sm",disabled:d,icon:t?e.jsx(ge,{className:"size-3.5"}):e.jsx(fe,{className:"size-3.5"}),onClick:()=>l(!t),children:t?"Pause updates":"Resume updates"}),o!=null&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:["Updates for ",s," were not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:w(o)})]})]})}const U=A(400,404),Ue=()=>`subscribed-${crypto.randomUUID().slice(0,8)}`;function $e(){const s=z(),n=V(),t=()=>{s.invalidateQueries({queryKey:$()}),n()},a=y({..._(),meta:U,onSuccess:t}),i=y({...H(),meta:U,onSuccess:t}),{mutate:d}=a,o=r.useCallback((h,c)=>{d({body:{urlSegment:Ue(),displayName:h.displayName.trim(),subscriptionUrl:h.url.trim()}},{onSuccess:c})},[d]),{mutate:l}=i,m=r.useCallback((h,c)=>{l({path:{calendarId:h},body:{subscriptionEnabled:c}})},[l]);return{subscribe:o,isSubscribing:a.isPending,subscribeError:a.error,setEnabled:m,togglingCalendarId:i.isPending?i.variables?.path.calendarId??"":"",toggleFailure:{calendarId:i.variables?.path.calendarId??"",error:i.error}}}const _e=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each calendar has a name, a time zone its floating times are read in, and an address CalDAV clients reach it by. The address is fixed when the calendar is added; the name and zone can change. Deleting a calendar deletes every event in it. The default calendar is where accepted invitations land, so it cannot be deleted."}),e.jsx("p",{children:"A subscription address lets Apple Calendar, Google Calendar, Outlook and Thunderbird show a calendar from here, read-only and kept up to date."}),e.jsx("p",{children:"Those clients never sign in, so the address itself is the credential. Anyone who has it can read the calendar; nobody who has it can change anything."}),e.jsx("p",{children:"Only a hash of the address is stored, so it is shown once and cannot be looked up later. Replacing it breaks every subscription built on the old one, which is how a shared address is taken back."}),e.jsx("p",{children:"Subscribing works the other way round: paste another calendar's iCal address and its events show here, read-only, refreshed on a schedule."})]});function as(){const s=ie(),[n,t]=r.useState(!0),{calendars:a,collections:i,timeZoneByCalendarId:d,isLoading:o}=ce(),l=$e(),{createCalendar:m,isWriting:h}=W(),[c,x]=r.useState("");return e.jsx(le,{items:de,activeId:"calendars",title:"Calendars",description:"Add, rename and delete calendars, subscribe to a calendar feed, and share one with any client that can subscribe to a URL.",help:_e,helpOpen:n,onToggleHelp:()=>t(u=>!u),onSelect:u=>{const p=oe[u];p&&s({to:p})},onBackToMail:()=>{s({to:"/mail"})},children:o?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading calendars"}):e.jsxs("div",{className:"space-y-4",children:[a.map(u=>{const p=i.find(b=>b.calendarId===u.id);return e.jsx(De,{calendarId:u.id,calendarName:u.name,timezone:d[u.id]??"",subscription:p?.source==="Subscribed"&&e.jsx(Le,{calendarName:p.displayName,subscriptionUrl:p.subscriptionUrl,enabled:p.subscriptionEnabled,fetchedAt:p.subscriptionFetchedAt,error:p.subscriptionError,isBusy:l.togglingCalendarId===u.id,actionError:l.toggleFailure.calendarId===u.id?l.toggleFailure.error:void 0,onSetEnabled:b=>l.setEnabled(u.id,b)})},u.id)}),e.jsx(Oe,{isBusy:l.isSubscribing,error:l.subscribeError,onSubscribe:l.subscribe}),e.jsx(Ce,{isBusy:h,problem:c,onCreate:u=>(x(""),m(u).then(p=>p.kind==="written"?!0:(x(p.message),!1)))})]})})}export{as as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,t}from"./index-
|
|
1
|
+
import{j as r,t}from"./index-CTrN7dU7.js";function n({raised:s,className:e,...a}){return r.jsx("div",{className:t("rounded-sm border border-line bg-surface",s?"bg-surface-raised shadow-sm":"",e),...a})}function o({className:s,...e}){return r.jsx("div",{className:t("px-4 pt-3 pb-2",s),...e})}function i({className:s,...e}){return r.jsx("h3",{className:t("text-md font-semibold text-fg",s),...e})}function m({className:s,...e}){return r.jsx("div",{className:t("px-4 pb-3 text-sm text-fg-muted",s),...e})}export{n as C,o as a,i as b,m as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as e,aB as u,t as r}from"./index-
|
|
1
|
+
import{r as a,j as e,aB as u,t as r}from"./index-CTrN7dU7.js";import{M as p}from"./minus-QLsR9rVM.js";const m="peer relative size-5 shrink-0 cursor-pointer appearance-none rounded-md border border-line-strong bg-surface outline-none transition-colors checked:border-positive checked:bg-positive indeterminate:border-positive indeterminate:bg-positive focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",l="pointer-events-none absolute inset-0 m-auto size-3.5 text-accent-fg";function v({label:s,description:i,indeterminate:t=!1,checked:d,onChange:f,className:o,...x}){const n=a.useRef(null);a.useEffect(()=>{n.current&&(n.current.indeterminate=t)},[t]);const c=e.jsxs("span",{className:"relative inline-flex",children:[e.jsx("input",{ref:n,type:"checkbox",checked:d,onChange:f,className:m,...x}),e.jsx(u,{className:r(l,"hidden peer-checked:block"),"aria-hidden":!0}),e.jsx(p,{className:r(l,"hidden peer-indeterminate:block"),"aria-hidden":!0})]});return s===void 0&&i===void 0?e.jsx("span",{className:o,children:c}):e.jsxs("label",{className:r("flex min-h-11 cursor-pointer items-center gap-3 text-left",o),children:[c,e.jsxs("span",{className:"flex min-w-0 flex-col",children:[s!==void 0&&e.jsx("span",{className:"text-sm text-fg",children:s}),i!==void 0&&e.jsx("span",{className:"text-xs text-fg-subtle",children:i})]})]})}export{v as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e}from"./index-CTrN7dU7.js";const t=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{t as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./index-
|
|
1
|
+
import{e as c}from"./index-CTrN7dU7.js";const r=c("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{r as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./index-
|
|
1
|
+
import{e}from"./index-CTrN7dU7.js";const t=e("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);export{t as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./index-
|
|
1
|
+
import{e}from"./index-CTrN7dU7.js";const p=e("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);export{p as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./index-
|
|
1
|
+
import{e as c}from"./index-CTrN7dU7.js";const o=c("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);export{o as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o}from"./FullCompose-CPT2R-pn.js";import"./index-CTrN7dU7.js";import"./ErrorState-DWzQfscg.js";import"./index-DMA0YSsS.js";import"./useMessageBodyContent-C6WheWR5.js";import"./useSignature-COUd5paq.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DgoW2gtH.js";import"./sections-CfTDsSEu.js";import"./confirm-dialog-CocDko9U.js";const c=o;export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o}from"./FullCompose-CPT2R-pn.js";import"./index-CTrN7dU7.js";import"./ErrorState-DWzQfscg.js";import"./index-DMA0YSsS.js";import"./useMessageBodyContent-C6WheWR5.js";import"./useSignature-COUd5paq.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DgoW2gtH.js";import"./sections-CfTDsSEu.js";import"./confirm-dialog-CocDko9U.js";const c=o;export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o}from"./FullCompose-CPT2R-pn.js";import"./index-CTrN7dU7.js";import"./ErrorState-DWzQfscg.js";import"./index-DMA0YSsS.js";import"./useMessageBodyContent-C6WheWR5.js";import"./useSignature-COUd5paq.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DgoW2gtH.js";import"./sections-CfTDsSEu.js";import"./confirm-dialog-CocDko9U.js";const c=o;export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o}from"./FullCompose-CPT2R-pn.js";import"./index-CTrN7dU7.js";import"./ErrorState-DWzQfscg.js";import"./index-DMA0YSsS.js";import"./useMessageBodyContent-C6WheWR5.js";import"./useSignature-COUd5paq.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DgoW2gtH.js";import"./sections-CfTDsSEu.js";import"./confirm-dialog-CocDko9U.js";const c=o;export{c as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as v,b6 as T}from"./index-
|
|
1
|
+
import{b5 as v,b6 as T}from"./index-CTrN7dU7.js";const k=e=>new Promise(n=>{n(JSON.parse(e))}),l=["accounts","labels","filters","addressFlags","settings"],g={accounts:"Accounts",labels:"Labels",filters:"Rules & filters",addressFlags:"Senders",settings:"Folders & appearance"},S=["created","updated","unchanged","skipped","rejected"],$={created:"positive",updated:"accent",unchanged:"neutral",skipped:"warning",rejected:"danger"},m=e=>S.includes(e)?e:"rejected",h="unknown",p=e=>l.includes(e)?e:void 0,I=e=>{const n=new Map;return e.forEach((t,i)=>{const a=p(t.section)??h,r=n.get(a)??[];r.push({id:`${a}-${t.key}-${i}`,label:t.key,verdict:m(t.verdict),reason:a===h?t.reason??`This instance does not know the "${t.section}" section, so it cannot say what this entry does.`:t.reason}),n.set(a,r)}),[...l,h].filter(t=>n.has(t)).map(t=>({id:t,title:t===h?"Not recognised":g[t],entries:n.get(t)??[]}))},j=e=>{const n={created:0,updated:0,unchanged:0,skipped:0,rejected:0};for(const o of e)n[m(o.verdict)]+=1;return n},E={NotAnObject:()=>({title:"That is not a Reader config file",explanation:"The file was read, but it is not a configuration document — a Reader config is a JSON object carrying a kind and a schemaVersion.",fix:"Export one from Settings › Advanced on the instance you are moving from, or run remit config save on its host."}),WrongKind:()=>({title:"That is not a Reader config file",explanation:"The file parses as JSON but does not declare itself a Reader configuration, so nothing here can be trusted to mean what it looks like.",fix:"Export one from Settings › Advanced on the instance you are moving from, or run remit config save on its host."}),UnsupportedVersion:e=>({title:"This file was written by a newer Reader",explanation:e.message||"The file declares a schema version this instance does not read, so importing it would drop settings it cannot understand.",fix:"Update this Reader, then import again. The file is unchanged and safe to keep."}),UnknownKeys:e=>({title:"The file contains settings this version does not know",explanation:"An unknown key is refused rather than quietly dropped: losing configuration without saying so is exactly what this feature exists to prevent.",fix:`Update this Reader, or remove the named keys from the file and import again. ${e.message}`}),CredentialPresent:()=>({title:"The file carries a credential",explanation:"A configuration document describes which credential an account needs; it never carries one. Reader refuses the file rather than importing around it — the secret may now be in your backups, your chat history, or a pull request.",fix:"Delete the field from the file and import again, then change that mailbox's password. Exports written by Reader never contain one."}),Malformed:e=>({title:"The file does not match the configuration format",explanation:"Every part of the document has to validate before anything is written, and this one does not.",fix:`Re-export it from the instance you are moving from. ${e.message}`}),duplicate_key:e=>({title:"The file names something twice",explanation:"A configuration names each account, label and filter once, so a document with two of the same key has no single answer to import.",fix:`Remove the duplicate and import again. ${e.message}`}),unknown_label:e=>({title:"A rule points at a label that is not here",explanation:"The file applies a label neither it nor this instance carries, so the rule would land doing nothing.",fix:`Add the label to the file, or create it here first, then import again. ${e.message}`}),unknown_account:e=>({title:"A rule points at an account that is not here",explanation:"The file files mail into a folder on an account it does not carry, so the rule has no destination to bind to.",fix:`Export the configuration again from an instance that holds both, then import that file. ${e.message}`})},R=e=>({title:"The file could not be imported",explanation:e.message||"The import was refused and nothing was written.",fix:"Re-export the configuration from the instance you are moving from and try again. If it keeps failing, report it with the line below."}),x="import_write_failed",N="config_not_empty",F=e=>{const n=v(e);if(n!==void 0&&n!==409)return;const o=e instanceof T?e.body:e;if(typeof o!="object"||o===null)return;const t=o;if(t.code===N)return{message:typeof t.message=="string"?t.message:"",details:typeof t.details=="object"&&t.details!==null?t.details:void 0}},C=e=>{const n=e.errors.find(t=>t.code!==x);return n?{...(E[n.code]??R)(n),raw:`${n.code}: ${n.message}`}:void 0},O=e=>e.errors.find(n=>n.code===x),w="Nothing from this section was written.",D=e=>{const n=O(e),o=n?.details?.section,t=o?p(o):void 0,i=!e.applied,a=new Map;for(const s of e.items){if(m(s.verdict)==="rejected")continue;const c=p(s.section);c&&a.set(c,(a.get(c)??0)+1)}const r=(s,c)=>l.map(d=>({section:d,title:g[d],state:s,detail:c}));if(!t){if(i)return r("not-landed",w);const s=o?`The import stopped in "${o}", which this instance does not recognise, so it cannot say whether this section was written.`:"The import stopped without naming where, so it cannot say whether this section was written. Open Settings to see what is here.";return r("unknown",s)}const f=l.indexOf(t);return l.map((s,c)=>{const d=g[s];if(s===t)return{section:s,title:d,state:"failed",detail:n?.message??"This section could not be written."};if(c>f)return{section:s,title:d,state:"not-attempted",detail:"Not attempted — the import stopped before this section."};if(i)return{section:s,title:d,state:"not-landed",detail:w};const u=a.get(s)??0;return{section:s,title:d,state:"landed",detail:u===0?"Nothing in the file for this section.":`${u} ${u===1?"entry":"entries"} written.`}})},_="folder_not_found_yet",L=e=>{const n=new Set,o=[];for(const t of e.warnings){if(t.code!==_)continue;const i=t.details?.folderPath;if(!i)continue;const a=t.details?.filter,r=t.details?.accountId,f=`${r??""}:${i}:${a??""}`;n.has(f)||(n.add(f),o.push({path:i,accountId:r,waitingFor:a?`Rule “${a}”`:"A folder role or a folder's own settings"}))}return o},y=2*1024*1024,b=Symbol("not json"),J=async(e,n,o)=>{if(n>y)return{ok:!1,failure:{title:"That file is too large to be a config file",explanation:`${e} is ${Math.round(n/1024)} kB. A Reader configuration is tens of kilobytes; a file this size is something else.`,fix:"Pick the .json file written by Settings › Advanced, or by remit config save.",raw:`${n} bytes > ${y} byte limit`}};let t="";const i=await k(o).catch(a=>(t=a instanceof Error?a.message:String(a),b));return i===b?{ok:!1,failure:{title:"That file is not JSON",explanation:`${e} could not be read as JSON at all, so there is nothing in it to import.`,fix:"Pick the .json file written by Settings › Advanced, or by remit config save.",raw:t}}:typeof i!="object"||i===null||Array.isArray(i)?{ok:!1,failure:{title:"That is not a Reader config file",explanation:`${e} is valid JSON but not a configuration document — a Reader config is a JSON object carrying a kind and a schemaVersion.`,fix:"Export one from Settings › Advanced on the instance you are moving from, or run remit config save on its host.",raw:`expected a JSON object, found ${Array.isArray(i)?"an array":typeof i}`}}:{ok:!0,document:i}},P=e=>`reader-config.${e.toISOString().slice(0,10)}.json`,U=e=>e<1024?`${e} B`:`${Math.round(e/1024)} kB`;export{x as W,F as a,C as b,j as c,P as e,U as f,I as g,L as p,J as r,D as s,$ as v,O as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,G as x,H as f,j as e,J as b,t as a}from"./index-
|
|
1
|
+
import{r as u,G as x,H as f,j as e,J as b,t as a}from"./index-CTrN7dU7.js";const h=({isOpen:s,title:r,description:i,confirmLabel:l,cancelLabel:o="Cancel",destructive:c=!1,isBusy:d=!1,onConfirm:m,onCancel:t})=>{const n=u.useRef(null);return x({id:"confirm-dialog",open:s,answers:{back:t}}),f(n,s),s?e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[e.jsx(b,{label:"Dismiss confirmation",onDismiss:t,className:"backdrop-blur-sm"}),e.jsxs("div",{ref:n,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,className:a("relative z-10 w-full max-w-sm","bg-surface border border-line rounded-sm shadow-lg","p-6"),children:[e.jsx("h2",{className:"text-lg font-semibold",children:r}),i&&e.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:i}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:t,className:a("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors","border border-line hover:bg-surface-raised"),children:o}),e.jsx("button",{type:"button",onClick:m,disabled:d,className:a("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors",c?"bg-danger text-canvas hover:bg-danger/90":"bg-accent text-accent-fg hover:bg-accent-hover","disabled:opacity-50 disabled:cursor-not-allowed"),children:l})]})]})]}):null};export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./index-
|
|
1
|
+
import{e}from"./index-CTrN7dU7.js";const t=e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);export{t as C};
|