@remit/web-client-dist 0.0.698 → 0.0.700

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 (201) hide show
  1. package/assets/{BriefPane-OvZiBDtW.js → BriefPane-1X78pLE1.js} +1 -1
  2. package/assets/{CalendarEventEditor-JBfO_GQa.js → CalendarEventEditor-GVmbgsnz.js} +1 -1
  3. package/assets/{CalendarEventPopup-U6Ndkn2v.js → CalendarEventPopup-BXpx-Ku2.js} +1 -1
  4. package/assets/{CalendarLoadFailed-CNaVKDtW.js → CalendarLoadFailed-C47ken4G.js} +1 -1
  5. package/assets/{CalendarQuickCreate-C-yc6zce.js → CalendarQuickCreate-Icz8bbCP.js} +1 -1
  6. package/assets/{CalendarSession-C_XnZoOI.js → CalendarSession-B6dbruSb.js} +1 -1
  7. package/assets/{CollectionPane-C6EYtyWc.js → CollectionPane-CHKXUrhZ.js} +1 -1
  8. package/assets/{DesktopChrome-DXIJ6wUA.js → DesktopChrome-Dv5ZCeNJ.js} +1 -1
  9. package/assets/{DropdownMenu-DsxemHc4.js → DropdownMenu-BaLCJNxL.js} +1 -1
  10. package/assets/{EmptyState-Dv8xCRkX.js → EmptyState-DNcM-EnL.js} +1 -1
  11. package/assets/{ErrorState-BptbbJAv.js → ErrorState-BTTbYobA.js} +1 -1
  12. package/assets/{FullCompose-BGLjrGst.js → FullCompose-CfHgzwr4.js} +1 -1
  13. package/assets/{LabelApplyTrigger-DzgVUcax.js → LabelApplyTrigger-C3JLcO9V.js} +1 -1
  14. package/assets/{MailShell-DE0ZN2ct.js → MailShell-F1IPFnEY.js} +1 -1
  15. package/assets/{MailViewChrome-DoBZYTxQ.js → MailViewChrome-0kmIcU2a.js} +1 -1
  16. package/assets/{MailboxPane-CxaGFC0R.js → MailboxPane-BH4Wy3IV.js} +1 -1
  17. package/assets/{MessageBody-BYYCZieC.js → MessageBody-Djhcr7mH.js} +1 -1
  18. package/assets/{MessageToolbar-CnhMX7Ap.js → MessageToolbar-DsaMB1As.js} +1 -1
  19. package/assets/{NavMenuButton-B28Nb9kR.js → NavMenuButton-DYR0-1E6.js} +1 -1
  20. package/assets/{OnboardingWizard-dQ9c99Ni.js → OnboardingWizard-wyK1Mh9q.js} +1 -1
  21. package/assets/{OutboxPane-ByJt4RDv.js → OutboxPane-BGB85Zw5.js} +1 -1
  22. package/assets/{ReportLink-D0tCso5T.js → ReportLink-BIbpn8n0.js} +1 -1
  23. package/assets/_calendarObjectId-UGnLOBrz.js +1 -0
  24. package/assets/_labelId-BEYs4sLQ.js +1 -0
  25. package/assets/_mailboxId-Cs76zwUj.js +1 -0
  26. package/assets/_messageId-BgokXSax.js +1 -0
  27. package/assets/_messageId-CfxVb_fy.js +1 -0
  28. package/assets/_messageId-CrEJ-3q6.js +1 -0
  29. package/assets/_messageId-CuuCAE3l.js +1 -0
  30. package/assets/_outboxMessageId-CVN9Jsje.js +1 -0
  31. package/assets/_recurrenceId-CpO73ca1.js +1 -0
  32. package/assets/{_slotId-BgSRkGdw.js → _slotId-Dup1VJ9f.js} +1 -1
  33. package/assets/_threadId-CeXaxU5-.js +1 -0
  34. package/assets/_threadId-DmBbZCRQ.js +1 -0
  35. package/assets/_threadId-Fpo0BNhS.js +1 -0
  36. package/assets/_threadId-KbaehKOy.js +1 -0
  37. package/assets/{_view._date-BCOouUgc.js → _view._date-Cyt_qJFk.js} +1 -1
  38. package/assets/{account-service-status-C6hq8flJ.js → account-service-status-DfJaPtgF.js} +1 -1
  39. package/assets/{accounts-B2HAE5Mp.js → accounts-CSTgaqDu.js} +1 -1
  40. package/assets/{advanced-BBWKSR4H.js → advanced-BMIK5PED.js} +1 -1
  41. package/assets/{agenda-time-C9jExuVe.js → agenda-time-jh144Gvm.js} +1 -1
  42. package/assets/{app-chrome-CS-vT-4r.js → app-chrome-D1NIvvpc.js} +1 -1
  43. package/assets/{appearance-oUeDfZvm.js → appearance-7JHpRG--.js} +1 -1
  44. package/assets/{avatar-B60PZejm.js → avatar-BL40ICSJ.js} +1 -1
  45. package/assets/{badge-DYFkBshe.js → badge-BuEj66zZ.js} +1 -1
  46. package/assets/{bottom-sheet-B0y_-mKC.js → bottom-sheet-BnrQALZr.js} +1 -1
  47. package/assets/brief-3bPqDpxR.js +1 -0
  48. package/assets/{brief-DBLwMpYO.js → brief-DhZbrkct.js} +1 -1
  49. package/assets/{calendar-Cf7D8za1.js → calendar-1FVjmRTn.js} +1 -1
  50. package/assets/{calendar-DON3hXqq.js → calendar-DWDr32Pg.js} +1 -1
  51. package/assets/{calendar-event-popup-BqE6svk6.js → calendar-event-popup-PVY1kYQF.js} +1 -1
  52. package/assets/{calendar-event-sidebar-BGvCPmWa.js → calendar-event-sidebar-BUfI3YjI.js} +1 -1
  53. package/assets/{calendar-failure-note-sEjmPcbo.js → calendar-failure-note-BVioFwWu.js} +1 -1
  54. package/assets/{calendar-guests-CuFcAD3k.js → calendar-guests-BqL_oNsB.js} +1 -1
  55. package/assets/{calendar-suggestion-CZ6ssHct.js → calendar-suggestion-k_ABH6QD.js} +1 -1
  56. package/assets/{calendars-9OZeuRv6.js → calendars-D4eBXLYf.js} +1 -1
  57. package/assets/{card-13z0qC0r.js → card-DT547OCZ.js} +1 -1
  58. package/assets/{checkbox-ZdvWSWRN.js → checkbox-BQtzZS8k.js} +1 -1
  59. package/assets/{chevron-down-wpFtElCn.js → chevron-down-pXHA84n5.js} +1 -1
  60. package/assets/{chevron-left-HeNgNNR2.js → chevron-left-BahGQZIk.js} +1 -1
  61. package/assets/{circle-check-Q9IHsvBp.js → circle-check-AS6dW8bL.js} +1 -1
  62. package/assets/{circle-check-big-C2cm1OoH.js → circle-check-big-CB4KqzoP.js} +1 -1
  63. package/assets/{circle-question-mark-CYsyue28.js → circle-question-mark-BaR50kvR.js} +1 -1
  64. package/assets/{classification-BxsZLEnC.js → classification-Dc4amyUU.js} +1 -1
  65. package/assets/{clock-D8a14yMJ.js → clock-Nfb5MDhL.js} +1 -1
  66. package/assets/{cloud-off-I2wH-wZi.js → cloud-off-BgkpB7KU.js} +1 -1
  67. package/assets/compose._-_outboxMessageId_-COLqOsyy.js +1 -0
  68. package/assets/compose._-_outboxMessageId_-DCQmLiHN.js +1 -0
  69. package/assets/compose._-_outboxMessageId_-DHsEuAW4.js +1 -0
  70. package/assets/compose._-_outboxMessageId_-DUhN13RX.js +1 -0
  71. package/assets/compose._-_outboxMessageId_-qlcrUpQ6.js +1 -0
  72. package/assets/{config-import-DTqOa38a.js → config-import-BZQDs381.js} +1 -1
  73. package/assets/{confirm-dialog-CsttDS5u.js → confirm-dialog-DYq0xqzk.js} +1 -1
  74. package/assets/{copy-V6gKiItu.js → copy-DQUWdx9U.js} +1 -1
  75. package/assets/{credential-steps-BPun50HH.js → credential-steps-CCGZ6JdD.js} +1 -1
  76. package/assets/{download-CHIm9QMw.js → download-Brw9q_-P.js} +1 -1
  77. package/assets/{draft-CUl68Y86.js → draft-Cd-2kcmd.js} +1 -1
  78. package/assets/edit-Cl3as_cw.js +1 -0
  79. package/assets/edit-DT7h9lL5.js +1 -0
  80. package/assets/{external-link-DinDD_TS.js → external-link-Dk90khCr.js} +1 -1
  81. package/assets/{file-braces-DSnr6-a7.js → file-braces-D8FfI4WO.js} +1 -1
  82. package/assets/{filters-BOpD_izN.js → filters-CHZmyfZw.js} +1 -1
  83. package/assets/{flagged-Cj4ARwpT.js → flagged-By_YD4cC.js} +1 -1
  84. package/assets/flagged-D7BRH9c-.js +1 -0
  85. package/assets/{folder-input-BqAxe_6s.js → folder-input-DKDXDpie.js} +1 -1
  86. package/assets/{folders-NwCVYN5L.js → folders-CHad3XAp.js} +1 -1
  87. package/assets/{help-copy-EtAi1Aq7.js → help-copy-CUON12Au.js} +1 -1
  88. package/assets/{import-DJMjk1Ri.js → import-LtyqW8iL.js} +1 -1
  89. package/assets/index-BZiOavIe.js +57 -0
  90. package/assets/index-CK8liNXs.js +1 -0
  91. package/assets/index-CXyrhsSF.js +1 -0
  92. package/assets/index-CrEJ-3q6.js +1 -0
  93. package/assets/index-CrdNZQNf.js +1 -0
  94. package/assets/index-CuuCAE3l.js +1 -0
  95. package/assets/index-D8Xl9aln.js +1 -0
  96. package/assets/{index-CKFdaY9c.js → index-DAdnmNGF.js} +3 -3
  97. package/assets/index-DS9vrT_q.js +1 -0
  98. package/assets/index-DfFfr-F8.js +1 -0
  99. package/assets/index-DiBpocpZ.js +1 -0
  100. package/assets/index-IJSR-1EH.js +1 -0
  101. package/assets/index-PL2et9Cy.js +1 -0
  102. package/assets/index-x7B0xpK4.js +1 -0
  103. package/assets/{kbd-qpWA48X9.js → kbd-Dck-H7HI.js} +1 -1
  104. package/assets/{label-chip-zwUAXSWu.js → label-chip-PA6sFIAt.js} +1 -1
  105. package/assets/{labels-CwGUliq_.js → labels-DsTLyF02.js} +1 -1
  106. package/assets/{mail-B-_K5JCo.js → mail-Bc_qCbu3.js} +1 -1
  107. package/assets/{mail-Bsgov7FY.js → mail-CNc7ptBm.js} +1 -1
  108. package/assets/{menu-CKmdL0us.js → menu-0smgSLZN.js} +1 -1
  109. package/assets/{nav-link-YOSchPy9.js → nav-link-DsF82VIK.js} +1 -1
  110. package/assets/new-DQ1DUWtx.js +1 -0
  111. package/assets/onboarding-ZeQ8izEG.js +1 -0
  112. package/assets/{onboarding-completion-cX9HM-aL.js → onboarding-completion-Bpy8dmzE.js} +1 -1
  113. package/assets/outbox-CfYm1ISa.js +1 -0
  114. package/assets/{pencil-C6KO5975.js → pencil-DzsoMa_O.js} +1 -1
  115. package/assets/{people-BhhvdCU4.js → people-C_xBLBOV.js} +1 -1
  116. package/assets/{plus-DsSkq30M.js → plus-B59D825u.js} +1 -1
  117. package/assets/{popover-menu-DP-hyKpu.js → popover-menu-CklSwxyo.js} +1 -1
  118. package/assets/{refresh-cw-CCcTeH3S.js → refresh-cw-CHIH0Wcb.js} +1 -1
  119. package/assets/{reply-SkF_KCOk.js → reply-iVDGWyKD.js} +1 -1
  120. package/assets/{rich-text-By6rXXKy.js → rich-text-BG71v2el.js} +1 -1
  121. package/assets/{rich-text-spellcheck-worker-provider-DQbI8hMR.js → rich-text-spellcheck-worker-provider-CYOVgYAu.js} +1 -1
  122. package/assets/{rotate-ccw-lh0BmpDo.js → rotate-ccw-DCz7Obdq.js} +1 -1
  123. package/assets/{roving-focus-DlzLpO4G.js → roving-focus-BKvgV51a.js} +1 -1
  124. package/assets/{row-actions-0g39M7ib.js → row-actions-BuX34ZFc.js} +1 -1
  125. package/assets/{search-mirror-D9nwr5km.js → search-mirror-zI1Wto7m.js} +1 -1
  126. package/assets/{search-scope-DNDpRNp9.js → search-scope-CCaj49Vd.js} +1 -1
  127. package/assets/{search-token-index-cy3uaYXm.js → search-token-index-BWG-pAOC.js} +1 -1
  128. package/assets/{sections-ZsRsk30_.js → sections-2qhslMDR.js} +1 -1
  129. package/assets/{segmented-control-CeqFpYfk.js → segmented-control-DAjB5Iim.js} +1 -1
  130. package/assets/{select-yGv73aji.js → select-C4OaQe9Y.js} +1 -1
  131. package/assets/{senders-lMWjFLIX.js → senders-CyRl3YXt.js} +1 -1
  132. package/assets/settings-DoyBSz9G.js +1 -0
  133. package/assets/{settings-screen-C8z8YwuM.js → settings-screen-CkqdkWAP.js} +1 -1
  134. package/assets/{shield-check-CIZoP3AE.js → shield-check-CtR5JIeP.js} +1 -1
  135. package/assets/{spam-D6paxCM2.js → spam-BcCIVQmt.js} +1 -1
  136. package/assets/{suggest-list-czu9q5H4.js → suggest-list-DfFvQ4CV.js} +1 -1
  137. package/assets/{suggested-vips-DXCCMmOn.js → suggested-vips-dDCIbwv4.js} +1 -1
  138. package/assets/{suggestion._suggestionId-zlbObxkn.js → suggestion._suggestionId-YO-ZCSDh.js} +1 -1
  139. package/assets/{switch-BezKd3gx.js → switch-D8q_07j1.js} +1 -1
  140. package/assets/{task._calendarTaskId-CgBc-n43.js → task._calendarTaskId-BNRB4ElI.js} +1 -1
  141. package/assets/{undo-2-CgG5m84e.js → undo-2-BVQZakOw.js} +1 -1
  142. package/assets/{useCalendarData-CgRGDHYQ.js → useCalendarData-Dw0DbJWn.js} +1 -1
  143. package/assets/{useCalendarScheduling-BhFuxgru.js → useCalendarScheduling-CdGHvRHZ.js} +1 -1
  144. package/assets/{useCalendarSuggestions-BaIFwYBZ.js → useCalendarSuggestions-p-hH5nuf.js} +1 -1
  145. package/assets/{useCalendarTasks-CnP7DfUR.js → useCalendarTasks-DMazKBtK.js} +1 -1
  146. package/assets/{useClassificationSettings-Bk89yu99.js → useClassificationSettings-CO0hn9NU.js} +1 -1
  147. package/assets/{useCollectionThreads-BMsppZhN.js → useCollectionThreads-CPr4txVm.js} +1 -1
  148. package/assets/{useDebouncedValue-BpDHcfPe.js → useDebouncedValue-C9NNbS8g.js} +1 -1
  149. package/assets/{useFilters-Cv2IfE4J.js → useFilters-BMKRyTCu.js} +1 -1
  150. package/assets/{useInfiniteQuery-DwTTxcsy.js → useInfiniteQuery-CK5IyvrU.js} +1 -1
  151. package/assets/{useJunkMailboxIds-CDFS8XJA.js → useJunkMailboxIds-CdTwA43P.js} +1 -1
  152. package/assets/{useLabels-BIArT792.js → useLabels-CX2FfltE.js} +1 -1
  153. package/assets/{useLayoutTier-Y7Z9Nnsm.js → useLayoutTier-D0BFfVm6.js} +1 -1
  154. package/assets/{useMediaQuery-CjE8xNMz.js → useMediaQuery-CH9DMslv.js} +1 -1
  155. package/assets/{useMessageBodyContent-D5mskS3v.js → useMessageBodyContent-B2YcWG0V.js} +1 -1
  156. package/assets/{useQueries-CQ_R-NWg.js → useQueries-D7oIAKqU.js} +1 -1
  157. package/assets/{useRefreshControl-DwtRYeei.js → useRefreshControl-BYVDaLtF.js} +1 -1
  158. package/assets/{useResultFolderIndex-ZNSoZByc.js → useResultFolderIndex-B4dE8eq5.js} +1 -1
  159. package/assets/{useSignature-CnLh1XFv.js → useSignature-CrwNi268.js} +1 -1
  160. package/assets/{warnings-zZSUr-_I.js → warnings-DweDlyG4.js} +1 -1
  161. package/index.html +1 -1
  162. package/package.json +1 -1
  163. package/assets/_calendarObjectId-DA9THlEZ.js +0 -1
  164. package/assets/_labelId-QQEJSaaH.js +0 -1
  165. package/assets/_mailboxId-CjHcitFP.js +0 -1
  166. package/assets/_messageId-BR_TgwKr.js +0 -1
  167. package/assets/_messageId-CAxQBVFC.js +0 -1
  168. package/assets/_messageId-CO7AhNVu.js +0 -1
  169. package/assets/_messageId-D0sfforj.js +0 -1
  170. package/assets/_outboxMessageId-CuYUqctH.js +0 -1
  171. package/assets/_recurrenceId-CLQuwNQw.js +0 -1
  172. package/assets/_threadId-BGKDrxuA.js +0 -1
  173. package/assets/_threadId-Ba8E2aAx.js +0 -1
  174. package/assets/_threadId-Br_FU4M4.js +0 -1
  175. package/assets/_threadId-D9ge4hnK.js +0 -1
  176. package/assets/brief--Wmhw18k.js +0 -1
  177. package/assets/compose._-_outboxMessageId_-BGkih4eY.js +0 -1
  178. package/assets/compose._-_outboxMessageId_-CivLnC_Q.js +0 -1
  179. package/assets/compose._-_outboxMessageId_-DhaK6pb5.js +0 -1
  180. package/assets/compose._-_outboxMessageId_-cX-iEK_S.js +0 -1
  181. package/assets/compose._-_outboxMessageId_-nFk2BCjJ.js +0 -1
  182. package/assets/edit-CO4QGWtB.js +0 -1
  183. package/assets/edit-DRr0H801.js +0 -1
  184. package/assets/flagged-BLzcJrUz.js +0 -1
  185. package/assets/index-6MdUWIJB.js +0 -1
  186. package/assets/index-B3pRGruo.js +0 -1
  187. package/assets/index-BDF8UTpu.js +0 -1
  188. package/assets/index-BQ2vE6gp.js +0 -57
  189. package/assets/index-BoKIe_Hw.js +0 -1
  190. package/assets/index-CO7AhNVu.js +0 -1
  191. package/assets/index-CR5Op_4t.js +0 -1
  192. package/assets/index-D0sfforj.js +0 -1
  193. package/assets/index-DLuz5acm.js +0 -1
  194. package/assets/index-DqCcXbbs.js +0 -1
  195. package/assets/index-GZXGsbCN.js +0 -1
  196. package/assets/index-PBPFqVVA.js +0 -1
  197. package/assets/index-h2rbe_XB.js +0 -1
  198. package/assets/new-DKJdGwfE.js +0 -1
  199. package/assets/onboarding-pnezHKXj.js +0 -1
  200. package/assets/outbox-CLnMeXYO.js +0 -1
  201. package/assets/settings-C8z99CK0.js +0 -1
@@ -1 +1 @@
1
- import{b as H,j as e,d as x,B as f,L as W,X as Oe,r,I as Pe,e as pe,a as De,c as _e,f as L,s as de,g as Le,h as qe,i as He,m as We,k as X,l as Qe}from"./index-CKFdaY9c.js";import{W as k,C as fe,a as le,u as Ve,b as Ge,c as Ke,d as Ue,S as Xe,R as Ye}from"./credential-steps-BPun50HH.js";import{c as ge,f as Je,v as xe,r as Ze,a as et,b as ue,w as me,p as tt,W as st,s as nt,g as it}from"./config-import-DTqOa38a.js";import{F as at}from"./file-braces-DSnr6-a7.js";import{B as z}from"./badge-DYFkBshe.js";import{c as rt}from"./onboarding-completion-cX9HM-aL.js";import"./select-yGv73aji.js";import"./chevron-down-wpFtElCn.js";import"./card-13z0qC0r.js";const je={name:"folder-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};je.node;const ot=H(je);const ve={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};ve.node;const ct=H(ve);const ye={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};ye.node;const dt=H(ye);const we={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};we.node;const lt=H(we),y=["File","Review","Credentials","Folders"];function J({children:t}){return e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:t})}function ut({state:t="idle",file:n,ready:i=!1,failure:s,onChoose:d,onDragStateChange:l,onNext:h}){const w=r.useId(),u=r.useRef(null),p=t==="dragging",j=t==="reading",N=t==="checking",R=j||N,S=m=>{m.preventDefault(),l?.(!1);const b=m.dataTransfer.files.item(0);b&&d?.(b)};return e.jsx(k,{steps:y,activeStep:0,title:"Import a config file",subtitle:"Accounts, folder roles, rules, senders and appearance — everything except passwords.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Nothing is written until you have seen what will change."}),e.jsx(f,{variant:"primary",disabled:R||!i,icon:R?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:j?"Reading…":N?"Checking…":"Check the file"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{tone:"danger",children:s.title}),e.jsx("p",{className:"text-sm text-fg",children:s.explanation}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.fix}),e.jsx(J,{children:s.raw})]}),e.jsxs("div",{onDragOver:m=>{m.preventDefault(),l?.(!0)},onDragLeave:()=>l?.(!1),onDrop:S,className:p?"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-accent bg-accent-soft px-4 py-9 text-center":"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-line px-4 py-9 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-md bg-surface-sunken",children:e.jsx(lt,{className:"size-5 text-fg-muted"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:p?"Drop it here":"Drop a config file here, or choose one"}),e.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"A .json file written by Reader — up to 2 MB."})]}),e.jsx("input",{ref:u,id:w,type:"file",accept:"application/json,.json",className:"sr-only",onChange:m=>{const b=m.target.files?.item(0);b&&d?.(b)}}),e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>u.current?.click(),children:"Choose file"})]}),n&&e.jsxs("div",{className:"flex items-start gap-3 rounded-sm border border-line px-3 py-2.5",children:[e.jsx(at,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-fg",children:n.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[Je(n.size)," ·"," ",j?"reading it from disk":N?"checking it against this instance":i?"ready to check — nothing has been sent yet":"not a configuration this instance can read"]})]})]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Export one from Settings → Advanced on the instance you are moving from, or run"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on its host."]})]})})}function mt({sections:t}){const n=ge(t.flatMap(i=>i.entries.map(s=>({section:i.id,key:s.label,verdict:s.verdict}))));return e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["created","updated","unchanged","skipped","rejected"].filter(i=>n[i]>0).map(i=>e.jsxs(z,{tone:xe[i],dot:!0,children:[n[i]," ",i]},i))})}function ht({section:t}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.title}),e.jsx("ul",{className:"mt-1.5 divide-y divide-line",children:t.entries.map(n=>e.jsxs("li",{className:"flex items-start gap-3 py-2",children:[e.jsx(z,{tone:xe[n.verdict],className:"mt-0.5 shrink-0",children:n.verdict}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-fg",children:n.label}),n.reason&&e.jsx("p",{className:n.verdict==="rejected"?"mt-1 text-xs text-danger":"mt-1 text-xs text-warning",children:n.reason})]})]},n.id))})]})}function pt({sections:t,fileName:n,warnings:i=[],applying:s=!1,onBack:d,onNext:l}){const h=ge(t.flatMap(p=>p.entries.map(j=>({section:p.id,key:j.label,verdict:j.verdict})))),w=h.created+h.updated,u=h.skipped+h.rejected;return e.jsx(k,{steps:y,activeStep:1,title:"What this file will change",subtitle:`${n} · nothing has been written yet.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:s,icon:s?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:l,children:s?"Importing…":`Import ${w} changes`})]}),children:e.jsxs("div",{className:"space-y-5",children:[e.jsx(mt,{sections:t}),u>0&&e.jsxs(x,{tone:"warning",children:[u," entries will not be imported. Each says why below — read them before you continue, because nothing here retries on its own."]}),i.length>0&&e.jsx("ul",{className:"space-y-1 text-xs text-warning",children:i.map(p=>e.jsx("li",{children:p},p))}),t.map(p=>e.jsx(ht,{section:p},p.id))]})})}function ft({choice:t,held:n,onChoose:i,onBack:s,onNext:d}){return e.jsx(k,{steps:y,activeStep:1,title:"This instance already has configuration",subtitle:n,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:s,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:!t,onClick:d,children:t==="merge"?"Continue with merge":"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"warning",children:"An import into a configured instance can only add and update — it never deletes what is here. Pick how the two should meet."}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(le,{name:"Stop, keep this instance",description:"Nothing is written. Use this if you meant to import into a fresh instance.",icon:e.jsx(Oe,{className:"size-5"}),selected:t==="abort",onSelect:()=>i?.("abort")}),e.jsx(le,{name:"Merge the file in",description:"Adds what is missing and updates what differs. Existing accounts keep their server settings.",icon:e.jsx(dt,{className:"size-5"}),selected:t==="merge",onSelect:()=>i?.("merge")})]}),t==="merge"&&e.jsx("p",{className:"text-xs text-fg-muted",children:"The next screen lists every add and update before anything is written."})]})})}function gt(t){return t==="entered"?e.jsx(z,{tone:"positive",children:"ready"}):t==="failed"?e.jsx(z,{tone:"danger",children:"sign-in failed"}):e.jsx(z,{tone:"danger",children:"credentials needed"})}function xt({accounts:t,busyAccountId:n,onOpen:i}){return e.jsx("ul",{className:"divide-y divide-line",children:t.map(s=>e.jsxs("li",{className:s.state==="entered"?"flex flex-wrap items-start justify-between gap-3 py-3":"flex flex-wrap items-start justify-between gap-3 border-l-2 border-danger bg-danger-soft py-3 pl-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:s.address}),gt(s.state)]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[s.displayName," ·"," ",s.connector==="microsoft"?"Microsoft 365":"IMAP / SMTP"," ","· ",s.server]}),s.state!=="entered"&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:s.failure??(s.connector==="microsoft"?"Config files never carry OAuth tokens. Reconnect with Microsoft to start syncing this account.":"Config files never carry passwords. Enter this mailbox's password to start syncing.")})]}),s.state!=="entered"&&e.jsx(f,{variant:"primary",size:"sm",disabled:n===s.accountId,icon:n===s.accountId?e.jsx(W,{className:"size-3.5 animate-spin"}):s.connector==="microsoft"?e.jsx(Pe,{className:"size-3.5"}):e.jsx(ct,{className:"size-3.5"}),onClick:()=>i?.(s),children:n===s.accountId?"Redirecting…":s.connector==="microsoft"?"Reconnect":s.state==="failed"?"Try again":"Enter password"})]},s.accountId))})}function jt({accounts:t,busyAccountId:n,error:i,onOpen:s,onNext:d}){const l=t.filter(h=>h.state!=="entered").length;return e.jsx(k,{steps:y,activeStep:2,title:"These accounts need credentials",subtitle:"The config file carries servers and settings. Passwords and Microsoft sign-ins it deliberately leaves out.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:l>0?"Settings › Accounts keeps asking until every account is signed in.":"Every account can sync."}),e.jsx(f,{variant:"primary",onClick:d,children:l>0?"Finish later":"All accounts connected"})]}),children:e.jsxs("div",{className:"space-y-4",children:[i&&e.jsx(x,{tone:"danger",children:i}),l>0&&e.jsxs(x,{tone:"danger",children:[l," of ",t.length," accounts cannot sync yet. They stay listed in Settings, marked like this, until you sign in — no mail arrives for them in the meantime."]}),e.jsx(xt,{accounts:t,busyAccountId:n,onOpen:s})]})})}function vt({account:t,position:n,total:i,error:s,busy:d=!1,onBack:l,onNext:h}){return e.jsx(k,{steps:y,activeStep:2,title:`Reconnect ${t.address}`,subtitle:`Account ${n} of ${i} · Microsoft 365`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:l,children:"Back"}),e.jsx(f,{variant:"primary",disabled:d,icon:d?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:d?"Redirecting…":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(x,{tone:"danger",children:s}),e.jsx(x,{tone:"info",children:"A config file never carries an OAuth token — one only works for the instance it was granted to. Signing in here mints a fresh one for this instance."}),e.jsxs("div",{className:"rounded-sm border border-line px-3 py-2.5",children:[e.jsx("p",{className:"text-sm text-fg",children:t.displayName}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[t.address," · ",t.server]})]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"You will be sent to Microsoft and returned here. If your organisation requires admin approval, the sign-in stops there and this account keeps waiting."})]})})}function yt({folders:t,onNext:n}){return e.jsx(k,{steps:y,activeStep:3,title:t.length>0?"Creating folders":"Import finished",subtitle:t.length>0?"The config names folders this account does not have yet. Reader creates them on the mail server.":"Everything in the file landed, and every folder it named resolved.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Folder discovery runs with every sync."}),e.jsx(f,{variant:"primary",onClick:n,children:"Go to inbox"})]}),children:e.jsx("div",{className:"space-y-4",children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(x,{tone:"warning",children:[t.length," settings are imported but switched off. Reader creates each missing folder on the mail server the next time the account syncs, and turns the setting on once the server confirms it. A rule whose folder cannot be created stays off, and Settings → Filters says why."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(ot,{className:"size-4"}),"Folder discovery runs with every sync of the account."]}),e.jsx("div",{className:"divide-y divide-line",children:t.map(i=>e.jsx(fe,{label:i.path,detail:i.waitingFor,state:"pending"},`${i.accountId??""}-${i.path}-${i.waitingFor}`))})]}):e.jsx(x,{tone:"success",children:"Every account, rule, label and sender in the file is live on this instance."})})})}function wt({failure:t,onBack:n}){return e.jsx(k,{steps:y,activeStep:0,title:t.title,subtitle:"Nothing was imported.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"This instance is unchanged."}),e.jsx(f,{variant:"primary",onClick:n,children:"Choose another file"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(x,{tone:"danger",children:t.explanation}),e.jsx("p",{className:"text-sm text-fg",children:t.fix}),e.jsx(J,{children:t.raw})]})})}function bt(t){return t==="landed"?"ok":t==="failed"||t==="unknown"?"failed":"pending"}function kt({results:t,message:n,raw:i,nothingLanded:s,onBack:d,onNext:l}){const h=t.filter(u=>u.state==="landed").length,w=t.some(u=>u.state==="unknown");return e.jsx(k,{steps:y,activeStep:1,title:s?"The import stopped, and nothing landed":"The import stopped part-way",subtitle:s?"No section of the file was written.":w?"It did not say how far it got, so check Settings before importing again.":`${h} of ${t.length} sections landed.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",onClick:l,children:s?"Try the import again":"Retry the rest"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"danger",children:n}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Retrying is safe: an import folds into what is already here rather than replacing it, so what landed is recognised and left alone."}),e.jsx("div",{className:"divide-y divide-line",children:t.map(u=>e.jsx(fe,{label:u.title,detail:u.detail,state:bt(u.state)},u.section))}),e.jsx(J,{children:i})]})})}const be=(t,n)=>t?"tls":n?"starttls":"none",Nt=t=>({host:t.imapHost,port:t.imapPort,security:be(t.imapTls,t.imapStartTls)}),St=t=>({host:t.smtpEnabled?t.smtpHost:"",port:t.smtpPort,security:be(t.smtpTls,t.smtpStartTls)}),he=(t,n,i)=>{const s=t.authType==="oauthMicrosoft"?"microsoft":"imap",d=!i&&(s==="microsoft"?t.connectionState==="reauth_required":t.connectionState==="credentials_missing");return{accountId:t.accountId,address:t.email,displayName:t.displayName?.trim()||t.email,connector:s,server:`${t.imapHost}:${t.imapPort}`,state:n?"failed":d?"needed":"entered",failure:n}},Ct=t=>{if(!t)return"This instance already holds configuration of its own.";const n=[["accounts","account"],["labels","label"],["filters","rule"],["addressFlags","flagged sender"]].map(([i,s])=>({count:Number(t[i]??0),noun:s})).filter(i=>i.count>0).map(i=>`${i.count} ${i.noun}${i.count===1?"":"s"}`);return n.length===0?"This instance already holds configuration of its own.":`${n.join(", ")} are set up here already.`},q=(t,n)=>{if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){const i=t.message;if(typeof i=="string")return i}return n};function It({onDone:t}){const n=pe(),[i,s]=r.useState("file"),[d,l]=r.useState(!1),[h,w]=r.useState(!1),[u,p]=r.useState(void 0),[j,N]=r.useState(void 0),[R,S]=r.useState(void 0),[m,b]=r.useState(void 0),[Z,ee]=r.useState("abort"),[te,se]=r.useState(void 0),[Ne,Q]=r.useState(void 0),[C,Se]=r.useState([]),[V,Ce]=r.useState([]),[g,I]=r.useState(null),[T,G]=r.useState({username:"",password:""}),[F,K]=r.useState({}),[Ie,ne]=r.useState(void 0),[U,$]=r.useState(null),[B,Te]=r.useState([]),{data:O}=De({..._e(),enabled:C.length>0||i==="folders"}),A=r.useMemo(()=>{const a=new Map;for(const o of O?.accounts??[])a.set(o.accountId,o);return a},[O]),Re=r.useMemo(()=>C.map(a=>A.get(a)).filter(a=>!!a).map(a=>he(a,F[a.accountId],V.includes(a.accountId))),[C,A,F,V]),c=g?A.get(g):void 0,ie=g?C.indexOf(g)+1:0,P=L({...Le(),meta:de(409)}),ae=L({...qe(),meta:de(403,404)}),re=L(He()),oe=L(We());Ve(U!==null,()=>{n.invalidateQueries({queryKey:X()}),$(null)});const ce=Ge(a=>{$(null),a==="stalled"&&ne(Ye)}),Fe=r.useCallback(a=>{l(!1),w(!0),p({name:a.name,size:a.size}),S(void 0),N(void 0),a.text().then(o=>Ze(a.name,a.size,o)).then(o=>{if(w(!1),!o.ok){S(o.failure);return}N(o.document)}).catch(o=>{w(!1),S({title:"That file could not be read",explanation:`The browser could not read ${a.name} from disk, so nothing was sent.`,fix:"Check the file is still there and try again.",raw:q(o,"the file read was refused")})})},[]),D=r.useCallback((a,o)=>{j&&(Q(void 0),P.mutate({body:{mode:a,onExisting:o,document:j}},{onSuccess:v=>{if(b(v),ue(v)){s("rejected");return}if(me(v)){s("partial");return}if(a==="validate"){s("review");return}if(Te(tt(v)),n.invalidateQueries({queryKey:X()}),v.accountsNeedingCredentials.length>0){Se([...v.accountsNeedingCredentials]),s("credentials");return}s("folders")},onError:v=>{const _=et(v);if(_){Q(_),se(void 0),s("conflict");return}S({title:"The import could not be sent",explanation:"The request to this instance failed before it produced a report, so nothing was written.",fix:"Check your connection and try again.",raw:q(v,"POST /config/import failed")}),s("file")}}))},[j,P,n]),Ae=r.useCallback(a=>{if(I(a.accountId),ne(void 0),a.connector==="microsoft"){s("account-oauth");return}const o=A.get(a.accountId);G({username:o?.username||a.address,password:""}),s("account-password")},[A]),Me=r.useCallback(()=>{g&&ae.mutate({path:{accountId:g},body:{password:T.password,isActive:!0}},{onSuccess:()=>{re.mutate({path:{accountId:g}}),Ce(a=>a.includes(g)?a:[...a,g]),K(a=>{const o={...a};return delete o[g],o}),n.invalidateQueries({queryKey:X()}),G({username:"",password:""}),I(null),s("credentials")},onError:a=>{K(o=>({...o,[g]:q(a,"The password was verified but could not be stored. Try again.")})),I(null),s("credentials")}})},[g,T.password,n,re,ae]),Ee=r.useCallback(()=>{c&&($(c.accountId),oe.mutate({body:{email:c.email}},{onSuccess:a=>{ce(),window.location.assign(a.authorizationUrl)},onError:a=>{$(null),K(o=>({...o,[c.accountId]:q(a,"Microsoft sign-in could not be started.")})),I(null),s("credentials")}}))},[c,ce,oe]),ze=r.useCallback((a,o)=>G({username:a,password:o}),[]),$e=r.useMemo(()=>{const a=O?.pendingImport?.folderPaths;if(!a)return B;const o=new Set(a),v=B.filter(E=>o.has(E.path)),_=a.filter(E=>!B.some(Be=>Be.path===E)).map(E=>({path:E,waitingFor:"An imported setting"}));return[...v,..._]},[O,B]),M=r.useCallback(()=>{b(void 0),Q(void 0),S(void 0),p(void 0),N(void 0),ee("abort"),s("file")},[]);switch(i){case"file":return e.jsx(ut,{state:h?"reading":P.isPending?"checking":d?"dragging":"idle",file:u,ready:j!==void 0,failure:R,onChoose:Fe,onDragStateChange:l,onNext:()=>D("validate",Z)});case"rejected":return e.jsx(wt,{failure:(m&&ue(m))??R??{title:"The file could not be imported",explanation:"The import was refused and nothing was written.",fix:"Re-export the configuration and try again.",raw:"no error was reported"},onBack:M});case"conflict":return e.jsx(ft,{choice:te,held:Ct(Ne?.details),onChoose:se,onBack:M,onNext:()=>{if(te==="abort"){t("abandoned");return}ee("merge"),D("validate","merge")}});case"review":return e.jsx(pt,{sections:it(m?.items??[]),fileName:u?.name??"the config file",warnings:(m?.warnings??[]).map(a=>a.message),applying:P.isPending,onBack:M,onNext:()=>D("apply",Z)});case"partial":{if(!m)return e.jsx(Tt,{onBack:M});const a=me(m);return e.jsx(kt,{results:nt(m),message:a?.message??"The import stopped before it finished.",raw:`${a?.code??st}: ${a?.message??"no message"}`,nothingLanded:!m.applied,onBack:M,onNext:()=>D("apply","merge")})}case"credentials":return e.jsx(jt,{accounts:Re,busyAccountId:U??void 0,error:Ie,onOpen:Ae,onNext:()=>s("folders")});case"account-password":return c?e.jsx(Ue,{steps:y,activeStep:2,title:`Sign in to ${c.email}`,subtitle:`Account ${ie} of ${C.length} · ${c.imapHost}:${c.imapPort}`,email:c.email,username:T.username,password:T.password,error:F[c.accountId],continueLabel:"Test and continue",notice:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(Xe,{className:"size-3.5"}),"Server settings came from the config file — edit them in Settings if they are wrong."]}),onContinue:()=>s("account-test"),onBack:()=>{I(null),s("credentials")},onChange:ze}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-test":return c?e.jsx(Ke,{steps:y,activeStep:2,email:c.email,imapConfig:Nt(c),smtpConfig:St(c),username:T.username,password:T.password,credentialsBackLabel:"Back to the password",serversBackLabel:"Back to the password",successLabel:"Save and continue",onSuccess:Me,onBackToCredentials:()=>s("account-password"),onBackToServers:()=>s("account-password")}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-oauth":return c?e.jsx(vt,{account:he(c,F[c.accountId],V.includes(c.accountId)),position:ie,total:C.length,error:F[c.accountId],busy:U===c.accountId,onBack:()=>{I(null),s("credentials")},onNext:Ee}):e.jsx(Y,{onBack:()=>t("abandoned")});case"folders":return e.jsx(yt,{folders:$e,onNext:()=>t("imported")})}}function ke({children:t,label:n,onBack:i}){return e.jsxs("div",{className:"mx-auto max-w-lg p-6",children:[e.jsx(x,{tone:"danger",children:t}),e.jsx("button",{type:"button",className:"mt-3 text-sm text-accent underline",onClick:i,children:n})]})}function Y({onBack:t}){return e.jsx(ke,{label:"Go to inbox",onBack:t,children:"That account is no longer in this instance's configuration, so there is nothing left to sign in to. Open Settings › Accounts to see what is here."})}function Tt({onBack:t}){return e.jsx(ke,{label:"Choose another file",onBack:t,children:"The import stopped but produced no report, so nothing here can say what it wrote. Open Settings to see what this instance holds before importing again."})}function Pt(){const t=Qe(),n=pe(),i=r.useCallback(s=>{rt({queryClient:n,recordCompleted:()=>{s==="imported"&&t.recordEvent("config.imported")},navigateToInbox:()=>{window.location.assign("/mail")}})},[t,n]);return e.jsx(It,{onDone:i})}export{Pt as component};
1
+ import{b as H,j as e,d as x,B as f,L as W,X as Oe,r,I as Pe,e as pe,a as De,c as _e,f as L,s as de,g as Le,h as qe,i as He,m as We,k as X,l as Qe}from"./index-DAdnmNGF.js";import{W as k,C as fe,a as le,u as Ve,b as Ge,c as Ke,d as Ue,S as Xe,R as Ye}from"./credential-steps-CCGZ6JdD.js";import{c as ge,f as Je,v as xe,r as Ze,a as et,b as ue,w as me,p as tt,W as st,s as nt,g as it}from"./config-import-BZQDs381.js";import{F as at}from"./file-braces-D8FfI4WO.js";import{B as z}from"./badge-BuEj66zZ.js";import{c as rt}from"./onboarding-completion-Bpy8dmzE.js";import"./select-C4OaQe9Y.js";import"./chevron-down-pXHA84n5.js";import"./card-DT547OCZ.js";const je={name:"folder-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};je.node;const ot=H(je);const ve={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};ve.node;const ct=H(ve);const ye={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};ye.node;const dt=H(ye);const we={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};we.node;const lt=H(we),y=["File","Review","Credentials","Folders"];function J({children:t}){return e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:t})}function ut({state:t="idle",file:n,ready:i=!1,failure:s,onChoose:d,onDragStateChange:l,onNext:h}){const w=r.useId(),u=r.useRef(null),p=t==="dragging",j=t==="reading",N=t==="checking",R=j||N,S=m=>{m.preventDefault(),l?.(!1);const b=m.dataTransfer.files.item(0);b&&d?.(b)};return e.jsx(k,{steps:y,activeStep:0,title:"Import a config file",subtitle:"Accounts, folder roles, rules, senders and appearance — everything except passwords.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Nothing is written until you have seen what will change."}),e.jsx(f,{variant:"primary",disabled:R||!i,icon:R?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:j?"Reading…":N?"Checking…":"Check the file"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{tone:"danger",children:s.title}),e.jsx("p",{className:"text-sm text-fg",children:s.explanation}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.fix}),e.jsx(J,{children:s.raw})]}),e.jsxs("div",{onDragOver:m=>{m.preventDefault(),l?.(!0)},onDragLeave:()=>l?.(!1),onDrop:S,className:p?"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-accent bg-accent-soft px-4 py-9 text-center":"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-line px-4 py-9 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-md bg-surface-sunken",children:e.jsx(lt,{className:"size-5 text-fg-muted"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:p?"Drop it here":"Drop a config file here, or choose one"}),e.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"A .json file written by Reader — up to 2 MB."})]}),e.jsx("input",{ref:u,id:w,type:"file",accept:"application/json,.json",className:"sr-only",onChange:m=>{const b=m.target.files?.item(0);b&&d?.(b)}}),e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>u.current?.click(),children:"Choose file"})]}),n&&e.jsxs("div",{className:"flex items-start gap-3 rounded-sm border border-line px-3 py-2.5",children:[e.jsx(at,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-fg",children:n.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[Je(n.size)," ·"," ",j?"reading it from disk":N?"checking it against this instance":i?"ready to check — nothing has been sent yet":"not a configuration this instance can read"]})]})]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Export one from Settings → Advanced on the instance you are moving from, or run"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on its host."]})]})})}function mt({sections:t}){const n=ge(t.flatMap(i=>i.entries.map(s=>({section:i.id,key:s.label,verdict:s.verdict}))));return e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["created","updated","unchanged","skipped","rejected"].filter(i=>n[i]>0).map(i=>e.jsxs(z,{tone:xe[i],dot:!0,children:[n[i]," ",i]},i))})}function ht({section:t}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.title}),e.jsx("ul",{className:"mt-1.5 divide-y divide-line",children:t.entries.map(n=>e.jsxs("li",{className:"flex items-start gap-3 py-2",children:[e.jsx(z,{tone:xe[n.verdict],className:"mt-0.5 shrink-0",children:n.verdict}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-fg",children:n.label}),n.reason&&e.jsx("p",{className:n.verdict==="rejected"?"mt-1 text-xs text-danger":"mt-1 text-xs text-warning",children:n.reason})]})]},n.id))})]})}function pt({sections:t,fileName:n,warnings:i=[],applying:s=!1,onBack:d,onNext:l}){const h=ge(t.flatMap(p=>p.entries.map(j=>({section:p.id,key:j.label,verdict:j.verdict})))),w=h.created+h.updated,u=h.skipped+h.rejected;return e.jsx(k,{steps:y,activeStep:1,title:"What this file will change",subtitle:`${n} · nothing has been written yet.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:s,icon:s?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:l,children:s?"Importing…":`Import ${w} changes`})]}),children:e.jsxs("div",{className:"space-y-5",children:[e.jsx(mt,{sections:t}),u>0&&e.jsxs(x,{tone:"warning",children:[u," entries will not be imported. Each says why below — read them before you continue, because nothing here retries on its own."]}),i.length>0&&e.jsx("ul",{className:"space-y-1 text-xs text-warning",children:i.map(p=>e.jsx("li",{children:p},p))}),t.map(p=>e.jsx(ht,{section:p},p.id))]})})}function ft({choice:t,held:n,onChoose:i,onBack:s,onNext:d}){return e.jsx(k,{steps:y,activeStep:1,title:"This instance already has configuration",subtitle:n,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:s,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:!t,onClick:d,children:t==="merge"?"Continue with merge":"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"warning",children:"An import into a configured instance can only add and update — it never deletes what is here. Pick how the two should meet."}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(le,{name:"Stop, keep this instance",description:"Nothing is written. Use this if you meant to import into a fresh instance.",icon:e.jsx(Oe,{className:"size-5"}),selected:t==="abort",onSelect:()=>i?.("abort")}),e.jsx(le,{name:"Merge the file in",description:"Adds what is missing and updates what differs. Existing accounts keep their server settings.",icon:e.jsx(dt,{className:"size-5"}),selected:t==="merge",onSelect:()=>i?.("merge")})]}),t==="merge"&&e.jsx("p",{className:"text-xs text-fg-muted",children:"The next screen lists every add and update before anything is written."})]})})}function gt(t){return t==="entered"?e.jsx(z,{tone:"positive",children:"ready"}):t==="failed"?e.jsx(z,{tone:"danger",children:"sign-in failed"}):e.jsx(z,{tone:"danger",children:"credentials needed"})}function xt({accounts:t,busyAccountId:n,onOpen:i}){return e.jsx("ul",{className:"divide-y divide-line",children:t.map(s=>e.jsxs("li",{className:s.state==="entered"?"flex flex-wrap items-start justify-between gap-3 py-3":"flex flex-wrap items-start justify-between gap-3 border-l-2 border-danger bg-danger-soft py-3 pl-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:s.address}),gt(s.state)]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[s.displayName," ·"," ",s.connector==="microsoft"?"Microsoft 365":"IMAP / SMTP"," ","· ",s.server]}),s.state!=="entered"&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:s.failure??(s.connector==="microsoft"?"Config files never carry OAuth tokens. Reconnect with Microsoft to start syncing this account.":"Config files never carry passwords. Enter this mailbox's password to start syncing.")})]}),s.state!=="entered"&&e.jsx(f,{variant:"primary",size:"sm",disabled:n===s.accountId,icon:n===s.accountId?e.jsx(W,{className:"size-3.5 animate-spin"}):s.connector==="microsoft"?e.jsx(Pe,{className:"size-3.5"}):e.jsx(ct,{className:"size-3.5"}),onClick:()=>i?.(s),children:n===s.accountId?"Redirecting…":s.connector==="microsoft"?"Reconnect":s.state==="failed"?"Try again":"Enter password"})]},s.accountId))})}function jt({accounts:t,busyAccountId:n,error:i,onOpen:s,onNext:d}){const l=t.filter(h=>h.state!=="entered").length;return e.jsx(k,{steps:y,activeStep:2,title:"These accounts need credentials",subtitle:"The config file carries servers and settings. Passwords and Microsoft sign-ins it deliberately leaves out.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:l>0?"Settings › Accounts keeps asking until every account is signed in.":"Every account can sync."}),e.jsx(f,{variant:"primary",onClick:d,children:l>0?"Finish later":"All accounts connected"})]}),children:e.jsxs("div",{className:"space-y-4",children:[i&&e.jsx(x,{tone:"danger",children:i}),l>0&&e.jsxs(x,{tone:"danger",children:[l," of ",t.length," accounts cannot sync yet. They stay listed in Settings, marked like this, until you sign in — no mail arrives for them in the meantime."]}),e.jsx(xt,{accounts:t,busyAccountId:n,onOpen:s})]})})}function vt({account:t,position:n,total:i,error:s,busy:d=!1,onBack:l,onNext:h}){return e.jsx(k,{steps:y,activeStep:2,title:`Reconnect ${t.address}`,subtitle:`Account ${n} of ${i} · Microsoft 365`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:l,children:"Back"}),e.jsx(f,{variant:"primary",disabled:d,icon:d?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:d?"Redirecting…":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(x,{tone:"danger",children:s}),e.jsx(x,{tone:"info",children:"A config file never carries an OAuth token — one only works for the instance it was granted to. Signing in here mints a fresh one for this instance."}),e.jsxs("div",{className:"rounded-sm border border-line px-3 py-2.5",children:[e.jsx("p",{className:"text-sm text-fg",children:t.displayName}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[t.address," · ",t.server]})]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"You will be sent to Microsoft and returned here. If your organisation requires admin approval, the sign-in stops there and this account keeps waiting."})]})})}function yt({folders:t,onNext:n}){return e.jsx(k,{steps:y,activeStep:3,title:t.length>0?"Creating folders":"Import finished",subtitle:t.length>0?"The config names folders this account does not have yet. Reader creates them on the mail server.":"Everything in the file landed, and every folder it named resolved.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Folder discovery runs with every sync."}),e.jsx(f,{variant:"primary",onClick:n,children:"Go to inbox"})]}),children:e.jsx("div",{className:"space-y-4",children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(x,{tone:"warning",children:[t.length," settings are imported but switched off. Reader creates each missing folder on the mail server the next time the account syncs, and turns the setting on once the server confirms it. A rule whose folder cannot be created stays off, and Settings → Filters says why."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(ot,{className:"size-4"}),"Folder discovery runs with every sync of the account."]}),e.jsx("div",{className:"divide-y divide-line",children:t.map(i=>e.jsx(fe,{label:i.path,detail:i.waitingFor,state:"pending"},`${i.accountId??""}-${i.path}-${i.waitingFor}`))})]}):e.jsx(x,{tone:"success",children:"Every account, rule, label and sender in the file is live on this instance."})})})}function wt({failure:t,onBack:n}){return e.jsx(k,{steps:y,activeStep:0,title:t.title,subtitle:"Nothing was imported.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"This instance is unchanged."}),e.jsx(f,{variant:"primary",onClick:n,children:"Choose another file"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(x,{tone:"danger",children:t.explanation}),e.jsx("p",{className:"text-sm text-fg",children:t.fix}),e.jsx(J,{children:t.raw})]})})}function bt(t){return t==="landed"?"ok":t==="failed"||t==="unknown"?"failed":"pending"}function kt({results:t,message:n,raw:i,nothingLanded:s,onBack:d,onNext:l}){const h=t.filter(u=>u.state==="landed").length,w=t.some(u=>u.state==="unknown");return e.jsx(k,{steps:y,activeStep:1,title:s?"The import stopped, and nothing landed":"The import stopped part-way",subtitle:s?"No section of the file was written.":w?"It did not say how far it got, so check Settings before importing again.":`${h} of ${t.length} sections landed.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",onClick:l,children:s?"Try the import again":"Retry the rest"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"danger",children:n}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Retrying is safe: an import folds into what is already here rather than replacing it, so what landed is recognised and left alone."}),e.jsx("div",{className:"divide-y divide-line",children:t.map(u=>e.jsx(fe,{label:u.title,detail:u.detail,state:bt(u.state)},u.section))}),e.jsx(J,{children:i})]})})}const be=(t,n)=>t?"tls":n?"starttls":"none",Nt=t=>({host:t.imapHost,port:t.imapPort,security:be(t.imapTls,t.imapStartTls)}),St=t=>({host:t.smtpEnabled?t.smtpHost:"",port:t.smtpPort,security:be(t.smtpTls,t.smtpStartTls)}),he=(t,n,i)=>{const s=t.authType==="oauthMicrosoft"?"microsoft":"imap",d=!i&&(s==="microsoft"?t.connectionState==="reauth_required":t.connectionState==="credentials_missing");return{accountId:t.accountId,address:t.email,displayName:t.displayName?.trim()||t.email,connector:s,server:`${t.imapHost}:${t.imapPort}`,state:n?"failed":d?"needed":"entered",failure:n}},Ct=t=>{if(!t)return"This instance already holds configuration of its own.";const n=[["accounts","account"],["labels","label"],["filters","rule"],["addressFlags","flagged sender"]].map(([i,s])=>({count:Number(t[i]??0),noun:s})).filter(i=>i.count>0).map(i=>`${i.count} ${i.noun}${i.count===1?"":"s"}`);return n.length===0?"This instance already holds configuration of its own.":`${n.join(", ")} are set up here already.`},q=(t,n)=>{if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){const i=t.message;if(typeof i=="string")return i}return n};function It({onDone:t}){const n=pe(),[i,s]=r.useState("file"),[d,l]=r.useState(!1),[h,w]=r.useState(!1),[u,p]=r.useState(void 0),[j,N]=r.useState(void 0),[R,S]=r.useState(void 0),[m,b]=r.useState(void 0),[Z,ee]=r.useState("abort"),[te,se]=r.useState(void 0),[Ne,Q]=r.useState(void 0),[C,Se]=r.useState([]),[V,Ce]=r.useState([]),[g,I]=r.useState(null),[T,G]=r.useState({username:"",password:""}),[F,K]=r.useState({}),[Ie,ne]=r.useState(void 0),[U,$]=r.useState(null),[B,Te]=r.useState([]),{data:O}=De({..._e(),enabled:C.length>0||i==="folders"}),A=r.useMemo(()=>{const a=new Map;for(const o of O?.accounts??[])a.set(o.accountId,o);return a},[O]),Re=r.useMemo(()=>C.map(a=>A.get(a)).filter(a=>!!a).map(a=>he(a,F[a.accountId],V.includes(a.accountId))),[C,A,F,V]),c=g?A.get(g):void 0,ie=g?C.indexOf(g)+1:0,P=L({...Le(),meta:de(409)}),ae=L({...qe(),meta:de(403,404)}),re=L(He()),oe=L(We());Ve(U!==null,()=>{n.invalidateQueries({queryKey:X()}),$(null)});const ce=Ge(a=>{$(null),a==="stalled"&&ne(Ye)}),Fe=r.useCallback(a=>{l(!1),w(!0),p({name:a.name,size:a.size}),S(void 0),N(void 0),a.text().then(o=>Ze(a.name,a.size,o)).then(o=>{if(w(!1),!o.ok){S(o.failure);return}N(o.document)}).catch(o=>{w(!1),S({title:"That file could not be read",explanation:`The browser could not read ${a.name} from disk, so nothing was sent.`,fix:"Check the file is still there and try again.",raw:q(o,"the file read was refused")})})},[]),D=r.useCallback((a,o)=>{j&&(Q(void 0),P.mutate({body:{mode:a,onExisting:o,document:j}},{onSuccess:v=>{if(b(v),ue(v)){s("rejected");return}if(me(v)){s("partial");return}if(a==="validate"){s("review");return}if(Te(tt(v)),n.invalidateQueries({queryKey:X()}),v.accountsNeedingCredentials.length>0){Se([...v.accountsNeedingCredentials]),s("credentials");return}s("folders")},onError:v=>{const _=et(v);if(_){Q(_),se(void 0),s("conflict");return}S({title:"The import could not be sent",explanation:"The request to this instance failed before it produced a report, so nothing was written.",fix:"Check your connection and try again.",raw:q(v,"POST /config/import failed")}),s("file")}}))},[j,P,n]),Ae=r.useCallback(a=>{if(I(a.accountId),ne(void 0),a.connector==="microsoft"){s("account-oauth");return}const o=A.get(a.accountId);G({username:o?.username||a.address,password:""}),s("account-password")},[A]),Me=r.useCallback(()=>{g&&ae.mutate({path:{accountId:g},body:{password:T.password,isActive:!0}},{onSuccess:()=>{re.mutate({path:{accountId:g}}),Ce(a=>a.includes(g)?a:[...a,g]),K(a=>{const o={...a};return delete o[g],o}),n.invalidateQueries({queryKey:X()}),G({username:"",password:""}),I(null),s("credentials")},onError:a=>{K(o=>({...o,[g]:q(a,"The password was verified but could not be stored. Try again.")})),I(null),s("credentials")}})},[g,T.password,n,re,ae]),Ee=r.useCallback(()=>{c&&($(c.accountId),oe.mutate({body:{email:c.email}},{onSuccess:a=>{ce(),window.location.assign(a.authorizationUrl)},onError:a=>{$(null),K(o=>({...o,[c.accountId]:q(a,"Microsoft sign-in could not be started.")})),I(null),s("credentials")}}))},[c,ce,oe]),ze=r.useCallback((a,o)=>G({username:a,password:o}),[]),$e=r.useMemo(()=>{const a=O?.pendingImport?.folderPaths;if(!a)return B;const o=new Set(a),v=B.filter(E=>o.has(E.path)),_=a.filter(E=>!B.some(Be=>Be.path===E)).map(E=>({path:E,waitingFor:"An imported setting"}));return[...v,..._]},[O,B]),M=r.useCallback(()=>{b(void 0),Q(void 0),S(void 0),p(void 0),N(void 0),ee("abort"),s("file")},[]);switch(i){case"file":return e.jsx(ut,{state:h?"reading":P.isPending?"checking":d?"dragging":"idle",file:u,ready:j!==void 0,failure:R,onChoose:Fe,onDragStateChange:l,onNext:()=>D("validate",Z)});case"rejected":return e.jsx(wt,{failure:(m&&ue(m))??R??{title:"The file could not be imported",explanation:"The import was refused and nothing was written.",fix:"Re-export the configuration and try again.",raw:"no error was reported"},onBack:M});case"conflict":return e.jsx(ft,{choice:te,held:Ct(Ne?.details),onChoose:se,onBack:M,onNext:()=>{if(te==="abort"){t("abandoned");return}ee("merge"),D("validate","merge")}});case"review":return e.jsx(pt,{sections:it(m?.items??[]),fileName:u?.name??"the config file",warnings:(m?.warnings??[]).map(a=>a.message),applying:P.isPending,onBack:M,onNext:()=>D("apply",Z)});case"partial":{if(!m)return e.jsx(Tt,{onBack:M});const a=me(m);return e.jsx(kt,{results:nt(m),message:a?.message??"The import stopped before it finished.",raw:`${a?.code??st}: ${a?.message??"no message"}`,nothingLanded:!m.applied,onBack:M,onNext:()=>D("apply","merge")})}case"credentials":return e.jsx(jt,{accounts:Re,busyAccountId:U??void 0,error:Ie,onOpen:Ae,onNext:()=>s("folders")});case"account-password":return c?e.jsx(Ue,{steps:y,activeStep:2,title:`Sign in to ${c.email}`,subtitle:`Account ${ie} of ${C.length} · ${c.imapHost}:${c.imapPort}`,email:c.email,username:T.username,password:T.password,error:F[c.accountId],continueLabel:"Test and continue",notice:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(Xe,{className:"size-3.5"}),"Server settings came from the config file — edit them in Settings if they are wrong."]}),onContinue:()=>s("account-test"),onBack:()=>{I(null),s("credentials")},onChange:ze}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-test":return c?e.jsx(Ke,{steps:y,activeStep:2,email:c.email,imapConfig:Nt(c),smtpConfig:St(c),username:T.username,password:T.password,credentialsBackLabel:"Back to the password",serversBackLabel:"Back to the password",successLabel:"Save and continue",onSuccess:Me,onBackToCredentials:()=>s("account-password"),onBackToServers:()=>s("account-password")}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-oauth":return c?e.jsx(vt,{account:he(c,F[c.accountId],V.includes(c.accountId)),position:ie,total:C.length,error:F[c.accountId],busy:U===c.accountId,onBack:()=>{I(null),s("credentials")},onNext:Ee}):e.jsx(Y,{onBack:()=>t("abandoned")});case"folders":return e.jsx(yt,{folders:$e,onNext:()=>t("imported")})}}function ke({children:t,label:n,onBack:i}){return e.jsxs("div",{className:"mx-auto max-w-lg p-6",children:[e.jsx(x,{tone:"danger",children:t}),e.jsx("button",{type:"button",className:"mt-3 text-sm text-accent underline",onClick:i,children:n})]})}function Y({onBack:t}){return e.jsx(ke,{label:"Go to inbox",onBack:t,children:"That account is no longer in this instance's configuration, so there is nothing left to sign in to. Open Settings › Accounts to see what is here."})}function Tt({onBack:t}){return e.jsx(ke,{label:"Choose another file",onBack:t,children:"The import stopped but produced no report, so nothing here can say what it wrote. Open Settings to see what this instance holds before importing again."})}function Pt(){const t=Qe(),n=pe(),i=r.useCallback(s=>{rt({queryClient:n,recordCompleted:()=>{s==="imported"&&t.recordEvent("config.imported")},navigateToInbox:()=>{window.location.assign("/mail")}})},[t,n]);return e.jsx(It,{onDone:i})}export{Pt as component};
@@ -0,0 +1,57 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rich-text-spellcheck-worker-provider-CYOVgYAu.js","assets/useSignature-CrwNi268.js","assets/index-DAdnmNGF.js","assets/index-DS2W4dIw.css","assets/rich-text-spellcheck-provider-J8m9wz6A.js","assets/rich-text-BG71v2el.js","assets/roving-focus-BKvgV51a.js","assets/confirm-dialog-DYq0xqzk.js","assets/useMediaQuery-CH9DMslv.js","assets/bottom-sheet-BnrQALZr.js","assets/popover-menu-CklSwxyo.js","assets/undo-2-BVQZakOw.js","assets/useMessageBodyContent-B2YcWG0V.js","assets/reply-iVDGWyKD.js","assets/nav-link-DsF82VIK.js","assets/account-form-helpers-DhckT_PN.js","assets/useDebouncedValue-C9NNbS8g.js","assets/suggest-list-DfFvQ4CV.js","assets/sections-2qhslMDR.js","assets/chevron-down-pXHA84n5.js"])))=>i.map(i=>d[i]);
2
+ import{b as yr,j as f,X as wr,p as ln,B as un,L as br,z as Ho,T as zo,r as s,y as Wo,d as Er,ag as Vo,x as qo,cx as bn,ci as xr,cy as xe,cz as Sr,cA as Ko,cB as Yo,cC as Se,f as _e,aB as Me,cD as Go,cE as Xo,cF as Rr,cG as Qo,az as Cr,aA as Tr,aa as Zo,e as Ar,cH as Jo,Z as ea,a as At,bS as ta,cI as Dr,c9 as na,bU as ra,c as Nr,cJ as oa,an as aa,cK as Mn,a_ as jn,cL as sa,ao as ia,cM as ca,cN as la,aj as R}from"./index-DAdnmNGF.js";import{p as ua,c as da,b as fa}from"./useMessageBodyContent-B2YcWG0V.js";import{w as ma,u as ha,a as pa,d as va}from"./useSignature-CrwNi268.js";import{b as ga}from"./account-form-helpers-DhckT_PN.js";import{u as ya}from"./useDebouncedValue-C9NNbS8g.js";import{u as wa,S as ba}from"./suggest-list-DfFvQ4CV.js";import"./nav-link-DsF82VIK.js";import"./reply-iVDGWyKD.js";import{b as Ea}from"./sections-2qhslMDR.js";import{u as xa}from"./useMediaQuery-CH9DMslv.js";import{C as Or}from"./chevron-down-pXHA84n5.js";const kr={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};kr.node;const Sa=yr(kr);const Ir={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Ir.node;const Lr=yr(Ir),Ra=({email:e,displayName:t,onRemove:n,className:r})=>f.jsxs("span",{className:ln("inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent-2-soft text-sm max-w-[200px]",r),children:[f.jsx("span",{className:"truncate",children:t||e}),f.jsx("button",{type:"button",onClick:n,className:"shrink-0 p-0.5 rounded-full hover:bg-fg-muted/20 transition-colors","aria-label":`Remove ${e}`,children:f.jsx(wr,{className:"size-3"})})]}),Ca=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,Ta=/[<>:"|?*]/g,Aa=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,Fn=120,Da=12,Na="attachment",$n=e=>{const t=[...e];if(t.length<=Fn)return e;const n=e.lastIndexOf("."),r=n>0&&[...e.slice(n)].length<=Da?e.slice(n):"",o=Fn-[...r].length;return t.slice(0,o).join("")+r},Al=(e,t=Na)=>{const r=e.replace(Ca,"").split(/[/\\]/),a=(r[r.length-1]??"").replace(Ta,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(a.length===0)return $n(t);const i=Aa.test(a)?`_${a}`:a;return $n(i)},Bn=["KB","MB","GB","TB"],Oa=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const n=1023.95;let r=t/1024,o=0;for(;r>=n&&o<Bn.length-1;)r/=1024,o+=1;return`${r.toFixed(1).replace(/\.0$/,"")} ${Bn[o]}`},ka=({disabled:e,onAttach:t})=>{const n=s.useRef(null);return f.jsxs(f.Fragment,{children:[f.jsx(un,{variant:"ghost",size:"md","aria-label":"Attach files",title:"Attach files","aria-busy":e,className:"min-h-11 min-w-11 px-2","data-testid":"compose-attach",icon:f.jsx(Lr,{className:"size-4"}),onClick:()=>{e||n.current?.click()}}),f.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,"data-testid":"compose-attach-input",onChange:r=>{const o=Array.from(r.currentTarget.files??[]);r.currentTarget.value="",o.length>0&&t(o)}})]})},Ia=({save:e})=>e.status==="saving"?f.jsx("output",{className:"animate-pulse text-xs text-fg-muted",children:"Saving..."}):e.status==="saved"?f.jsx("output",{className:"text-xs text-fg-muted",children:"Draft saved"}):e.status==="error"?f.jsx("output",{className:"text-xs text-danger",children:"Save failed"}):e.status==="unsaved"?f.jsx("output",{className:"truncate text-xs text-warning",children:e.reason}):null;function La({send:e,onSend:t,onBlocked:n,onDiscard:r,save:o={status:"idle"},onAttach:a}){const i=e.status==="sending",c=e.status==="blocked"?e.reason:void 0;return f.jsxs("div",{className:"flex items-center justify-between border-t border-line px-3 py-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(un,{variant:"primary",size:"md","aria-busy":i,title:c,className:"min-h-11 shrink-0 rounded-full px-4","data-testid":"compose-send",icon:i?f.jsx(br,{className:"size-4 animate-spin"}):f.jsx(Ho,{className:"size-4"}),onClick:()=>{if(!i){if(c!==void 0){n(c);return}t()}},children:"Send"}),a&&f.jsx(ka,{disabled:i,onAttach:a}),f.jsx(Ia,{save:o})]}),f.jsx(un,{variant:"ghost",size:"md","aria-busy":i,"aria-label":"Discard",className:"min-h-11 min-w-11 px-2 hover:text-danger",icon:f.jsx(zo,{className:"size-4"}),onClick:()=>{i||r()}})]})}const Un=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),Pa=e=>{const t=e.trim();if(!t)return;const n=t.match(/^(.+?)\s*<([^>]+)>$/);if(n){const r=n[1].trim().replace(/^"(.*)"$/,"$1"),o=n[2].trim();if(Un(o))return{email:o,displayName:r}}if(Un(t))return{email:t}},_a=e=>{const t=[];let n="",r=!1,o=!1;for(const a of e){if(a==='"'&&(r=!r),a==="<"&&(o=!0),a===">"&&(o=!1),(a===","||a===";")&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t},Ma=e=>{const t=[],n=[];for(const r of _a(e)){const o=Pa(r);if(o){t.push(o);continue}r.trim()&&n.push(r.trim())}return{entries:t,unparsed:n.join(", ")}},ja=["Tab",","],Fa=150,$a=({label:e,addresses:t,onChange:n,placeholder:r,suggestions:o=[],onQueryChange:a,onPendingChange:i,ref:c})=>{const[u,d]=s.useState(""),m=s.useRef(null),l=s.useMemo(()=>Ma(u),[u]);s.useEffect(()=>{i?.(l)},[l,i]);const h=s.useRef(void 0),v=s.useCallback(()=>{h.current!==void 0&&(clearTimeout(h.current),h.current=void 0)},[]);s.useEffect(()=>v,[v]);const x=new Set(t.map(w=>w.email.toLowerCase())),p=u.length>=2?o.filter(w=>!x.has(w.email.toLowerCase())):[],b=s.useCallback(w=>{d(w),a?.(w)},[a]),y=s.useCallback(w=>{v(),!x.has(w.email.toLowerCase())&&(n([...t,w]),b(""))},[t,x,n,b,v]),T=s.useCallback(w=>{n(t.filter((_,C)=>C!==w))},[t,n]),S=s.useCallback(w=>{y(w),m.current?.focus()},[y]),E=s.useCallback(()=>{if(v(),l.entries.length===0)return{addresses:t,unparsed:l.unparsed};const w=new Set(x),_=[...t];for(const C of l.entries){const q=C.email.toLowerCase();w.has(q)||(w.add(q),_.push(C))}return n(_),b(l.unparsed),{addresses:_,unparsed:l.unparsed}},[l,t,x,n,b,v]),I=s.useCallback(()=>{v(),b("")},[b,v]);s.useImperativeHandle(c,()=>({commitPending:E,clearPending:I}),[E,I]);const N=s.useRef(E);s.useEffect(()=>{N.current=E},[E]);const g=wa({count:p.length,acceptKeys:ja,onAccept:w=>S(p[w])}),D=s.useMemo(()=>p.map(w=>({value:w.email,label:w.displayName??w.email,...w.displayName?{hint:w.email}:{}})),[p]),O=s.useCallback(w=>{if(w.key==="Backspace"&&u===""&&t.length>0){T(t.length-1);return}g.handleKeyDown(w)||(w.key==="Enter"||w.key==="Tab"||w.key===",")&&u.trim()&&(w.preventDefault(),E())},[u,t.length,T,g.handleKeyDown,E]),j=s.useCallback(()=>{v(),h.current=setTimeout(()=>{h.current=void 0,N.current(),g.dismiss()},Fa)},[v,g.dismiss]);return f.jsxs("div",{className:"relative","data-address-field":e,children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsxs("label",{htmlFor:`address-field-${e}`,className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:[e,":"]}),f.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-1 min-h-[36px] px-2 py-1 border rounded-md bg-canvas cursor-text",onClick:()=>m.current?.focus(),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&m.current?.focus()},children:[t.map((w,_)=>f.jsx(Ra,{email:w.email,displayName:w.displayName,onRemove:()=>T(_)},w.email)),f.jsx("input",{ref:m,id:`address-field-${e}`,type:"text",value:u,onChange:w=>{g.reopen(),b(w.target.value)},onKeyDown:O,onBlur:j,placeholder:t.length===0?r:"",className:"flex-1 min-w-[120px] bg-transparent outline-none text-sm py-0.5",autoComplete:"off",...g.comboboxProps})]})]}),g.open&&f.jsx(ba,{id:g.listId,suggestions:D,activeIndex:g.activeIndex,optionId:g.optionId,onPick:w=>{const _=p.find(C=>C.email===w.value);_&&S(_)},onHighlight:g.setActiveIndex,label:`${e} suggestions`,className:"absolute left-12 right-0 z-50 mt-1 max-h-[200px] shadow-lg"})]})},Ba=({state:e})=>e.status==="uploading"?f.jsx(br,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}):e.status==="failed"?f.jsx(Wo,{className:"size-4 shrink-0 text-danger","aria-hidden":!0}):f.jsx(Lr,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0});function Ua({items:e,onRemove:t,onRetry:n,className:r}){return e.length===0?null:f.jsx("ul",{"aria-label":"Attached files","data-testid":"compose-attachments",className:ln("flex flex-col gap-1 px-3 py-2",r),children:e.map(o=>f.jsxs("li",{"data-testid":"compose-attachment","data-state":o.state.status,className:ln("rounded-sm border bg-surface",o.state.status==="failed"?"border-danger/40":"border-line"),children:[f.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[f.jsx(Ba,{state:o.state}),f.jsxs("span",{className:"min-w-0 flex-1",children:[f.jsx("bdi",{className:"block truncate text-sm text-fg",title:o.filename,children:o.filename}),f.jsxs("span",{className:"block text-2xs text-fg-subtle",children:[Oa(o.sizeBytes),o.state.status==="uploading"?" · Uploading…":""]})]}),o.state.status==="failed"&&o.state.retryable&&f.jsx("button",{type:"button",onClick:()=>n(o.key),className:"text-xs font-medium text-accent hover:underline",children:"Try again"}),f.jsx("button",{type:"button","aria-label":`Remove ${o.filename}`,onClick:()=>t(o.key),className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-sunken hover:text-fg",children:f.jsx(wr,{className:"size-4","aria-hidden":!0})})]}),o.state.status==="failed"&&f.jsx("p",{role:"alert","data-testid":"compose-attachment-error",className:"border-t border-danger/30 bg-danger-soft px-2 py-1.5 text-xs text-danger",children:o.state.reason})]},o.key))})}const Ha=()=>f.jsxs("div",{"aria-hidden":"true","data-testid":"compose-body-skeleton",className:"min-h-[120px] px-3 py-2",children:[f.jsx("div",{className:"mb-2 h-8 animate-pulse rounded bg-surface-sunken"}),f.jsx("div",{className:"min-h-[80px] animate-pulse rounded bg-surface-sunken/50"})]}),za=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function Wa({banner:e,header:t,children:n,quoted:r,attachments:o,actionBar:a,layout:i="fill",onDropFiles:c}){const u=i==="fill",[d,m]=s.useState(!1),l=c?{onDragOver:h=>{za(h)&&(h.preventDefault(),m(!0))},onDragLeave:h=>{h.relatedTarget instanceof Node&&h.currentTarget.contains(h.relatedTarget)||m(!1)},onDrop:h=>{m(!1);const v=Array.from(h.dataTransfer?.files??[]);v.length!==0&&(h.preventDefault(),c(v))}}:{};return f.jsxs("div",{className:[u?"flex h-full min-h-0 flex-col":"flex flex-col",d&&"outline-2 -outline-offset-2 outline-dashed outline-accent"].filter(Boolean).join(" "),"data-testid":"compose-drop-target","data-dropping":d||void 0,...l,children:[e,t,f.jsxs("div",{className:u?"flex min-h-0 flex-1 flex-col overflow-auto":"flex flex-col","data-testid":"compose-body-area",children:[n,r&&f.jsx("div",{className:"shrink-0 px-3 pb-2",children:r})]}),o&&f.jsx("div",{className:"shrink-0",children:o}),u?a:f.jsx("div",{className:"sticky bottom-0 z-10 bg-canvas",children:a})]})}const Kt=({label:e,onClick:t})=>f.jsx("button",{type:"button",onClick:t,className:"text-xs text-fg-muted hover:text-fg transition-colors",children:e}),Va=({to:e,cc:t,bcc:n,subject:r})=>{const o=[];return e.length>0&&o.push(`To: ${e.map(a=>a.displayName??a.email).join(", ")}`),t.length>0&&o.push(`Cc: ${t.length}`),n.length>0&&o.push(`Bcc: ${n.length}`),r&&o.push(r),o.join(" · ")},qa=({collapsed:e=!1,summary:t="",onExpand:n,from:r,to:o,cc:a,bcc:i,subject:c,onShowCc:u,onShowBcc:d})=>e?f.jsxs("button",{type:"button",onClick:n,"aria-label":"Show recipients and subject",className:"flex min-h-11 w-full items-center gap-2 overflow-hidden border-b border-line px-3 py-1.5 text-left transition-colors hover:bg-surface-sunken","data-testid":"compose-header-collapsed",children:[f.jsx("span",{className:"truncate text-xs text-fg-muted",children:t||"…"}),f.jsx(Or,{className:"ml-auto size-4 shrink-0 text-fg-muted","aria-hidden":"true"})]}):f.jsxs("div",{className:"space-y-1 px-3 py-2 border-b border-line",children:[r,o,a??f.jsxs("div",{className:"flex gap-2 pl-14",children:[f.jsx(Kt,{label:"Cc",onClick:u}),f.jsx(Kt,{label:"Bcc",onClick:d})]}),a&&!i&&f.jsx("div",{className:"pl-14",children:f.jsx(Kt,{label:"Bcc",onClick:d})}),i,c]}),Pr="This message is attachments only, and attachments aren't forwarded — a forward would arrive with nothing of the original in it.",Ka="This message is attachments only, so there's nothing to quote and your reply goes out without the original.",Ya=e=>e==="forward"?Pr:Ka,Ga=({mode:e})=>f.jsx(Er,{tone:"warning","data-testid":"compose-quote-missing",children:f.jsx("span",{children:Ya(e)})}),dn="This account can't send mail until SMTP is configured.",Xa=({onConfigure:e,configureRef:t})=>f.jsxs("div",{role:"alert","data-testid":"compose-smtp-missing-banner",className:"flex items-start gap-3 border-b border-warning/50 bg-warning/10 px-3 py-2",children:[f.jsx(Vo,{className:"size-5 shrink-0 mt-0.5 text-warning","aria-hidden":"true"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-warning",children:dn}),f.jsxs("button",{ref:t,type:"button",onClick:e,"data-testid":"compose-smtp-configure",className:"mt-1 inline-flex items-center gap-1 text-xs font-medium text-warning hover:underline",children:["Configure SMTP",f.jsx(Sa,{className:"size-3","aria-hidden":"true"})]})]})]}),Qa=({value:e,onChange:t})=>f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"Subj:"}),f.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",placeholder:"Subject","data-subject-field":!0})]}),Za=({text:e,html:t,senderName:n,date:r})=>{const[o,a]=s.useState(!1);if(!e&&!t)return null;const i=[n,r].filter(Boolean).join(" on ");return f.jsxs("div",{className:"mt-2 px-3 pb-2",children:[f.jsxs("button",{type:"button",onClick:()=>a(!o),"aria-expanded":o,className:"flex items-center gap-1 text-xs text-fg-muted hover:text-fg transition-colors",children:[o?f.jsx(Or,{className:"size-3"}):f.jsx(qo,{className:"size-3"}),i?`${i} wrote:`:"Show quoted text"]}),o&&f.jsx("blockquote",{className:"mt-2 pl-3 border-l-2 border-fg-subtle/30 text-sm text-fg-muted [&_a]:text-accent [&_a]:underline [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-fg-subtle/30",children:t?f.jsx("div",{dangerouslySetInnerHTML:{__html:t}}):e.split(`
3
+ `).map((c,u)=>f.jsx("p",{className:"min-h-[1.2em]",children:c},u))})]})},Ja=["p","br","div","h1","h2","h3","h4","h5","h6","strong","b","em","i","u","s","ul","ol","li","blockquote","pre","code","hr","table","thead","tbody","tr","th","td","a","img"],es=["href","src","alt","colspan","rowspan","lang","dir"],ts=/^(?:https?:|mailto:)/i,ns=/^(?:https:|data:image\/)/i,rs=/^cid:(.+)$/i,fn=()=>!1;let mn=fn;const os=e=>{const t=rs.exec(e);return t?mn(t[1]):ns.test(e)},as="max-width:100%;height:auto",ss=e=>{const t=ua();if(!t.isSupported)throw new Error("adopted HTML cannot be sanitized: no DOM is available");return t.addHook("afterSanitizeAttributes",n=>{if(n.tagName==="A"){ts.test(n.getAttribute("href")??"")||n.removeAttribute("href"),e==="quoted"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer nofollow"));return}if(n.tagName==="IMG"){if(e==="quoted"){n.remove();return}if(!os(n.getAttribute("src")??"")){n.remove();return}n.setAttribute("style",as)}}),t},Hn=new Map,is=e=>{const t=Hn.get(e);if(t)return t;const n=ss(e);return Hn.set(e,n),n},_r=(e,t)=>is(t).sanitize(e,{ALLOWED_TAGS:Ja,ALLOWED_ATTR:es,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1}),Dl=(e,t=fn)=>{mn=t;try{return _r(e,"outgoing")}finally{mn=fn}},cs=e=>_r(e,"quoted"),ls=e=>typeof e=="string"&&e.length>0?"rich":"plain",Nl=(e,t)=>t.length>0,us={plain:"Couldn't switch to plain text",rich:"Couldn't switch to rich text"},Ol=(e,t,n)=>t.trim()===""||n.trim()!==""?{outcome:"switch"}:{outcome:"blocked",title:us[e],detail:"The conversion came back empty, so your message is unchanged."};function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o||!o.defaultPrevented)return t?.(o)}}function zn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ds(...e){return t=>{let n=!1;const r=e.map(o=>{const a=zn(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():zn(e[o],null)}}}}function je(...e){return s.useCallback(ds(...e),e)}function fs(e,t=[]){let n=[];function r(a,i){const c=s.createContext(i);c.displayName=a+"Context";const u=n.length;n=[...n,i];const d=l=>{const{scope:h,children:v,...x}=l,p=h?.[e]?.[u]||c,b=s.useMemo(()=>x,Object.values(x));return f.jsx(p.Provider,{value:b,children:v})};d.displayName=a+"Provider";function m(l,h,v={}){const{optional:x=!1}=v,p=h?.[e]?.[u]||c,b=s.useContext(p);if(b)return b;if(i!==void 0)return i;if(!x)throw new Error(`\`${l}\` must be used within \`${a}\``)}return[d,m]}const o=()=>{const a=n.map(i=>s.createContext(i));return function(c){const u=c?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,ms(o,...t)]}function ms(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((c,{useScope:u,scopeName:d})=>{const l=u(a)[`__scope${d}`];return{...c,...l}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var nt=globalThis?.document?s.useLayoutEffect:()=>{},hs=bn[" useInsertionEffect ".trim().toString()]||nt;function ps({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=vs({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const m=s.useRef(e!==void 0);s.useEffect(()=>{const l=m.current;l!==c&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,r])}const d=s.useCallback(m=>{if(c){const l=gs(m)?m(e):m;l!==e&&i.current?.(l)}else a(m)},[c,e,a,i]);return[u,d]}function vs({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),o=s.useRef(n),a=s.useRef(t);return hs(()=>{a.current=t},[t]),s.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function gs(e){return typeof e=="function"}function Mr(e){const t=s.forwardRef((n,r)=>{let{children:o,...a}=n,i=null,c=!1;const u=[];Wn(o)&&typeof pt=="function"&&(o=pt(o._payload)),s.Children.forEach(o,h=>{if(xs(h)){c=!0;const v=h;let x="child"in v.props?v.props.child:v.props.children;Wn(x)&&typeof pt=="function"&&(x=pt(x._payload)),i=ws(v,x),u.push(i?.props?.children)}else u.push(h)}),i?i=s.cloneElement(i,void 0,u):!c&&s.Children.count(o)===1&&s.isValidElement(o)&&(i=o);const d=i?Es(i):void 0,m=je(r,d);if(!i){if(o||o===0)throw new Error(c?Ts(e):Cs(e));return o}const l=bs(a,i.props??{});return i.type!==s.Fragment&&(l.ref=r?m:d),s.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}var ys=Symbol.for("radix.slottable"),ws=(e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null};function bs(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...c)=>{const u=a(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Es(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function xs(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ys}var Ss=Symbol.for("react.lazy");function Wn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ss&&"_payload"in e&&Rs(e._payload)}function Rs(e){return typeof e=="object"&&e!==null&&"then"in e}var Cs=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ts=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,pt=bn[" use ".trim().toString()],As=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ge=As.reduce((e,t)=>{const n=Mr(`Primitive.${t}`),r=s.forwardRef((o,a)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(u,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ds(e,t){e&&xr.flushSync(()=>e.dispatchEvent(t))}function rt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>t.current?.(...n)),[])}var Ns="DismissableLayer",hn="dismissableLayer.update",Os="dismissableLayer.pointerDownOutside",ks="dismissableLayer.focusOutside",Vn,En=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),jr=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...d}=e,m=s.useContext(En),[l,h]=s.useState(null),v=l?.ownerDocument??globalThis?.document,[,x]=s.useState({}),p=je(t,h),b=Array.from(m.layers),[y]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=y?b.indexOf(y):-1,S=l?b.indexOf(l):-1,E=m.layersWithOutsidePointerEventsDisabled.size>0,I=S>=T,N=s.useRef(!1),g=Ms(w=>{a?.(w),c?.(w),w.defaultPrevented||u?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(w=>{if(!(w instanceof Node))return!1;const _=[...m.branches].some(C=>C.contains(w));return I&&!_},[m.branches,I])}),D=js(w=>{if(r&&N.current)return;const _=w.target;[...m.branches].some(q=>q.contains(_))||(i?.(w),c?.(w),w.defaultPrevented||u?.())},v),O=l?S===b.length-1:!1,j=rt(w=>{w.key==="Escape"&&(o?.(w),!w.defaultPrevented&&u&&(w.preventDefault(),u()))});return s.useEffect(()=>{if(O)return v.addEventListener("keydown",j,{capture:!0}),()=>v.removeEventListener("keydown",j,{capture:!0})},[v,O,j]),s.useEffect(()=>{if(l)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Vn=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(l)),m.layers.add(l),qn(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(l),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=Vn))}},[l,v,n,m]),s.useEffect(()=>()=>{l&&(m.layers.delete(l),m.layersWithOutsidePointerEventsDisabled.delete(l),qn())},[l,m]),s.useEffect(()=>{const w=()=>x({});return document.addEventListener(hn,w),()=>document.removeEventListener(hn,w)},[]),f.jsx(ge.div,{...d,ref:p,style:{pointerEvents:E?I?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,g.onPointerDownCapture)})});jr.displayName=Ns;var Is="DismissableLayerBranch",Ls=s.forwardRef((e,t)=>{const n=s.useContext(En),r=s.useRef(null),o=je(t,r);return s.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),f.jsx(ge.div,{...e,ref:o})});Ls.displayName=Is;function Ps(){const e=s.useContext(En),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var _s=()=>!0;function Ms(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a,shouldHandlePointerDownOutside:i=_s}=t,c=rt(e),u=s.useRef(!1),d=s.useRef(!1),m=s.useRef(new Map),l=s.useRef(()=>{});return s.useEffect(()=>{function h(){d.current=!1,o.current=!1,m.current.clear()}function v(){return Array.from(m.current.values()).some(Boolean)}function x(S){if(!d.current)return;const E=S.target;E instanceof Node&&[...a].some(N=>N.contains(E))||m.current.set(S.type,!0),S.type==="click"&&window.setTimeout(()=>{d.current&&l.current()},0)}function p(S){d.current&&m.current.set(S.type,!1)}const b=S=>{if(S.target&&!u.current){let E=function(){n.removeEventListener("click",l.current);const N=v();h(),N||Fr(Os,c,I,{discrete:!0})};if(!i(S.target)){n.removeEventListener("click",l.current),h(),u.current=!1;return}const I={originalEvent:S};d.current=!0,o.current=r&&S.button===0,m.current.clear(),!r||S.button!==0?E():(n.removeEventListener("click",l.current),l.current=E,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),h();u.current=!1},y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const S of y)n.addEventListener(S,x,!0),n.addEventListener(S,p);const T=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(T),n.removeEventListener("pointerdown",b),n.removeEventListener("click",l.current);for(const S of y)n.removeEventListener(S,x,!0),n.removeEventListener(S,p)}},[n,c,r,o,a,i]),{onPointerDownCapture:()=>u.current=!0}}function js(e,t=globalThis?.document){const n=rt(e),r=s.useRef(!1);return s.useEffect(()=>{const o=a=>{a.target&&!r.current&&Fr(ks,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qn(){const e=new CustomEvent(hn);document.dispatchEvent(e)}function Fr(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ds(o,a):o.dispatchEvent(a)}var vt=0,Be=null;function Fs(){s.useEffect(()=>{Be||(Be={start:Kn(),end:Kn()});const{start:e,end:t}=Be;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),vt++,()=>{vt===1&&(Be?.start.remove(),Be?.end.remove(),Be=null),vt=Math.max(0,vt-1)}},[])}function Kn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yt="focusScope.autoFocusOnMount",Gt="focusScope.autoFocusOnUnmount",Yn={bubbles:!1,cancelable:!0},$s="FocusScope",$r=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[c,u]=s.useState(null),d=rt(o),m=rt(a),l=s.useRef(null),h=je(t,u),v=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let p=function(S){if(v.paused||!c)return;const E=S.target;c.contains(E)?l.current=E:Ee(l.current,{select:!0})},b=function(S){if(v.paused||!c)return;const E=S.relatedTarget;E!==null&&(c.contains(E)||Ee(l.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const I of S)I.removedNodes.length>0&&Ee(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const T=new MutationObserver(y);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),T.disconnect()}}},[r,c,v.paused]),s.useEffect(()=>{if(c){Xn.add(v);const p=document.activeElement;if(!c.contains(p)){const y=new CustomEvent(Yt,Yn);c.addEventListener(Yt,d),c.dispatchEvent(y),y.defaultPrevented||(Bs(Vs(Br(c)),{select:!0}),document.activeElement===p&&Ee(c))}return()=>{c.removeEventListener(Yt,d),setTimeout(()=>{const y=new CustomEvent(Gt,Yn);c.addEventListener(Gt,m),c.dispatchEvent(y),y.defaultPrevented||Ee(p??document.body,{select:!0}),c.removeEventListener(Gt,m),Xn.remove(v)},0)}}},[c,d,m,v]);const x=s.useCallback(p=>{if(!n&&!r||v.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(b&&y){const T=p.currentTarget,[S,E]=Us(T);S&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&Ee(S,{select:!0})):p.shiftKey&&y===S&&(p.preventDefault(),n&&Ee(E,{select:!0})):y===T&&p.preventDefault()}},[n,r,v.paused]);return f.jsx(ge.div,{tabIndex:-1,...i,ref:h,onKeyDown:x})});$r.displayName=$s;function Bs(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ee(r,{select:t}),document.activeElement!==n)return}function Us(e){const t=Br(e),n=Gn(t,e),r=Gn(t.reverse(),e);return[n,r]}function Br(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Gn(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Hs(r,{upTo:t})))return r}function Hs(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function zs(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zs(e)&&t&&e.select()}}var Xn=Ws();function Ws(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Qn(e,t),e.unshift(t)},remove(t){e=Qn(e,t),e[0]?.resume()}}}function Qn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Vs(e){return e.filter(t=>t.tagName!=="A")}var qs=bn[" useId ".trim().toString()]||(()=>{}),Ks=0;function Xt(e){const[t,n]=s.useState(qs());return nt(()=>{n(r=>r??String(Ks++))},[e]),e||(t?`radix-${t}`:"")}var Ys="Portal",Ur=s.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=s.useState(!1);nt(()=>a(!0),[]);const i=n||o&&globalThis?.document?.body;return i?xr.createPortal(f.jsx(ge.div,{...r,ref:t}),i):null});Ur.displayName=Ys;function Gs(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=Xs(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),a=Qs(r.ref,Zs(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:a}):null};Ot.displayName="Presence";function Xs(e){const[t,n]=s.useState(),r=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=s.useRef(void 0),c=e?"mounted":"unmounted",[u,d]=Gs(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{u==="mounted"?(a.current=i.current??Je(r.current),i.current=void 0):a.current="none"},[u]),nt(()=>{const m=r.current,l=o.current;if(l!==e){const v=a.current,x=Je(m);e?(i.current=x,d("MOUNT")):x==="none"||m?.display==="none"?d("UNMOUNT"):d(l&&v!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),nt(()=>{if(t){let m;const l=t.ownerDocument.defaultView??window,h=x=>{const b=Je(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",m=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},v=x=>{x.target===t&&(a.current=Je(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(m=>{if(m){const l=getComputedStyle(m);r.current=l,i.current=Je(l)}else r.current=null;n(m)},[])}}function Zn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qs(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let o=!1;const a=r.map(i=>{const c=Zn(i,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let i=0;i<a.length;i++){const c=a[i];typeof c=="function"?c():Zn(r[i],null)}}},[])}function Je(e){return e?.animationName||"none"}function Zs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Js=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ue=new WeakMap,gt=new WeakMap,yt={},Qt=0,Hr=function(e){return e&&(e.host||Hr(e.parentNode))},ei=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ti=function(e,t,n,r){var o=ei(t,Array.isArray(e)?e:[e]);yt[n]||(yt[n]=new WeakMap);var a=yt[n],i=[],c=new Set,u=new Set(o),d=function(l){!l||c.has(l)||(c.add(l),d(l.parentNode))};o.forEach(d);var m=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(h){if(c.has(h))m(h);else try{var v=h.getAttribute(r),x=v!==null&&v!=="false",p=(Ue.get(h)||0)+1,b=(a.get(h)||0)+1;Ue.set(h,p),a.set(h,b),i.push(h),p===1&&x&&gt.set(h,!0),b===1&&h.setAttribute(n,"true"),x||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return m(t),c.clear(),Qt++,function(){i.forEach(function(l){var h=Ue.get(l)-1,v=a.get(l)-1;Ue.set(l,h),a.set(l,v),h||(gt.has(l)||l.removeAttribute(r),gt.delete(l)),v||l.removeAttribute(n)}),Qt--,Qt||(Ue=new WeakMap,Ue=new WeakMap,gt=new WeakMap,yt={})}},ni=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Js(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ti(r,o,n,"aria-hidden")):function(){return null}},Rt="right-scroll-bar-position",Ct="width-before-scroll-bar",ri="with-scroll-bars-hidden",oi="--removed-body-scroll-bar-size";function Zt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ai(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var si=typeof window<"u"?s.useLayoutEffect:s.useEffect,Jn=new WeakMap;function ii(e,t){var n=ai(null,function(r){return e.forEach(function(o){return Zt(o,r)})});return si(function(){var r=Jn.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(c){a.has(c)||Zt(c,null)}),a.forEach(function(c){o.has(c)||Zt(c,i)})}Jn.set(n,e)},[e]),n}function ci(e){return e}function li(e,t){t===void 0&&(t=ci);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(a),i=n}var u=function(){var m=i;i=[],m.forEach(a)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(m){i.push(m),d()},filter:function(m){return i=i.filter(m),n}}}};return o}function ui(e){e===void 0&&(e={});var t=li(null);return t.options=xe({async:!0,ssr:!1},e),t}var zr=function(e){var t=e.sideCar,n=Sr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,xe({},n))};zr.isSideCarExport=!0;function di(e,t){return e.useMedium(t),zr}var Wr=ui(),Jt=function(){},kt=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Jt,onWheelCapture:Jt,onTouchMoveCapture:Jt}),o=r[0],a=r[1],i=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,m=e.enabled,l=e.shards,h=e.sideCar,v=e.noRelative,x=e.noIsolation,p=e.inert,b=e.allowPinchZoom,y=e.as,T=y===void 0?"div":y,S=e.gapMode,E=Sr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=h,N=ii([n,t]),g=xe(xe({},E),o);return s.createElement(s.Fragment,null,m&&s.createElement(I,{sideCar:Wr,removeScrollBar:d,shards:l,noRelative:v,noIsolation:x,inert:p,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:S}),i?s.cloneElement(s.Children.only(c),xe(xe({},g),{ref:N})):s.createElement(T,xe({},g,{className:u,ref:N}),c))});kt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kt.classNames={fullWidth:Ct,zeroRight:Rt};var fi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fi();return t&&e.setAttribute("nonce",t),e}function hi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var vi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mi())&&(hi(t,n),pi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gi=function(){var e=vi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vr=function(){var e=gi(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},yi={left:0,top:0,right:0,gap:0},en=function(e){return parseInt(e||"",10)||0},wi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[en(n),en(r),en(o)]},bi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yi;var t=wi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ei=Vr(),We="data-scroll-locked",xi=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
4
+ .`.concat(ri,` {
5
+ overflow: hidden `).concat(r,`;
6
+ padding-right: `).concat(c,"px ").concat(r,`;
7
+ }
8
+ body[`).concat(We,`] {
9
+ overflow: hidden `).concat(r,`;
10
+ overscroll-behavior: contain;
11
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
12
+ padding-left: `.concat(o,`px;
13
+ padding-top: `).concat(a,`px;
14
+ padding-right: `).concat(i,`px;
15
+ margin-left:0;
16
+ margin-top:0;
17
+ margin-right: `).concat(c,"px ").concat(r,`;
18
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
19
+ }
20
+
21
+ .`).concat(Rt,` {
22
+ right: `).concat(c,"px ").concat(r,`;
23
+ }
24
+
25
+ .`).concat(Ct,` {
26
+ margin-right: `).concat(c,"px ").concat(r,`;
27
+ }
28
+
29
+ .`).concat(Rt," .").concat(Rt,` {
30
+ right: 0 `).concat(r,`;
31
+ }
32
+
33
+ .`).concat(Ct," .").concat(Ct,` {
34
+ margin-right: 0 `).concat(r,`;
35
+ }
36
+
37
+ body[`).concat(We,`] {
38
+ `).concat(oi,": ").concat(c,`px;
39
+ }
40
+ `)},er=function(){var e=parseInt(document.body.getAttribute(We)||"0",10);return isFinite(e)?e:0},Si=function(){s.useEffect(function(){return document.body.setAttribute(We,(er()+1).toString()),function(){var e=er()-1;e<=0?document.body.removeAttribute(We):document.body.setAttribute(We,e.toString())}},[])},Ri=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Si();var a=s.useMemo(function(){return bi(o)},[o]);return s.createElement(Ei,{styles:xi(a,!t,o,n?"":"!important")})},pn=!1;if(typeof window<"u")try{var wt=Object.defineProperty({},"passive",{get:function(){return pn=!0,!0}});window.addEventListener("test",wt,wt),window.removeEventListener("test",wt,wt)}catch{pn=!1}var He=pn?{passive:!1}:!1,Ci=function(e){return e.tagName==="TEXTAREA"},qr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ci(e)&&n[t]==="visible")},Ti=function(e){return qr(e,"overflowY")},Ai=function(e){return qr(e,"overflowX")},tr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Kr(e,r);if(o){var a=Yr(e,r),i=a[1],c=a[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Di=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ni=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Kr=function(e,t){return e==="v"?Ti(t):Ai(t)},Yr=function(e,t){return e==="v"?Di(t):Ni(t)},Oi=function(e,t){return e==="h"&&t==="rtl"?-1:1},ki=function(e,t,n,r,o){var a=Oi(e,window.getComputedStyle(t).direction),i=a*r,c=n.target,u=t.contains(c),d=!1,m=i>0,l=0,h=0;do{if(!c)break;var v=Yr(e,c),x=v[0],p=v[1],b=v[2],y=p-b-a*x;(x||y)&&Kr(e,c)&&(l+=y,h+=x);var T=c.parentNode;c=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(m&&Math.abs(l)<1||!m&&Math.abs(h)<1)&&(d=!0),d},bt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nr=function(e){return[e.deltaX,e.deltaY]},rr=function(e){return e&&"current"in e?e.current:e},Ii=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Li=function(e){return`
41
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
42
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
43
+ `)},Pi=0,ze=[];function _i(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(Pi++)[0],a=s.useState(Vr)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Ko([e.lockRef.current],(e.shards||[]).map(rr),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var y=bt(p),T=n.current,S="deltaX"in p?p.deltaX:T[0]-y[0],E="deltaY"in p?p.deltaY:T[1]-y[1],I,N=p.target,g=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in p&&g==="h"&&N.type==="range")return!1;var D=window.getSelection(),O=D&&D.anchorNode,j=O?O===N||O.contains(N):!1;if(j)return!1;var w=tr(g,N);if(!w)return!0;if(w?I=g:(I=g==="v"?"h":"v",w=tr(g,N)),!w)return!1;if(!r.current&&"changedTouches"in p&&(S||E)&&(r.current=I),!I)return!0;var _=r.current||I;return ki(_,b,p,_==="h"?S:E)},[]),u=s.useCallback(function(p){var b=p;if(!(!ze.length||ze[ze.length-1]!==a)){var y="deltaY"in b?nr(b):bt(b),T=t.current.filter(function(I){return I.name===b.type&&(I.target===b.target||b.target===I.shadowParent)&&Ii(I.delta,y)})[0];if(T&&T.should){b.cancelable&&b.preventDefault();return}if(!T){var S=(i.current.shards||[]).map(rr).filter(Boolean).filter(function(I){return I.contains(b.target)}),E=S.length>0?c(b,S[0]):!i.current.noIsolation;E&&b.cancelable&&b.preventDefault()}}},[]),d=s.useCallback(function(p,b,y,T){var S={name:p,delta:b,target:y,should:T,shadowParent:Mi(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),m=s.useCallback(function(p){n.current=bt(p),r.current=void 0},[]),l=s.useCallback(function(p){d(p.type,nr(p),p.target,c(p,e.lockRef.current))},[]),h=s.useCallback(function(p){d(p.type,bt(p),p.target,c(p,e.lockRef.current))},[]);s.useEffect(function(){return ze.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,He),document.addEventListener("touchmove",u,He),document.addEventListener("touchstart",m,He),function(){ze=ze.filter(function(p){return p!==a}),document.removeEventListener("wheel",u,He),document.removeEventListener("touchmove",u,He),document.removeEventListener("touchstart",m,He)}},[]);var v=e.removeScrollBar,x=e.inert;return s.createElement(s.Fragment,null,x?s.createElement(a,{styles:Li(o)}):null,v?s.createElement(Ri,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Mi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ji=di(Wr,_i);var Gr=s.forwardRef(function(e,t){return s.createElement(kt,xe({},e,{ref:t,sideCar:ji}))});Gr.classNames=kt.classNames;const or=new Set,vn=e=>(or.add(e),()=>{or.delete(e)}),kl=({enabled:e=!0,bindings:t,capture:n=!1})=>{const r=s.useCallback(o=>{const a=o.target;if(!(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))for(const i of t){if(!(o.key.toLowerCase()===i.key.toLowerCase())||i.action&&Yo(i.action)||i.requireShift!==void 0&&i.requireShift!==o.shiftKey)continue;const u=o.ctrlKey||o.metaKey;if(i.requireMeta!==void 0){if(i.requireMeta!==u)continue}else{const d=i.noModifiers??!0,m=u||o.altKey||i.requireShift===void 0&&o.shiftKey;if(d&&m)continue}i.preventDefault&&o.preventDefault(),i.stopPropagation&&(o.stopPropagation(),o.stopImmediatePropagation()),i.handler(o);return}},[t]);s.useEffect(()=>{if(e)return window.addEventListener("keydown",r,n),()=>window.removeEventListener("keydown",r,n)},[e,r,n])},Fi=e=>typeof e=="object"&&e!==null&&"code"in e&&e.code==="attachment_rejected"&&"message"in e&&typeof e.message=="string",$i=new Set(["EmptyFile","UnusableFilename","FileTooLarge","TooManyAttachments"]),ar={status:"uploading"},Xr={status:"attached"},Pe=(e,t)=>({status:"failed",reason:e,retryable:t}),tn=(e,t)=>Fi(t)?Pe(t.message,!$i.has(t.reason)):Pe(`"${e}" could not be attached: ${Se(t)??"the request failed"}. Try again.`,!0),Bi=e=>({key:e.outboxAttachmentId,serverId:e.outboxAttachmentId,file:null,placement:null,contentId:e.contentId,contentType:e.contentType,contentUrl:e.contentUrl,filename:e.filename,sizeBytes:e.sizeBytes,state:e.state==="Stored"?Xr:Pe(`"${e.filename}" did not finish uploading. Remove it and attach it again.`,!1)});class Ui{constructor(t){this.deps=t}deps;entries=[];snapshot=[];listeners=new Set;generation=0;draftId;nextKey=0;reservationsInFlight=new Set;inFlight=new Map;mintedAfterRemoval=new Map;removing=new Map;removedListeners=new Set;loaded=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.snapshot;owns=t=>this.entries.some(n=>n.contentId===t);storedContent=t=>{const n=this.entries.find(r=>r.contentId===t&&r.contentUrl!==null);return n?.contentUrl?{filename:n.filename,contentType:n.contentType,contentUrl:n.contentUrl}:null};isLoaded=()=>this.loaded;refreshLinks=t=>{const n=new Map(t.map(r=>[r.outboxAttachmentId,r.contentUrl]));this.set(this.entries.map(r=>{const o=r.serverId===null?void 0:n.get(r.serverId);return o===void 0?r:{...r,contentUrl:o}}))};onRemoved=t=>(this.removedListeners.add(t),()=>this.removedListeners.delete(t));blockingReason=()=>{const[t]=this.removing.values();if(t!==void 0)return`Removing "${t}"…`;const n=this.entries.find(o=>o.state.status==="uploading");if(n)return`"${n.filename}" is still uploading.`;const r=this.entries.find(o=>o.state.status==="failed");if(r)return`"${r.filename}" is not attached. Try it again or remove it before sending.`};set(t){this.entries=t,this.snapshot=t.map(({key:n,filename:r,sizeBytes:o,state:a})=>({key:n,filename:r,sizeBytes:o,state:a}));for(const n of this.listeners)n()}patch(t,n,r){t===this.generation&&this.entries.some(o=>o.key===n)&&this.set(this.entries.map(o=>o.key===n?{...o,...r}:o))}reserve(t,n){let r=()=>{};const o=new Promise(a=>{r=()=>{this.reservationsInFlight.delete(o),a()}});return this.reservationsInFlight.add(o),{minted:this.deps.transport().mint(t,n),settle:r}}upload=async(t,n,r,o,a)=>{if(a.aborted)return;const i=this.deps.transport(),{minted:c,settle:u}=this.reserve(o,r),d=await c.catch(h=>(this.patch(t,n,{state:tn(r.name,h)}),null));if(d!==null&&a.aborted&&this.mintedAfterRemoval.set(n,d.outboxAttachmentId),d!==null&&!a.aborted&&this.patch(t,n,{serverId:d.outboxAttachmentId,filename:d.filename,contentId:d.contentId,contentType:d.contentType}),u(),d===null||a.aborted)return;const m=await i.put(d.uploadUrl,r,a).then(()=>null,h=>Se(h)??"the connection dropped");if(a.aborted)return;if(m!==null){this.patch(t,n,{state:Pe(`"${d.filename}" did not finish uploading: ${m}. Try again.`,!0)});return}const l=await i.complete(o,d.outboxAttachmentId).catch(h=>(this.patch(t,n,{state:tn(d.filename,h)}),null));l===null||a.aborted||(this.patch(t,n,{state:Xr,contentUrl:l.contentUrl}),t===this.generation&&this.entries.find(h=>h.key===n)?.placement?.stored(r,d.contentId))};settleFailure(t,n,r){if(t!==this.generation)return;const o=this.entries.find(a=>a.key===n);o?.state.status==="failed"&&o.placement?.failed(r)}run=async(t,n,r,o,a)=>{await this.upload(t,n,r,o,a),this.inFlight.get(n)?.signal===a&&this.inFlight.delete(n),this.settleFailure(t,n,r)};syncKept=async t=>{for(;this.reservationsInFlight.size>0;)await Promise.all([...this.reservationsInFlight]);const n=this.draftId;return t!==this.generation||n===void 0?null:this.deps.transport().keep(n,this.entries.flatMap(r=>r.serverId===null?[]:[r.serverId])).then(()=>null,r=>r??new Error("the request failed"))};attach=async(t,n)=>{const r=this.generation,o=t.map(i=>{this.nextKey+=1;const c={key:`local-${this.nextKey}`,serverId:null,file:i,placement:n??null,contentId:null,contentType:i.type||"application/octet-stream",contentUrl:null,filename:i.name,sizeBytes:i.size,state:ar},u=new AbortController;return this.inFlight.set(c.key,u),{entry:c,file:i,signal:u.signal}});this.set([...this.entries,...o.map(({entry:i})=>i)]);const a=await this.deps.ensureDraft();if(a.outcome==="refused"){for(const{entry:i,file:c}of o)this.inFlight.delete(i.key),this.patch(r,i.key,{state:Pe(a.reason,!0)}),this.settleFailure(r,i.key,c);return}r===this.generation&&(this.draftId=a.outboxMessageId,await Promise.all(o.map(({entry:i,file:c,signal:u})=>this.run(r,i.key,c,a.outboxMessageId,u))))};retry=async t=>{const n=this.entries.find(c=>c.key===t);if(!n||n.file===null||this.inFlight.has(t))return;const r=n.file,o=this.generation,a=new AbortController;this.inFlight.set(t,a),this.patch(o,t,{state:ar,serverId:null});const i=await this.deps.ensureDraft();if(i.outcome==="refused"){this.inFlight.delete(t),this.patch(o,t,{state:Pe(i.reason,!0)});return}if(this.draftId=i.outboxMessageId,n.serverId!==null){const c=await this.syncKept(o);if(c!==null){this.inFlight.delete(t),this.patch(o,t,{serverId:n.serverId,state:tn(r.name,c)});return}}await this.run(o,t,r,i.outboxMessageId,a.signal)};remove=async t=>{const n=this.entries.find(c=>c.key===t);if(!n)return;const r=this.generation,o=this.inFlight.get(t);if(this.set(this.entries.filter(c=>c.key!==t)),o&&(this.inFlight.delete(t),o.abort()),n.serverId===null&&!o)return;this.removing.set(t,n.filename),this.set(this.entries);const a=await this.syncKept(r);this.removing.delete(t),this.set(this.entries);const i=n.serverId??this.mintedAfterRemoval.get(t)??null;if(this.mintedAfterRemoval.delete(t),r===this.generation){if(a===null){if(n.contentId===null)return;for(const c of this.removedListeners)c(n.contentId);return}i!==null&&this.set([...this.entries,{...n,serverId:i,file:null,state:Pe(`"${n.filename}" could not be removed: ${Se(a)??"the request failed"}. It is still on the draft — remove it again.`,!1)}])}};load=(t,n)=>{this.draftId=t,this.loaded=!0;const r=new Set(n.map(a=>a.outboxAttachmentId)),o=this.entries.filter(a=>a.file!==null&&(a.serverId===null||!r.has(a.serverId)));this.set([...n.map(Bi),...o])};reset=t=>{this.generation+=1;for(const n of this.inFlight.values())n.abort();this.inFlight.clear(),this.mintedAfterRemoval.clear(),this.removing.clear(),this.draftId=t,this.loaded=!1,this.set([])}}const Hi=(e,t,n)=>fetch(e,{method:"PUT",body:t,signal:n}).then(r=>{if(!r.ok)throw new Error(`the server answered ${r.status}`)}),zi=({ensureDraft:e})=>{const t=_e({...Go(),meta:Me}),n=_e({...Xo(),meta:Me}),r=_e({...Rr(),meta:Me}),o=s.useRef(null);o.current={mint:(u,d)=>t.mutateAsync({path:{outboxMessageId:u},body:{filename:d.name,contentType:d.type||"application/octet-stream",sizeBytes:d.size}}),put:Hi,complete:(u,d)=>n.mutateAsync({path:{outboxMessageId:u,outboxAttachmentId:d}}).then(m=>({contentUrl:m.contentUrl})),keep:(u,d)=>r.mutateAsync({path:{outboxMessageId:u},body:{attachmentIds:d}}).then(()=>{})};const a=s.useRef(e);a.current=e;const[i]=s.useState(()=>new Ui({transport:()=>{const u=o.current;if(!u)throw new Error("attachment transport not ready");return u},ensureDraft:()=>a.current()}));return{items:s.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),attach:i.attach,retry:i.retry,remove:i.remove,load:i.load,reset:i.reset,owns:i.owns,isLoaded:i.isLoaded,refreshLinks:i.refreshLinks,storedContent:i.storedContent,onRemoved:i.onRemoved,blockingReason:i.blockingReason()}},Il=e=>e==="link-expired"||e==="not-ready";class gn extends Error{reason;status;constructor(t,n,r){super(n),this.name="AttachmentFetchError",this.reason=t,this.status=r}}const Wi="x-remit-403-reason",Vi="expired",qi=(e,t)=>{if(t?.trim()===Vi)return"link-expired";const n=da(e,t);return n==="auth"?"auth":n==="body-missing"?"missing":"generic"},Ki=300*1e3,Yi=async(e,t)=>{const n={},r=await t();r&&(n.Authorization=`Bearer ${r}`);const o=await Qo(e,{headers:n,signal:AbortSignal.timeout(Ki)});if(o.status===202)throw new gn("not-ready","Attachment is still being fetched from the mail server",202);if(!o.ok)throw new gn(qi(o.status,o.headers.get(Wi)),`Failed to download attachment (${o.status} ${o.statusText})`,o.status);return o.blob()},Gi=(e,t,n)=>{switch(e){case"auth":return{title:"Your session expired",detail:`Sign in again, then download ${t} once more. Other parts of the app may also stop responding until you do.`};case"link-expired":return{title:"This download link expired and could not be renewed",detail:`Reload the page, then download ${t} again. If that keeps failing, this is worth reporting.`};case"missing":return{title:"This attachment is missing from storage",detail:"Remit has the message but not the file. Re-sync the account from Settings, then try again."};case"not-ready":return{title:"Still fetching this attachment",detail:"Remit is downloading it from the mail server now. Try again in a few seconds."};default:return{title:"Couldn't download this attachment",detail:n}}},sr=e=>e instanceof gn?e.reason:"generic",Xi=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while downloading this attachment.",Ll=(e,t,n)=>{if(e!=="auth")return Cr(Tr({title:`Bug: attachment download failed (${e})`,errorMessage:`Downloading "${t}" failed: ${n}`}))},Pl=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.rel="noopener",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)},Qi=e=>{const{getToken:t}=Zo(),n=s.useRef({...e,getToken:t});return n.current={...e,getToken:t},s.useMemo(()=>{const r=c=>{const u=n.current;return u.isLoaded()?null:u.draftAttachments.find(d=>d.contentId===c)??null},o=c=>n.current.storedContent(c)??r(c),a=c=>Yi(c.contentUrl,n.current.getToken).then(u=>URL.createObjectURL(new Blob([u],{type:c.contentType}))),i=c=>n.current.refreshLinks().then(()=>{const u=o(c);if(!u)throw new Error("the file is no longer on this draft");return a(u)});return{attach:(c,u)=>{n.current.attach(c,u)},owns:c=>n.current.owns(c)||r(c)!==null,onRemoved:c=>n.current.onRemoved(c),resolve:c=>{const u=o(c);return u?a(u).catch(d=>{if(sr(d)!=="link-expired")throw d;return i(c)}).catch(d=>{const m=sr(d);return n.current.pushError({...Gi(m,u.filename,Xi(d)),error:m==="generic"?d:void 0}),null}):Promise.resolve(null)}}},[])},Zi=(e,t)=>e===void 0&&t.toAddresses.length===0,Ji={status:"unsaved",reason:"Not saved — add a To address to keep this draft."},ir={status:"idle"},ec={status:"saving"},cr={status:"saved"},lr={status:"error"},tc=e=>e.then(()=>{},()=>{}),nc=({outboxMessageId:e,onDraftCreated:t})=>{const[n,r]=s.useState(ir),[o,a]=s.useState(null),i=s.useRef(!0);s.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const c=s.useRef(void 0),u=s.useRef(void 0),d=s.useCallback(()=>{clearTimeout(c.current),c.current=void 0,u.current?.(),u.current=void 0},[]),m=s.useRef(new Set),l=Ar(),h=s.useRef(e),v=s.useRef(e);if(h.current!==e){const N=h.current!==void 0;h.current=e,v.current=e,N&&d()}const x=_e({...Jo(),meta:Me}),p=_e({...Rr(),meta:Me}),b=s.useCallback(async N=>{r(ec),a(null);const g=v.current;if(g){const O=await p.mutateAsync({path:{outboxMessageId:g},body:{toAddresses:N.toAddresses,ccAddresses:N.ccAddresses,bccAddresses:N.bccAddresses,subject:N.subject,textBody:N.textBody,htmlBody:N.htmlBody,inReplyTo:N.inReplyTo,references:N.references}});return r(cr),O}const D=await x.mutateAsync({body:{...N,sendImmediately:!1}});return v.current=D.outboxMessageId,i.current&&t(D.outboxMessageId),r(cr),l.invalidateQueries({queryKey:ea().queryKey}),D},[x.mutateAsync,p.mutateAsync,t,l]),y=s.useRef(Promise.resolve()),T=s.useCallback(N=>{const g=vn(()=>!0),D=y.current.then(()=>b(N)).finally(g);return y.current=tc(D),D},[b]),S=s.useCallback(N=>{if(d(),Zi(v.current,N)){r(Ji);return}r(g=>g.status==="unsaved"?ir:g),u.current=vn(()=>!0),c.current=setTimeout(()=>{c.current=void 0;const g=u.current;u.current=void 0;const D=v.current;if(D&&m.current.has(D)){g?.();return}const O=T(N);g?.(),O.catch(j=>{a(j),r(lr)})},2e3)},[T,d]),E=s.useCallback(N=>(d(),T(N).then(g=>({outcome:"saved",outboxMessageId:g.outboxMessageId})).catch(g=>(r(lr),{outcome:"failed",error:g}))),[T,d]),I=s.useCallback(N=>{d(),N&&m.current.add(N)},[d]);return{saveState:n,saveError:o,saveDraft:S,saveImmediately:E,stopAutoSave:I}},rc=e=>e.outboundCount>0||e.replyCount>0||e.flags?.vip?.value===!0||e.flags?.trusted?.value===!0,oc=e=>e.flags?.blocked?.value===!0?!1:e.flags?.junkOnly?.value!==!0?!0:rc(e),nn=({label:e,addresses:t,onChange:n,placeholder:r,onPendingChange:o,ref:a})=>{const[i,c]=s.useState(""),u=ya(i,200),{data:d}=At({...ta({query:{q:u,limit:8}}),enabled:u.length>=2}),m=s.useMemo(()=>(d?.items??[]).filter(oc).map(l=>({email:l.normalizedEmail,displayName:l.displayName})),[d]);return f.jsx($a,{label:e,addresses:t,onChange:n,placeholder:r,suggestions:m,onQueryChange:c,onPendingChange:o,ref:a})},ac=({accountId:e,configureRef:t})=>{const n=Ea();return f.jsx(Xa,{configureRef:t,onConfigure:()=>{n(e)}})},sc={download:"its dictionary could not be downloaded",engine:"the checker could not start",worker:"the checker stopped running"},ic=e=>{const t=`Spellcheck for ${e.language} is off: ${sc[e.reason]}.`;return{severity:"warning",title:"Spellcheck stopped",detail:`${t} Your browser is checking this message instead. ${e.detail}`,action:{label:"Report this",href:Cr(Tr({title:`Spellcheck stopped: ${e.reason} (${e.language})`,errorMessage:`${t} ${e.detail}`}))}}},cc=e=>({provider:async t=>{const{openSpellcheckWorker:n}=await Dr(async()=>{const{openSpellcheckWorker:r}=await import("./rich-text-spellcheck-worker-provider-CYOVgYAu.js");return{openSpellcheckWorker:r}},__vite__mapDeps([0,1,2,3,4]));return n(t)},onStatus:t=>{t.state==="failed"&&e(ic(t))}}),lc=e=>{if(na(e)?.code==="mail_sync_off")return Se(e)},Qr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Dt=e=>e.split(`
44
+ `).map(t=>`<p>${Qr(t)}</p>`).join(""),uc=new Set(["ADDRESS","ARTICLE","BLOCKQUOTE","BR","DIV","H1","H2","H3","H4","H5","H6","HR","LI","OL","P","PRE","SECTION","TABLE","TR","UL"]),dc=e=>{const t=new DOMParser().parseFromString(e,"text/html"),n=[];let r="";const o=()=>{n.push(r.trim()),r=""},a=i=>{if(i.nodeType===i.TEXT_NODE){r+=(i.textContent??"").replace(/\s+/g," ");return}if(i.nodeType!==i.ELEMENT_NODE)return;const c=uc.has(i.tagName);c&&r!==""&&o();for(const u of i.childNodes)a(u);c&&o()};return a(t.body),r!==""&&o(),n.join(`
45
+ `).replace(/\n{3,}/g,`
46
+
47
+ `).trim()},fc=e=>e.displayName?`${e.displayName} <${e.normalizedEmail}>`:e.normalizedEmail,Tt=e=>e.map(fc).join(", "),Zr=e=>ra(e,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),mc=e=>{const t=Tt(e.from)||"the sender",n=Zr(e.date);return n?`On ${n}, ${t} wrote:`:`${t} wrote:`},hc="---------- Forwarded message ----------",pc=e=>{const t=[hc,`From: ${Tt(e.from)}`,`Date: ${Zr(e.date)}`,`Subject: ${e.subject??""}`,`To: ${Tt(e.to)}`];return e.cc.length>0&&t.push(`Cc: ${Tt(e.cc)}`),t},vc=e=>e.split(`
48
+ `).map(t=>t===""?">":`> ${t}`),gc=(e,t,n)=>{const r=n.kind==="text"?n.content.trim():dc(n.content),o=n.kind==="html"?n.content:Dt(n.content.trim());if(e==="forward"){const i=pc(t);return{text:[...i,"",r].join(`
49
+ `),html:`${Dt(i.join(`
50
+ `))}${o}`}}const a=mc(t);return{text:[a,...vc(r)].join(`
51
+ `),html:`<p>${Qr(a)}</p><blockquote type="cite">${o}</blockquote>`}},yc=(e,t)=>e===""?t:`${e}
52
+
53
+ ${t}`,rn=(e,t,n,r)=>{const o=r?yc(t.text,r.text):t.text;if(e==="plain")return{textBody:o||void 0,htmlBody:""};const a=r?`${t.html}${r.html}`:t.html;return{textBody:o||void 0,htmlBody:a?ma(a,n):void 0}},ur=150,wc=()=>{const[e,t]=s.useState(()=>{if(typeof window>"u"||!window.visualViewport)return{viewportHeight:0,isKeyboardOpen:!1};const n=window.visualViewport.height;return{viewportHeight:n,isKeyboardOpen:window.innerHeight-n>ur}});return s.useEffect(()=>{if(typeof window>"u"||!window.visualViewport)return;const n=window.visualViewport,r=()=>{const o=n.height;t({viewportHeight:o,isKeyboardOpen:window.innerHeight-o>ur})};return r(),n.addEventListener("resize",r),()=>n.removeEventListener("resize",r)},[]),e},bc=({selectedAccountId:e,onSelect:t})=>{const{data:n}=At({...Nr(),staleTime:1/0}),r=n?.accounts??[];if(s.useEffect(()=>{!e&&r.length===1&&r[0]&&t(r[0])},[e,r,t]),r.length<=1){const a=r[0];return a?f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),f.jsx("div",{className:"text-sm py-1.5",children:a.email})]}):null}const o=r.some(a=>a.accountId===e);return f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("label",{htmlFor:"from-account-selector",className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),f.jsxs("select",{id:"from-account-selector",value:o?e:"",onChange:a=>{const i=r.find(c=>c.accountId===a.target.value);i&&t(i)},className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",children:[!o&&f.jsx("option",{value:"",disabled:!0,children:"Choose an account"}),r.map(a=>f.jsx("option",{value:a.accountId,children:a.email},a.accountId))]})]})},Ec=s.lazy(()=>Dr(()=>import("./rich-text-BG71v2el.js"),__vite__mapDeps([5,2,3,1,6,7,8,9,10,11,4,12,13,14,15,16,17,18,19])).then(e=>({default:e.ComposeBody}))),dr=e=>e?`<p></p><p>-- </p>${Dt(e)}`:"",Et=(e,t)=>t?{html:`${Dt(t.body)}${dr(e)}`,text:[t.body,e].filter(Boolean).join(`
54
+
55
+ `)}:{html:dr(e),text:e},xc=e=>e?/^re:\s/i.test(e)?e:`Re: ${e}`:"Re: ",Sc=e=>e?/^fwd?:\s/i.test(e)?e:`Fwd: ${e}`:"Fwd: ",Rc=(e,t,n)=>{const{envelope:r}=e,a=(r.replyTo.length>0?r.replyTo:r.from).map(d=>({email:d.normalizedEmail,displayName:d.displayName}));if(t!=="reply-all")return{to:a,cc:[]};const i=n?.toLowerCase(),c=new Set(a.map(d=>d.email.toLowerCase())),u=[...r.to,...r.cc].filter(d=>d.normalizedEmail.toLowerCase()!==i&&!c.has(d.normalizedEmail.toLowerCase())).map(d=>({email:d.normalizedEmail,displayName:d.displayName}));return{to:a,cc:u}},fr=e=>{const t=e.envelope.messageIdValue,n=a=>e.references.filter(i=>i.referenceType===a).sort((i,c)=>i.referenceOrder-c.referenceOrder).map(i=>i.messageIdValue),r=n("references"),o=r.length>0?[...r]:n("in_reply_to");return t&&!o.includes(t)&&o.push(t),{inReplyTo:t,references:o}},Cc="Add a To address before sending.",Tc="Loading the message you're quoting.",Ac="The message you're quoting couldn't be loaded, so it won't be included.",Dc="Add a To address before attaching a file — the draft the file is kept with is saved against it.",Nc=({label:e,text:t})=>`${e} holds "${t}", which is not an address.`,mr=e=>e.find(t=>t.text.trim()!==""),Oc={entries:[],unparsed:""},kc=(e,t,n,r,o)=>e.length===0&&t.length===0&&n.length===0&&r.trim()===""&&o.text.trim()==="",Ic=({documentGeneration:e,selectedAccountId:t,onAccountChange:n,toAddresses:r,setToAddresses:o,ccAddresses:a,setCcAddresses:i,bccAddresses:c,setBccAddresses:u,showCc:d,setShowCc:m,showBcc:l,setShowBcc:h,subject:v,setSubject:x,fieldHandles:p,onToPendingChange:b})=>{const y=xa(),{isKeyboardOpen:T}=wc(),[S,E]=s.useState(void 0),I=S===e,[N,g]=s.useState(!1);return f.jsx("div",{className:"contents",onFocusCapture:()=>g(!0),onBlurCapture:D=>{D.currentTarget.contains(D.relatedTarget)||g(!1)},children:f.jsx(qa,{collapsed:!y&&T&&!I&&!N,onExpand:()=>E(e),summary:Va({to:r,cc:a,bcc:c,subject:v}),from:f.jsx(bc,{selectedAccountId:t,onSelect:n}),to:f.jsx(nn,{label:"To",addresses:r,onChange:o,placeholder:"Recipients",onPendingChange:b,ref:p.to}),cc:d?f.jsx(nn,{label:"Cc",addresses:a,onChange:i,ref:p.cc}):void 0,bcc:l?f.jsx(nn,{label:"Bcc",addresses:c,onChange:u,ref:p.bcc}):void 0,subject:f.jsx(Qa,{value:v,onChange:x}),onShowCc:()=>m(!0),onShowBcc:()=>h(!0)})})},_l=({mode:e,account:t,sourceMessage:n,outboxMessageId:r,seed:o,insertion:a,onDraftCreated:i,onClose:c,onAccountChange:u,layout:d="fill"})=>{s.useEffect(()=>vn(()=>!0),[]);const{startSendPolling:m}=oa(),{pushError:l}=aa(),[h,v]=s.useState([]),[x,p]=s.useState([]),[b,y]=s.useState([]),[T,S]=s.useState(Oc),E=s.useRef(null),I=s.useRef(null),N=s.useRef(null),g=s.useMemo(()=>({to:E,cc:I,bcc:N}),[]),D=s.useCallback(()=>{E.current?.clearPending(),I.current?.clearPending(),N.current?.clearPending()},[]),[O,j]=s.useState(""),[w,_]=s.useState(!1),[C,q]=s.useState(!1),[$,Q]=s.useState(t?.accountId),[W,ee]=s.useState(!1),[ne,ye]=s.useState(r),Fe=s.useRef(void 0),Ce=s.useRef(!1),de=s.useRef(null),Te=s.useRef(r),Ae=s.useRef(r!==void 0),[De,Ne]=s.useState(r!==void 0),fe=s.useRef(r!==void 0?e:void 0),Oe=s.useRef(void 0),$e=s.useRef(e);$e.current=e;const me=s.useRef(t?.accountId);s.useEffect(()=>{const A=t?.accountId;!A||me.current===A||(me.current=A,!Ae.current&&Q(A))},[t?.accountId]),s.useEffect(()=>{const A=Te.current;if(A===r||(Te.current=r,A===void 0))return;Ae.current=r!==void 0,Ne(r!==void 0),fe.current=r!==void 0?$e.current:void 0,Oe.current=void 0;const U=r?{html:"",text:""}:Et(qe.current,L.current);v([]),p([]),y([]),D(),j(""),_(!1),q(!1),at(U.html),he(U.text),Xe("rich"),it(void 0),be({...U,formatting:[]}),Ye(Z=>Z+1),ee(!1),Fe.current=void 0,Ce.current=!1,ye(r)},[r,D]);const{signature:we}=ha($),qe=s.useRef(we.plainText);qe.current=we.plainText;const L=s.useRef(o);L.current=o;const[Ke,Ye]=s.useState(0),[Ge,at]=s.useState(()=>Et(we.plainText,o).html),[Lt,he]=s.useState(()=>Et(we.plainText,o).text),[ce,Xe]=s.useState("rich"),[re,Pt]=s.useState("en"),[st,it]=s.useState(),[pe,be]=s.useState(()=>({...Et(we.plainText,o),formatting:[]})),[_t,ct]=s.useState(()=>a?.version??0),Mt=a&&a.version>_t&&(r===void 0||W)?a:void 0,{data:F,error:Qe}=At({...Mn({path:{outboxMessageId:r??""}}),enabled:!!r&&!W,meta:la,retry:(A,U)=>!jn(U)&&A<1});s.useEffect(()=>{jn(Qe)&&c()},[Qe,c]),s.useEffect(()=>{if(!F||W)return;v(F.toAddresses.map(K=>({email:K,displayName:void 0}))),F.ccAddresses&&F.ccAddresses.length>0&&(p(F.ccAddresses.map(K=>({email:K,displayName:void 0}))),_(!0)),F.bccAddresses&&F.bccAddresses.length>0&&(y(F.bccAddresses.map(K=>({email:K,displayName:void 0}))),q(!0)),F.subject&&j(F.subject);const A=pa(F.htmlBody??""),U=A.html,Z=F.textBody??"";Xe(ls(F.htmlBody)),it(A.language??void 0),at(U),he(Z),be({html:U,text:Z,formatting:[]}),Ye(K=>K+1),Q(F.accountId),ee(!0),Ce.current=!0},[F,W]),s.useEffect(()=>{if(n){if(Ae.current&&fe.current===e){const A=Oe.current;if(!A||A.myEmail===t?.email)return}if(fe.current=e,Oe.current={myEmail:t?.email},D(),e==="reply"||e==="reply-all"){const{to:A,cc:U}=Rc(n,e,t?.email);v(A),p(U),U.length>0&&_(!0),j(xc(n.envelope.subject))}e==="forward"&&(v([]),p([]),y([]),j(Sc(n.envelope.subject)))}},[e,n,t?.email,D]);const ke=e==="reply"||e==="reply-all"||e==="forward",{data:Ie,isLoading:lt,isError:jt,hasNoRenderablePart:Ft,refetch:k}=fa({messageId:n?.message.messageId,bodyParts:n?.bodyParts,enabled:ke&&!!n}),M=e==="forward"?"forward":"reply",B=ke&&!n,P=ke&&!De&&Ft,H=P&&M==="forward",z=s.useMemo(()=>{if(!ke||!n||De||!Ie)return;const A=Ie.kind==="html"?{kind:"html",content:cs(Ie.body)}:{kind:"text",content:Ie.body};return gc(e==="forward"?"forward":"reply",n.envelope,A)},[ke,n,De,Ie,e]),X=n?.envelope.from[0]?.displayName??n?.envelope.from[0]?.normalizedEmail,le=s.useCallback(A=>{ee(!0),ye(A),i(A)},[i]),{saveState:te,saveError:oe,saveDraft:se,saveImmediately:J,stopAutoSave:ue}=nc({outboxMessageId:r,onDraftCreated:le}),ut=s.useCallback(async()=>{if(r)return{outcome:"ready",outboxMessageId:r};if(!$)return{outcome:"refused",reason:"Choose an account to send from before attaching a file."};if(h.length===0)return{outcome:"refused",reason:Dc};const{htmlBody:A,textBody:U}=rn(ce,pe,re,z),Z=await J({accountId:$,toAddresses:h.map(K=>K.email),ccAddresses:x.length>0?x.map(K=>K.email):void 0,bccAddresses:b.length>0?b.map(K=>K.email):void 0,subject:O||void 0,textBody:U,htmlBody:A,...n&&(e==="reply"||e==="reply-all")?fr(n):{}});return Z.outcome==="failed"?{outcome:"refused",reason:`The draft could not be saved, so the file was not attached: ${Se(Z.error)??"the request failed"}.`}:{outcome:"ready",outboxMessageId:Z.outboxMessageId}},[r,$,h,x,b,O,pe,ce,re,z,n,e,J]),{items:Ro,attach:$t,retry:Co,remove:To,load:Cn,reset:Tn,owns:Ao,isLoaded:Do,refreshLinks:No,storedContent:Oo,onRemoved:ko,blockingReason:Bt}=zi({ensureDraft:ut}),Io=Ar(),Lo=Qi({attach:$t,owns:Ao,isLoaded:Do,storedContent:Oo,refreshLinks:()=>r?Io.fetchQuery({...Mn({path:{outboxMessageId:r}}),staleTime:0}).then(A=>No(A.attachments)):Promise.resolve(),onRemoved:ko,draftAttachments:F&&F.outboxMessageId===r?F.attachments:[],pushError:l}),An=s.useRef(r);s.useEffect(()=>{const A=An.current;A!==r&&(An.current=r,A!==void 0&&Tn(r))},[r,Tn]);const Dn=s.useRef(void 0);s.useEffect(()=>{!F||F.outboxMessageId!==r||Dn.current!==F.outboxMessageId&&(Dn.current=F.outboxMessageId,Cn(F.outboxMessageId,F.attachments))},[F,r,Cn]),s.useEffect(()=>{oe&&l({title:"Couldn't save draft",detail:Se(oe)??"Saving the draft failed.",error:oe})},[oe,l]);const Nn=_e({...sa(),meta:Me}),On=_e({...ca(),meta:Me,onError:A=>{l(ia("Couldn't discard draft","The draft wasn't discarded.",A))}}),{data:Po}=At({...Nr(),staleTime:1/0}),Ze=Po?.accounts.find(A=>A.accountId===$),Ut=Ze?ga(Ze):!1,[Ht,_o]=s.useState(),zt=Ht&&Ht.accountId===$?Ht.reason:void 0,dt=Ze?.composeLanguages,Mo=s.useMemo(()=>dt&&dt.length>0?dt:va(navigator.languages),[dt]),jo=s.useMemo(()=>cc(l),[l]),ft=s.useRef(!1),[kn,In]=s.useState(!1),mt=s.useCallback((A,U)=>kn?{status:"sending"}:$?zt?{status:"blocked",reason:zt}:Ut?{status:"blocked",reason:dn}:lt||B?{status:"blocked",reason:Tc}:Bt?{status:"blocked",reason:Bt}:U?{status:"blocked",reason:Nc(U)}:A===0?{status:"blocked",reason:Cc}:H?{status:"blocked",reason:Pr}:{status:"ready",accountId:$}:{status:"blocked",reason:"Choose an account to send from."},[kn,$,zt,Ut,lt,B,Bt,H]),Wt=s.useMemo(()=>mt(h.length+T.entries.length,mr([{label:"To",text:T.unparsed}])),[mt,h.length,T]),Fo=Wt;s.useEffect(()=>{if(!$||ft.current||ne!==void 0&&ne!==r||r&&!W||kc(h,x,b,O,pe))return;const{htmlBody:A,textBody:U}=rn(ce,pe,re,z),Z={accountId:$,toAddresses:h.map(ae=>ae.email),ccAddresses:x.length>0?x.map(ae=>ae.email):void 0,bccAddresses:b.length>0?b.map(ae=>ae.email):void 0,subject:O||void 0,textBody:U,htmlBody:A},K=JSON.stringify(Z);if(Ce.current){Ce.current=!1,Fe.current=K;return}Fe.current!==K&&(Fe.current=void 0,se(Z))},[$,r,ne,W,h,x,b,O,pe,ce,re,z,se]);const Ln=s.useCallback(async(A,U)=>{if(!ft.current){ft.current=!0,In(!0);try{ue();const Z=n&&(e==="reply"||e==="reply-all")?fr(n):{},{htmlBody:K,textBody:ae}=rn(ce,pe,re,z),Uo=!r,ht=await J({accountId:A,toAddresses:U.to.map(ve=>ve.email),ccAddresses:U.cc.length>0?U.cc.map(ve=>ve.email):void 0,bccAddresses:U.bcc.length>0?U.bcc.map(ve=>ve.email):void 0,subject:O||void 0,textBody:ae,htmlBody:K,...Z});if(ht.outcome==="failed"){l({title:"Couldn't send message",detail:Se(ht.error)??"Saving the message failed, so nothing was sent. Try again.",error:ht.error});return}const qt=ht.outboxMessageId;if(await Nn.mutateAsync({path:{outboxMessageId:qt}}).catch(ve=>{const _n=lc(ve);return _n&&_o({accountId:A,reason:_n}),l({title:"Couldn't send message",detail:Se(ve)??(Uo?"The draft was saved but the send request failed. Try again from the Outbox.":"The send request failed. Try again."),error:ve}),null})===null)return;ue(qt),m(qt),c()}finally{ft.current=!1,In(!1)}}},[O,pe,ce,re,z,e,n,r,J,Nn,ue,m,l,c]),$o=s.useCallback(()=>{ue(r),r&&On.mutate({path:{outboxMessageId:r}}),c()},[ue,r,On,c]),Vt=s.useCallback(A=>{l({title:"Can't send yet",detail:A}),A===dn&&de.current?.focus()},[l]),Pn=s.useCallback(()=>{if(Wt.status==="sending")return;const A=g.to.current?.commitPending(),U=g.cc.current?.commitPending(),Z=g.bcc.current?.commitPending(),K={to:A?.addresses??h,cc:U?.addresses??x,bcc:Z?.addresses??b},ae=mt(K.to.length,mr([{label:"To",text:A?.unparsed??""},{label:"Cc",text:U?.unparsed??""},{label:"Bcc",text:Z?.unparsed??""}]));if(ae.status!=="sending"){if(ae.status==="blocked"){Vt(ae.reason);return}Ln(ae.accountId,K)}},[Wt.status,g,h,x,b,mt,Vt,Ln]),Bo=s.useCallback(A=>{Q(A.accountId),u?.(A)},[u]);return f.jsx(Wa,{layout:d,onDropFiles:A=>{$t(A)},banner:f.jsxs(f.Fragment,{children:[Ze&&Ut?f.jsx(ac,{accountId:Ze.accountId,configureRef:de}):null,P?f.jsx(Ga,{mode:M}):null,jt?f.jsxs(Er,{tone:"warning","data-testid":"compose-quote-failed",children:[f.jsx("span",{children:Ac})," ",f.jsx("button",{type:"button",className:"underline",onClick:()=>{k()},children:"Try again"})]}):null]}),header:f.jsx(Ic,{documentGeneration:Ke,selectedAccountId:$,onAccountChange:Bo,toAddresses:h,setToAddresses:v,ccAddresses:x,setCcAddresses:p,bccAddresses:b,setBccAddresses:y,showCc:w,setShowCc:_,showBcc:C,setShowBcc:q,subject:O,setSubject:j,fieldHandles:g,onToPendingChange:S}),quoted:z?f.jsx(Za,{text:z.text,html:z.html,senderName:X}):void 0,attachments:f.jsx(Ua,{items:Ro,onRemove:A=>{To(A)},onRetry:A=>{Co(A)}}),actionBar:f.jsx(La,{send:Fo,onSend:Pn,onBlocked:Vt,onDiscard:$o,save:te,onAttach:A=>{$t(A)}}),children:f.jsx(s.Suspense,{fallback:f.jsx(Ha,{}),children:f.jsx(Ec,{mode:ce,onModeChange:Xe,initialHtml:Ge,initialText:Lt,onChange:be,onSubmit:Pn,initialCaret:e==="new"?"start":void 0,onConversionError:l,languages:Mo,initialLanguage:st,onLanguageChange:Pt,spellcheck:jo,insertion:Mt,onInserted:ct,inlineImages:Lo},Ke)})})};var It="Dialog",[Jr]=fs(It),[Lc,ie]=Jr(It),eo=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,m]=ps({prop:r,defaultProp:o??!1,onChange:a,caller:It});return f.jsx(Lc,{scope:t,triggerRef:c,contentRef:u,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:d,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(l=>!l),[m]),modal:i,children:n})};eo.displayName=It;var to="DialogTrigger",Pc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(to,n),a=je(t,o.triggerRef);return f.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Sn(o.open),...r,ref:a,onClick:Re(e.onClick,o.onOpenToggle)})});Pc.displayName=to;var xn="DialogPortal",[_c,no]=Jr(xn,{forceMount:void 0}),ro=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=ie(xn,t);return f.jsx(_c,{scope:t,forceMount:n,children:s.Children.map(r,i=>f.jsx(Ot,{present:n||a.open,children:f.jsx(Ur,{asChild:!0,container:o,children:i})}))})};ro.displayName=xn;var Nt="DialogOverlay",oo=s.forwardRef((e,t)=>{const n=no(Nt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ie(Nt,e.__scopeDialog);return a.modal?f.jsx(Ot,{present:r||a.open,children:f.jsx(jc,{...o,ref:t})}):null});oo.displayName=Nt;var Mc=Mr("DialogOverlay.RemoveScroll"),jc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(Nt,n),a=Ps(),i=je(t,a);return f.jsx(Gr,{as:Mc,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(ge.div,{"data-state":Sn(o.open),...r,ref:i,style:{pointerEvents:"auto",...r.style}})})}),Ve="DialogContent",ao=s.forwardRef((e,t)=>{const n=no(Ve,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ie(Ve,e.__scopeDialog);return f.jsx(Ot,{present:r||a.open,children:a.modal?f.jsx(Fc,{...o,ref:t}):f.jsx($c,{...o,ref:t})})});ao.displayName=Ve;var Fc=s.forwardRef((e,t)=>{const n=ie(Ve,e.__scopeDialog),r=s.useRef(null),o=je(t,n.contentRef,r);return s.useEffect(()=>{const a=r.current;if(a)return ni(a)},[]),f.jsx(so,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,a=>a.preventDefault())})}),$c=s.forwardRef((e,t)=>{const n=ie(Ve,e.__scopeDialog),r=s.useRef(!1),o=s.useRef(!1);return f.jsx(so,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),so=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,c=ie(Ve,n);return Fs(),f.jsx(f.Fragment,{children:f.jsx($r,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:f.jsx(jr,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Sn(c.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),io="DialogTitle",co=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(io,n);return f.jsx(ge.h2,{id:o.titleId,...r,ref:t})});co.displayName=io;var lo="DialogDescription",Bc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(lo,n);return f.jsx(ge.p,{id:o.descriptionId,...r,ref:t})});Bc.displayName=lo;var uo="DialogClose",Uc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(uo,n);return f.jsx(ge.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>o.onOpenChange(!1))})});Uc.displayName=uo;function Sn(e){return e?"open":"closed"}function Hc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const fo=R.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ot=()=>{const e=R.useContext(fo);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Hc(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
56
+ [data-state=closed]
57
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function zc(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Wc(){return Rn(/^Mac/)}function Vc(){return Rn(/^iPhone/)}function hr(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function qc(){return Rn(/^iPad/)||Wc()&&navigator.maxTouchPoints>1}function mo(){return Vc()||qc()}function Rn(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Kc=24,Yc=typeof window<"u"?s.useLayoutEffect:s.useEffect;function pr(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const on=typeof document<"u"&&window.visualViewport;function vr(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ho(e){for(vr(e)&&(e=e.parentElement);e&&!vr(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Gc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let xt=0,an;function Xc(e={}){let{isDisabled:t}=e;Yc(()=>{if(!t)return xt++,xt===1&&mo()&&(an=Qc()),()=>{xt--,xt===0&&an?.()}},[t])}function Qc(){let e,t=0,n=l=>{e=ho(l.target),!(e===document.documentElement&&e===document.body)&&(t=l.changedTouches[0].pageY)},r=l=>{if(!e||e===document.documentElement||e===document.body){l.preventDefault();return}let h=l.changedTouches[0].pageY,v=e.scrollTop,x=e.scrollHeight-e.clientHeight;x!==0&&((v<=0&&h>t||v>=x&&h<t)&&l.preventDefault(),t=h)},o=l=>{let h=l.target;yn(h)&&h!==document.activeElement&&(l.preventDefault(),h.style.transform="translateY(-2000px)",h.focus(),requestAnimationFrame(()=>{h.style.transform=""}))},a=l=>{let h=l.target;yn(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",on&&(on.height<window.innerHeight?requestAnimationFrame(()=>{gr(h)}):on.addEventListener("resize",()=>gr(h),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},c=window.pageXOffset,u=window.pageYOffset,d=pr(Zc(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let m=pr(et(document,"touchstart",n,{passive:!1,capture:!0}),et(document,"touchmove",r,{passive:!1,capture:!0}),et(document,"touchend",o,{passive:!1,capture:!0}),et(document,"focus",a,!0),et(window,"scroll",i));return()=>{d(),m(),window.scrollTo(c,u)}}function Zc(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function et(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function gr(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=ho(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+Kc;a>i&&(n.scrollTop+=o-r)}e=n.parentElement}}function yn(e){return e instanceof HTMLInputElement&&!Gc.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Jc(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function el(...e){return t=>e.forEach(n=>Jc(n,t))}function po(...e){return s.useCallback(el(...e),e)}const vo=new WeakMap;function G(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,a])=>{if(o.startsWith("--")){e.style.setProperty(o,a);return}r[o]=e.style[o],e.style[o]=a}),!n&&vo.set(e,r)}function tl(e,t){if(!e||!(e instanceof HTMLElement))return;let n=vo.get(e);n&&(e.style[t]=n[t])}const Y=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function St(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Y(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Y(t)?5:4]):null)}function nl(e){return 8*(Math.log(e+1)-2)}function sn(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function rl(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const V={DURATION:.5,EASE:[.32,.72,0,1]},go=.4,ol=.25,al=100,yo=8,Le=16,wn=26,cn="vaul-dragging";function wo(e){const t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function sl({defaultProp:e,onChange:t}){const n=R.useState(e),[r]=n,o=R.useRef(r),a=wo(t);return R.useEffect(()=>{o.current!==r&&(a(r),o.current=r)},[r,o,a]),n}function bo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=sl({defaultProp:t,onChange:n}),a=e!==void 0,i=a?e:r,c=wo(n),u=R.useCallback(d=>{if(a){const l=typeof d=="function"?d(e):d;l!==e&&c(l)}else o(d)},[a,e,o,c]);return[i,u]}function il({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:a,onSnapPointChange:i,direction:c="bottom",container:u,snapToSequentialPoint:d}){const[m,l]=bo({prop:e,defaultProp:n?.[0],onChange:t}),[h,v]=R.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);R.useEffect(()=>{function g(){v({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]);const x=R.useMemo(()=>m===n?.[n.length-1]||null,[n,m]),p=R.useMemo(()=>{var g;return(g=n?.findIndex(D=>D===m))!=null?g:null},[n,m]),b=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===m||!n,y=R.useMemo(()=>{const g=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var D;return(D=n?.map(O=>{const j=typeof O=="string";let w=0;if(j&&(w=parseInt(O,10)),Y(c)){const C=j?w:h?O*g.height:0;return h?c==="bottom"?g.height-C:-g.height+C:C}const _=j?w:h?O*g.width:0;return h?c==="right"?g.width-_:-g.width+_:_}))!=null?D:[]},[n,h,u]),T=R.useMemo(()=>p!==null?y?.[p]:null,[y,p]),S=R.useCallback(g=>{var D;const O=(D=y?.findIndex(j=>j===g))!=null?D:null;i(O),G(r.current,{transition:`transform ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`,transform:Y(c)?`translate3d(0, ${g}px, 0)`:`translate3d(${g}px, 0, 0)`}),y&&O!==y.length-1&&a!==void 0&&O!==a&&O<a?G(o.current,{transition:`opacity ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`,opacity:"0"}):G(o.current,{transition:`opacity ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`,opacity:"1"}),l(n?.[Math.max(O,0)])},[r.current,n,y,a,o,l]);R.useEffect(()=>{if(m||e){var g;const D=(g=n?.findIndex(O=>O===e||O===m))!=null?g:-1;y&&D!==-1&&typeof y[D]=="number"&&S(y[D])}},[m,e,n,y,S]);function E({draggedDistance:g,closeDrawer:D,velocity:O,dismissible:j}){if(a===void 0)return;const w=c==="bottom"||c==="right"?(T??0)-g:(T??0)+g,_=p===a-1,C=p===0,q=g>0;if(_&&G(o.current,{transition:`opacity ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`}),!d&&O>2&&!q){j?D():S(y[0]);return}if(!d&&O>2&&q&&y&&n){S(y[n.length-1]);return}const $=y?.reduce((W,ee)=>typeof W!="number"||typeof ee!="number"?W:Math.abs(ee-w)<Math.abs(W-w)?ee:W),Q=Y(c)?window.innerHeight:window.innerWidth;if(O>go&&Math.abs(g)<Q*.4){const W=q?1:-1;if(W>0&&x&&n){S(y[n.length-1]);return}if(C&&W<0&&j&&D(),p===null)return;S(y[p+W]);return}S($)}function I({draggedDistance:g}){if(T===null)return;const D=c==="bottom"||c==="right"?T-g:T+g;(c==="bottom"||c==="right")&&D<y[y.length-1]||(c==="top"||c==="left")&&D>y[y.length-1]||G(r.current,{transform:Y(c)?`translate3d(0, ${D}px, 0)`:`translate3d(${D}px, 0, 0)`})}function N(g,D){if(!n||typeof p!="number"||!y||a===void 0)return null;const O=p===a-1;if(p>=a&&D)return 0;if(O&&!D)return 1;if(!b&&!O)return null;const w=O?p+1:p-1,_=O?y[w]-y[w-1]:y[w+1]-y[w],C=g/Math.abs(_);return O?1-C:C}return{isLastSnapPoint:x,activeSnapPoint:m,shouldFade:b,getPercentageDragged:N,setActiveSnapPoint:l,activeSnapPointIndex:p,onRelease:E,onDrag:I,snapPointsOffset:y}}const cl=()=>()=>{};function ll(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=ot(),a=R.useRef(null),i=s.useMemo(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-wn)/window.innerWidth}R.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);const u=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!u)return;rl(r&&!o?sn(document.body,{background:"black"}):cl,sn(u,{transformOrigin:Y(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${V.DURATION}s`,transitionTimingFunction:`cubic-bezier(${V.EASE.join(",")})`}));const d=sn(u,{borderRadius:`${yo}px`,overflow:"hidden",...Y(e)?{transform:`scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),a.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},V.DURATION*1e3)}}},[t,n,i])}let tt=null;function ul({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:a}){const[i,c]=R.useState(()=>typeof window<"u"?window.location.href:""),u=R.useRef(0),d=R.useCallback(()=>{if(hr()&&tt===null&&e&&!a){tt={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:l,innerHeight:h}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-u.current}px`,left:`${-l}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const v=h-window.innerHeight;v&&u.current>=h&&(document.body.style.top=`${-(u.current+v)}px`)}),300)}},[e]),m=R.useCallback(()=>{if(hr()&&tt!==null&&!a){const l=-parseInt(document.body.style.top,10),h=-parseInt(document.body.style.left,10);Object.assign(document.body.style,tt),window.requestAnimationFrame(()=>{if(o&&i!==window.location.href){c(window.location.href);return}window.scrollTo(h,l)}),tt=null}},[i]);return R.useEffect(()=>{function l(){u.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),R.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||m()}},[t,m]),R.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{m()},500)):m())},[e,r,i,t,n,d,m]),{restorePositionSetting:m}}function dl({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:a,shouldScaleBackground:i=!1,setBackgroundColorOnScale:c=!0,closeThreshold:u=ol,scrollLockTimeout:d=al,dismissible:m=!0,handleOnly:l=!1,fadeFromIndex:h=a&&a.length-1,activeSnapPoint:v,setActiveSnapPoint:x,fixed:p,modal:b=!0,onClose:y,nested:T,noBodyStyles:S=!1,direction:E="bottom",defaultOpen:I=!1,disablePreventScroll:N=!0,snapToSequentialPoint:g=!1,preventScrollRestoration:D=!1,repositionInputs:O=!0,onAnimationEnd:j,container:w,autoFocus:_=!1}){var C,q;const[$=!1,Q]=bo({defaultProp:I,prop:e,onChange:k=>{t?.(k),!k&&!T&&pe(),setTimeout(()=>{j?.(k)},V.DURATION*1e3),k&&!b&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),k||(document.body.style.pointerEvents="auto")}}),[W,ee]=R.useState(!1),[ne,ye]=R.useState(!1),[Fe,Ce]=R.useState(!1),de=R.useRef(null),Te=R.useRef(null),Ae=R.useRef(null),De=R.useRef(null),Ne=R.useRef(null),fe=R.useRef(!1),Oe=R.useRef(null),$e=R.useRef(0),me=R.useRef(!1),we=R.useRef(!I),qe=R.useRef(0),L=R.useRef(null),Ke=R.useRef(((C=L.current)==null?void 0:C.getBoundingClientRect().height)||0),Ye=R.useRef(((q=L.current)==null?void 0:q.getBoundingClientRect().width)||0),Ge=R.useRef(0),at=R.useCallback(k=>{a&&k===re.length-1&&(Te.current=new Date)},[]),{activeSnapPoint:Lt,activeSnapPointIndex:he,setActiveSnapPoint:ce,onRelease:Xe,snapPointsOffset:re,onDrag:Pt,shouldFade:st,getPercentageDragged:it}=il({snapPoints:a,activeSnapPointProp:v,setActiveSnapPointProp:x,drawerRef:L,fadeFromIndex:h,overlayRef:de,onSnapPointChange:at,direction:E,container:w,snapToSequentialPoint:g});Xc({isDisabled:!$||ne||!b||Fe||!W||!O||!N});const{restorePositionSetting:pe}=ul({isOpen:$,modal:b,nested:T??!1,hasBeenOpened:W,preventScrollRestoration:D,noBodyStyles:S});function be(){return(window.innerWidth-wn)/window.innerWidth}function _t(k){var M,B;!m&&!a||L.current&&!L.current.contains(k.target)||(Ke.current=((M=L.current)==null?void 0:M.getBoundingClientRect().height)||0,Ye.current=((B=L.current)==null?void 0:B.getBoundingClientRect().width)||0,ye(!0),Ae.current=new Date,mo()&&window.addEventListener("touchend",()=>fe.current=!1,{once:!0}),k.target.setPointerCapture(k.pointerId),$e.current=Y(E)?k.pageY:k.pageX)}function ct(k,M){var B;let P=k;const H=(B=window.getSelection())==null?void 0:B.toString(),z=L.current?St(L.current,E):null,X=new Date;if(P.tagName==="SELECT"||P.hasAttribute("data-vaul-no-drag")||P.closest("[data-vaul-no-drag]"))return!1;if(E==="right"||E==="left")return!0;if(Te.current&&X.getTime()-Te.current.getTime()<500)return!1;if(z!==null&&(E==="bottom"?z>0:z<0))return!0;if(H&&H.length>0)return!1;if(Ne.current&&X.getTime()-Ne.current.getTime()<d&&z===0||M)return Ne.current=X,!1;for(;P;){if(P.scrollHeight>P.clientHeight){if(P.scrollTop!==0)return Ne.current=new Date,!1;if(P.getAttribute("role")==="dialog")return!0}P=P.parentNode}return!0}function Mt(k){if(L.current&&ne){const M=E==="bottom"||E==="right"?1:-1,B=($e.current-(Y(E)?k.pageY:k.pageX))*M,P=B>0,H=a&&!m&&!P;if(H&&he===0)return;const z=Math.abs(B),X=document.querySelector("[data-vaul-drawer-wrapper]"),le=E==="bottom"||E==="top"?Ke.current:Ye.current;let te=z/le;const oe=it(z,P);if(oe!==null&&(te=oe),H&&te>=1||!fe.current&&!ct(k.target,P))return;if(L.current.classList.add(cn),fe.current=!0,G(L.current,{transition:"none"}),G(de.current,{transition:"none"}),a&&Pt({draggedDistance:B}),P&&!a){const J=nl(B),ue=Math.min(J*-1,0)*M;G(L.current,{transform:Y(E)?`translate3d(0, ${ue}px, 0)`:`translate3d(${ue}px, 0, 0)`});return}const se=1-te;if((st||h&&he===h-1)&&(r?.(k,te),G(de.current,{opacity:`${se}`,transition:"none"},!0)),X&&de.current&&i){const J=Math.min(be()+te*(1-be()),1),ue=8-te*8,ut=Math.max(0,14-te*14);G(X,{borderRadius:`${ue}px`,transform:Y(E)?`scale(${J}) translate3d(0, ${ut}px, 0)`:`scale(${J}) translate3d(${ut}px, 0, 0)`,transition:"none"},!0)}if(!a){const J=z*M;G(L.current,{transform:Y(E)?`translate3d(0, ${J}px, 0)`:`translate3d(${J}px, 0, 0)`})}}}R.useEffect(()=>{window.requestAnimationFrame(()=>{we.current=!0})},[]),R.useEffect(()=>{var k;function M(){if(!L.current||!O)return;const B=document.activeElement;if(yn(B)||me.current){var P;const H=((P=window.visualViewport)==null?void 0:P.height)||0,z=window.innerHeight;let X=z-H;const le=L.current.getBoundingClientRect().height||0,te=le>z*.8;Ge.current||(Ge.current=le);const oe=L.current.getBoundingClientRect().top;if(Math.abs(qe.current-X)>60&&(me.current=!me.current),a&&a.length>0&&re&&he){const se=re[he]||0;X+=se}if(qe.current=X,le>H||me.current){const se=L.current.getBoundingClientRect().height;let J=se;se>H&&(J=H-(te?oe:wn)),p?L.current.style.height=`${se-Math.max(X,0)}px`:L.current.style.height=`${Math.max(J,H-oe)}px`}else zc()||(L.current.style.height=`${Ge.current}px`);a&&a.length>0&&!me.current?L.current.style.bottom="0px":L.current.style.bottom=`${Math.max(X,0)}px`}}return(k=window.visualViewport)==null||k.addEventListener("resize",M),()=>{var B;return(B=window.visualViewport)==null?void 0:B.removeEventListener("resize",M)}},[he,a,re]);function F(k){ke(),y?.(),k||Q(!1),setTimeout(()=>{a&&ce(a[0])},V.DURATION*1e3)}function Qe(){if(!L.current)return;const k=document.querySelector("[data-vaul-drawer-wrapper]"),M=St(L.current,E);G(L.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`}),G(de.current,{transition:`opacity ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`,opacity:"1"}),i&&M&&M>0&&$&&G(k,{borderRadius:`${yo}px`,overflow:"hidden",...Y(E)?{transform:`scale(${be()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${be()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${V.DURATION}s`,transitionTimingFunction:`cubic-bezier(${V.EASE.join(",")})`},!0)}function ke(){!ne||!L.current||(L.current.classList.remove(cn),fe.current=!1,ye(!1),De.current=new Date)}function Ie(k){if(!ne||!L.current)return;L.current.classList.remove(cn),fe.current=!1,ye(!1),De.current=new Date;const M=St(L.current,E);if(!k||!ct(k.target,!1)||!M||Number.isNaN(M)||Ae.current===null)return;const B=De.current.getTime()-Ae.current.getTime(),P=$e.current-(Y(E)?k.pageY:k.pageX),H=Math.abs(P)/B;if(H>.05&&(Ce(!0),setTimeout(()=>{Ce(!1)},200)),a){Xe({draggedDistance:P*(E==="bottom"||E==="right"?1:-1),closeDrawer:F,velocity:H,dismissible:m}),o?.(k,!0);return}if(E==="bottom"||E==="right"?P>0:P<0){Qe(),o?.(k,!0);return}if(H>go){F(),o?.(k,!1);return}var z;const X=Math.min((z=L.current.getBoundingClientRect().height)!=null?z:0,window.innerHeight);var le;const te=Math.min((le=L.current.getBoundingClientRect().width)!=null?le:0,window.innerWidth),oe=E==="left"||E==="right";if(Math.abs(M)>=(oe?te:X)*u){F(),o?.(k,!1);return}o?.(k,!0),Qe()}R.useEffect(()=>($&&(G(document.documentElement,{scrollBehavior:"auto"}),Te.current=new Date),()=>{tl(document.documentElement,"scrollBehavior")}),[$]);function lt(k){const M=k?(window.innerWidth-Le)/window.innerWidth:1,B=k?-Le:0;Oe.current&&window.clearTimeout(Oe.current),G(L.current,{transition:`transform ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`,transform:Y(E)?`scale(${M}) translate3d(0, ${B}px, 0)`:`scale(${M}) translate3d(${B}px, 0, 0)`}),!k&&L.current&&(Oe.current=setTimeout(()=>{const P=St(L.current,E);G(L.current,{transition:"none",transform:Y(E)?`translate3d(0, ${P}px, 0)`:`translate3d(${P}px, 0, 0)`})},500))}function jt(k,M){if(M<0)return;const B=(window.innerWidth-Le)/window.innerWidth,P=B+M*(1-B),H=-Le+M*Le;G(L.current,{transform:Y(E)?`scale(${P}) translate3d(0, ${H}px, 0)`:`scale(${P}) translate3d(${H}px, 0, 0)`,transition:"none"})}function Ft(k,M){const B=Y(E)?window.innerHeight:window.innerWidth,P=M?(B-Le)/B:1,H=M?-Le:0;M&&G(L.current,{transition:`transform ${V.DURATION}s cubic-bezier(${V.EASE.join(",")})`,transform:Y(E)?`scale(${P}) translate3d(0, ${H}px, 0)`:`scale(${P}) translate3d(${H}px, 0, 0)`})}return R.useEffect(()=>{b||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[b]),R.createElement(eo,{defaultOpen:I,onOpenChange:k=>{!m&&!k||(k?ee(!0):F(!0),Q(k))},open:$},R.createElement(fo.Provider,{value:{activeSnapPoint:Lt,snapPoints:a,setActiveSnapPoint:ce,drawerRef:L,overlayRef:de,onOpenChange:t,onPress:_t,onRelease:Ie,onDrag:Mt,dismissible:m,shouldAnimate:we,handleOnly:l,isOpen:$,isDragging:ne,shouldFade:st,closeDrawer:F,onNestedDrag:jt,onNestedOpenChange:lt,onNestedRelease:Ft,keyboardIsOpen:me,modal:b,snapPointsOffset:re,activeSnapPointIndex:he,direction:E,shouldScaleBackground:i,setBackgroundColorOnScale:c,noBodyStyles:S,container:w,autoFocus:_}},n))}const Eo=R.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:a,isOpen:i,modal:c,shouldAnimate:u}=ot(),d=po(t,n),m=r&&r.length>0;if(!c)return null;const l=R.useCallback(h=>o(h),[o]);return R.createElement(oo,{onMouseUp:l,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":i&&m?"true":"false","data-vaul-snap-points-overlay":i&&a?"true":"false","data-vaul-animate":u?.current?"true":"false",...e})});Eo.displayName="Drawer.Overlay";const xo=R.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:a,onPress:i,onRelease:c,onDrag:u,keyboardIsOpen:d,snapPointsOffset:m,activeSnapPointIndex:l,modal:h,isOpen:v,direction:x,snapPoints:p,container:b,handleOnly:y,shouldAnimate:T,autoFocus:S}=ot(),[E,I]=R.useState(!1),N=po(o,a),g=R.useRef(null),D=R.useRef(null),O=R.useRef(!1),j=p&&p.length>0;ll();const w=(C,q,$=0)=>{if(O.current)return!0;const Q=Math.abs(C.y),W=Math.abs(C.x),ee=W>Q,ne=["bottom","right"].includes(q)?1:-1;if(q==="left"||q==="right"){if(!(C.x*ne<0)&&W>=0&&W<=$)return ee}else if(!(C.y*ne<0)&&Q>=0&&Q<=$)return!ee;return O.current=!0,!0};R.useEffect(()=>{j&&window.requestAnimationFrame(()=>{I(!0)})},[]);function _(C){g.current=null,O.current=!1,c(C)}return R.createElement(ao,{"data-vaul-drawer-direction":x,"data-vaul-drawer":"","data-vaul-delayed-snap-points":E?"true":"false","data-vaul-snap-points":v&&j?"true":"false","data-vaul-custom-container":b?"true":"false","data-vaul-animate":T?.current?"true":"false",...r,ref:N,style:m&&m.length>0?{"--snap-point-height":`${m[l??0]}px`,...t}:t,onPointerDown:C=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,C),g.current={x:C.pageX,y:C.pageY},i(C))},onOpenAutoFocus:C=>{n?.(C),S||C.preventDefault()},onPointerDownOutside:C=>{if(e?.(C),!h||C.defaultPrevented){C.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:C=>{if(!h){C.preventDefault();return}},onPointerMove:C=>{if(D.current=C,y||(r.onPointerMove==null||r.onPointerMove.call(r,C),!g.current))return;const q=C.pageY-g.current.y,$=C.pageX-g.current.x,Q=C.pointerType==="touch"?10:2;w({x:$,y:q},x,Q)?u(C):(Math.abs($)>Q||Math.abs(q)>Q)&&(g.current=null)},onPointerUp:C=>{r.onPointerUp==null||r.onPointerUp.call(r,C),g.current=null,O.current=!1,c(C)},onPointerOut:C=>{r.onPointerOut==null||r.onPointerOut.call(r,C),_(D.current)},onContextMenu:C=>{r.onContextMenu==null||r.onContextMenu.call(r,C),D.current&&_(D.current)}})});xo.displayName="Drawer.Content";const fl=250,ml=120,So=R.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:a,snapPoints:i,activeSnapPoint:c,setActiveSnapPoint:u,dismissible:d,handleOnly:m,isOpen:l,onPress:h,onDrag:v}=ot(),x=R.useRef(null),p=R.useRef(!1);function b(){if(p.current){S();return}window.setTimeout(()=>{y()},ml)}function y(){if(a||e||p.current){S();return}if(S(),!i||i.length===0){d||o();return}if(c===i[i.length-1]&&d){o();return}const I=i.findIndex(g=>g===c);if(I===-1)return;const N=i[I+1];u(N)}function T(){x.current=window.setTimeout(()=>{p.current=!0},fl)}function S(){x.current&&window.clearTimeout(x.current),p.current=!1}return R.createElement("div",{onClick:b,onPointerCancel:S,onPointerDown:E=>{m&&h(E),T()},onPointerMove:E=>{m&&v(E)},ref:r,"data-vaul-drawer-visible":l?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},R.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});So.displayName="Drawer.Handle";function hl(e){const t=ot(),{container:n=t.container,...r}=e;return R.createElement(ro,{container:n,...r})}const Ml={Root:dl,Content:xo,Overlay:Eo,Portal:hl,Handle:So,Title:co};export{Sa as A,_l as C,Ml as D,Lr as P,Pl as a,Xi as b,Gi as c,Ll as d,sr as e,Oa as f,Yi as g,Dl as h,Il as i,Ol as j,Nl as k,Al as s,kl as u};
@@ -0,0 +1 @@
1
+ import{j as r}from"./index-DAdnmNGF.js";import{B as o}from"./BriefPane-1X78pLE1.js";import"./MessageToolbar-DsaMB1As.js";import"./MessageBody-Djhcr7mH.js";import"./kbd-Dck-H7HI.js";import"./search-scope-CCaj49Vd.js";import"./app-chrome-D1NIvvpc.js";import"./nav-link-DsF82VIK.js";import"./useMediaQuery-CH9DMslv.js";import"./reply-iVDGWyKD.js";import"./useMessageBodyContent-B2YcWG0V.js";import"./roving-focus-BKvgV51a.js";import"./chevron-down-pXHA84n5.js";import"./search-token-index-BWG-pAOC.js";import"./useQueries-D7oIAKqU.js";import"./useLabels-CX2FfltE.js";import"./list-pages-BCUbyyea.js";import"./index-BZiOavIe.js";import"./useSignature-CrwNi268.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C9NNbS8g.js";import"./suggest-list-DfFvQ4CV.js";import"./sections-2qhslMDR.js";import"./useJunkMailboxIds-CdTwA43P.js";import"./badge-BuEj66zZ.js";import"./undo-2-BVQZakOw.js";import"./DropdownMenu-BaLCJNxL.js";import"./refresh-cw-CHIH0Wcb.js";import"./popover-menu-CklSwxyo.js";import"./ErrorState-BTTbYobA.js";import"./mail-CNc7ptBm.js";import"./download-Brw9q_-P.js";import"./avatar-BL40ICSJ.js";import"./EmptyState-DNcM-EnL.js";import"./circle-question-mark-BaR50kvR.js";import"./useFilters-BMKRyTCu.js";import"./select-C4OaQe9Y.js";import"./plus-B59D825u.js";import"./calendar-suggestion-k_ABH6QD.js";import"./useCalendarSuggestions-p-hH5nuf.js";import"./agenda-time-jh144Gvm.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-DWDr32Pg.js";import"./calendar-failure-note-BVioFwWu.js";import"./checkbox-BQtzZS8k.js";import"./clock-Nfb5MDhL.js";import"./segmented-control-DAjB5Iim.js";import"./useLayoutTier-D0BFfVm6.js";import"./menu-0smgSLZN.js";import"./folder-input-DKDXDpie.js";import"./confirm-dialog-DYq0xqzk.js";import"./label-chip-PA6sFIAt.js";import"./cloud-off-BgkpB7KU.js";import"./LabelApplyTrigger-C3JLcO9V.js";import"./useRefreshControl-BYVDaLtF.js";import"./circle-check-big-CB4KqzoP.js";import"./wizard-selection-zWa1qc6-.js";function pr(){return r.jsx(o.Reading,{})}export{pr as component};
@@ -0,0 +1 @@
1
+ import{j as t,ad as o}from"./index-DAdnmNGF.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
@@ -0,0 +1 @@
1
+ import{j as r}from"./index-DAdnmNGF.js";import{B as o}from"./BriefPane-1X78pLE1.js";import"./MessageToolbar-DsaMB1As.js";import"./MessageBody-Djhcr7mH.js";import"./kbd-Dck-H7HI.js";import"./search-scope-CCaj49Vd.js";import"./app-chrome-D1NIvvpc.js";import"./nav-link-DsF82VIK.js";import"./useMediaQuery-CH9DMslv.js";import"./reply-iVDGWyKD.js";import"./useMessageBodyContent-B2YcWG0V.js";import"./roving-focus-BKvgV51a.js";import"./chevron-down-pXHA84n5.js";import"./search-token-index-BWG-pAOC.js";import"./useQueries-D7oIAKqU.js";import"./useLabels-CX2FfltE.js";import"./list-pages-BCUbyyea.js";import"./index-BZiOavIe.js";import"./useSignature-CrwNi268.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C9NNbS8g.js";import"./suggest-list-DfFvQ4CV.js";import"./sections-2qhslMDR.js";import"./useJunkMailboxIds-CdTwA43P.js";import"./badge-BuEj66zZ.js";import"./undo-2-BVQZakOw.js";import"./DropdownMenu-BaLCJNxL.js";import"./refresh-cw-CHIH0Wcb.js";import"./popover-menu-CklSwxyo.js";import"./ErrorState-BTTbYobA.js";import"./mail-CNc7ptBm.js";import"./download-Brw9q_-P.js";import"./avatar-BL40ICSJ.js";import"./EmptyState-DNcM-EnL.js";import"./circle-question-mark-BaR50kvR.js";import"./useFilters-BMKRyTCu.js";import"./select-C4OaQe9Y.js";import"./plus-B59D825u.js";import"./calendar-suggestion-k_ABH6QD.js";import"./useCalendarSuggestions-p-hH5nuf.js";import"./agenda-time-jh144Gvm.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-DWDr32Pg.js";import"./calendar-failure-note-BVioFwWu.js";import"./checkbox-BQtzZS8k.js";import"./clock-Nfb5MDhL.js";import"./segmented-control-DAjB5Iim.js";import"./useLayoutTier-D0BFfVm6.js";import"./menu-0smgSLZN.js";import"./folder-input-DKDXDpie.js";import"./confirm-dialog-DYq0xqzk.js";import"./label-chip-PA6sFIAt.js";import"./cloud-off-BgkpB7KU.js";import"./LabelApplyTrigger-C3JLcO9V.js";import"./useRefreshControl-BYVDaLtF.js";import"./circle-check-big-CB4KqzoP.js";import"./wizard-selection-zWa1qc6-.js";function pr(){return r.jsx(o.Reading,{})}export{pr as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-DAdnmNGF.js";import{C as t}from"./CollectionPane-CHKXUrhZ.js";import"./useCollectionThreads-CPr4txVm.js";import"./useQueries-D7oIAKqU.js";import"./useInfiniteQuery-CK5IyvrU.js";import"./MessageToolbar-DsaMB1As.js";import"./MessageBody-Djhcr7mH.js";import"./kbd-Dck-H7HI.js";import"./search-scope-CCaj49Vd.js";import"./app-chrome-D1NIvvpc.js";import"./nav-link-DsF82VIK.js";import"./useMediaQuery-CH9DMslv.js";import"./reply-iVDGWyKD.js";import"./useMessageBodyContent-B2YcWG0V.js";import"./roving-focus-BKvgV51a.js";import"./chevron-down-pXHA84n5.js";import"./search-token-index-BWG-pAOC.js";import"./useLabels-CX2FfltE.js";import"./list-pages-BCUbyyea.js";import"./index-BZiOavIe.js";import"./useSignature-CrwNi268.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C9NNbS8g.js";import"./suggest-list-DfFvQ4CV.js";import"./sections-2qhslMDR.js";import"./useJunkMailboxIds-CdTwA43P.js";import"./badge-BuEj66zZ.js";import"./undo-2-BVQZakOw.js";import"./DropdownMenu-BaLCJNxL.js";import"./refresh-cw-CHIH0Wcb.js";import"./popover-menu-CklSwxyo.js";import"./ErrorState-BTTbYobA.js";import"./mail-CNc7ptBm.js";import"./download-Brw9q_-P.js";import"./avatar-BL40ICSJ.js";import"./EmptyState-DNcM-EnL.js";import"./circle-question-mark-BaR50kvR.js";import"./useFilters-BMKRyTCu.js";import"./select-C4OaQe9Y.js";import"./plus-B59D825u.js";import"./calendar-suggestion-k_ABH6QD.js";import"./useCalendarSuggestions-p-hH5nuf.js";import"./agenda-time-jh144Gvm.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-DWDr32Pg.js";import"./calendar-failure-note-BVioFwWu.js";import"./checkbox-BQtzZS8k.js";import"./clock-Nfb5MDhL.js";import"./segmented-control-DAjB5Iim.js";import"./useLayoutTier-D0BFfVm6.js";import"./menu-0smgSLZN.js";import"./folder-input-DKDXDpie.js";import"./confirm-dialog-DYq0xqzk.js";import"./label-chip-PA6sFIAt.js";import"./cloud-off-BgkpB7KU.js";import"./MailViewChrome-0kmIcU2a.js";import"./wizard-selection-zWa1qc6-.js";function po(){return o.jsx(t.Reading,{})}export{po as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-DAdnmNGF.js";import{M as r}from"./MailboxPane-BH4Wy3IV.js";import"./useInfiniteQuery-CK5IyvrU.js";import"./MessageToolbar-DsaMB1As.js";import"./MessageBody-Djhcr7mH.js";import"./kbd-Dck-H7HI.js";import"./search-scope-CCaj49Vd.js";import"./app-chrome-D1NIvvpc.js";import"./nav-link-DsF82VIK.js";import"./useMediaQuery-CH9DMslv.js";import"./reply-iVDGWyKD.js";import"./useMessageBodyContent-B2YcWG0V.js";import"./roving-focus-BKvgV51a.js";import"./chevron-down-pXHA84n5.js";import"./search-token-index-BWG-pAOC.js";import"./useQueries-D7oIAKqU.js";import"./useLabels-CX2FfltE.js";import"./list-pages-BCUbyyea.js";import"./index-BZiOavIe.js";import"./useSignature-CrwNi268.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C9NNbS8g.js";import"./suggest-list-DfFvQ4CV.js";import"./sections-2qhslMDR.js";import"./useJunkMailboxIds-CdTwA43P.js";import"./badge-BuEj66zZ.js";import"./undo-2-BVQZakOw.js";import"./DropdownMenu-BaLCJNxL.js";import"./refresh-cw-CHIH0Wcb.js";import"./popover-menu-CklSwxyo.js";import"./ErrorState-BTTbYobA.js";import"./mail-CNc7ptBm.js";import"./download-Brw9q_-P.js";import"./avatar-BL40ICSJ.js";import"./EmptyState-DNcM-EnL.js";import"./circle-question-mark-BaR50kvR.js";import"./useFilters-BMKRyTCu.js";import"./select-C4OaQe9Y.js";import"./plus-B59D825u.js";import"./calendar-suggestion-k_ABH6QD.js";import"./useCalendarSuggestions-p-hH5nuf.js";import"./agenda-time-jh144Gvm.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-DWDr32Pg.js";import"./calendar-failure-note-BVioFwWu.js";import"./checkbox-BQtzZS8k.js";import"./clock-Nfb5MDhL.js";import"./segmented-control-DAjB5Iim.js";import"./useLayoutTier-D0BFfVm6.js";import"./menu-0smgSLZN.js";import"./folder-input-DKDXDpie.js";import"./confirm-dialog-DYq0xqzk.js";import"./label-chip-PA6sFIAt.js";import"./cloud-off-BgkpB7KU.js";import"./useRefreshControl-BYVDaLtF.js";import"./circle-check-big-CB4KqzoP.js";import"./LabelApplyTrigger-C3JLcO9V.js";import"./MailViewChrome-0kmIcU2a.js";import"./NavMenuButton-DYR0-1E6.js";import"./shield-check-CtR5JIeP.js";import"./bottom-sheet-BnrQALZr.js";import"./circle-check-AS6dW8bL.js";function xo(){return o.jsx(r.Reading,{})}export{xo as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-DAdnmNGF.js";import{C as r}from"./CollectionPane-CHKXUrhZ.js";import"./useCollectionThreads-CPr4txVm.js";import"./useQueries-D7oIAKqU.js";import"./useInfiniteQuery-CK5IyvrU.js";import"./MessageToolbar-DsaMB1As.js";import"./MessageBody-Djhcr7mH.js";import"./kbd-Dck-H7HI.js";import"./search-scope-CCaj49Vd.js";import"./app-chrome-D1NIvvpc.js";import"./nav-link-DsF82VIK.js";import"./useMediaQuery-CH9DMslv.js";import"./reply-iVDGWyKD.js";import"./useMessageBodyContent-B2YcWG0V.js";import"./roving-focus-BKvgV51a.js";import"./chevron-down-pXHA84n5.js";import"./search-token-index-BWG-pAOC.js";import"./useLabels-CX2FfltE.js";import"./list-pages-BCUbyyea.js";import"./index-BZiOavIe.js";import"./useSignature-CrwNi268.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C9NNbS8g.js";import"./suggest-list-DfFvQ4CV.js";import"./sections-2qhslMDR.js";import"./useJunkMailboxIds-CdTwA43P.js";import"./badge-BuEj66zZ.js";import"./undo-2-BVQZakOw.js";import"./DropdownMenu-BaLCJNxL.js";import"./refresh-cw-CHIH0Wcb.js";import"./popover-menu-CklSwxyo.js";import"./ErrorState-BTTbYobA.js";import"./mail-CNc7ptBm.js";import"./download-Brw9q_-P.js";import"./avatar-BL40ICSJ.js";import"./EmptyState-DNcM-EnL.js";import"./circle-question-mark-BaR50kvR.js";import"./useFilters-BMKRyTCu.js";import"./select-C4OaQe9Y.js";import"./plus-B59D825u.js";import"./calendar-suggestion-k_ABH6QD.js";import"./useCalendarSuggestions-p-hH5nuf.js";import"./agenda-time-jh144Gvm.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-DWDr32Pg.js";import"./calendar-failure-note-BVioFwWu.js";import"./checkbox-BQtzZS8k.js";import"./clock-Nfb5MDhL.js";import"./segmented-control-DAjB5Iim.js";import"./useLayoutTier-D0BFfVm6.js";import"./menu-0smgSLZN.js";import"./folder-input-DKDXDpie.js";import"./confirm-dialog-DYq0xqzk.js";import"./label-chip-PA6sFIAt.js";import"./cloud-off-BgkpB7KU.js";import"./MailViewChrome-0kmIcU2a.js";import"./wizard-selection-zWa1qc6-.js";function po(){return o.jsx(r.Reading,{})}export{po as component};