@remit/web-client-dist 0.0.601 → 0.0.603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/assets/{BriefPane-Dkxhbmf3.js → BriefPane-PoCwW_rw.js} +1 -1
  2. package/assets/CalendarComposePane-CPgvMuhs.js +1 -0
  3. package/assets/{CalendarComposeSeed-DAAWogXI.js → CalendarComposeSeed-BNxq0PPg.js} +1 -1
  4. package/assets/{CalendarShell-Dfhdii1j.js → CalendarShell-D_NxjO1T.js} +1 -1
  5. package/assets/{EmptyState-B8pxCvgq.js → EmptyState-6r0r5FVG.js} +1 -1
  6. package/assets/{ErrorState-BND_1CuC.js → ErrorState-Cjdi1Pbp.js} +1 -1
  7. package/assets/{FlaggedPane-CkWsw0HI.js → FlaggedPane-D2_45Zph.js} +1 -1
  8. package/assets/{FullCompose-L3u0M9jx.js → FullCompose-ZmZmBukk.js} +1 -1
  9. package/assets/{MailListHeader-DiI5otvq.js → MailListHeader-D2YY1oCj.js} +1 -1
  10. package/assets/{MailNav-Bq08jgH1.js → MailNav-dXSXwtSS.js} +1 -1
  11. package/assets/{MailShell-NsicYXmr.js → MailShell-D8B5KgJY.js} +1 -1
  12. package/assets/{MailViewChrome-Dhd5NwZT.js → MailViewChrome-Ca_PpFLh.js} +1 -1
  13. package/assets/{MailboxPane-B2ufgVwI.js → MailboxPane-D0KDT0nA.js} +1 -1
  14. package/assets/{NavMenuButton-DURIiOWw.js → NavMenuButton-UuS12b8o.js} +1 -1
  15. package/assets/{OnboardingWizard-BBQws18N.js → OnboardingWizard-Bg0oMi5d.js} +1 -1
  16. package/assets/{OpenCalendarEvent-DrqU23A_.js → OpenCalendarEvent-eXphsQkd.js} +1 -1
  17. package/assets/{OutboxPane-BdzyB0yX.js → OutboxPane-KyfD-xAT.js} +1 -1
  18. package/assets/_calendarObjectId-bOBkPp1e.js +1 -0
  19. package/assets/_mailboxId-CBnetBDe.js +1 -0
  20. package/assets/_messageId-CC7P0NKV.js +1 -0
  21. package/assets/_messageId-CyzEwcHf.js +1 -0
  22. package/assets/_messageId-D9ErNE0i.js +1 -0
  23. package/assets/_outboxMessageId-BAuSfwjW.js +1 -0
  24. package/assets/_recurrenceId-BYVaWJco.js +1 -0
  25. package/assets/_threadId-Bf_hxH8H.js +1 -0
  26. package/assets/_threadId-DGaPE-UV.js +1 -0
  27. package/assets/_threadId-DNmbMRxQ.js +1 -0
  28. package/assets/_view._date-Buy6VJ4Y.js +1 -0
  29. package/assets/{accounts-D3aQAQEO.js → accounts-slqMhpwq.js} +1 -1
  30. package/assets/{advanced-MuGaRYCq.js → advanced-DJYUnJcM.js} +1 -1
  31. package/assets/{appearance-B_euwBFm.js → appearance-B9Zd5MxX.js} +1 -1
  32. package/assets/{attachment-file-DBmXtWWD.js → attachment-file-bw6jpX2a.js} +1 -1
  33. package/assets/{attendee-row-CFZyUMUp.js → attendee-row-y73RSxi6.js} +1 -1
  34. package/assets/{avatar-DsC7KMh_.js → avatar-C5DZJDZl.js} +1 -1
  35. package/assets/{bottom-sheet-BVoaqyZL.js → bottom-sheet-BMfA1os-.js} +1 -1
  36. package/assets/brief-BSP8cSU6.js +1 -0
  37. package/assets/{brief-DOtEY9cM.js → brief-CWpVPlag.js} +1 -1
  38. package/assets/{browser-ponyfill-BeKHtO0j.js → browser-ponyfill-BtE6DJaU.js} +1 -1
  39. package/assets/{bug-De-q0Zl4.js → bug-XlVUpJy1.js} +1 -1
  40. package/assets/{calendar-color-CXQvTXXO.js → calendar-color-DgHc36b7.js} +1 -1
  41. package/assets/{calendar-event-chip-aW3iXF3m.js → calendar-event-chip-C1T8fqpx.js} +1 -1
  42. package/assets/{calendar-0D1Aok7_.js → calendar-u1hgf3tg.js} +1 -1
  43. package/assets/{calendars-D_BRIbCo.js → calendars-BLCqhIG7.js} +1 -1
  44. package/assets/{card-D5vkdB74.js → card-k-jKWhR7.js} +1 -1
  45. package/assets/chevron-left-CrajKg1c.js +1 -0
  46. package/assets/{circle-check-BG2_X7qM.js → circle-check-DsecdMli.js} +1 -1
  47. package/assets/{circle-check-big-BhJgBM3A.js → circle-check-big-DJeT115E.js} +1 -1
  48. package/assets/{circle-help-DmmRA9UB.js → circle-help-PfoCuRx4.js} +1 -1
  49. package/assets/{clock-C871fqyU.js → clock-BoxKHt-D.js} +1 -1
  50. package/assets/compose._-_outboxMessageId_-B4Esrx1s.js +1 -0
  51. package/assets/compose._-_outboxMessageId_-Bkav_--V.js +1 -0
  52. package/assets/compose._-_outboxMessageId_-DKmOtVWX.js +1 -0
  53. package/assets/compose._-_outboxMessageId_-Eu5BpvJ5.js +1 -0
  54. package/assets/{config-import-C2tOC-s3.js → config-import-Cob6KRxW.js} +1 -1
  55. package/assets/{confirm-dialog-DJwDI10e.js → confirm-dialog-BV8yPk0Z.js} +1 -1
  56. package/assets/{copy-DwoxXH17.js → copy-dsQZ9_Tq.js} +1 -1
  57. package/assets/{credential-steps-DD5HljSU.js → credential-steps-BSDUae-c.js} +1 -1
  58. package/assets/{download-Cg086Q1a.js → download-pgJibm8f.js} +1 -1
  59. package/assets/{file-json-BAHI7df8.js → file-json-BaQxcYdZ.js} +1 -1
  60. package/assets/{filters-DKc4giAx.js → filters-CpRRg5mW.js} +1 -1
  61. package/assets/{flagged-B95s3NdW.js → flagged-6pOoeZxm.js} +1 -1
  62. package/assets/flagged-BFSPdfnJ.js +1 -0
  63. package/assets/{folders-DNYaNs7I.js → folders-Bu7Ke42f.js} +1 -1
  64. package/assets/{help-copy-F4bWua7S.js → help-copy-DlRaQ3-c.js} +1 -1
  65. package/assets/{import-dGEeUqae.js → import-CLgzHXP3.js} +1 -1
  66. package/assets/index-3zQFhWS_.js +1 -0
  67. package/assets/{index-CxubvY-b.js → index-88kWC0mY.js} +1 -1
  68. package/assets/index-BHFrxX5A.js +1 -0
  69. package/assets/index-BRJl-vWl.js +1 -0
  70. package/assets/index-Bh1nz_PB.js +1 -0
  71. package/assets/index-BoTmstF8.js +1 -0
  72. package/assets/index-CyzEwcHf.js +1 -0
  73. package/assets/index-D9ErNE0i.js +1 -0
  74. package/assets/{index-D356i3SP.js → index-DembAj_D.js} +4 -4
  75. package/assets/{index-B7Z_VTQH.js → index-YYH_p-Ox.js} +4 -4
  76. package/assets/index-Z8mU620o.js +1 -0
  77. package/assets/index-d-DkNljh.js +1 -0
  78. package/assets/{kbd-DC1TU-ib.js → kbd-BHWNGlF5.js} +1 -1
  79. package/assets/{labels-N8kTkbQD.js → labels-BEzmtjRK.js} +1 -1
  80. package/assets/{mail-Dc80bLtZ.js → mail-Bw_opxSY.js} +1 -1
  81. package/assets/{mail-CE9mZHRO.js → mail-D_9uR_xf.js} +1 -1
  82. package/assets/{map-pin-fc35L0nf.js → map-pin-C7QrVAH3.js} +1 -1
  83. package/assets/{menu-BFEzC3rH.js → menu-DPopx5EJ.js} +1 -1
  84. package/assets/new-7ha2oCKa.js +1 -0
  85. package/assets/onboarding-DVkSteAy.js +1 -0
  86. package/assets/{onboarding-completion-Cj1X5Vfi.js → onboarding-completion-gdz3-ZZG.js} +1 -1
  87. package/assets/outbox-Chk8Sk4b.js +1 -0
  88. package/assets/{pencil-Bw-KIM6o.js → pencil-701ohwSi.js} +1 -1
  89. package/assets/{refresh-cw-BGeOxWhI.js → refresh-cw-Di3kvivg.js} +1 -1
  90. package/assets/{rich-text-C26wbF1i.js → rich-text-C4evizno.js} +1 -1
  91. package/assets/{rich-text-spellcheck-worker-provider-Dh-4zmjL.js → rich-text-spellcheck-worker-provider-BI4F1onx.js} +1 -1
  92. package/assets/{rotate-ccw-DZYCC0q2.js → rotate-ccw-CY4_PNoH.js} +1 -1
  93. package/assets/{roving-focus-DOho_TJw.js → roving-focus-CFhWtHQV.js} +1 -1
  94. package/assets/{row-actions-CgvAWKly.js → row-actions-e8dcmEFt.js} +1 -1
  95. package/assets/{search-mirror-gwKyvyS3.js → search-mirror-C4Q_FmCR.js} +1 -1
  96. package/assets/{search-token-index-Cp8U_9CO.js → search-token-index-CF-eJ9n9.js} +1 -1
  97. package/assets/{sections-CoGcGCNP.js → sections-BZ0O_NV5.js} +1 -1
  98. package/assets/{senders-5riMSNkV.js → senders-RmiQhHZD.js} +1 -1
  99. package/assets/settings-BtStj6GW.js +1 -0
  100. package/assets/{settings-screen-BbWxKV6I.js → settings-screen-ClyspzuZ.js} +1 -1
  101. package/assets/{shield-check-BTT2FIky.js → shield-check-D9zGpyyh.js} +1 -1
  102. package/assets/{suggested-vips-DrVDQPt6.js → suggested-vips-sI4H9GLc.js} +1 -1
  103. package/assets/{useCalendarData-yJ6hC9z8.js → useCalendarData-B6t-M5Ly.js} +1 -1
  104. package/assets/{useCalendars-fIST617L.js → useCalendars-BIBQT7Wk.js} +1 -1
  105. package/assets/{useDebouncedValue-cuoS7Za9.js → useDebouncedValue-BMYHRqha.js} +1 -1
  106. package/assets/{useFilters-R75OGKuu.js → useFilters-DXXBrpPW.js} +1 -1
  107. package/assets/{useLabels-BhpyswcI.js → useLabels-D8sluUEk.js} +1 -1
  108. package/assets/{useLayoutTier-m2Yj3Bit.js → useLayoutTier-MqmqPhVY.js} +1 -1
  109. package/assets/{useMessageBodyContent-D1pso69a.js → useMessageBodyContent-D-lqah5s.js} +1 -1
  110. package/assets/{useQueries-OnbrANu7.js → useQueries-Dm82vk6v.js} +1 -1
  111. package/assets/{useRefreshControl-ChwiMB1J.js → useRefreshControl-B9v4eUjG.js} +1 -1
  112. package/assets/{useResultFolderIndex-B8NL34jx.js → useResultFolderIndex-D6xs6h1E.js} +1 -1
  113. package/assets/{useSearchTokenContext-BI18VCbl.js → useSearchTokenContext-DMTmSJiu.js} +1 -1
  114. package/assets/{useSemanticSearch-fU6QEg8I.js → useSemanticSearch-zOQZMrAG.js} +1 -1
  115. package/assets/{useSignature-DkKAGoyM.js → useSignature-15aE8XaV.js} +1 -1
  116. package/assets/window-DNm0-rvw.js +1 -0
  117. package/index.html +1 -1
  118. package/package.json +1 -1
  119. package/assets/CalendarComposePane-BD4pTRBc.js +0 -1
  120. package/assets/_calendarObjectId-B1FRBkCC.js +0 -1
  121. package/assets/_mailboxId-CnueEzRZ.js +0 -1
  122. package/assets/_messageId-CcHxaziM.js +0 -1
  123. package/assets/_messageId-CgSbxfQW.js +0 -1
  124. package/assets/_messageId-CzaQd6Rw.js +0 -1
  125. package/assets/_outboxMessageId-CHW97N06.js +0 -1
  126. package/assets/_recurrenceId-cMf0Sjf9.js +0 -1
  127. package/assets/_threadId-Cdt-BTzL.js +0 -1
  128. package/assets/_threadId-CeHzexUr.js +0 -1
  129. package/assets/_threadId-CeZUKd8r.js +0 -1
  130. package/assets/_view._date-L09dCcUu.js +0 -1
  131. package/assets/brief-DiXcsZRQ.js +0 -1
  132. package/assets/chevron-left-CXY1ffcB.js +0 -1
  133. package/assets/compose._-_outboxMessageId_-BgMvbEV2.js +0 -1
  134. package/assets/compose._-_outboxMessageId_-C1zlZc45.js +0 -1
  135. package/assets/compose._-_outboxMessageId_-GGPO338F.js +0 -1
  136. package/assets/compose._-_outboxMessageId_-e4Y8u9ZM.js +0 -1
  137. package/assets/flagged-CnYY4RqX.js +0 -1
  138. package/assets/index-BgxMwZ8G.js +0 -1
  139. package/assets/index-CgSbxfQW.js +0 -1
  140. package/assets/index-CzaQd6Rw.js +0 -1
  141. package/assets/index-DE8DkWf9.js +0 -1
  142. package/assets/index-DYTkkk17.js +0 -1
  143. package/assets/index-Dtbr1c3D.js +0 -1
  144. package/assets/index-Dx-OdWG7.js +0 -1
  145. package/assets/index-Kl2oWgHI.js +0 -1
  146. package/assets/index-dwBc-qt7.js +0 -1
  147. package/assets/new-14h8cu99.js +0 -1
  148. package/assets/onboarding-C6U7Q2aY.js +0 -1
  149. package/assets/outbox-D5Gnyi3x.js +0 -1
  150. package/assets/settings-B4jLnDtd.js +0 -1
  151. package/assets/window-CHmnHHPE.js +0 -1
@@ -1,2 +1,2 @@
1
- import{eM as A,N as $}from"./index-B7Z_VTQH.js";function X(_,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 M=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],q=ArrayBuffer.isView||function(e){return e&&M.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 C(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function I(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)||q(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(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return I(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(`
1
+ import{eM as A,N as $}from"./index-YYH_p-Ox.js";function X(_,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 M=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],q=ArrayBuffer.isView||function(e){return e&&M.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 C(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function I(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)||q(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(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return I(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
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=$(S),Q=X({__proto__:null,default:Z},[S]);export{Q as b};
@@ -1 +1 @@
1
- import{e as a}from"./index-B7Z_VTQH.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
+ import{e as a}from"./index-YYH_p-Ox.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{e as l}from"./index-B7Z_VTQH.js";const e=l("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"}]]),r={"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 o(a){return r[a]}export{e as R,o as c};
1
+ import{e as l}from"./index-YYH_p-Ox.js";const e=l("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"}]]),r={"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 o(a){return r[a]}export{e as R,o as c};
@@ -1 +1 @@
1
- import{t as o,j as s}from"./index-B7Z_VTQH.js";import{c as g,R as j}from"./calendar-color-CXQvTXXO.js";import{M as h}from"./mail-CE9mZHRO.js";import{G as C}from"./map-pin-fc35L0nf.js";function N(e){const n=g(e.color),t=e.rsvp==="tentative"||e.status==="tentative";return o("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",n.soft,n.text,n.rail,e.layout==="column"||e.stacked?"flex-col":"items-center gap-1.5",t&&"border-y border-r border-dashed",t&&n.border,e.rsvp==="declined"&&"opacity-60",e.selected&&"ring-2 ring-ring",e.density==="compact"?"text-2xs":"text-xs")}function w({title:e,timeText:n,layout:t,rsvp:r,hasThread:u,isRecurring:i,zoneCertainty:x,trailing:c,detail:p}){const a=t==="column",l=x==="ambiguous",b=!a&&p!==void 0,m=s.jsxs("span",{className:o("flex min-w-0 items-center gap-1",a&&"w-full",r==="declined"&&"line-through"),children:[n!==""&&s.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:n}),s.jsx("span",{className:"truncate font-medium",children:e})]}),f=(i||u||l)&&s.jsxs("span",{className:o("flex shrink-0 items-center gap-1",a&&"mt-0.5",!a&&c===void 0&&"ml-auto"),children:[i&&s.jsx(j,{className:"size-2.5","aria-label":"Repeats"}),u&&s.jsx(h,{className:"size-2.5","aria-label":"From mail"}),l&&s.jsx(C,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),d=c!==void 0&&s.jsx("span",{className:o("shrink-0 opacity-80",!a&&"ml-auto"),children:c});return s.jsxs(s.Fragment,{children:[b?s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[m,f,d]}):s.jsxs(s.Fragment,{children:[m,f,d]}),p]})}function F({title:e,timeText:n,color:t,layout:r,density:u,rsvp:i,status:x,hasThread:c,isRecurring:p,zoneCertainty:a,selected:l,onClick:b,leading:m,trailing:f,detail:d}){const v=r==="column";return s.jsxs("button",{type:"button",onClick:b,"aria-pressed":l,className:o("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",v?"h-full":"items-start",m!==void 0&&"gap-2"),children:[m,s.jsx("span",{className:o(N({color:t,layout:r,density:u,rsvp:i,status:x,selected:l,stacked:d!==void 0}),"flex-1",v&&"h-full"),children:s.jsx(w,{title:e,timeText:n,layout:r,rsvp:i,hasThread:c,isRecurring:p,zoneCertainty:a,trailing:f,detail:d})})]})}export{F as C,w as a,N as c};
1
+ import{t as o,j as s}from"./index-YYH_p-Ox.js";import{c as g,R as j}from"./calendar-color-DgHc36b7.js";import{M as h}from"./mail-D_9uR_xf.js";import{G as C}from"./map-pin-C7QrVAH3.js";function N(e){const n=g(e.color),t=e.rsvp==="tentative"||e.status==="tentative";return o("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",n.soft,n.text,n.rail,e.layout==="column"||e.stacked?"flex-col":"items-center gap-1.5",t&&"border-y border-r border-dashed",t&&n.border,e.rsvp==="declined"&&"opacity-60",e.selected&&"ring-2 ring-ring",e.density==="compact"?"text-2xs":"text-xs")}function w({title:e,timeText:n,layout:t,rsvp:r,hasThread:u,isRecurring:i,zoneCertainty:x,trailing:c,detail:p}){const a=t==="column",l=x==="ambiguous",b=!a&&p!==void 0,m=s.jsxs("span",{className:o("flex min-w-0 items-center gap-1",a&&"w-full",r==="declined"&&"line-through"),children:[n!==""&&s.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:n}),s.jsx("span",{className:"truncate font-medium",children:e})]}),f=(i||u||l)&&s.jsxs("span",{className:o("flex shrink-0 items-center gap-1",a&&"mt-0.5",!a&&c===void 0&&"ml-auto"),children:[i&&s.jsx(j,{className:"size-2.5","aria-label":"Repeats"}),u&&s.jsx(h,{className:"size-2.5","aria-label":"From mail"}),l&&s.jsx(C,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),d=c!==void 0&&s.jsx("span",{className:o("shrink-0 opacity-80",!a&&"ml-auto"),children:c});return s.jsxs(s.Fragment,{children:[b?s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[m,f,d]}):s.jsxs(s.Fragment,{children:[m,f,d]}),p]})}function F({title:e,timeText:n,color:t,layout:r,density:u,rsvp:i,status:x,hasThread:c,isRecurring:p,zoneCertainty:a,selected:l,onClick:b,leading:m,trailing:f,detail:d}){const v=r==="column";return s.jsxs("button",{type:"button",onClick:b,"aria-pressed":l,className:o("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",v?"h-full":"items-start",m!==void 0&&"gap-2"),children:[m,s.jsx("span",{className:o(N({color:t,layout:r,density:u,rsvp:i,status:x,selected:l,stacked:d!==void 0}),"flex-1",v&&"h-full"),children:s.jsx(w,{title:e,timeText:n,layout:r,rsvp:i,hasThread:c,isRecurring:p,zoneCertainty:a,trailing:f,detail:d})})]})}export{F as C,w as a,N as c};
@@ -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-B7Z_VTQH.js";import{C as N}from"./CalendarShell-Dfhdii1j.js";import{M as P}from"./MailNav-Bq08jgH1.js";import{E}from"./ErrorState-BND_1CuC.js";import{i as S,u as b}from"./useLayoutTier-m2Yj3Bit.js";import"./roving-focus-DOho_TJw.js";import"./useQueries-OnbrANu7.js";import"./outbox-status-BlKn6P0x.js";import"./bug-De-q0Zl4.js";function I(){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:s,isLoading:u,isError:p,error:f,refetch:m}=j({...y(),staleTime:1/0}),o=!!(s&&(s.accounts?.length??0)===0);i.useEffect(()=>{o&&t({to:"/onboarding",replace:!0})},[o,t]);const d=s?.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:f,onRetry:()=>{m()}})}):e.jsx(N,{chrome:{isSinglePane:c,isLoading:u||o,nav:e.jsx(P,{accounts:d,onMailboxSelect:()=>n(!1)}),navOpen:l,onOpenNav:()=>n(!0),onCloseNav:()=>n(!1)},children:e.jsx(C,{})})}export{I as component};
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-YYH_p-Ox.js";import{C as N}from"./CalendarShell-D_NxjO1T.js";import{M as P}from"./MailNav-dXSXwtSS.js";import{E}from"./ErrorState-Cjdi1Pbp.js";import{i as S,u as b}from"./useLayoutTier-MqmqPhVY.js";import"./roving-focus-CFhWtHQV.js";import"./useQueries-Dm82vk6v.js";import"./outbox-status-BlKn6P0x.js";import"./bug-XlVUpJy1.js";function I(){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:s,isLoading:u,isError:p,error:f,refetch:m}=j({...y(),staleTime:1/0}),o=!!(s&&(s.accounts?.length??0)===0);i.useEffect(()=>{o&&t({to:"/onboarding",replace:!0})},[o,t]);const d=s?.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:f,onRetry:()=>{m()}})}):e.jsx(N,{chrome:{isSinglePane:c,isLoading:u||o,nav:e.jsx(P,{accounts:d,onMailboxSelect:()=>n(!1)}),navOpen:l,onOpenNav:()=>n(!0),onCloseNav:()=>n(!1)},children:e.jsx(C,{})})}export{I as component};
@@ -1 +1 @@
1
- import{e as S,r as i,j as e,f as m,B as j,g as T,b9 as v,a3 as F,aB as M,h as A,ba as E,c as R,bb as O,i as y,bc as C,bd as D,be as P,bf as z,s as $,u as L,aL as _,aN as H}from"./index-B7Z_VTQH.js";import{S as I}from"./settings-screen-BbWxKV6I.js";import{C as B}from"./confirm-dialog-DJwDI10e.js";import{C as G,a as Q,b as U,c as K}from"./card-D5vkdB74.js";import{E as X,f as V}from"./ErrorState-BND_1CuC.js";import{R as J}from"./refresh-cw-BGeOxWhI.js";import{C as W}from"./copy-DwoxXH17.js";import{u as Y}from"./useCalendars-fIST617L.js";import"./avatar-DsC7KMh_.js";import"./chevron-left-CXY1ffcB.js";import"./menu-BFEzC3rH.js";import"./circle-help-DmmRA9UB.js";const Z=S("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"}]]),q=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."}),ee=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 se({calendarName:s,url:a,onDismiss:t}){const[n,o]=i.useState(!1),[r,c]=i.useState(!1),u=i.useRef(0);i.useEffect(()=>()=>window.clearTimeout(u.current),[]);const l=()=>{navigator.clipboard.writeText(a).then(()=>{c(!1),o(!0),u.current=window.setTimeout(()=>o(!1),2e3)}).catch(()=>c(!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:a,"aria-label":`Subscription address for ${s}`,onFocus:d=>d.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(m,{variant:"primary",size:"sm",icon:n?e.jsx(M,{className:"size-3.5"}):e.jsx(W,{className:"size-3.5"}),onClick:l,children:n?"Copied":"Copy address"})]}),r&&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(m,{variant:"ghost",size:"sm",onClick:t,children:"I've saved it"})]})}function te({createdAt:s,rotatedAt:a,isBusy:t,onRotate:n,onRevoke:o}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(T,{tone:"positive",children:"shared"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Address created ",v(s,"medium"),a>0?`, last replaced ${v(a,"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(m,{variant:"secondary",size:"sm",disabled:t,icon:e.jsx(J,{className:"size-3.5"}),onClick:n,children:"Replace address"}),e.jsx(m,{variant:"danger",size:"sm",disabled:t,icon:e.jsx(F,{className:"size-3.5"}),onClick:o,children:"Stop sharing"})]})]})}function ae({calendarName:s,state:a,mintedUrl:t,isBusy:n,actionError:o,onMint:r,onRevoke:c,onDismissMinted:u,onRetry:l}){const[d,p]=i.useState("none"),h=i.useId(),f=()=>{const b=d;p("none"),b==="rotate"&&r(),b==="revoke"&&c()},x=d==="revoke"?ee(s):q(s);return e.jsxs(G,{className:"max-w-xl",role:"region","aria-labelledby":h,children:[e.jsx(Q,{children:e.jsx(U,{id:h,children:s})}),e.jsxs(K,{children:[a.status==="loading"&&t===""&&e.jsx("div",{className:"h-12 animate-pulse rounded-sm bg-surface-sunken","aria-busy":"true","aria-label":`Loading the subscription address for ${s}`}),a.status==="unreadable"&&t===""&&e.jsx(X,{variant:"inline",title:`Couldn't read whether ${s} is shared`,error:a.error,onRetry:l}),a.status==="absent"&&t===""&&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(m,{variant:"primary",size:"sm",disabled:n,icon:e.jsx(Z,{className:"size-3.5"}),onClick:r,children:n?"Creating…":"Create subscription address"})]}),a.status==="active"&&e.jsx(te,{createdAt:a.createdAt,rotatedAt:a.rotatedAt,isBusy:n,onRotate:()=>p("rotate"),onRevoke:()=>p("revoke")}),o!=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:V(o)})]}),t!==""&&e.jsx(se,{calendarName:s,url:t,onDismiss:u})]}),e.jsx(B,{isOpen:d!=="none",title:x.title,description:x.description,confirmLabel:d==="revoke"?"Stop sharing":"Replace address",destructive:!0,onConfirm:f,onCancel:()=>p("none")})]})}const ne="/feeds/calendar/",re=".ics",ie=(s,a)=>`webcal://${s}${ne}${a}${re}`;function oe(s){const a=A(),[t,n]=i.useState(""),o=E({path:{calendarId:s}}),r=R({...O({path:{calendarId:s}}),meta:$(404,403),retry:!1}),c=()=>{a.invalidateQueries({queryKey:o})},u=i.useRef(()=>{}),l=y({...D(),meta:C,onMutate:()=>{u.current()},onSuccess:()=>{n(""),c()}}),d=y({...P(),meta:C,gcTime:0,onMutate:()=>{l.reset()},onSuccess:N=>{n(ie(window.location.host,N.feedToken)),c()}});u.current=d.reset;const{mutate:p,reset:h}=d,{mutate:f}=l,x=i.useCallback(()=>{p({path:{calendarId:s}})},[s,p]),b=i.useCallback(()=>{f({path:{calendarId:s}})},[s,f]),k=i.useCallback(()=>{n(""),h()},[h]),{refetch:g}=r,w=i.useCallback(()=>{g()},[g]);return{state:de(r),mintedUrl:t,isBusy:d.isPending||l.isPending,actionError:d.error??l.error,mint:x,revoke:b,dismissMinted:k,retry:w}}function de(s){return s.error?z(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 ce({calendarId:s,calendarName:a}){const t=oe(s);return e.jsx(ae,{calendarName:a,state:t.state,mintedUrl:t.mintedUrl,isBusy:t.isBusy,actionError:t.actionError,onMint:t.mint,onRevoke:t.revoke,onDismissMinted:t.dismissMinted,onRetry:t.retry})}const le=e.jsxs("div",{className:"space-y-3",children:[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."})]});function ke(){const s=L(),[a,t]=i.useState(!0),{calendars:n,isLoading:o}=Y();return e.jsx(I,{items:_,activeId:"calendars",title:"Calendars",description:"Share a calendar with any client that can subscribe to a URL.",help:le,helpOpen:a,onToggleHelp:()=>t(r=>!r),onSelect:r=>{const c=H[r];c&&s({to:c})},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"}):n.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No calendars yet."}):e.jsx("div",{className:"space-y-4",children:n.map(r=>e.jsx(ce,{calendarId:r.id,calendarName:r.name},r.id))})})}export{ke as component};
1
+ import{e as S,r as i,j as e,f as m,B as j,g as T,b9 as v,a3 as F,aB as M,h as A,ba as E,c as R,bb as O,i as y,bc as C,bd as D,be as P,bf as z,s as $,u as L,aL as _,aN as H}from"./index-YYH_p-Ox.js";import{S as I}from"./settings-screen-ClyspzuZ.js";import{C as B}from"./confirm-dialog-BV8yPk0Z.js";import{C as G,a as Q,b as U,c as K}from"./card-k-jKWhR7.js";import{E as X,f as V}from"./ErrorState-Cjdi1Pbp.js";import{R as J}from"./refresh-cw-Di3kvivg.js";import{C as W}from"./copy-dsQZ9_Tq.js";import{u as Y}from"./useCalendars-BIBQT7Wk.js";import"./avatar-C5DZJDZl.js";import"./chevron-left-CrajKg1c.js";import"./menu-DPopx5EJ.js";import"./circle-help-PfoCuRx4.js";const Z=S("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"}]]),q=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."}),ee=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 se({calendarName:s,url:a,onDismiss:t}){const[n,o]=i.useState(!1),[r,c]=i.useState(!1),u=i.useRef(0);i.useEffect(()=>()=>window.clearTimeout(u.current),[]);const l=()=>{navigator.clipboard.writeText(a).then(()=>{c(!1),o(!0),u.current=window.setTimeout(()=>o(!1),2e3)}).catch(()=>c(!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:a,"aria-label":`Subscription address for ${s}`,onFocus:d=>d.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(m,{variant:"primary",size:"sm",icon:n?e.jsx(M,{className:"size-3.5"}):e.jsx(W,{className:"size-3.5"}),onClick:l,children:n?"Copied":"Copy address"})]}),r&&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(m,{variant:"ghost",size:"sm",onClick:t,children:"I've saved it"})]})}function te({createdAt:s,rotatedAt:a,isBusy:t,onRotate:n,onRevoke:o}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(T,{tone:"positive",children:"shared"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Address created ",v(s,"medium"),a>0?`, last replaced ${v(a,"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(m,{variant:"secondary",size:"sm",disabled:t,icon:e.jsx(J,{className:"size-3.5"}),onClick:n,children:"Replace address"}),e.jsx(m,{variant:"danger",size:"sm",disabled:t,icon:e.jsx(F,{className:"size-3.5"}),onClick:o,children:"Stop sharing"})]})]})}function ae({calendarName:s,state:a,mintedUrl:t,isBusy:n,actionError:o,onMint:r,onRevoke:c,onDismissMinted:u,onRetry:l}){const[d,p]=i.useState("none"),h=i.useId(),f=()=>{const b=d;p("none"),b==="rotate"&&r(),b==="revoke"&&c()},x=d==="revoke"?ee(s):q(s);return e.jsxs(G,{className:"max-w-xl",role:"region","aria-labelledby":h,children:[e.jsx(Q,{children:e.jsx(U,{id:h,children:s})}),e.jsxs(K,{children:[a.status==="loading"&&t===""&&e.jsx("div",{className:"h-12 animate-pulse rounded-sm bg-surface-sunken","aria-busy":"true","aria-label":`Loading the subscription address for ${s}`}),a.status==="unreadable"&&t===""&&e.jsx(X,{variant:"inline",title:`Couldn't read whether ${s} is shared`,error:a.error,onRetry:l}),a.status==="absent"&&t===""&&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(m,{variant:"primary",size:"sm",disabled:n,icon:e.jsx(Z,{className:"size-3.5"}),onClick:r,children:n?"Creating…":"Create subscription address"})]}),a.status==="active"&&e.jsx(te,{createdAt:a.createdAt,rotatedAt:a.rotatedAt,isBusy:n,onRotate:()=>p("rotate"),onRevoke:()=>p("revoke")}),o!=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:V(o)})]}),t!==""&&e.jsx(se,{calendarName:s,url:t,onDismiss:u})]}),e.jsx(B,{isOpen:d!=="none",title:x.title,description:x.description,confirmLabel:d==="revoke"?"Stop sharing":"Replace address",destructive:!0,onConfirm:f,onCancel:()=>p("none")})]})}const ne="/feeds/calendar/",re=".ics",ie=(s,a)=>`webcal://${s}${ne}${a}${re}`;function oe(s){const a=A(),[t,n]=i.useState(""),o=E({path:{calendarId:s}}),r=R({...O({path:{calendarId:s}}),meta:$(404,403),retry:!1}),c=()=>{a.invalidateQueries({queryKey:o})},u=i.useRef(()=>{}),l=y({...D(),meta:C,onMutate:()=>{u.current()},onSuccess:()=>{n(""),c()}}),d=y({...P(),meta:C,gcTime:0,onMutate:()=>{l.reset()},onSuccess:N=>{n(ie(window.location.host,N.feedToken)),c()}});u.current=d.reset;const{mutate:p,reset:h}=d,{mutate:f}=l,x=i.useCallback(()=>{p({path:{calendarId:s}})},[s,p]),b=i.useCallback(()=>{f({path:{calendarId:s}})},[s,f]),k=i.useCallback(()=>{n(""),h()},[h]),{refetch:g}=r,w=i.useCallback(()=>{g()},[g]);return{state:de(r),mintedUrl:t,isBusy:d.isPending||l.isPending,actionError:d.error??l.error,mint:x,revoke:b,dismissMinted:k,retry:w}}function de(s){return s.error?z(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 ce({calendarId:s,calendarName:a}){const t=oe(s);return e.jsx(ae,{calendarName:a,state:t.state,mintedUrl:t.mintedUrl,isBusy:t.isBusy,actionError:t.actionError,onMint:t.mint,onRevoke:t.revoke,onDismissMinted:t.dismissMinted,onRetry:t.retry})}const le=e.jsxs("div",{className:"space-y-3",children:[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."})]});function ke(){const s=L(),[a,t]=i.useState(!0),{calendars:n,isLoading:o}=Y();return e.jsx(I,{items:_,activeId:"calendars",title:"Calendars",description:"Share a calendar with any client that can subscribe to a URL.",help:le,helpOpen:a,onToggleHelp:()=>t(r=>!r),onSelect:r=>{const c=H[r];c&&s({to:c})},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"}):n.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No calendars yet."}):e.jsx("div",{className:"space-y-4",children:n.map(r=>e.jsx(ce,{calendarId:r.id,calendarName:r.name},r.id))})})}export{ke as component};
@@ -1 +1 @@
1
- import{j as r,t}from"./index-B7Z_VTQH.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
+ import{j as r,t}from"./index-YYH_p-Ox.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};
@@ -0,0 +1 @@
1
+ import{e}from"./index-YYH_p-Ox.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-B7Z_VTQH.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
+ import{e as c}from"./index-YYH_p-Ox.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-B7Z_VTQH.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
+ import{e}from"./index-YYH_p-Ox.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-B7Z_VTQH.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
+ import{e}from"./index-YYH_p-Ox.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-B7Z_VTQH.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};
1
+ import{e as c}from"./index-YYH_p-Ox.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-ZmZmBukk.js";import"./index-YYH_p-Ox.js";import"./ErrorState-Cjdi1Pbp.js";import"./index-DembAj_D.js";import"./useMessageBodyContent-D-lqah5s.js";import"./useSignature-15aE8XaV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BMYHRqha.js";import"./sections-BZ0O_NV5.js";import"./confirm-dialog-BV8yPk0Z.js";const c=o;export{c as component};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-ZmZmBukk.js";import"./index-YYH_p-Ox.js";import"./ErrorState-Cjdi1Pbp.js";import"./index-DembAj_D.js";import"./useMessageBodyContent-D-lqah5s.js";import"./useSignature-15aE8XaV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BMYHRqha.js";import"./sections-BZ0O_NV5.js";import"./confirm-dialog-BV8yPk0Z.js";const c=o;export{c as component};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-ZmZmBukk.js";import"./index-YYH_p-Ox.js";import"./ErrorState-Cjdi1Pbp.js";import"./index-DembAj_D.js";import"./useMessageBodyContent-D-lqah5s.js";import"./useSignature-15aE8XaV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BMYHRqha.js";import"./sections-BZ0O_NV5.js";import"./confirm-dialog-BV8yPk0Z.js";const c=o;export{c as component};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-ZmZmBukk.js";import"./index-YYH_p-Ox.js";import"./ErrorState-Cjdi1Pbp.js";import"./index-DembAj_D.js";import"./useMessageBodyContent-D-lqah5s.js";import"./useSignature-15aE8XaV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BMYHRqha.js";import"./sections-BZ0O_NV5.js";import"./confirm-dialog-BV8yPk0Z.js";const c=o;export{c as component};
@@ -1 +1 @@
1
- import{b3 as v,b4 as T}from"./index-B7Z_VTQH.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
+ import{b3 as v,b4 as T}from"./index-YYH_p-Ox.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-B7Z_VTQH.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
+ import{r as u,G as x,H as f,j as e,J as b,t as a}from"./index-YYH_p-Ox.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-B7Z_VTQH.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};
1
+ import{e}from"./index-YYH_p-Ox.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};
@@ -1 +1 @@
1
- import{e as W,j as t,ay as F,aB as _,t as E,r as n,g as B,aQ as R,az as C,i as G,aw as Q,B as X,aA as J,f as N}from"./index-B7Z_VTQH.js";import{C as K}from"./card-D5vkdB74.js";const ut=W("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function Y({url:r}){return t.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",r?t.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):t.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function M({value:r,defaultValue:i,onValueChange:s,...e}){return s?t.jsxs(F,{value:r,onChange:a=>s(a.target.value),...e,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]}):t.jsxs(F,{defaultValue:i??r,...e,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]})}function D(r){return{tls:r==="tls",startTls:r==="starttls"}}function Z({steps:r,activeStep:i}){return t.jsx("ol",{className:"flex items-center gap-1",children:r.map((s,e)=>{const a=e<i,o=e===i;return t.jsxs("li",{className:"flex items-center gap-1",children:[e>0&&t.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:E("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",a&&"bg-accent text-accent-fg",o&&"bg-accent-soft text-accent ring-1 ring-accent",!a&&!o&&"bg-surface-sunken text-fg-subtle"),children:a?t.jsx(_,{className:"size-3"}):e+1}),t.jsx("span",{className:E("hidden text-2xs sm:inline",o?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function H({steps:r,activeStep:i,title:s,subtitle:e,children:a,footer:o,hideSteps:c}){return t.jsxs("div",{className:"flex h-dvh w-full flex-col items-center overflow-hidden bg-canvas pb-[max(2rem,env(safe-area-inset-bottom,0px))] pl-[max(2rem,env(safe-area-inset-left,0px))] pr-[max(2rem,env(safe-area-inset-right,0px))] pt-[max(2rem,env(safe-area-inset-top,0px))] font-sans text-fg",children:[t.jsx("div",{className:"hidden shrink-[9999] basis-[30vh] sm:block"}),!c&&t.jsx("div",{className:"mb-5 w-full max-w-xl shrink-0",children:t.jsx(Z,{steps:r,activeStep:i})}),t.jsxs(K,{raised:!0,className:"flex w-full min-h-0 max-w-xl flex-col",children:[t.jsxs("div",{className:"shrink-0 px-5 pt-5",children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),e&&t.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:e})]}),t.jsx("div",{"data-testid":"wizard-body",className:"min-h-0 overflow-y-auto px-5 py-5",children:a}),o&&t.jsx("div",{"data-testid":"wizard-footer",className:"flex shrink-0 items-center justify-between gap-3 border-t border-line px-5 py-3",children:o})]})]})}const tt="Coming soon — use IMAP for now.";function pt({name:r,description:i,icon:s,comingSoon:e,selected:a,onSelect:o}){const[c,l]=n.useState(!1),m=()=>{if(o){o();return}e&&l(!0)};return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("button",{type:"button",onClick:m,"aria-disabled":e||void 0,className:E("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",a?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",e&&"opacity-55"),children:[t.jsx("span",{className:E("text-fg-muted",a&&"text-accent-2"),children:s}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-semibold text-fg",children:r}),e&&t.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),t.jsx("span",{className:"text-xs text-fg-subtle",children:i})]}),c&&t.jsx("p",{className:"text-2xs text-fg-subtle",children:tt})]})}function dt({legend:r,badge:i,host:s,port:e,security:a,readOnly:o,onHostChange:c,onPortChange:l,onSecurityChange:m,hostPlaceholder:x,portPlaceholder:g}){const v=n.useId(),b=n.useId(),h=n.useId();return t.jsxs("fieldset",{children:[t.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[r,i&&t.jsx(B,{tone:i.tone,children:i.label})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[t.jsxs("div",{children:[t.jsx(R,{htmlFor:v,children:"Host"}),c?t.jsx(C,{id:v,readOnly:o,value:s,onChange:p=>c(p.target.value),placeholder:x}):t.jsx(C,{id:v,readOnly:o,defaultValue:s,placeholder:x})]}),t.jsxs("div",{children:[t.jsx(R,{htmlFor:b,children:"Port"}),l?t.jsx(C,{id:b,readOnly:o,value:e,onChange:p=>l(p.target.value),placeholder:g}):t.jsx(C,{id:b,readOnly:o,defaultValue:e,placeholder:g})]}),t.jsxs("div",{children:[t.jsx(R,{htmlFor:h,children:"Security"}),m?t.jsx(M,{id:h,value:a,onValueChange:m}):t.jsx(M,{id:h,defaultValue:a})]})]})]})}function q({label:r,detail:i,state:s}){return t.jsxs("div",{className:"flex items-start gap-3 py-2",children:[t.jsxs("span",{className:E("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&t.jsx(_,{className:"size-3"}),s==="failed"&&"!",s==="running"&&t.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:E("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:r}),i&&t.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:i})]})]})}const et=(r,i)=>{const s=n.useRef(i);s.current=i,n.useEffect(()=>{if(!r)return;const e=()=>{document.visibilityState==="visible"&&s.current()};return document.addEventListener("visibilitychange",e),window.addEventListener("pageshow",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pageshow",e)}},[r])},st=2e4,ht="Couldn't open Microsoft's sign-in page. Check your connection, and anything blocking redirects, then try again.",xt=r=>{const i=n.useRef(!1),s=n.useRef(!1),e=n.useRef(null),a=n.useRef(r);a.current=r;const o=n.useCallback(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),c=n.useCallback(()=>{!i.current||!s.current||(o(),s.current=!1,a.current("returned"))},[o]);return n.useEffect(()=>{const l=()=>{s.current=!0,o()},m=()=>{document.visibilityState==="hidden"&&l()},x=g=>{g.persisted&&(l(),c())};return document.addEventListener("visibilitychange",m),window.addEventListener("pagehide",l),window.addEventListener("pageshow",x),()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("pagehide",l),window.removeEventListener("pageshow",x),o()}},[c,o]),et(!0,c),n.useCallback(()=>{i.current=!0,s.current=!1,o(),e.current=setTimeout(()=>{e.current=null,i.current=!1,s.current=!1,a.current("stalled")},st)},[o])},rt={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},ot={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function O(r){try{const s=new DOMParser().parseFromString(r,"application/xml");if(s.querySelector("parsererror"))return null;const e=s.querySelectorAll("incomingServer[type='imap']"),a=s.querySelectorAll("outgoingServer[type='smtp']");if(!e.length||!a.length)return null;const o=e[0],c=a[0],l=o.querySelector("hostname")?.textContent?.trim(),m=o.querySelector("port")?.textContent?.trim(),x=o.querySelector("socketType")?.textContent?.trim().toUpperCase(),g=c.querySelector("hostname")?.textContent?.trim(),v=c.querySelector("port")?.textContent?.trim(),b=c.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!l||!m||!g||!v)return null;const h=p=>p==="SSL"||p==="TLS"||p==="SSL/TLS"?"tls":p==="STARTTLS"?"starttls":"none";return{imap:{host:l,port:Number.parseInt(m,10),security:h(x)},smtp:{host:g,port:Number.parseInt(v,10),security:h(b)},source:"mozilla-autoconfig"}}catch{return null}}async function it(r,i){try{const s=`https://autoconfig.thunderbird.net/v1.1/${r}`,e=await fetch(s,{signal:i});if(!e.ok)return null;const a=await e.text(),o=O(a);return o||null}catch{return null}}async function at(r,i){try{const s=`https://autoconfig.${r}/mail/config-v1.1.xml`,e=await fetch(s,{signal:i});if(!e.ok)return null;const a=await e.text(),o=O(a);return o?{...o,source:"domain-autoconfig"}:null}catch{return null}}function nt(r){return{imap:{host:`imap.${r}`,port:993,security:"tls"},smtp:{host:`smtp.${r}`,port:587,security:"starttls"},source:"heuristic"}}async function ft(r,i=1500){const s=r.indexOf("@");if(s===-1)return null;const e=r.slice(s+1).toLowerCase();if(!e)return null;const a=rt[e];if(a)return a;const o=new AbortController,c=setTimeout(()=>o.abort(),i);try{const l=await it(e,o.signal);if(l)return l;const m=await at(e,o.signal);if(m)return m}finally{clearTimeout(c)}return nt(e)}function yt(r){const i=r.indexOf("@");return i===-1?"Looking up server settings…":`Looking up settings for ${r.slice(i+1)}…`}function ct(r){const i=r.indexOf("@");if(i===-1)return;const s=r.slice(i+1).toLowerCase();return ot[s]}function gt({steps:r,activeStep:i,title:s,subtitle:e,email:a,username:o,password:c,notice:l,error:m,continueLabel:x="Test connection",backLabel:g="Back",onContinue:v,onBack:b,onChange:h}){const[p,z]=n.useState(o||a),[S,w]=n.useState(c),[T,k]=n.useState(null),I=ct(a),y=p.trim()!==""&&S.trim()!=="";n.useEffect(()=>{h(p,S)},[p,S,h]);const L=n.useCallback(()=>{if(!y){k("Enter your username and password.");return}k(null),v()},[y,v]);return n.useEffect(()=>{const u=j=>{j.key==="Enter"&&L(),j.key==="Escape"&&b()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[L,b]),t.jsx(H,{steps:r,activeStep:i,title:s,subtitle:e,footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:b,children:g}),t.jsx(N,{variant:"primary",onClick:L,children:x})]}),children:t.jsxs("div",{className:"space-y-3",children:[m&&t.jsx(X,{tone:"danger",children:m}),T&&t.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:T}),l,t.jsxs("div",{children:[t.jsx(R,{htmlFor:"credentials-username",children:"Username"}),t.jsx(C,{id:"credentials-username",value:p,onChange:u=>{z(u.target.value),k(null)},autoComplete:"username"})]}),t.jsxs("div",{children:[t.jsx(R,{htmlFor:"credentials-password",children:"Password or app password"}),t.jsx(J,{id:"credentials-password",value:S,onChange:u=>{w(u.target.value),k(null)},autoComplete:"current-password"})]}),t.jsx(Y,{url:I})]})})}function vt({steps:r,activeStep:i,email:s,imapConfig:e,smtpConfig:a,username:o,password:c,onSuccess:l,onBackToCredentials:m,onBackToServers:x,credentialsBackLabel:g="Back to credentials",serversBackLabel:v="Back to servers",successLabel:b="Start syncing"}){const[h,p]=n.useState({imapState:"running",smtpState:"pending",phase:"running"}),[z,S]=n.useState(0),w=a.host.trim()!=="",T=D(e.security),k=D(a.security),I=G({...Q()});n.useEffect(()=>{let u=!1;const j=[];return p({imapState:"running",smtpState:"pending",phase:"running"}),I.mutate({body:{username:o,password:c,imapHost:e.host,imapPort:e.port,imapTls:T.tls,imapStartTls:T.startTls,smtpHost:a.host,smtpPort:a.port,smtpTls:k.tls,smtpStartTls:k.startTls}},{onSuccess:d=>{if(u)return;const f=d.imapSuccess,P=w?d.smtpSuccess:!0;p({imapState:f?"ok":"failed",smtpState:w?"running":"ok",imapDetail:f?`Connected — ${e.host}:${e.port}`:d.imapError,phase:"running"}),j.push(window.setTimeout(()=>{if(u)return;const $=V=>{const A=V?.toLowerCase()??"";return A.includes("auth")||A.includes("login")||A.includes("535")||A.includes("credential")},U=!f&&$(d.imapError)||f&&w&&!d.smtpSuccess&&$(d.smtpError);p({imapState:f?"ok":"failed",smtpState:w?d.smtpSuccess?"ok":"failed":"ok",imapDetail:f?`Connected — ${e.host}:${e.port}`:d.imapError,smtpDetail:w?d.smtpSuccess?`Connected — ${a.host}:${a.port}`:d.smtpError:"Not set up — receive-only",rawError:f?w&&!d.smtpSuccess?d.smtpError:void 0:d.imapError,phase:f&&P?"success":U?"auth-failure":"network-failure"}),f&&P&&j.push(window.setTimeout(()=>{u||l()},800))},400))},onError:d=>{if(u)return;const f=d instanceof Error?d.message:"Connection failed";p({imapState:"failed",smtpState:"failed",imapDetail:f,smtpDetail:f,rawError:f,phase:"network-failure"})}}),()=>{u=!0;for(const d of j)window.clearTimeout(d)}},[z]);const{phase:y}=h;n.useEffect(()=>{const u=j=>{j.key==="Escape"&&(y==="auth-failure"?m():y==="network-failure"&&x())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[y,m,x]);const L=y==="auth-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:m,children:g}),t.jsx(N,{variant:"primary",onClick:()=>S(u=>u+1),children:"Retry"})]}):y==="network-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:x,children:v}),t.jsx(N,{variant:"primary",onClick:()=>S(u=>u+1),children:"Retry"})]}):y==="success"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),t.jsx(N,{variant:"primary",onClick:l,children:b})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),t.jsx("span",{})]});return t.jsx(H,{steps:r,activeStep:i,title:"Testing the connection",subtitle:`Checking ${s}`,footer:L,children:t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(q,{label:`IMAP — ${e.host}:${e.port}`,detail:h.imapDetail,state:h.imapState}),t.jsx(q,{label:w?`SMTP — ${a.host}:${a.port}`:"SMTP — sending",detail:w?h.smtpDetail:"Not set up — you can add sending later in Settings",state:h.smtpState}),(y==="auth-failure"||y==="network-failure")&&h.rawError&&t.jsxs("div",{className:"py-3",children:[y==="auth-failure"&&t.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:h.rawError})]})]})})}export{q as C,ht as R,ut as S,H as W,pt as a,xt as b,vt as c,gt as d,dt as e,yt as f,ct as g,ft as h,D as s,et as u};
1
+ import{e as W,j as t,ay as F,aB as _,t as E,r as n,g as B,aQ as R,az as C,i as G,aw as Q,B as X,aA as J,f as N}from"./index-YYH_p-Ox.js";import{C as K}from"./card-k-jKWhR7.js";const ut=W("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function Y({url:r}){return t.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",r?t.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):t.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function M({value:r,defaultValue:i,onValueChange:s,...e}){return s?t.jsxs(F,{value:r,onChange:a=>s(a.target.value),...e,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]}):t.jsxs(F,{defaultValue:i??r,...e,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]})}function D(r){return{tls:r==="tls",startTls:r==="starttls"}}function Z({steps:r,activeStep:i}){return t.jsx("ol",{className:"flex items-center gap-1",children:r.map((s,e)=>{const a=e<i,o=e===i;return t.jsxs("li",{className:"flex items-center gap-1",children:[e>0&&t.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:E("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",a&&"bg-accent text-accent-fg",o&&"bg-accent-soft text-accent ring-1 ring-accent",!a&&!o&&"bg-surface-sunken text-fg-subtle"),children:a?t.jsx(_,{className:"size-3"}):e+1}),t.jsx("span",{className:E("hidden text-2xs sm:inline",o?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function H({steps:r,activeStep:i,title:s,subtitle:e,children:a,footer:o,hideSteps:c}){return t.jsxs("div",{className:"flex h-dvh w-full flex-col items-center overflow-hidden bg-canvas pb-[max(2rem,env(safe-area-inset-bottom,0px))] pl-[max(2rem,env(safe-area-inset-left,0px))] pr-[max(2rem,env(safe-area-inset-right,0px))] pt-[max(2rem,env(safe-area-inset-top,0px))] font-sans text-fg",children:[t.jsx("div",{className:"hidden shrink-[9999] basis-[30vh] sm:block"}),!c&&t.jsx("div",{className:"mb-5 w-full max-w-xl shrink-0",children:t.jsx(Z,{steps:r,activeStep:i})}),t.jsxs(K,{raised:!0,className:"flex w-full min-h-0 max-w-xl flex-col",children:[t.jsxs("div",{className:"shrink-0 px-5 pt-5",children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),e&&t.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:e})]}),t.jsx("div",{"data-testid":"wizard-body",className:"min-h-0 overflow-y-auto px-5 py-5",children:a}),o&&t.jsx("div",{"data-testid":"wizard-footer",className:"flex shrink-0 items-center justify-between gap-3 border-t border-line px-5 py-3",children:o})]})]})}const tt="Coming soon — use IMAP for now.";function pt({name:r,description:i,icon:s,comingSoon:e,selected:a,onSelect:o}){const[c,l]=n.useState(!1),m=()=>{if(o){o();return}e&&l(!0)};return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("button",{type:"button",onClick:m,"aria-disabled":e||void 0,className:E("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",a?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",e&&"opacity-55"),children:[t.jsx("span",{className:E("text-fg-muted",a&&"text-accent-2"),children:s}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-semibold text-fg",children:r}),e&&t.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),t.jsx("span",{className:"text-xs text-fg-subtle",children:i})]}),c&&t.jsx("p",{className:"text-2xs text-fg-subtle",children:tt})]})}function dt({legend:r,badge:i,host:s,port:e,security:a,readOnly:o,onHostChange:c,onPortChange:l,onSecurityChange:m,hostPlaceholder:x,portPlaceholder:g}){const v=n.useId(),b=n.useId(),h=n.useId();return t.jsxs("fieldset",{children:[t.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[r,i&&t.jsx(B,{tone:i.tone,children:i.label})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[t.jsxs("div",{children:[t.jsx(R,{htmlFor:v,children:"Host"}),c?t.jsx(C,{id:v,readOnly:o,value:s,onChange:p=>c(p.target.value),placeholder:x}):t.jsx(C,{id:v,readOnly:o,defaultValue:s,placeholder:x})]}),t.jsxs("div",{children:[t.jsx(R,{htmlFor:b,children:"Port"}),l?t.jsx(C,{id:b,readOnly:o,value:e,onChange:p=>l(p.target.value),placeholder:g}):t.jsx(C,{id:b,readOnly:o,defaultValue:e,placeholder:g})]}),t.jsxs("div",{children:[t.jsx(R,{htmlFor:h,children:"Security"}),m?t.jsx(M,{id:h,value:a,onValueChange:m}):t.jsx(M,{id:h,defaultValue:a})]})]})]})}function q({label:r,detail:i,state:s}){return t.jsxs("div",{className:"flex items-start gap-3 py-2",children:[t.jsxs("span",{className:E("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&t.jsx(_,{className:"size-3"}),s==="failed"&&"!",s==="running"&&t.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:E("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:r}),i&&t.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:i})]})]})}const et=(r,i)=>{const s=n.useRef(i);s.current=i,n.useEffect(()=>{if(!r)return;const e=()=>{document.visibilityState==="visible"&&s.current()};return document.addEventListener("visibilitychange",e),window.addEventListener("pageshow",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pageshow",e)}},[r])},st=2e4,ht="Couldn't open Microsoft's sign-in page. Check your connection, and anything blocking redirects, then try again.",xt=r=>{const i=n.useRef(!1),s=n.useRef(!1),e=n.useRef(null),a=n.useRef(r);a.current=r;const o=n.useCallback(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),c=n.useCallback(()=>{!i.current||!s.current||(o(),s.current=!1,a.current("returned"))},[o]);return n.useEffect(()=>{const l=()=>{s.current=!0,o()},m=()=>{document.visibilityState==="hidden"&&l()},x=g=>{g.persisted&&(l(),c())};return document.addEventListener("visibilitychange",m),window.addEventListener("pagehide",l),window.addEventListener("pageshow",x),()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("pagehide",l),window.removeEventListener("pageshow",x),o()}},[c,o]),et(!0,c),n.useCallback(()=>{i.current=!0,s.current=!1,o(),e.current=setTimeout(()=>{e.current=null,i.current=!1,s.current=!1,a.current("stalled")},st)},[o])},rt={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},ot={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function O(r){try{const s=new DOMParser().parseFromString(r,"application/xml");if(s.querySelector("parsererror"))return null;const e=s.querySelectorAll("incomingServer[type='imap']"),a=s.querySelectorAll("outgoingServer[type='smtp']");if(!e.length||!a.length)return null;const o=e[0],c=a[0],l=o.querySelector("hostname")?.textContent?.trim(),m=o.querySelector("port")?.textContent?.trim(),x=o.querySelector("socketType")?.textContent?.trim().toUpperCase(),g=c.querySelector("hostname")?.textContent?.trim(),v=c.querySelector("port")?.textContent?.trim(),b=c.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!l||!m||!g||!v)return null;const h=p=>p==="SSL"||p==="TLS"||p==="SSL/TLS"?"tls":p==="STARTTLS"?"starttls":"none";return{imap:{host:l,port:Number.parseInt(m,10),security:h(x)},smtp:{host:g,port:Number.parseInt(v,10),security:h(b)},source:"mozilla-autoconfig"}}catch{return null}}async function it(r,i){try{const s=`https://autoconfig.thunderbird.net/v1.1/${r}`,e=await fetch(s,{signal:i});if(!e.ok)return null;const a=await e.text(),o=O(a);return o||null}catch{return null}}async function at(r,i){try{const s=`https://autoconfig.${r}/mail/config-v1.1.xml`,e=await fetch(s,{signal:i});if(!e.ok)return null;const a=await e.text(),o=O(a);return o?{...o,source:"domain-autoconfig"}:null}catch{return null}}function nt(r){return{imap:{host:`imap.${r}`,port:993,security:"tls"},smtp:{host:`smtp.${r}`,port:587,security:"starttls"},source:"heuristic"}}async function ft(r,i=1500){const s=r.indexOf("@");if(s===-1)return null;const e=r.slice(s+1).toLowerCase();if(!e)return null;const a=rt[e];if(a)return a;const o=new AbortController,c=setTimeout(()=>o.abort(),i);try{const l=await it(e,o.signal);if(l)return l;const m=await at(e,o.signal);if(m)return m}finally{clearTimeout(c)}return nt(e)}function yt(r){const i=r.indexOf("@");return i===-1?"Looking up server settings…":`Looking up settings for ${r.slice(i+1)}…`}function ct(r){const i=r.indexOf("@");if(i===-1)return;const s=r.slice(i+1).toLowerCase();return ot[s]}function gt({steps:r,activeStep:i,title:s,subtitle:e,email:a,username:o,password:c,notice:l,error:m,continueLabel:x="Test connection",backLabel:g="Back",onContinue:v,onBack:b,onChange:h}){const[p,z]=n.useState(o||a),[S,w]=n.useState(c),[T,k]=n.useState(null),I=ct(a),y=p.trim()!==""&&S.trim()!=="";n.useEffect(()=>{h(p,S)},[p,S,h]);const L=n.useCallback(()=>{if(!y){k("Enter your username and password.");return}k(null),v()},[y,v]);return n.useEffect(()=>{const u=j=>{j.key==="Enter"&&L(),j.key==="Escape"&&b()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[L,b]),t.jsx(H,{steps:r,activeStep:i,title:s,subtitle:e,footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:b,children:g}),t.jsx(N,{variant:"primary",onClick:L,children:x})]}),children:t.jsxs("div",{className:"space-y-3",children:[m&&t.jsx(X,{tone:"danger",children:m}),T&&t.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:T}),l,t.jsxs("div",{children:[t.jsx(R,{htmlFor:"credentials-username",children:"Username"}),t.jsx(C,{id:"credentials-username",value:p,onChange:u=>{z(u.target.value),k(null)},autoComplete:"username"})]}),t.jsxs("div",{children:[t.jsx(R,{htmlFor:"credentials-password",children:"Password or app password"}),t.jsx(J,{id:"credentials-password",value:S,onChange:u=>{w(u.target.value),k(null)},autoComplete:"current-password"})]}),t.jsx(Y,{url:I})]})})}function vt({steps:r,activeStep:i,email:s,imapConfig:e,smtpConfig:a,username:o,password:c,onSuccess:l,onBackToCredentials:m,onBackToServers:x,credentialsBackLabel:g="Back to credentials",serversBackLabel:v="Back to servers",successLabel:b="Start syncing"}){const[h,p]=n.useState({imapState:"running",smtpState:"pending",phase:"running"}),[z,S]=n.useState(0),w=a.host.trim()!=="",T=D(e.security),k=D(a.security),I=G({...Q()});n.useEffect(()=>{let u=!1;const j=[];return p({imapState:"running",smtpState:"pending",phase:"running"}),I.mutate({body:{username:o,password:c,imapHost:e.host,imapPort:e.port,imapTls:T.tls,imapStartTls:T.startTls,smtpHost:a.host,smtpPort:a.port,smtpTls:k.tls,smtpStartTls:k.startTls}},{onSuccess:d=>{if(u)return;const f=d.imapSuccess,P=w?d.smtpSuccess:!0;p({imapState:f?"ok":"failed",smtpState:w?"running":"ok",imapDetail:f?`Connected — ${e.host}:${e.port}`:d.imapError,phase:"running"}),j.push(window.setTimeout(()=>{if(u)return;const $=V=>{const A=V?.toLowerCase()??"";return A.includes("auth")||A.includes("login")||A.includes("535")||A.includes("credential")},U=!f&&$(d.imapError)||f&&w&&!d.smtpSuccess&&$(d.smtpError);p({imapState:f?"ok":"failed",smtpState:w?d.smtpSuccess?"ok":"failed":"ok",imapDetail:f?`Connected — ${e.host}:${e.port}`:d.imapError,smtpDetail:w?d.smtpSuccess?`Connected — ${a.host}:${a.port}`:d.smtpError:"Not set up — receive-only",rawError:f?w&&!d.smtpSuccess?d.smtpError:void 0:d.imapError,phase:f&&P?"success":U?"auth-failure":"network-failure"}),f&&P&&j.push(window.setTimeout(()=>{u||l()},800))},400))},onError:d=>{if(u)return;const f=d instanceof Error?d.message:"Connection failed";p({imapState:"failed",smtpState:"failed",imapDetail:f,smtpDetail:f,rawError:f,phase:"network-failure"})}}),()=>{u=!0;for(const d of j)window.clearTimeout(d)}},[z]);const{phase:y}=h;n.useEffect(()=>{const u=j=>{j.key==="Escape"&&(y==="auth-failure"?m():y==="network-failure"&&x())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[y,m,x]);const L=y==="auth-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:m,children:g}),t.jsx(N,{variant:"primary",onClick:()=>S(u=>u+1),children:"Retry"})]}):y==="network-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:x,children:v}),t.jsx(N,{variant:"primary",onClick:()=>S(u=>u+1),children:"Retry"})]}):y==="success"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),t.jsx(N,{variant:"primary",onClick:l,children:b})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),t.jsx("span",{})]});return t.jsx(H,{steps:r,activeStep:i,title:"Testing the connection",subtitle:`Checking ${s}`,footer:L,children:t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(q,{label:`IMAP — ${e.host}:${e.port}`,detail:h.imapDetail,state:h.imapState}),t.jsx(q,{label:w?`SMTP — ${a.host}:${a.port}`:"SMTP — sending",detail:w?h.smtpDetail:"Not set up — you can add sending later in Settings",state:h.smtpState}),(y==="auth-failure"||y==="network-failure")&&h.rawError&&t.jsxs("div",{className:"py-3",children:[y==="auth-failure"&&t.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:h.rawError})]})]})})}export{q as C,ht as R,ut as S,H as W,pt as a,xt as b,vt as c,gt as d,dt as e,yt as f,ct as g,ft as h,D as s,et as u};
@@ -1 +1 @@
1
- import{e}from"./index-B7Z_VTQH.js";const a=e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
1
+ import{e}from"./index-YYH_p-Ox.js";const a=e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
@@ -1 +1 @@
1
- import{e as a}from"./index-B7Z_VTQH.js";const o=a("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);export{o as F};
1
+ import{e as a}from"./index-YYH_p-Ox.js";const o=a("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);export{o as F};
@@ -1 +1 @@
1
- import{h as X,i as Z,bg as ee,bh as te,r as x,bi as se,j as t,bj as ae,bk as ie,L as R,f as N,bl as ne,aI as re,g as oe,bm as le,bn as ce,a3 as de,c as P,K as me,bo as ue,ae as pe,af as xe,bp as fe,bq as he,u as ge,d as be,aL as ve,aN as je}from"./index-B7Z_VTQH.js";import{S as ye}from"./settings-screen-BbWxKV6I.js";import{B as Ne}from"./bottom-sheet-BVoaqyZL.js";import{u as Ce,a as Se}from"./useLabels-BhpyswcI.js";import{b as Fe,N as S,p as Ie,u as Me,r as we,a as Ee,S as A,c as Oe,n as De,f as Le,d as Ae,e as ke,g as Te}from"./useFilters-R75OGKuu.js";import{C as L}from"./circle-check-BG2_X7qM.js";import{E as $}from"./ErrorState-BND_1CuC.js";import"./avatar-DsC7KMh_.js";import"./chevron-left-CXY1ffcB.js";import"./menu-BFEzC3rH.js";import"./circle-help-DmmRA9UB.js";const Re=(e,s)=>{const r=X(),i=Z({...te(),onSuccess:()=>{e&&(r.invalidateQueries({queryKey:Fe(e)}),s&&r.invalidateQueries({queryKey:ee({path:{accountId:e,filterId:s}})}))}}),{mutate:c}=i;return{updateFilter:x.useCallback(d=>{!e||!s||c({path:{accountId:e,filterId:s},body:d})},[e,s,c]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Pe=(e,s=!1)=>({clauses:e.literalClauses.map((i,c)=>({id:`clause-${c}`,field:i.field,value:i.value})),matchOperator:e.matchOperator==="And"?"all":"any",widen:e.hasAnchor?{anchorCount:1,...s?{inactive:!0}:{}}:void 0,moveMailboxId:e.actionMailboxId!==S?e.actionMailboxId:void 0,labelId:e.actionLabelId!==S?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?$e(e.expiresAt):void 0,name:e.name}),$e=e=>{if(!e)return"";const s=Date.parse(e);if(Number.isNaN(s))return"";const r=new Date(s),i=c=>String(c).padStart(2,"0");return`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`},k=e=>JSON.stringify({clauses:e.clauses.map(s=>[s.field,s.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null,widen:e.widen?e.widen.inactive?"inactive":"active":"none"}),z=(e,s)=>k(e)!==k(s),T=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),_=(e,s)=>T(e)!==T(s),ze=(e,s)=>{const r={},i=(e.name??"").trim();return i!==(s.name??"").trim()&&(r.name=i),z(e,s)&&(r.matchOperator=e.matchOperator==="all"?"And":"Or",r.literalClauses=e.clauses.map(c=>({field:c.field,value:c.value})),r.actionMailboxId=e.moveMailboxId??S,r.actionLabelId=e.labelId??S),_(e,s)&&(r.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(r.expiresAt=Ie(e.until??""))),r};function _e({accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g=!1,onClose:d}){const f=x.useMemo(()=>Pe(s,g),[s,g]),[n,l]=x.useState(f),[m,u]=x.useState(),[h,v]=x.useState(!1),I=x.useRef(0),{count:C}=Me(e,we(n)),y=Re(e,s.filterId),b=Ee(e),{createFolderIn:F}=se(e),{createLabel:E}=Ce(e),M=async o=>{const a=await E(o);return{id:a.labelId,name:a.name,color:a.color}},p=()=>u({mode:"add",draft:{field:A[0],value:""}}),w=o=>{const a=n.clauses.find(j=>j.id===o);a&&u({mode:"edit",clauseId:o,draft:{field:a.field,value:a.value}})},O=o=>u(a=>a&&{...a,draft:{...a.draft,field:o}}),K=o=>u(a=>a&&{...a,draft:{...a.draft,value:o}}),U=()=>{if(!m)return;const o=m.draft.field,a=De(o,m.draft.value);a!==""&&(l(j=>m.mode==="edit"&&m.clauseId?{...j,clauses:j.clauses.map(D=>D.id===m.clauseId?{id:D.id,field:o,value:a}:D)}:(I.current+=1,{...j,clauses:[...j.clauses,{id:`new-${I.current}`,field:o,value:a}]})),u(void 0))},B=o=>l(a=>({...a,clauses:a.clauses.filter(j=>j.id!==o)})),Q=o=>l(a=>({...a,matchOperator:o})),q=o=>l(a=>({...a,moveMailboxId:o||void 0})),G=o=>l(a=>({...a,labelId:o||void 0})),H=o=>l(a=>({...a,name:o})),J=o=>l(a=>({...a,scope:o,until:o==="until"?a.until:void 0})),V=o=>l(a=>({...a,until:o})),W=()=>{const o=z(n,f)||_(n,f),a=ze(n,f);if(Object.keys(a).length===0){d();return}v(o),y.updateFilter(a)},Y=()=>b.start(Oe(n));return b.isStarting||b.isRunning||b.isDone?t.jsx(Qe,{progress:b.progress,isDone:b.isDone,onClose:d}):y.isPending?t.jsx(Ke,{}):y.isError?t.jsx(qe,{onRetry:y.reset,onClose:d}):y.isSuccess?h?t.jsx(Be,{preview:ae(C),blocked:C.status!=="ready"||C.stale===!0,onReapply:Y,onClose:d}):t.jsx(Ue,{onClose:d}):t.jsx(ie,{rule:n,folders:r,delimiter:i,labels:c,preview:C,semanticAvailable:!1,clauseFields:A,anchorLocked:!0,clauseEdit:m,onStartAddClause:p,onStartEditClause:w,onRemoveClause:B,onChangeDraftField:O,onChangeDraftValue:K,onSubmitClause:U,onCancelClause:()=>u(void 0),onChangeMatchOperator:Q,onChangeMove:q,onCreateFolder:F,onChangeLabel:G,onCreateLabel:M,onChangeName:H,onChangeScope:J,onChangeUntil:V,onCommit:W,onCancel:d})}function Ke(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Ue({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(L,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(N,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Be({preview:e,blocked:s,onReapply:r,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(L,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:r,disabled:s,children:"Move existing mail"}),t.jsx(N,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Qe({progress:e,isDone:s,onClose:r}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(L,{className:"size-8 text-positive"}):t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),!s&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),s&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),s&&t.jsx(N,{variant:"primary",onClick:r,className:"mt-2",children:"Done"})]})}function qe({onRetry:e,onClose:s}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(N,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function Ge({accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d}){const f=ne(),n=t.jsx(_e,{accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d});return f?t.jsx(re,{open:!0,onClose:d,title:"Filter rule",children:n}):t.jsx(Ne,{open:!0,onClose:d,label:"Filter rule",dismissLabel:"Dismiss filter rule",children:n})}function He({filters:e,mailboxName:s,labelById:r,onEdit:i,onDelete:c,deletingFilterId:g,semanticUnavailable:d=!1,now:f=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(n=>{const l=Le(n,f),m=l==="Expired",u=n.actionMailboxId!==S?s(n.actionMailboxId):void 0,h=n.actionLabelId!==S?r.get(n.actionLabelId):void 0,v=Ae(n.expiresAt);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(n.filterId),"aria-label":`Edit filter ${n.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${m?"text-fg-muted":"text-fg"}`,children:n.name}),t.jsx(oe,{tone:m?"neutral":"positive",dot:!0,children:l})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[u?`Moves matches to ${u}`:"No move action",n.scope==="Temporary"&&v?m?` · expired ${v}`:` · until ${v}`:n.scope==="Standing"?" · always":""]}),(n.hasAnchor||h)&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[n.hasAnchor&&t.jsx(le,{widen:{anchorCount:1,...d?{inactive:!0}:{}}}),h&&t.jsx(ce,{label:{labelId:h.id,name:h.name,color:h.color}})]})]}),t.jsx(N,{variant:"ghost",size:"sm",icon:t.jsx(de,{className:"size-4 text-danger"}),onClick:()=>c(n.filterId),disabled:g===n.filterId,"aria-label":`Delete filter ${n.name}`})]},n.filterId)})})}const Je=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function Ve({account:e}){const s=e.accountId,{filters:r,isPending:i,isError:c,error:g,refetch:d}=ke(s),{deleteFilter:f,deletingFilterId:n}=Te(s),[l,m]=x.useState(),{data:u}=P({...me({path:{accountId:s}}),staleTime:1/0}),h=ue(),v=x.useMemo(()=>pe(e.folderAppointments),[e.folderAppointments]),I=x.useCallback(p=>{const w=u?.items.find(O=>O.mailboxId===p);if(w)return xe(w,v.get(p),h)},[u?.items,v,h]),C=x.useMemo(()=>fe({mailboxes:u?.items??[],folderAppointments:e.folderAppointments,translator:h}),[u?.items,e.folderAppointments,h]),y=he(u?.items??[]),{labels:b}=Se(s),F=x.useMemo(()=>b.map(p=>({id:p.labelId,name:p.name,color:p.color})),[b]),E=x.useMemo(()=>new Map(F.map(p=>[p.id,p])),[F]),M=r.find(p=>p.filterId===l);return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),M&&t.jsx(Ge,{accountId:s,filter:M,folders:C,delimiter:y,labels:F,onClose:()=>m(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):c?t.jsx($,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:g,onRetry:()=>{d()}}):t.jsx(He,{filters:r,mailboxName:I,labelById:E,onEdit:m,onDelete:f,deletingFilterId:n})]})}function ot(){const e=ge(),[s,r]=x.useState(!0),{data:i,isPending:c,isError:g,error:d,refetch:f}=P(be()),n=l=>{const m=je[l];m&&e({to:m})};return t.jsx(ye,{items:ve,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:Je,helpOpen:s,onToggleHelp:()=>r(l=>!l),onSelect:n,onBackToMail:()=>{e({to:"/mail"})},children:c?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):g?t.jsx($,{title:"Couldn't load accounts",error:d,onRetry:()=>{f()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(Ve,{account:l},l.accountId))})})}export{Ve as AccountFilters,ot as component};
1
+ import{h as X,i as Z,bg as ee,bh as te,r as x,bi as se,j as t,bj as ae,bk as ie,L as R,f as N,bl as ne,aI as re,g as oe,bm as le,bn as ce,a3 as de,c as P,K as me,bo as ue,ae as pe,af as xe,bp as fe,bq as he,u as ge,d as be,aL as ve,aN as je}from"./index-YYH_p-Ox.js";import{S as ye}from"./settings-screen-ClyspzuZ.js";import{B as Ne}from"./bottom-sheet-BMfA1os-.js";import{u as Ce,a as Se}from"./useLabels-D8sluUEk.js";import{b as Fe,N as S,p as Ie,u as Me,r as we,a as Ee,S as A,c as Oe,n as De,f as Le,d as Ae,e as ke,g as Te}from"./useFilters-DXXBrpPW.js";import{C as L}from"./circle-check-DsecdMli.js";import{E as $}from"./ErrorState-Cjdi1Pbp.js";import"./avatar-C5DZJDZl.js";import"./chevron-left-CrajKg1c.js";import"./menu-DPopx5EJ.js";import"./circle-help-PfoCuRx4.js";const Re=(e,s)=>{const r=X(),i=Z({...te(),onSuccess:()=>{e&&(r.invalidateQueries({queryKey:Fe(e)}),s&&r.invalidateQueries({queryKey:ee({path:{accountId:e,filterId:s}})}))}}),{mutate:c}=i;return{updateFilter:x.useCallback(d=>{!e||!s||c({path:{accountId:e,filterId:s},body:d})},[e,s,c]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Pe=(e,s=!1)=>({clauses:e.literalClauses.map((i,c)=>({id:`clause-${c}`,field:i.field,value:i.value})),matchOperator:e.matchOperator==="And"?"all":"any",widen:e.hasAnchor?{anchorCount:1,...s?{inactive:!0}:{}}:void 0,moveMailboxId:e.actionMailboxId!==S?e.actionMailboxId:void 0,labelId:e.actionLabelId!==S?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?$e(e.expiresAt):void 0,name:e.name}),$e=e=>{if(!e)return"";const s=Date.parse(e);if(Number.isNaN(s))return"";const r=new Date(s),i=c=>String(c).padStart(2,"0");return`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`},k=e=>JSON.stringify({clauses:e.clauses.map(s=>[s.field,s.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null,widen:e.widen?e.widen.inactive?"inactive":"active":"none"}),z=(e,s)=>k(e)!==k(s),T=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),_=(e,s)=>T(e)!==T(s),ze=(e,s)=>{const r={},i=(e.name??"").trim();return i!==(s.name??"").trim()&&(r.name=i),z(e,s)&&(r.matchOperator=e.matchOperator==="all"?"And":"Or",r.literalClauses=e.clauses.map(c=>({field:c.field,value:c.value})),r.actionMailboxId=e.moveMailboxId??S,r.actionLabelId=e.labelId??S),_(e,s)&&(r.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(r.expiresAt=Ie(e.until??""))),r};function _e({accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g=!1,onClose:d}){const f=x.useMemo(()=>Pe(s,g),[s,g]),[n,l]=x.useState(f),[m,u]=x.useState(),[h,v]=x.useState(!1),I=x.useRef(0),{count:C}=Me(e,we(n)),y=Re(e,s.filterId),b=Ee(e),{createFolderIn:F}=se(e),{createLabel:E}=Ce(e),M=async o=>{const a=await E(o);return{id:a.labelId,name:a.name,color:a.color}},p=()=>u({mode:"add",draft:{field:A[0],value:""}}),w=o=>{const a=n.clauses.find(j=>j.id===o);a&&u({mode:"edit",clauseId:o,draft:{field:a.field,value:a.value}})},O=o=>u(a=>a&&{...a,draft:{...a.draft,field:o}}),K=o=>u(a=>a&&{...a,draft:{...a.draft,value:o}}),U=()=>{if(!m)return;const o=m.draft.field,a=De(o,m.draft.value);a!==""&&(l(j=>m.mode==="edit"&&m.clauseId?{...j,clauses:j.clauses.map(D=>D.id===m.clauseId?{id:D.id,field:o,value:a}:D)}:(I.current+=1,{...j,clauses:[...j.clauses,{id:`new-${I.current}`,field:o,value:a}]})),u(void 0))},B=o=>l(a=>({...a,clauses:a.clauses.filter(j=>j.id!==o)})),Q=o=>l(a=>({...a,matchOperator:o})),q=o=>l(a=>({...a,moveMailboxId:o||void 0})),G=o=>l(a=>({...a,labelId:o||void 0})),H=o=>l(a=>({...a,name:o})),J=o=>l(a=>({...a,scope:o,until:o==="until"?a.until:void 0})),V=o=>l(a=>({...a,until:o})),W=()=>{const o=z(n,f)||_(n,f),a=ze(n,f);if(Object.keys(a).length===0){d();return}v(o),y.updateFilter(a)},Y=()=>b.start(Oe(n));return b.isStarting||b.isRunning||b.isDone?t.jsx(Qe,{progress:b.progress,isDone:b.isDone,onClose:d}):y.isPending?t.jsx(Ke,{}):y.isError?t.jsx(qe,{onRetry:y.reset,onClose:d}):y.isSuccess?h?t.jsx(Be,{preview:ae(C),blocked:C.status!=="ready"||C.stale===!0,onReapply:Y,onClose:d}):t.jsx(Ue,{onClose:d}):t.jsx(ie,{rule:n,folders:r,delimiter:i,labels:c,preview:C,semanticAvailable:!1,clauseFields:A,anchorLocked:!0,clauseEdit:m,onStartAddClause:p,onStartEditClause:w,onRemoveClause:B,onChangeDraftField:O,onChangeDraftValue:K,onSubmitClause:U,onCancelClause:()=>u(void 0),onChangeMatchOperator:Q,onChangeMove:q,onCreateFolder:F,onChangeLabel:G,onCreateLabel:M,onChangeName:H,onChangeScope:J,onChangeUntil:V,onCommit:W,onCancel:d})}function Ke(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Ue({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(L,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(N,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Be({preview:e,blocked:s,onReapply:r,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(L,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:r,disabled:s,children:"Move existing mail"}),t.jsx(N,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Qe({progress:e,isDone:s,onClose:r}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(L,{className:"size-8 text-positive"}):t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),!s&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),s&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),s&&t.jsx(N,{variant:"primary",onClick:r,className:"mt-2",children:"Done"})]})}function qe({onRetry:e,onClose:s}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(N,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function Ge({accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d}){const f=ne(),n=t.jsx(_e,{accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d});return f?t.jsx(re,{open:!0,onClose:d,title:"Filter rule",children:n}):t.jsx(Ne,{open:!0,onClose:d,label:"Filter rule",dismissLabel:"Dismiss filter rule",children:n})}function He({filters:e,mailboxName:s,labelById:r,onEdit:i,onDelete:c,deletingFilterId:g,semanticUnavailable:d=!1,now:f=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(n=>{const l=Le(n,f),m=l==="Expired",u=n.actionMailboxId!==S?s(n.actionMailboxId):void 0,h=n.actionLabelId!==S?r.get(n.actionLabelId):void 0,v=Ae(n.expiresAt);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(n.filterId),"aria-label":`Edit filter ${n.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${m?"text-fg-muted":"text-fg"}`,children:n.name}),t.jsx(oe,{tone:m?"neutral":"positive",dot:!0,children:l})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[u?`Moves matches to ${u}`:"No move action",n.scope==="Temporary"&&v?m?` · expired ${v}`:` · until ${v}`:n.scope==="Standing"?" · always":""]}),(n.hasAnchor||h)&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[n.hasAnchor&&t.jsx(le,{widen:{anchorCount:1,...d?{inactive:!0}:{}}}),h&&t.jsx(ce,{label:{labelId:h.id,name:h.name,color:h.color}})]})]}),t.jsx(N,{variant:"ghost",size:"sm",icon:t.jsx(de,{className:"size-4 text-danger"}),onClick:()=>c(n.filterId),disabled:g===n.filterId,"aria-label":`Delete filter ${n.name}`})]},n.filterId)})})}const Je=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function Ve({account:e}){const s=e.accountId,{filters:r,isPending:i,isError:c,error:g,refetch:d}=ke(s),{deleteFilter:f,deletingFilterId:n}=Te(s),[l,m]=x.useState(),{data:u}=P({...me({path:{accountId:s}}),staleTime:1/0}),h=ue(),v=x.useMemo(()=>pe(e.folderAppointments),[e.folderAppointments]),I=x.useCallback(p=>{const w=u?.items.find(O=>O.mailboxId===p);if(w)return xe(w,v.get(p),h)},[u?.items,v,h]),C=x.useMemo(()=>fe({mailboxes:u?.items??[],folderAppointments:e.folderAppointments,translator:h}),[u?.items,e.folderAppointments,h]),y=he(u?.items??[]),{labels:b}=Se(s),F=x.useMemo(()=>b.map(p=>({id:p.labelId,name:p.name,color:p.color})),[b]),E=x.useMemo(()=>new Map(F.map(p=>[p.id,p])),[F]),M=r.find(p=>p.filterId===l);return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),M&&t.jsx(Ge,{accountId:s,filter:M,folders:C,delimiter:y,labels:F,onClose:()=>m(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):c?t.jsx($,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:g,onRetry:()=>{d()}}):t.jsx(He,{filters:r,mailboxName:I,labelById:E,onEdit:m,onDelete:f,deletingFilterId:n})]})}function ot(){const e=ge(),[s,r]=x.useState(!0),{data:i,isPending:c,isError:g,error:d,refetch:f}=P(be()),n=l=>{const m=je[l];m&&e({to:m})};return t.jsx(ye,{items:ve,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:Je,helpOpen:s,onToggleHelp:()=>r(l=>!l),onSelect:n,onBackToMail:()=>{e({to:"/mail"})},children:c?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):g?t.jsx($,{title:"Couldn't load accounts",error:d,onRetry:()=>{f()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(Ve,{account:l},l.accountId))})})}export{Ve as AccountFilters,ot as component};
@@ -1 +1 @@
1
- import{j as r}from"./index-B7Z_VTQH.js";import{E as o}from"./ErrorState-BND_1CuC.js";const l=({error:t,reset:e})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(o,{title:"Couldn't load your starred mail",error:t,onRetry:e})});export{l as errorComponent};
1
+ import{j as r}from"./index-YYH_p-Ox.js";import{E as o}from"./ErrorState-Cjdi1Pbp.js";const l=({error:t,reset:e})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(o,{title:"Couldn't load your starred mail",error:t,onRetry:e})});export{l as errorComponent};
@@ -0,0 +1 @@
1
+ import{j as o,O as i}from"./index-YYH_p-Ox.js";import{a as m}from"./MailShell-D8B5KgJY.js";import{F as r}from"./FlaggedPane-D2_45Zph.js";import{d as p}from"./search-token-index-CF-eJ9n9.js";import{u as e}from"./search-mirror-C4Q_FmCR.js";import"./FullCompose-ZmZmBukk.js";import"./ErrorState-Cjdi1Pbp.js";import"./index-DembAj_D.js";import"./useMessageBodyContent-D-lqah5s.js";import"./useSignature-15aE8XaV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BMYHRqha.js";import"./sections-BZ0O_NV5.js";import"./confirm-dialog-BV8yPk0Z.js";import"./useSearchTokenContext-DMTmSJiu.js";import"./kbd-BHWNGlF5.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D2YY1oCj.js";import"./roving-focus-CFhWtHQV.js";import"./attachment-file-bw6jpX2a.js";import"./mail-D_9uR_xf.js";import"./avatar-C5DZJDZl.js";import"./EmptyState-6r0r5FVG.js";import"./download-pgJibm8f.js";import"./calendar-event-chip-C1T8fqpx.js";import"./calendar-color-DgHc36b7.js";import"./map-pin-C7QrVAH3.js";import"./attendee-row-y73RSxi6.js";import"./clock-BoxKHt-D.js";import"./useLayoutTier-MqmqPhVY.js";import"./shield-check-D9zGpyyh.js";import"./useFilters-DXXBrpPW.js";import"./useQueries-Dm82vk6v.js";import"./menu-DPopx5EJ.js";import"./MailViewChrome-Ca_PpFLh.js";import"./refresh-cw-Di3kvivg.js";import"./wizard-selection-DxUM65kM.js";function N(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{N as component};