@arbidocs/blocks 0.5.132 → 0.5.133

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 (318) hide show
  1. package/dist/{ConnectedCallDock-CJ7RWP5B.cjs → ConnectedCallDock-ZNS5BS2R.cjs} +22 -22
  2. package/dist/{ConnectedCallDock-CJ7RWP5B.cjs.map → ConnectedCallDock-ZNS5BS2R.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-JPJCXP6X.cjs → ConnectedCallRoom-ACNVSFH7.cjs} +14 -14
  4. package/dist/{ConnectedCallRoom-JPJCXP6X.cjs.map → ConnectedCallRoom-ACNVSFH7.cjs.map} +1 -1
  5. package/dist/ConnectedMailInviteCard-AJI7JZYJ.cjs +22 -0
  6. package/dist/{ConnectedMailInviteCard-EINB3THA.cjs.map → ConnectedMailInviteCard-AJI7JZYJ.cjs.map} +1 -1
  7. package/dist/{ConnectedNativeDocxComparison-5TZAIR4V.cjs → ConnectedNativeDocxComparison-H72RQJKH.cjs} +19 -19
  8. package/dist/{ConnectedNativeDocxComparison-5TZAIR4V.cjs.map → ConnectedNativeDocxComparison-H72RQJKH.cjs.map} +1 -1
  9. package/dist/{ConnectedPresentation-SEUUNFUA.cjs → ConnectedPresentation-3JXN6SRT.cjs} +19 -19
  10. package/dist/{ConnectedPresentation-SEUUNFUA.cjs.map → ConnectedPresentation-3JXN6SRT.cjs.map} +1 -1
  11. package/dist/{ConnectedProductionSetDialog-LHB4VQWC.cjs → ConnectedProductionSetDialog-EOWZQ6J3.cjs} +9 -9
  12. package/dist/{ConnectedProductionSetDialog-LHB4VQWC.cjs.map → ConnectedProductionSetDialog-EOWZQ6J3.cjs.map} +1 -1
  13. package/dist/{ConnectedSlidesTab-3ATAKNSJ.cjs → ConnectedSlidesTab-IECS2MJI.cjs} +18 -18
  14. package/dist/{ConnectedSlidesTab-3ATAKNSJ.cjs.map → ConnectedSlidesTab-IECS2MJI.cjs.map} +1 -1
  15. package/dist/{ConnectedStreamedWordArtifact-BKPOMQ6G.cjs → ConnectedStreamedWordArtifact-T7PZIRBY.cjs} +19 -19
  16. package/dist/{ConnectedStreamedWordArtifact-BKPOMQ6G.cjs.map → ConnectedStreamedWordArtifact-T7PZIRBY.cjs.map} +1 -1
  17. package/dist/{DocumentReviewCard-2VI5OOLE.cjs → DocumentReviewCard-EM2AJUF3.cjs} +22 -22
  18. package/dist/{DocumentReviewCard-2VI5OOLE.cjs.map → DocumentReviewCard-EM2AJUF3.cjs.map} +1 -1
  19. package/dist/{FilesViewerDialog-77YTFIX3.cjs → FilesViewerDialog-OA3HDLOI.cjs} +44 -44
  20. package/dist/{FilesViewerDialog-77YTFIX3.cjs.map → FilesViewerDialog-OA3HDLOI.cjs.map} +1 -1
  21. package/dist/{NativeDocxEditor-2PTEK6ND.cjs → NativeDocxEditor-XZAEU5QU.cjs} +8 -8
  22. package/dist/{NativeDocxEditor-2PTEK6ND.cjs.map → NativeDocxEditor-XZAEU5QU.cjs.map} +1 -1
  23. package/dist/{WorkspaceTableView-7BMZ2O3Y.cjs → WorkspaceTableView-HMQ6PXUC.cjs} +9 -9
  24. package/dist/{WorkspaceTableView-7BMZ2O3Y.cjs.map → WorkspaceTableView-HMQ6PXUC.cjs.map} +1 -1
  25. package/dist/agents/index.cjs +194 -194
  26. package/dist/{ai-4XJ2VFNS.cjs → ai-QEXZ4SYR.cjs} +25 -25
  27. package/dist/ai-QEXZ4SYR.cjs.map +1 -0
  28. package/dist/calls/index.cjs +118 -118
  29. package/dist/chat/index.cjs +30 -30
  30. package/dist/{chunk-PSIKUQYM.cjs → chunk-2FA7UVLG.cjs} +12 -12
  31. package/dist/{chunk-PSIKUQYM.cjs.map → chunk-2FA7UVLG.cjs.map} +1 -1
  32. package/dist/{chunk-ZYGAXD3N.cjs → chunk-2SWS7ESM.cjs} +3 -3
  33. package/dist/{chunk-ZYGAXD3N.cjs.map → chunk-2SWS7ESM.cjs.map} +1 -1
  34. package/dist/{chunk-YZ6YOOTF.cjs → chunk-32W2S6DE.cjs} +4 -4
  35. package/dist/{chunk-YZ6YOOTF.cjs.map → chunk-32W2S6DE.cjs.map} +1 -1
  36. package/dist/{chunk-IZBAWZTB.cjs → chunk-3RAW2ZH5.cjs} +8 -8
  37. package/dist/{chunk-IZBAWZTB.cjs.map → chunk-3RAW2ZH5.cjs.map} +1 -1
  38. package/dist/{chunk-MXBXZXXQ.cjs → chunk-3Y75LUCT.cjs} +4 -4
  39. package/dist/{chunk-MXBXZXXQ.cjs.map → chunk-3Y75LUCT.cjs.map} +1 -1
  40. package/dist/{chunk-PL7HUTM3.cjs → chunk-57LUHZLV.cjs} +8 -8
  41. package/dist/{chunk-PL7HUTM3.cjs.map → chunk-57LUHZLV.cjs.map} +1 -1
  42. package/dist/{chunk-MXGXKUSW.cjs → chunk-5GHGIDZP.cjs} +15 -15
  43. package/dist/{chunk-MXGXKUSW.cjs.map → chunk-5GHGIDZP.cjs.map} +1 -1
  44. package/dist/{chunk-KSDTK66A.cjs → chunk-5JK3232B.cjs} +20 -20
  45. package/dist/{chunk-KSDTK66A.cjs.map → chunk-5JK3232B.cjs.map} +1 -1
  46. package/dist/{chunk-Q6IKXWPG.cjs → chunk-64247UHS.cjs} +4 -4
  47. package/dist/{chunk-Q6IKXWPG.cjs.map → chunk-64247UHS.cjs.map} +1 -1
  48. package/dist/{chunk-HBUHOCWF.cjs → chunk-6CGMSJLB.cjs} +4 -4
  49. package/dist/{chunk-HBUHOCWF.cjs.map → chunk-6CGMSJLB.cjs.map} +1 -1
  50. package/dist/{chunk-VRK3IQAP.cjs → chunk-6RC6GYIW.cjs} +4 -4
  51. package/dist/{chunk-VRK3IQAP.cjs.map → chunk-6RC6GYIW.cjs.map} +1 -1
  52. package/dist/{chunk-VJCSEMXT.cjs → chunk-6THN5ZGA.cjs} +4 -4
  53. package/dist/{chunk-VJCSEMXT.cjs.map → chunk-6THN5ZGA.cjs.map} +1 -1
  54. package/dist/{chunk-ZESMRGDV.cjs → chunk-7NJKDJVO.cjs} +6 -6
  55. package/dist/{chunk-ZESMRGDV.cjs.map → chunk-7NJKDJVO.cjs.map} +1 -1
  56. package/dist/{chunk-SBWIA4PL.cjs → chunk-AGL7Z6Y2.cjs} +21 -21
  57. package/dist/{chunk-SBWIA4PL.cjs.map → chunk-AGL7Z6Y2.cjs.map} +1 -1
  58. package/dist/{chunk-PDDYAY4Z.cjs → chunk-BN33PC5F.cjs} +82 -82
  59. package/dist/{chunk-PDDYAY4Z.cjs.map → chunk-BN33PC5F.cjs.map} +1 -1
  60. package/dist/{chunk-TBPCG2PV.cjs → chunk-C5APAFUY.cjs} +224 -165
  61. package/dist/chunk-C5APAFUY.cjs.map +1 -0
  62. package/dist/{chunk-H7PHOTX2.cjs → chunk-C6RJQQLG.cjs} +10 -10
  63. package/dist/{chunk-H7PHOTX2.cjs.map → chunk-C6RJQQLG.cjs.map} +1 -1
  64. package/dist/{chunk-HQDR43JC.cjs → chunk-CENMN32L.cjs} +6 -6
  65. package/dist/{chunk-HQDR43JC.cjs.map → chunk-CENMN32L.cjs.map} +1 -1
  66. package/dist/{chunk-ULWRNGGE.cjs → chunk-CVPV4I7Z.cjs} +4 -3
  67. package/dist/chunk-CVPV4I7Z.cjs.map +1 -0
  68. package/dist/{chunk-QECKDZ47.cjs → chunk-CYN66TBO.cjs} +3 -3
  69. package/dist/chunk-CYN66TBO.cjs.map +1 -0
  70. package/dist/{chunk-B3BZ6MNI.cjs → chunk-DGAGSP5G.cjs} +6 -6
  71. package/dist/{chunk-B3BZ6MNI.cjs.map → chunk-DGAGSP5G.cjs.map} +1 -1
  72. package/dist/{chunk-325GVZE6.cjs → chunk-ECSOXKJQ.cjs} +6 -6
  73. package/dist/{chunk-325GVZE6.cjs.map → chunk-ECSOXKJQ.cjs.map} +1 -1
  74. package/dist/{chunk-GNZAH6UI.cjs → chunk-ETMSINQS.cjs} +6 -6
  75. package/dist/{chunk-GNZAH6UI.cjs.map → chunk-ETMSINQS.cjs.map} +1 -1
  76. package/dist/{chunk-SGYSDABK.cjs → chunk-EYXU32D7.cjs} +6 -6
  77. package/dist/{chunk-SGYSDABK.cjs.map → chunk-EYXU32D7.cjs.map} +1 -1
  78. package/dist/{chunk-UZHWXKS6.cjs → chunk-F6F375V7.cjs} +7 -7
  79. package/dist/{chunk-UZHWXKS6.cjs.map → chunk-F6F375V7.cjs.map} +1 -1
  80. package/dist/{chunk-ALK3PUUB.cjs → chunk-FYFL3CET.cjs} +25 -25
  81. package/dist/{chunk-ALK3PUUB.cjs.map → chunk-FYFL3CET.cjs.map} +1 -1
  82. package/dist/{chunk-IWHP7FAB.cjs → chunk-IFJBE7M5.cjs} +10 -10
  83. package/dist/{chunk-IWHP7FAB.cjs.map → chunk-IFJBE7M5.cjs.map} +1 -1
  84. package/dist/{chunk-AFXLRO6E.cjs → chunk-IN3KXI3K.cjs} +6 -6
  85. package/dist/{chunk-AFXLRO6E.cjs.map → chunk-IN3KXI3K.cjs.map} +1 -1
  86. package/dist/{chunk-MLA2BJ2Y.cjs → chunk-JYZ6UE5X.cjs} +28 -28
  87. package/dist/{chunk-MLA2BJ2Y.cjs.map → chunk-JYZ6UE5X.cjs.map} +1 -1
  88. package/dist/{chunk-QMIHLJMH.cjs → chunk-JZQ47OW5.cjs} +6 -6
  89. package/dist/{chunk-QMIHLJMH.cjs.map → chunk-JZQ47OW5.cjs.map} +1 -1
  90. package/dist/{chunk-VWTOIGX4.cjs → chunk-K3ZZ6IH3.cjs} +4 -4
  91. package/dist/{chunk-VWTOIGX4.cjs.map → chunk-K3ZZ6IH3.cjs.map} +1 -1
  92. package/dist/chunk-KWD5Q4XH.cjs +18 -0
  93. package/dist/{chunk-TDA6KESI.cjs.map → chunk-KWD5Q4XH.cjs.map} +1 -1
  94. package/dist/{chunk-ESVRVZ53.cjs → chunk-L4Y6UMRC.cjs} +5 -5
  95. package/dist/{chunk-ESVRVZ53.cjs.map → chunk-L4Y6UMRC.cjs.map} +1 -1
  96. package/dist/{chunk-YWHUWIHP.cjs → chunk-LFMOQALU.cjs} +75 -75
  97. package/dist/{chunk-YWHUWIHP.cjs.map → chunk-LFMOQALU.cjs.map} +1 -1
  98. package/dist/{chunk-TKHCIHE2.cjs → chunk-LIKDQBNJ.cjs} +7 -7
  99. package/dist/{chunk-TKHCIHE2.cjs.map → chunk-LIKDQBNJ.cjs.map} +1 -1
  100. package/dist/{chunk-ADDQKZ5I.cjs → chunk-LLD4PNBW.cjs} +4 -4
  101. package/dist/{chunk-ADDQKZ5I.cjs.map → chunk-LLD4PNBW.cjs.map} +1 -1
  102. package/dist/{chunk-2Z25MUAY.cjs → chunk-MEYQLQWS.cjs} +12 -12
  103. package/dist/{chunk-2Z25MUAY.cjs.map → chunk-MEYQLQWS.cjs.map} +1 -1
  104. package/dist/{chunk-H4ID6S4P.cjs → chunk-MSJGEZHL.cjs} +6 -6
  105. package/dist/{chunk-H4ID6S4P.cjs.map → chunk-MSJGEZHL.cjs.map} +1 -1
  106. package/dist/{chunk-ORELHENJ.cjs → chunk-NZNBJF3M.cjs} +12 -2
  107. package/dist/chunk-NZNBJF3M.cjs.map +1 -0
  108. package/dist/{chunk-P5AQYC4D.cjs → chunk-OA3AN6WW.cjs} +4 -4
  109. package/dist/{chunk-P5AQYC4D.cjs.map → chunk-OA3AN6WW.cjs.map} +1 -1
  110. package/dist/{chunk-A6GBPE5E.cjs → chunk-OOHBXCDV.cjs} +5 -5
  111. package/dist/{chunk-A6GBPE5E.cjs.map → chunk-OOHBXCDV.cjs.map} +1 -1
  112. package/dist/{chunk-DBN6GBRQ.cjs → chunk-OOW7H2YD.cjs} +14 -14
  113. package/dist/{chunk-DBN6GBRQ.cjs.map → chunk-OOW7H2YD.cjs.map} +1 -1
  114. package/dist/{chunk-JV5TVUOU.cjs → chunk-OUGRCQM7.cjs} +4 -4
  115. package/dist/{chunk-JV5TVUOU.cjs.map → chunk-OUGRCQM7.cjs.map} +1 -1
  116. package/dist/{chunk-JH6JTI76.cjs → chunk-OUYBYZ7Y.cjs} +6 -6
  117. package/dist/{chunk-JH6JTI76.cjs.map → chunk-OUYBYZ7Y.cjs.map} +1 -1
  118. package/dist/{chunk-TXP2N3DC.cjs → chunk-P7VUIW24.cjs} +6 -6
  119. package/dist/{chunk-TXP2N3DC.cjs.map → chunk-P7VUIW24.cjs.map} +1 -1
  120. package/dist/{chunk-OD6NGGL3.cjs → chunk-R5NTEW4L.cjs} +28 -28
  121. package/dist/{chunk-OD6NGGL3.cjs.map → chunk-R5NTEW4L.cjs.map} +1 -1
  122. package/dist/{chunk-SUOHAB7N.cjs → chunk-RSQGDXAF.cjs} +8 -8
  123. package/dist/{chunk-SUOHAB7N.cjs.map → chunk-RSQGDXAF.cjs.map} +1 -1
  124. package/dist/{chunk-U7KB42OQ.cjs → chunk-RZSBHRQL.cjs} +70 -70
  125. package/dist/{chunk-U7KB42OQ.cjs.map → chunk-RZSBHRQL.cjs.map} +1 -1
  126. package/dist/{chunk-YVCOQHCE.cjs → chunk-S5OGPQSB.cjs} +5 -5
  127. package/dist/{chunk-YVCOQHCE.cjs.map → chunk-S5OGPQSB.cjs.map} +1 -1
  128. package/dist/{chunk-ULPTSXXO.cjs → chunk-SD7GUB44.cjs} +4 -4
  129. package/dist/{chunk-ULPTSXXO.cjs.map → chunk-SD7GUB44.cjs.map} +1 -1
  130. package/dist/{chunk-ERRXU2HL.cjs → chunk-SK6LFIU2.cjs} +11 -11
  131. package/dist/{chunk-ERRXU2HL.cjs.map → chunk-SK6LFIU2.cjs.map} +1 -1
  132. package/dist/{chunk-23I5EUZA.cjs → chunk-T2DUNNYY.cjs} +4 -4
  133. package/dist/{chunk-23I5EUZA.cjs.map → chunk-T2DUNNYY.cjs.map} +1 -1
  134. package/dist/{chunk-E3Y7RI3J.cjs → chunk-T6WA6S5T.cjs} +4 -4
  135. package/dist/{chunk-E3Y7RI3J.cjs.map → chunk-T6WA6S5T.cjs.map} +1 -1
  136. package/dist/{chunk-XJE7W42L.cjs → chunk-TENWM7BH.cjs} +10 -13
  137. package/dist/chunk-TENWM7BH.cjs.map +1 -0
  138. package/dist/{chunk-XCW6OY7E.cjs → chunk-TOYKBRAU.cjs} +14 -14
  139. package/dist/{chunk-XCW6OY7E.cjs.map → chunk-TOYKBRAU.cjs.map} +1 -1
  140. package/dist/{chunk-FQRJCAT2.cjs → chunk-TXBXIUTX.cjs} +7 -7
  141. package/dist/{chunk-FQRJCAT2.cjs.map → chunk-TXBXIUTX.cjs.map} +1 -1
  142. package/dist/{chunk-7OPOPYV6.cjs → chunk-U6XMZG6G.cjs} +4 -4
  143. package/dist/{chunk-7OPOPYV6.cjs.map → chunk-U6XMZG6G.cjs.map} +1 -1
  144. package/dist/{chunk-4EK7TAP7.cjs → chunk-UOI6JJPG.cjs} +5 -5
  145. package/dist/{chunk-4EK7TAP7.cjs.map → chunk-UOI6JJPG.cjs.map} +1 -1
  146. package/dist/{chunk-TZYB22FM.cjs → chunk-UOZ237OW.cjs} +22 -22
  147. package/dist/{chunk-TZYB22FM.cjs.map → chunk-UOZ237OW.cjs.map} +1 -1
  148. package/dist/{chunk-QXMPATG6.cjs → chunk-UWTCK5IN.cjs} +14 -14
  149. package/dist/{chunk-QXMPATG6.cjs.map → chunk-UWTCK5IN.cjs.map} +1 -1
  150. package/dist/{chunk-HORAMB52.cjs → chunk-V6SFJ44C.cjs} +101 -101
  151. package/dist/{chunk-HORAMB52.cjs.map → chunk-V6SFJ44C.cjs.map} +1 -1
  152. package/dist/{chunk-NY3YUCOW.cjs → chunk-VCDD763Y.cjs} +4 -4
  153. package/dist/{chunk-NY3YUCOW.cjs.map → chunk-VCDD763Y.cjs.map} +1 -1
  154. package/dist/{chunk-BQ5RIWWT.cjs → chunk-VF26CUE3.cjs} +28 -28
  155. package/dist/{chunk-BQ5RIWWT.cjs.map → chunk-VF26CUE3.cjs.map} +1 -1
  156. package/dist/{chunk-5QERK4PK.cjs → chunk-VIUEPJ3Y.cjs} +42 -42
  157. package/dist/{chunk-5QERK4PK.cjs.map → chunk-VIUEPJ3Y.cjs.map} +1 -1
  158. package/dist/{chunk-7PN3YENO.cjs → chunk-VPKKPHJY.cjs} +4 -4
  159. package/dist/{chunk-7PN3YENO.cjs.map → chunk-VPKKPHJY.cjs.map} +1 -1
  160. package/dist/{chunk-CMGNRMPA.cjs → chunk-WNAZM2YS.cjs} +4 -4
  161. package/dist/{chunk-CMGNRMPA.cjs.map → chunk-WNAZM2YS.cjs.map} +1 -1
  162. package/dist/{chunk-7LEN65YI.cjs → chunk-X46QYO4S.cjs} +4 -4
  163. package/dist/{chunk-7LEN65YI.cjs.map → chunk-X46QYO4S.cjs.map} +1 -1
  164. package/dist/{chunk-5SKHK3BG.cjs → chunk-XZMYSDU4.cjs} +4 -4
  165. package/dist/{chunk-5SKHK3BG.cjs.map → chunk-XZMYSDU4.cjs.map} +1 -1
  166. package/dist/{chunk-JR2YSBD5.cjs → chunk-YKOPKLYP.cjs} +6 -6
  167. package/dist/{chunk-JR2YSBD5.cjs.map → chunk-YKOPKLYP.cjs.map} +1 -1
  168. package/dist/{chunk-JDFBEGQO.cjs → chunk-YZBDHBKI.cjs} +7 -7
  169. package/dist/chunk-YZBDHBKI.cjs.map +1 -0
  170. package/dist/{chunk-GNX3FBBX.cjs → chunk-ZM6B5WJW.cjs} +4 -4
  171. package/dist/{chunk-GNX3FBBX.cjs.map → chunk-ZM6B5WJW.cjs.map} +1 -1
  172. package/dist/{chunk-5UYFLFNR.cjs → chunk-ZOU6K6DD.cjs} +4 -4
  173. package/dist/{chunk-5UYFLFNR.cjs.map → chunk-ZOU6K6DD.cjs.map} +1 -1
  174. package/dist/{chunk-NM7RWZ4E.cjs → chunk-ZTHYJP4G.cjs} +21 -21
  175. package/dist/{chunk-NM7RWZ4E.cjs.map → chunk-ZTHYJP4G.cjs.map} +1 -1
  176. package/dist/citations/index.cjs +10 -10
  177. package/dist/collaboration/index.cjs +70 -70
  178. package/dist/components/UsageMeter.d.ts +2 -0
  179. package/dist/components/UsageMeter.js +10 -0
  180. package/dist/components/UsageMeter.js.map +2 -2
  181. package/dist/connect/docx.cjs +23 -23
  182. package/dist/connect/index.cjs +3201 -2446
  183. package/dist/connect/index.cjs.map +1 -1
  184. package/dist/connect/viewer.cjs +30 -30
  185. package/dist/connection/billing/AddAddonDialog.js +1 -1
  186. package/dist/connection/billing/AddAddonDialog.js.map +2 -2
  187. package/dist/connection/billing/BillingCard.d.ts +1 -1
  188. package/dist/connection/billing/BillingCard.js.map +1 -1
  189. package/dist/connection/billing/ChangePlanDialog.d.ts +1 -1
  190. package/dist/connection/billing/ChangePlanDialog.js +2 -5
  191. package/dist/connection/billing/ChangePlanDialog.js.map +2 -2
  192. package/dist/connection/billing/ChangeProPlan.js +2 -2
  193. package/dist/connection/billing/ChangeProPlan.js.map +2 -2
  194. package/dist/connection/billing/CollaboratorPlan.d.ts +2 -1
  195. package/dist/connection/billing/CollaboratorPlan.js +115 -52
  196. package/dist/connection/billing/CollaboratorPlan.js.map +2 -2
  197. package/dist/connection/billing/ConnectedSubscriptionSetup.d.ts +1 -0
  198. package/dist/connection/billing/ConnectedSubscriptionSetup.js +198 -0
  199. package/dist/connection/billing/ConnectedSubscriptionSetup.js.map +7 -0
  200. package/dist/connection/billing/ConnectedWelcomeDialog.d.ts +3 -13
  201. package/dist/connection/billing/ConnectedWelcomeDialog.js +26 -30
  202. package/dist/connection/billing/ConnectedWelcomeDialog.js.map +2 -2
  203. package/dist/connection/billing/InvoicesModal.js +2 -2
  204. package/dist/connection/billing/InvoicesModal.js.map +1 -1
  205. package/dist/connection/billing/ManualSubscriptionAdjustments.d.ts +12 -0
  206. package/dist/connection/billing/ManualSubscriptionAdjustments.js +424 -0
  207. package/dist/connection/billing/ManualSubscriptionAdjustments.js.map +7 -0
  208. package/dist/connection/billing/MonthlySpendCap.d.ts +3 -1
  209. package/dist/connection/billing/MonthlySpendCap.js +11 -7
  210. package/dist/connection/billing/MonthlySpendCap.js.map +2 -2
  211. package/dist/connection/billing/NewProjectFlow.d.ts +4 -1
  212. package/dist/connection/billing/NewProjectFlow.js +44 -37
  213. package/dist/connection/billing/NewProjectFlow.js.map +2 -2
  214. package/dist/connection/billing/PlanChangeLines.d.ts +1 -1
  215. package/dist/connection/billing/PlanChangeLines.js.map +1 -1
  216. package/dist/connection/billing/ProjectBilling.d.ts +3 -3
  217. package/dist/connection/billing/ProjectBilling.js +2 -2
  218. package/dist/connection/billing/ProjectBilling.js.map +2 -2
  219. package/dist/connection/billing/ProjectDetail.js +17 -2
  220. package/dist/connection/billing/ProjectDetail.js.map +2 -2
  221. package/dist/connection/billing/ProjectPurchaseOptions.d.ts +2 -14
  222. package/dist/connection/billing/ProjectPurchaseOptions.js +289 -440
  223. package/dist/connection/billing/ProjectPurchaseOptions.js.map +2 -2
  224. package/dist/connection/billing/ProjectUsageCard.js +4 -4
  225. package/dist/connection/billing/ProjectUsageCard.js.map +2 -2
  226. package/dist/connection/billing/SharedProjects.js +1 -1
  227. package/dist/connection/billing/SharedProjects.js.map +1 -1
  228. package/dist/connection/billing/StripeCheckoutModal.d.ts +2 -1
  229. package/dist/connection/billing/StripeCheckoutModal.js +20 -4
  230. package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
  231. package/dist/connection/billing/SubscriptionIntervalToggle.d.ts +9 -0
  232. package/dist/connection/billing/SubscriptionIntervalToggle.js +40 -0
  233. package/dist/connection/billing/SubscriptionIntervalToggle.js.map +7 -0
  234. package/dist/connection/billing/SubscriptionPlans.d.ts +3 -4
  235. package/dist/connection/billing/SubscriptionPlans.js +35 -112
  236. package/dist/connection/billing/SubscriptionPlans.js.map +2 -2
  237. package/dist/connection/billing/SubscriptionSetupDialog.d.ts +26 -0
  238. package/dist/connection/billing/SubscriptionSetupDialog.js +248 -0
  239. package/dist/connection/billing/SubscriptionSetupDialog.js.map +7 -0
  240. package/dist/connection/billing/addon-pricing.d.ts +2 -2
  241. package/dist/connection/billing/addon-pricing.js +2 -2
  242. package/dist/connection/billing/addon-pricing.js.map +1 -1
  243. package/dist/connection/billing/plan-pricing.d.ts +2 -2
  244. package/dist/connection/billing/plan-pricing.js +1 -1
  245. package/dist/connection/billing/plan-pricing.js.map +2 -2
  246. package/dist/connection/contacts/ConnectedWelcomeInvitations.js +11 -11
  247. package/dist/connection/contacts/ConnectedWelcomeInvitations.js.map +2 -2
  248. package/dist/connection/conversation/ConnectedConversationPage.js +1 -1
  249. package/dist/connection/conversation/ConnectedConversationPage.js.map +2 -2
  250. package/dist/connection/dialogs/ConnectedGlobalDialogs.js +9 -5
  251. package/dist/connection/dialogs/ConnectedGlobalDialogs.js.map +2 -2
  252. package/dist/connection/export/ConnectedExportPanel.js +1 -1
  253. package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
  254. package/dist/connection/files/page/DocumentsUploadButton.js +1 -1
  255. package/dist/connection/files/page/DocumentsUploadButton.js.map +2 -2
  256. package/dist/connection/runtime/usePaymentReturn.js +62 -18
  257. package/dist/connection/runtime/usePaymentReturn.js.map +3 -3
  258. package/dist/connection/sharing/WorkspaceMembersList.js.map +1 -1
  259. package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.d.ts +1 -1
  260. package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.js.map +1 -1
  261. package/dist/connection/workspace-list/WorkspaceCardsView.js +1 -1
  262. package/dist/connection/workspace-list/WorkspaceCardsView.js.map +1 -1
  263. package/dist/connection/workspace-list/projectBilling.d.ts +1 -1
  264. package/dist/connection/workspace-list/projectBilling.js.map +1 -1
  265. package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +2 -0
  266. package/dist/dashboards/index.cjs +24 -24
  267. package/dist/document-tools/index.cjs +26 -26
  268. package/dist/document-tools/viewer/SignatureRequestEditor.js +1 -1
  269. package/dist/document-tools/viewer/SignatureRequestEditor.js.map +2 -2
  270. package/dist/document-tools/viewer/index.cjs +12 -12
  271. package/dist/document-tools/viewer/index.cjs.map +1 -1
  272. package/dist/docx/index.cjs +40 -40
  273. package/dist/embed/index.cjs +34 -34
  274. package/dist/facts/index.cjs +46 -46
  275. package/dist/files/index.cjs +226 -226
  276. package/dist/home/index.cjs +34 -34
  277. package/dist/index.cjs +437 -437
  278. package/dist/provider/dialog-registry.d.ts +4 -0
  279. package/dist/provider/dialog-registry.js.map +2 -2
  280. package/dist/retrieval/index.cjs +6 -6
  281. package/dist/settings/Billing.d.ts +1 -1
  282. package/dist/settings/Billing.js.map +1 -1
  283. package/dist/settings/IdentityVerification.js +3 -3
  284. package/dist/settings/IdentityVerification.js.map +2 -2
  285. package/dist/settings/ModalScaffold.d.ts +3 -1
  286. package/dist/settings/ModalScaffold.js +2 -1
  287. package/dist/settings/ModalScaffold.js.map +2 -2
  288. package/dist/settings/PlanCard.d.ts +1 -1
  289. package/dist/settings/PlanCard.js +2 -2
  290. package/dist/settings/PlanCard.js.map +1 -1
  291. package/dist/settings/SubscriptionParts.js +1 -1
  292. package/dist/settings/SubscriptionParts.js.map +1 -1
  293. package/dist/settings/WelcomeDialog.d.ts +7 -3
  294. package/dist/settings/WelcomeDialog.js +194 -135
  295. package/dist/settings/WelcomeDialog.js.map +2 -2
  296. package/dist/settings/index.cjs +154 -154
  297. package/dist/shell/index.cjs +48 -48
  298. package/dist/studio/index.cjs +33 -33
  299. package/dist/styles.css +1 -1
  300. package/dist/workflow-canvas/index.cjs +51 -51
  301. package/dist/workspaces/WorkspaceGroup.d.ts +1 -1
  302. package/dist/workspaces/WorkspaceGroup.js.map +1 -1
  303. package/dist/workspaces/index.cjs +33 -33
  304. package/dist/workspaces/workspace-roles.d.ts +2 -2
  305. package/dist/workspaces/workspace-roles.js +1 -1
  306. package/dist/workspaces/workspace-roles.js.map +1 -1
  307. package/node_modules/@arbidocs/coedit/package.json +1 -1
  308. package/package.json +5 -5
  309. package/src/connection/billing/project-purchase.css +362 -9
  310. package/dist/ConnectedMailInviteCard-EINB3THA.cjs +0 -22
  311. package/dist/ai-4XJ2VFNS.cjs.map +0 -1
  312. package/dist/chunk-JDFBEGQO.cjs.map +0 -1
  313. package/dist/chunk-ORELHENJ.cjs.map +0 -1
  314. package/dist/chunk-QECKDZ47.cjs.map +0 -1
  315. package/dist/chunk-TBPCG2PV.cjs.map +0 -1
  316. package/dist/chunk-TDA6KESI.cjs +0 -18
  317. package/dist/chunk-ULWRNGGE.cjs.map +0 -1
  318. package/dist/chunk-XJE7W42L.cjs.map +0 -1
@@ -41,6 +41,10 @@ export interface BlocksDialogProps {
41
41
  quota: QuotaExceededInfo;
42
42
  /** The first-login snapshot for free users. */
43
43
  welcome: Record<string, never>;
44
+ /** Resume explicit approval of a paid project’s spending limits. */
45
+ subscriptionSetup: {
46
+ projectId: string;
47
+ };
44
48
  /** Share a document or a thread by email. */
45
49
  share: ShareRequest;
46
50
  createWorkspace: CreateWorkspaceDialogProps;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/provider/dialog-registry.ts"],
4
- "sourcesContent": ["/**\n * The global dialogs: one registry of what is open, so any surface (a kit, a command, code outside\n * React such as an API middleware) opens a dialog by kind, and the one `<ConnectedGlobalDialogs>`\n * mounted in the shell shows it. Each kind is open or not; an open kind holds the props it was\n * opened with. Opening a kind that is already open replaces its props.\n *\n * Kits reach it through the environment (`useBlocksEnvironment().openDialog`), which a host may\n * replace; code outside React calls `openDialog` / `closeDialog` here. Confirm and choice prompts\n * are promise-based instead (`./dialogs`).\n */\nimport { useSyncExternalStore } from 'react'\nimport type { components } from '@arbidocs/client'\nimport type { WorkflowLaunchRequest } from '../agents/workflows/launchRequest'\nimport type { QuotaExceededInfo } from '../connection/billing/ConnectedQuotaDialog'\n\ntype NotificationResponse = components['schemas']['NotificationResponse']\n\n/** Where files are added from: this device, links, or an email account. */\nexport type UploadSource = 'computer' | 'internet' | 'email'\n\n/** What `openShare` shares by email. */\nexport interface ShareRequest {\n resourceType: 'document' | 'conversation'\n resourceExtId: string\n workspaceExtId: string\n resourceName?: string\n /** Whether it is private to its owner now: the dialog offers to share it with the workspace. */\n isPrivate: boolean\n}\n\n/** The upload dialog: files or links already picked, one source, a folder to add them to. */\nexport interface UploadDialogProps {\n /** The tab it opens on (default `upload`). */\n tab?: 'upload' | 'status'\n files?: File[]\n urls?: string[]\n /** Only this source (from an \"Add\" menu). None: every source. */\n source?: UploadSource | null\n /** The folder the files go into. */\n folder?: string | null\n}\n\n/** The create-workspace dialog: in a project (locked to it), or the first-login welcome copy. */\nexport interface CreateWorkspaceDialogProps {\n projectId?: string | null\n variant?: 'default' | 'welcome'\n}\n\n/** Each global dialog, by kind, and the props it is opened with. */\nexport interface BlocksDialogProps {\n /** Personal support requests and their resolution. */\n support: { ticketId?: number }\n /** Add files (upload, links, email). */\n upload: UploadDialogProps\n /** A project's AI usage for the month is used up. */\n quota: QuotaExceededInfo\n /** The first-login snapshot for free users. */\n welcome: Record<string, never>\n /** Share a document or a thread by email. */\n share: ShareRequest\n createWorkspace: CreateWorkspaceDialogProps\n /** Export, copy or move the whole open workspace. */\n transfer: Record<string, never>\n /** Number the selected documents as a production set. */\n productionSet: Record<string, never>\n /** Invite people as contacts. */\n inviteContacts: Record<string, never>\n /** Review a workspace access request (its notification). */\n grantAccess: { notification: NotificationResponse }\n /** Browse, run and edit skills, optionally on one. */\n skillsBrowser: { skillSlug?: string }\n /** Start a workflow with some inputs preset (or at once, `autoStart`). */\n workflowLaunch: WorkflowLaunchRequest\n /** Sign out of this session or all of them. */\n logout: Record<string, never>\n /** Restore an archived workspace. */\n unarchiveWorkspace: { workspaceId: string }\n /** The caller's access to a workspace has expired (its link was opened): ask its owner to renew. */\n expiredWorkspaceAccess: { access: components['schemas']['WorkspaceAccessStatusResponse'] }\n /** The open conversation's settings. */\n conversationSettings: Record<string, never>\n /** Pick the open conversation's documents. */\n conversationDocuments: Record<string, never>\n}\n\nexport type BlocksDialogKind = keyof BlocksDialogProps\n\n/** The props argument: optional for a kind whose props are all optional. */\nexport type DialogPropsArg<K extends BlocksDialogKind> =\n Record<never, never> extends BlocksDialogProps[K]\n ? [props?: BlocksDialogProps[K]]\n : [props: BlocksDialogProps[K]]\n\ntype OpenDialogs = { readonly [K in BlocksDialogKind]?: BlocksDialogProps[K] }\n\nlet open: OpenDialogs = {}\nconst listeners = new Set<() => void>()\nconst promptCleanups = new Set<() => void>()\n\n/** Internal lifetime registration, including prompts that are fading out. */\nexport function registerPromptCleanup(cleanup: () => void): () => void {\n promptCleanups.add(cleanup)\n return () => {\n promptCleanups.delete(cleanup)\n }\n}\n\nfunction set(next: OpenDialogs) {\n open = next\n listeners.forEach((listener) => listener())\n}\n\n/** Open a dialog (replacing the props of one already open). */\nexport function openDialog<K extends BlocksDialogKind>(kind: K, ...[props]: DialogPropsArg<K>) {\n set({ ...open, [kind]: props ?? {} })\n}\n\n/** Close a dialog (nothing happens when it is not open). */\nexport function closeDialog(kind: BlocksDialogKind): void {\n if (!(kind in open)) return\n const next = { ...open }\n delete next[kind]\n set(next)\n}\n\n/** Close every dialog (signing out). */\nexport function closeAllDialogs(): void {\n for (const cleanup of promptCleanups) cleanup()\n if (Object.keys(open).length > 0) set({})\n}\n\n/** The props an open dialog was opened with, or `null` while it is closed. */\nexport function getDialog<K extends BlocksDialogKind>(kind: K): BlocksDialogProps[K] | null {\n return (open[kind] as BlocksDialogProps[K] | undefined) ?? null\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\n/** A dialog's props while it is open, `null` while closed; re-renders when it opens or closes. */\nexport function useDialogProps<K extends BlocksDialogKind>(kind: K): BlocksDialogProps[K] | null {\n const snapshot = () => getDialog(kind)\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n"],
5
- "mappings": ";AAUA,SAAS,4BAA4B;AAqFrC,IAAI,OAAoB,CAAC;AACzB,MAAM,YAAY,oBAAI,IAAgB;AACtC,MAAM,iBAAiB,oBAAI,IAAgB;AAGpC,SAAS,sBAAsB,SAAiC;AACrE,iBAAe,IAAI,OAAO;AAC1B,SAAO,MAAM;AACX,mBAAe,OAAO,OAAO;AAAA,EAC/B;AACF;AAEA,SAAS,IAAI,MAAmB;AAC9B,SAAO;AACP,YAAU,QAAQ,CAAC,aAAa,SAAS,CAAC;AAC5C;AAGO,SAAS,WAAuC,SAAY,CAAC,KAAK,GAAsB;AAC7F,MAAI,EAAE,GAAG,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;AACtC;AAGO,SAAS,YAAY,MAA8B;AACxD,MAAI,EAAE,QAAQ,MAAO;AACrB,QAAM,OAAO,EAAE,GAAG,KAAK;AACvB,SAAO,KAAK,IAAI;AAChB,MAAI,IAAI;AACV;AAGO,SAAS,kBAAwB;AACtC,aAAW,WAAW,eAAgB,SAAQ;AAC9C,MAAI,OAAO,KAAK,IAAI,EAAE,SAAS,EAAG,KAAI,CAAC,CAAC;AAC1C;AAGO,SAAS,UAAsC,MAAsC;AAC1F,SAAQ,KAAK,IAAI,KAA0C;AAC7D;AAEA,SAAS,UAAU,UAAsB;AACvC,YAAU,IAAI,QAAQ;AACtB,SAAO,MAAM,UAAU,OAAO,QAAQ;AACxC;AAGO,SAAS,eAA2C,MAAsC;AAC/F,QAAM,WAAW,MAAM,UAAU,IAAI;AACrC,SAAO,qBAAqB,WAAW,UAAU,QAAQ;AAC3D;",
4
+ "sourcesContent": ["/**\n * The global dialogs: one registry of what is open, so any surface (a kit, a command, code outside\n * React such as an API middleware) opens a dialog by kind, and the one `<ConnectedGlobalDialogs>`\n * mounted in the shell shows it. Each kind is open or not; an open kind holds the props it was\n * opened with. Opening a kind that is already open replaces its props.\n *\n * Kits reach it through the environment (`useBlocksEnvironment().openDialog`), which a host may\n * replace; code outside React calls `openDialog` / `closeDialog` here. Confirm and choice prompts\n * are promise-based instead (`./dialogs`).\n */\nimport { useSyncExternalStore } from 'react'\nimport type { components } from '@arbidocs/client'\nimport type { WorkflowLaunchRequest } from '../agents/workflows/launchRequest'\nimport type { QuotaExceededInfo } from '../connection/billing/ConnectedQuotaDialog'\n\ntype NotificationResponse = components['schemas']['NotificationResponse']\n\n/** Where files are added from: this device, links, or an email account. */\nexport type UploadSource = 'computer' | 'internet' | 'email'\n\n/** What `openShare` shares by email. */\nexport interface ShareRequest {\n resourceType: 'document' | 'conversation'\n resourceExtId: string\n workspaceExtId: string\n resourceName?: string\n /** Whether it is private to its owner now: the dialog offers to share it with the workspace. */\n isPrivate: boolean\n}\n\n/** The upload dialog: files or links already picked, one source, a folder to add them to. */\nexport interface UploadDialogProps {\n /** The tab it opens on (default `upload`). */\n tab?: 'upload' | 'status'\n files?: File[]\n urls?: string[]\n /** Only this source (from an \"Add\" menu). None: every source. */\n source?: UploadSource | null\n /** The folder the files go into. */\n folder?: string | null\n}\n\n/** The create-workspace dialog: in a project (locked to it), or the first-login welcome copy. */\nexport interface CreateWorkspaceDialogProps {\n projectId?: string | null\n variant?: 'default' | 'welcome'\n}\n\n/** Each global dialog, by kind, and the props it is opened with. */\nexport interface BlocksDialogProps {\n /** Personal support requests and their resolution. */\n support: { ticketId?: number }\n /** Add files (upload, links, email). */\n upload: UploadDialogProps\n /** A project's AI usage for the month is used up. */\n quota: QuotaExceededInfo\n /** The first-login snapshot for free users. */\n welcome: Record<string, never>\n /** Resume explicit approval of a paid project\u2019s spending limits. */\n subscriptionSetup: { projectId: string }\n /** Share a document or a thread by email. */\n share: ShareRequest\n createWorkspace: CreateWorkspaceDialogProps\n /** Export, copy or move the whole open workspace. */\n transfer: Record<string, never>\n /** Number the selected documents as a production set. */\n productionSet: Record<string, never>\n /** Invite people as contacts. */\n inviteContacts: Record<string, never>\n /** Review a workspace access request (its notification). */\n grantAccess: { notification: NotificationResponse }\n /** Browse, run and edit skills, optionally on one. */\n skillsBrowser: { skillSlug?: string }\n /** Start a workflow with some inputs preset (or at once, `autoStart`). */\n workflowLaunch: WorkflowLaunchRequest\n /** Sign out of this session or all of them. */\n logout: Record<string, never>\n /** Restore an archived workspace. */\n unarchiveWorkspace: { workspaceId: string }\n /** The caller's access to a workspace has expired (its link was opened): ask its owner to renew. */\n expiredWorkspaceAccess: { access: components['schemas']['WorkspaceAccessStatusResponse'] }\n /** The open conversation's settings. */\n conversationSettings: Record<string, never>\n /** Pick the open conversation's documents. */\n conversationDocuments: Record<string, never>\n}\n\nexport type BlocksDialogKind = keyof BlocksDialogProps\n\n/** The props argument: optional for a kind whose props are all optional. */\nexport type DialogPropsArg<K extends BlocksDialogKind> =\n Record<never, never> extends BlocksDialogProps[K]\n ? [props?: BlocksDialogProps[K]]\n : [props: BlocksDialogProps[K]]\n\ntype OpenDialogs = { readonly [K in BlocksDialogKind]?: BlocksDialogProps[K] }\n\nlet open: OpenDialogs = {}\nconst listeners = new Set<() => void>()\nconst promptCleanups = new Set<() => void>()\n\n/** Internal lifetime registration, including prompts that are fading out. */\nexport function registerPromptCleanup(cleanup: () => void): () => void {\n promptCleanups.add(cleanup)\n return () => {\n promptCleanups.delete(cleanup)\n }\n}\n\nfunction set(next: OpenDialogs) {\n open = next\n listeners.forEach((listener) => listener())\n}\n\n/** Open a dialog (replacing the props of one already open). */\nexport function openDialog<K extends BlocksDialogKind>(kind: K, ...[props]: DialogPropsArg<K>) {\n set({ ...open, [kind]: props ?? {} })\n}\n\n/** Close a dialog (nothing happens when it is not open). */\nexport function closeDialog(kind: BlocksDialogKind): void {\n if (!(kind in open)) return\n const next = { ...open }\n delete next[kind]\n set(next)\n}\n\n/** Close every dialog (signing out). */\nexport function closeAllDialogs(): void {\n for (const cleanup of promptCleanups) cleanup()\n if (Object.keys(open).length > 0) set({})\n}\n\n/** The props an open dialog was opened with, or `null` while it is closed. */\nexport function getDialog<K extends BlocksDialogKind>(kind: K): BlocksDialogProps[K] | null {\n return (open[kind] as BlocksDialogProps[K] | undefined) ?? null\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\n/** A dialog's props while it is open, `null` while closed; re-renders when it opens or closes. */\nexport function useDialogProps<K extends BlocksDialogKind>(kind: K): BlocksDialogProps[K] | null {\n const snapshot = () => getDialog(kind)\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n"],
5
+ "mappings": ";AAUA,SAAS,4BAA4B;AAuFrC,IAAI,OAAoB,CAAC;AACzB,MAAM,YAAY,oBAAI,IAAgB;AACtC,MAAM,iBAAiB,oBAAI,IAAgB;AAGpC,SAAS,sBAAsB,SAAiC;AACrE,iBAAe,IAAI,OAAO;AAC1B,SAAO,MAAM;AACX,mBAAe,OAAO,OAAO;AAAA,EAC/B;AACF;AAEA,SAAS,IAAI,MAAmB;AAC9B,SAAO;AACP,YAAU,QAAQ,CAAC,aAAa,SAAS,CAAC;AAC5C;AAGO,SAAS,WAAuC,SAAY,CAAC,KAAK,GAAsB;AAC7F,MAAI,EAAE,GAAG,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;AACtC;AAGO,SAAS,YAAY,MAA8B;AACxD,MAAI,EAAE,QAAQ,MAAO;AACrB,QAAM,OAAO,EAAE,GAAG,KAAK;AACvB,SAAO,KAAK,IAAI;AAChB,MAAI,IAAI;AACV;AAGO,SAAS,kBAAwB;AACtC,aAAW,WAAW,eAAgB,SAAQ;AAC9C,MAAI,OAAO,KAAK,IAAI,EAAE,SAAS,EAAG,KAAI,CAAC,CAAC;AAC1C;AAGO,SAAS,UAAsC,MAAsC;AAC1F,SAAQ,KAAK,IAAI,KAA0C;AAC7D;AAEA,SAAS,UAAU,UAAsB;AACvC,YAAU,IAAI,QAAQ;AACtB,SAAO,MAAM,UAAU,OAAO,QAAQ;AACxC;AAGO,SAAS,eAA2C,MAAsC;AAC/F,QAAM,WAAW,MAAM,UAAU,IAAI;AACrC,SAAO,qBAAqB,WAAW,UAAU,QAAQ;AAC3D;",
6
6
  "names": []
7
7
  }
@@ -3,10 +3,10 @@
3
3
 
4
4
  var chunkSRTSMA5K_cjs = require('../chunk-SRTSMA5K.cjs');
5
5
  var chunkNX56DIG3_cjs = require('../chunk-NX56DIG3.cjs');
6
- var chunkGNX3FBBX_cjs = require('../chunk-GNX3FBBX.cjs');
7
- require('../chunk-TKHCIHE2.cjs');
8
- require('../chunk-JDFBEGQO.cjs');
9
- require('../chunk-ULWRNGGE.cjs');
6
+ var chunkZM6B5WJW_cjs = require('../chunk-ZM6B5WJW.cjs');
7
+ require('../chunk-LIKDQBNJ.cjs');
8
+ require('../chunk-YZBDHBKI.cjs');
9
+ require('../chunk-CVPV4I7Z.cjs');
10
10
  require('../chunk-PLIF5CUV.cjs');
11
11
 
12
12
 
@@ -181,11 +181,11 @@ Object.defineProperty(exports, "stripMarkdownLinks", {
181
181
  });
182
182
  Object.defineProperty(exports, "DEFAULT_SEARCH_HIT_LABELS", {
183
183
  enumerable: true,
184
- get: function () { return chunkGNX3FBBX_cjs.DEFAULT_SEARCH_HIT_LABELS; }
184
+ get: function () { return chunkZM6B5WJW_cjs.DEFAULT_SEARCH_HIT_LABELS; }
185
185
  });
186
186
  Object.defineProperty(exports, "SearchHit", {
187
187
  enumerable: true,
188
- get: function () { return chunkGNX3FBBX_cjs.SearchHit; }
188
+ get: function () { return chunkZM6B5WJW_cjs.SearchHit; }
189
189
  });
190
190
  //# sourceMappingURL=index.cjs.map
191
191
  //# sourceMappingURL=index.cjs.map
@@ -19,7 +19,7 @@ export interface InvoiceRowView {
19
19
  date: string;
20
20
  /** Formatted amount, e.g. "$50.00". */
21
21
  amount: string;
22
- /** What the charge was for, e.g. "Plan", "Plan change", "Add-on". */
22
+ /** What the charge was for, e.g. "Plan", "Subscription change", "Add-on". */
23
23
  kind?: string;
24
24
  /** Secondary amount line, e.g. "£35 ex VAT". */
25
25
  amountNote?: string;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/settings/Billing.tsx"],
4
- "sourcesContent": ["import { useMemo, type ReactNode, type Ref } from 'react'\nimport { Check, ChevronDown, ChevronRight, FileText, Loader2, X } from 'lucide-react'\nimport {\n Badge,\n Button,\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n Input,\n} from '@arbidocs/react/ui'\n\n/** Every fixed string of the receipts dialog. */\nexport interface InvoicesDialogLabels {\n title: (projectName: string) => string\n description: (projectName: string) => string\n noReceipts: string\n paid: string\n}\n\nexport const DEFAULT_INVOICES_DIALOG_LABELS: InvoicesDialogLabels = {\n title: (projectName) => `Receipts \u00B7 ${projectName}`,\n description: (projectName) => `Receipts for ${projectName}`,\n noReceipts: 'No receipts yet.',\n paid: 'Paid',\n}\n\n/** Every fixed string of the daily-cap field. */\nexport interface DailyCapFieldLabels {\n noLimit: string\n ariaLabel: string\n unit: string\n save: string\n}\n\nexport const DEFAULT_DAILY_CAP_FIELD_LABELS: DailyCapFieldLabels = {\n noLimit: 'No limit',\n ariaLabel: 'Daily AI usage limit per collaborator (\u00A3)',\n unit: '\u00A3 / user / day',\n save: 'Save',\n}\n\nexport interface InvoiceRowView {\n key: string\n date: string\n /** Formatted amount, e.g. \"$50.00\". */\n amount: string\n /** What the charge was for, e.g. \"Plan\", \"Plan change\", \"Add-on\". */\n kind?: string\n /** Secondary amount line, e.g. \"\u00A335 ex VAT\". */\n amountNote?: string\n status: string\n isPaid: boolean\n /** Receipt (paid) or invoice (unpaid) link; omitted when none exists. */\n href?: string\n linkLabel?: string\n}\n\nexport interface InvoicesDialogProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n projectName: string\n isLoading: boolean\n invoices: InvoiceRowView[]\n labels?: Partial<InvoicesDialogLabels>\n}\n\n/** Receipts of a project: date, amount, status and a link to each. */\nexport function InvoicesDialog({\n open,\n onOpenChange,\n projectName,\n isLoading,\n invoices,\n labels,\n}: InvoicesDialogProps) {\n const l = useMemo(() => ({ ...DEFAULT_INVOICES_DIALOG_LABELS, ...labels }), [labels])\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent presentation=\"sheet\" className=\"max-w-lg\">\n <DialogHeader>\n <DialogTitle>{l.title(projectName)}</DialogTitle>\n <DialogDescription className=\"sr-only\">{l.description(projectName)}</DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-1\">\n {isLoading && (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 className=\"h-5 w-5 animate-spin text-muted-foreground\" />\n </div>\n )}\n {!isLoading && invoices.length === 0 && (\n <p className=\"py-4 text-center text-sm text-muted-foreground\">{l.noReceipts}</p>\n )}\n {!isLoading &&\n invoices.map((invoice) => (\n <div\n key={invoice.key}\n className=\"flex items-center justify-between border-b py-2 text-sm last:border-0\"\n >\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-0.5\">\n <span className=\"tabular-nums text-muted-foreground\">{invoice.date}</span>\n {invoice.kind && <span className=\"text-foreground\">{invoice.kind}</span>}\n <span className=\"font-medium tabular-nums\">{invoice.amount}</span>\n {invoice.amountNote && (\n <span className=\"text-xs tabular-nums text-muted-foreground\">\n {invoice.amountNote}\n </span>\n )}\n <Badge\n variant=\"outline\"\n className={cn(\n 'h-4 px-1.5 py-0 text-sm',\n invoice.isPaid && 'border-green-border text-green-text'\n )}\n >\n {invoice.isPaid ? l.paid : invoice.status}\n </Badge>\n </div>\n {invoice.href && (\n <a\n href={invoice.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground\"\n >\n {invoice.linkLabel} <FileText className=\"h-3 w-3\" />\n </a>\n )}\n </div>\n ))}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface DailyCapFieldProps {\n value: string\n onChange: (value: string) => void\n onSave?: () => void\n canSave?: boolean\n isSaving?: boolean\n labels?: Partial<DailyCapFieldLabels>\n}\n\n/** Per-collaborator daily AI usage cap (\u00A3) input; Enter or Save commits, empty means no limit. */\nexport function DailyCapField({\n value,\n onChange,\n onSave,\n canSave,\n isSaving,\n labels,\n}: DailyCapFieldProps) {\n const l = useMemo(() => ({ ...DEFAULT_DAILY_CAP_FIELD_LABELS, ...labels }), [labels])\n return (\n <div className=\"flex flex-wrap items-center gap-3\">\n <Input\n type=\"number\"\n min={0}\n step={0.01}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onSave?.()\n }}\n placeholder={l.noLimit}\n className=\"h-9 w-40\"\n aria-label={l.ariaLabel}\n disabled={isSaving}\n />\n <span className=\"text-sm text-muted-foreground\">{l.unit}</span>\n {onSave && (\n <Button size=\"sm\" className=\"h-9 px-4\" disabled={!canSave || isSaving} onClick={onSave}>\n {l.save}\n </Button>\n )}\n </div>\n )\n}\n"],
4
+ "sourcesContent": ["import { useMemo, type ReactNode, type Ref } from 'react'\nimport { Check, ChevronDown, ChevronRight, FileText, Loader2, X } from 'lucide-react'\nimport {\n Badge,\n Button,\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n Input,\n} from '@arbidocs/react/ui'\n\n/** Every fixed string of the receipts dialog. */\nexport interface InvoicesDialogLabels {\n title: (projectName: string) => string\n description: (projectName: string) => string\n noReceipts: string\n paid: string\n}\n\nexport const DEFAULT_INVOICES_DIALOG_LABELS: InvoicesDialogLabels = {\n title: (projectName) => `Receipts \u00B7 ${projectName}`,\n description: (projectName) => `Receipts for ${projectName}`,\n noReceipts: 'No receipts yet.',\n paid: 'Paid',\n}\n\n/** Every fixed string of the daily-cap field. */\nexport interface DailyCapFieldLabels {\n noLimit: string\n ariaLabel: string\n unit: string\n save: string\n}\n\nexport const DEFAULT_DAILY_CAP_FIELD_LABELS: DailyCapFieldLabels = {\n noLimit: 'No limit',\n ariaLabel: 'Daily AI usage limit per collaborator (\u00A3)',\n unit: '\u00A3 / user / day',\n save: 'Save',\n}\n\nexport interface InvoiceRowView {\n key: string\n date: string\n /** Formatted amount, e.g. \"$50.00\". */\n amount: string\n /** What the charge was for, e.g. \"Plan\", \"Subscription change\", \"Add-on\". */\n kind?: string\n /** Secondary amount line, e.g. \"\u00A335 ex VAT\". */\n amountNote?: string\n status: string\n isPaid: boolean\n /** Receipt (paid) or invoice (unpaid) link; omitted when none exists. */\n href?: string\n linkLabel?: string\n}\n\nexport interface InvoicesDialogProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n projectName: string\n isLoading: boolean\n invoices: InvoiceRowView[]\n labels?: Partial<InvoicesDialogLabels>\n}\n\n/** Receipts of a project: date, amount, status and a link to each. */\nexport function InvoicesDialog({\n open,\n onOpenChange,\n projectName,\n isLoading,\n invoices,\n labels,\n}: InvoicesDialogProps) {\n const l = useMemo(() => ({ ...DEFAULT_INVOICES_DIALOG_LABELS, ...labels }), [labels])\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent presentation=\"sheet\" className=\"max-w-lg\">\n <DialogHeader>\n <DialogTitle>{l.title(projectName)}</DialogTitle>\n <DialogDescription className=\"sr-only\">{l.description(projectName)}</DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-1\">\n {isLoading && (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 className=\"h-5 w-5 animate-spin text-muted-foreground\" />\n </div>\n )}\n {!isLoading && invoices.length === 0 && (\n <p className=\"py-4 text-center text-sm text-muted-foreground\">{l.noReceipts}</p>\n )}\n {!isLoading &&\n invoices.map((invoice) => (\n <div\n key={invoice.key}\n className=\"flex items-center justify-between border-b py-2 text-sm last:border-0\"\n >\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-0.5\">\n <span className=\"tabular-nums text-muted-foreground\">{invoice.date}</span>\n {invoice.kind && <span className=\"text-foreground\">{invoice.kind}</span>}\n <span className=\"font-medium tabular-nums\">{invoice.amount}</span>\n {invoice.amountNote && (\n <span className=\"text-xs tabular-nums text-muted-foreground\">\n {invoice.amountNote}\n </span>\n )}\n <Badge\n variant=\"outline\"\n className={cn(\n 'h-4 px-1.5 py-0 text-sm',\n invoice.isPaid && 'border-green-border text-green-text'\n )}\n >\n {invoice.isPaid ? l.paid : invoice.status}\n </Badge>\n </div>\n {invoice.href && (\n <a\n href={invoice.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground\"\n >\n {invoice.linkLabel} <FileText className=\"h-3 w-3\" />\n </a>\n )}\n </div>\n ))}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface DailyCapFieldProps {\n value: string\n onChange: (value: string) => void\n onSave?: () => void\n canSave?: boolean\n isSaving?: boolean\n labels?: Partial<DailyCapFieldLabels>\n}\n\n/** Per-collaborator daily AI usage cap (\u00A3) input; Enter or Save commits, empty means no limit. */\nexport function DailyCapField({\n value,\n onChange,\n onSave,\n canSave,\n isSaving,\n labels,\n}: DailyCapFieldProps) {\n const l = useMemo(() => ({ ...DEFAULT_DAILY_CAP_FIELD_LABELS, ...labels }), [labels])\n return (\n <div className=\"flex flex-wrap items-center gap-3\">\n <Input\n type=\"number\"\n min={0}\n step={0.01}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onSave?.()\n }}\n placeholder={l.noLimit}\n className=\"h-9 w-40\"\n aria-label={l.ariaLabel}\n disabled={isSaving}\n />\n <span className=\"text-sm text-muted-foreground\">{l.unit}</span>\n {onSave && (\n <Button size=\"sm\" className=\"h-9 px-4\" disabled={!canSave || isSaving} onClick={onSave}>\n {l.save}\n </Button>\n )}\n </div>\n )\n}\n"],
5
5
  "mappings": ";AAkFQ,SACE,KADF;AAlFR,SAAS,eAAyC;AAClD,SAA2C,UAAU,eAAkB;AACvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,MAAM,iCAAuD;AAAA,EAClE,OAAO,CAAC,gBAAgB,iBAAc,WAAW;AAAA,EACjD,aAAa,CAAC,gBAAgB,gBAAgB,WAAW;AAAA,EACzD,YAAY;AAAA,EACZ,MAAM;AACR;AAUO,MAAM,iCAAsD;AAAA,EACjE,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AACR;AA4BO,SAAS,eAAe;AAAA,EA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ACJ,WAAU;AAAA,gBAET;AAAA,0BAAQ;AAAA,kBAAU;AAAA,kBAAC,oBAAC,YAAS,WAAU,WAAU;AAAA;AAAA;AAAA,YACpD;AAAA;AAAA;AAAA,QA9BG,QAAQ;AAAA,MAgCf,CACD;AAAA,OACL;AAAA,KACF,GACF;AAEJ;AAYO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,IAAI,QAAQ,OAAO,EAAE,GAAG,gCAAgC,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC;AACpF,SACE,qBAAC,SAAI,WAAU,qCACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,KAAK;AAAA,QACL,MAAM;AAAA,QACN;AAAA,QACA,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK;AAAA,QACxC,WAAW,CAAC,MAAM;AAChB,cAAI,EAAE,QAAQ,QAAS,UAAS;AAAA,QAClC;AAAA,QACA,aAAa,EAAE;AAAA,QACf,WAAU;AAAA,QACV,cAAY,EAAE;AAAA,QACd,UAAU;AAAA;AAAA,IACZ;AAAA,IACA,oBAAC,UAAK,WAAU,iCAAiC,YAAE,MAAK;AAAA,IACvD,UACC,oBAAC,UAAO,MAAK,MAAK,WAAU,YAAW,UAAU,CAAC,WAAW,UAAU,SAAS,QAC7E,YAAE,MACL;AAAA,KAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -9,8 +9,8 @@ const DEFAULT_IDENTITY_VERIFICATION_LABELS = {
9
9
  title: "Identity verification",
10
10
  intro: "Check your ID once to get a verified tick next to your name.",
11
11
  priceLine: (price, attempts) => `${price} \xB7 ${attempts} attempts`,
12
- proOnly: "Available on Pro plans.",
13
- seePlans: "See plans",
12
+ proOnly: "Available on Pro subscriptions.",
13
+ seePlans: "See subscriptions",
14
14
  manageBilling: "Manage billing",
15
15
  verify: "Verify identity",
16
16
  continue: "Continue",
@@ -22,7 +22,7 @@ const DEFAULT_IDENTITY_VERIFICATION_LABELS = {
22
22
  finish: "Finish",
23
23
  remove: "Remove",
24
24
  payTitle: "Verify your identity",
25
- payBody: (price, attempts) => `A one-time fee of ${price} is charged to the card on your Pro plan. It covers up to ${attempts} attempts. Your ID is checked by our provider, Didit; ARBI does not keep your document.`,
25
+ payBody: (price, attempts) => `A one-time fee of ${price} is charged to the card on your Pro subscription. It covers up to ${attempts} attempts. Your ID is checked by our provider, Didit; ARBI does not keep your document.`,
26
26
  pay: "Pay and continue",
27
27
  confirmPayment: "Confirm payment with your bank",
28
28
  paymentConfirmed: "I\u2019ve confirmed it",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/settings/IdentityVerification.tsx"],
4
- "sourcesContent": ["/**\n * Identity verification blocks: the settings card, the dialog (pay \u2192 verify in Didit's frame \u2192\n * result) and a gate for deployments that require it. All take the `IdentityVerificationFlow` from\n * `@arbidocs/react` (`useIdentityVerification` with a provider, or `useIdentityVerificationFlow`\n * bound to a host's own API), so they work the same inside ARBI and on a customer's site.\n */\nimport { useMemo, type ReactNode } from 'react'\nimport { ExternalLink, Loader2, ShieldCheck } from 'lucide-react'\nimport { Button, VerifiedBadge, type IdentityVerificationFlow } from '@arbidocs/react/ui'\nimport { ModalScaffold } from './ModalScaffold'\nimport { SettingsCard, SettingsDisclosure, SettingsRow } from './SettingsPanel'\n\n/** Every fixed string of the identity verification blocks. */\nexport interface IdentityVerificationLabels {\n title: string\n intro: string\n /** \"\u00A35.00 incl. VAT \u00B7 3 attempts\" (`price` comes formatted, VAT note included). */\n priceLine: (price: string, attempts: number) => string\n proOnly: string\n seePlans: string\n manageBilling: string\n verify: string\n continue: string\n attemptsLeft: (n: number) => string\n verified: string\n verifiedDetail: (country: string) => string\n inReview: string\n finishName: string\n finish: string\n remove: string\n payTitle: string\n payBody: (price: string, attempts: number) => string\n pay: string\n confirmPayment: string\n paymentConfirmed: string\n verifyTitle: string\n embedFailed: string\n openInNewTab: string\n checkResult: string\n resultVerified: string\n resultDeclined: (attemptsLeft: number) => string\n tryAgain: string\n resultInReview: string\n nameMismatchTitle: string\n nameMismatchBody: string\n documentName: string\n accountName: string\n useDocumentName: (name: string) => string\n keepName: string\n close: string\n}\n\nexport const DEFAULT_IDENTITY_VERIFICATION_LABELS: IdentityVerificationLabels = {\n title: 'Identity verification',\n intro: 'Check your ID once to get a verified tick next to your name.',\n priceLine: (price, attempts) => `${price} \u00B7 ${attempts} attempts`,\n proOnly: 'Available on Pro plans.',\n seePlans: 'See plans',\n manageBilling: 'Manage billing',\n verify: 'Verify identity',\n continue: 'Continue',\n attemptsLeft: (n) => `${n} attempt${n === 1 ? '' : 's'} left`,\n verified: 'Verified',\n verifiedDetail: (country) => `ID issued in ${country}`,\n inReview: 'Your check is being reviewed. We\u2019ll update this when it\u2019s done.',\n finishName: 'Your ID was verified. Confirm your name to get the tick.',\n finish: 'Finish',\n remove: 'Remove',\n payTitle: 'Verify your identity',\n payBody: (price, attempts) =>\n `A one-time fee of ${price} is charged to the card on your Pro plan. It covers up to ${attempts} attempts. Your ID is checked by our provider, Didit; ARBI does not keep your document.`,\n pay: 'Pay and continue',\n confirmPayment: 'Confirm payment with your bank',\n paymentConfirmed: 'I\u2019ve confirmed it',\n verifyTitle: 'Scan your ID',\n embedFailed: 'Your camera isn\u2019t available here. Continue in a new tab, then come back.',\n openInNewTab: 'Open in a new tab',\n checkResult: 'I\u2019ve finished',\n resultVerified: 'You\u2019re verified. The tick now shows next to your name.',\n resultDeclined: (n) =>\n n > 0\n ? `We couldn\u2019t verify your ID. You have ${n} attempt${n === 1 ? '' : 's'} left.`\n : 'We couldn\u2019t verify your ID and no attempts are left.',\n tryAgain: 'Try again',\n resultInReview: 'Your check needs a manual review. We\u2019ll show the result here when it\u2019s done.',\n nameMismatchTitle: 'Your ID was verified',\n nameMismatchBody:\n 'The name on your ID differs from your account name. The tick shows only with the name on your ID.',\n documentName: 'Name on your ID',\n accountName: 'Account name',\n useDocumentName: (name) => `Change my name to ${name}`,\n keepName: 'Keep my name',\n close: 'Close',\n}\n\nfunction useLabels(labels?: Partial<IdentityVerificationLabels>) {\n return useMemo(() => ({ ...DEFAULT_IDENTITY_VERIFICATION_LABELS, ...labels }), [labels])\n}\n\n/** Refusals the user fixes in billing (plan, card, address). */\nconst BILLING_CODES = [\n 'PRO_REQUIRED',\n 'PAYMENT_METHOD_REQUIRED',\n 'BILLING_ADDRESS_REQUIRED',\n 'PAYMENT_DECLINED',\n]\n\nfunction Problem({\n flow,\n onManageBilling,\n label,\n}: {\n flow: IdentityVerificationFlow\n onManageBilling?: () => void\n label: string\n}) {\n if (!flow.problem) return null\n const billing = onManageBilling && BILLING_CODES.includes(flow.problem.code ?? '')\n return (\n <div className=\"flex flex-wrap items-center gap-2\" data-testid=\"identity-problem\">\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {flow.problem.message}\n </p>\n {billing && (\n <Button size=\"sm\" variant=\"outline\" onClick={onManageBilling}>\n {label}\n </Button>\n )}\n </div>\n )\n}\n\n// \u2500\u2500 Card \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface IdentityVerificationCardProps {\n /** Secondary account settings start closed; payment and verification remain explicit actions. */\n collapsible?: boolean\n flow: IdentityVerificationFlow\n /** Open the host's plans / billing (upgrade to Pro, fix the card or address). */\n onManageBilling?: () => void\n labels?: Partial<IdentityVerificationLabels>\n}\n\n/** Settings row for the ID check: offer, progress, or the tick. Renders nothing when not offered. */\nexport function IdentityVerificationCard({\n collapsible = false,\n flow,\n onManageBilling,\n labels,\n}: IdentityVerificationCardProps) {\n const l = useLabels(labels)\n const { status } = flow\n if (!status?.enabled) return null\n const busy = flow.busy !== null\n\n let description: ReactNode\n let action: ReactNode = null\n if (status.verified) {\n description = (\n <span className=\"inline-flex items-center gap-1.5\">\n <VerifiedBadge />\n {l.verified}\n {status.document_country && (\n <span className=\"text-muted-foreground\">\n {' \u00B7 '}\n {l.verifiedDetail(status.document_country)}\n </span>\n )}\n </span>\n )\n action = (\n <Button size=\"sm\" variant=\"ghost\" onClick={flow.remove} disabled={busy}>\n {l.remove}\n </Button>\n )\n } else if (!status.eligible) {\n description = `${l.intro} ${l.proOnly}`\n action = onManageBilling ? (\n <Button size=\"sm\" variant=\"outline\" onClick={onManageBilling}>\n {l.seePlans}\n </Button>\n ) : null\n } else if (status.state === 'in_review') {\n description = l.inReview\n } else if (status.state === 'name_mismatch') {\n description = l.finishName\n action = (\n <Button size=\"sm\" onClick={flow.open}>\n {l.finish}\n </Button>\n )\n } else {\n const resuming = status.attempts_left > 0 || status.state === 'in_progress'\n description = (\n <>\n {l.intro}{' '}\n <span className=\"text-muted-foreground\">\n {resuming\n ? l.attemptsLeft(status.attempts_left)\n : l.priceLine(flow.price ?? '', status.attempts_per_fee)}\n </span>\n </>\n )\n action = (\n <Button size=\"sm\" onClick={flow.open} disabled={busy}>\n <ShieldCheck className=\"mr-1 h-4 w-4\" />\n {resuming ? l.continue : l.verify}\n </Button>\n )\n }\n\n const card = (\n <SettingsCard padding=\"sm\" data-testid=\"identity-verification-card\">\n <SettingsRow label={collapsible ? null : l.title} description={description}>\n {action}\n </SettingsRow>\n {!flow.isOpen && (\n <Problem flow={flow} onManageBilling={onManageBilling} label={l.manageBilling} />\n )}\n </SettingsCard>\n )\n return collapsible ? (\n <SettingsDisclosure title={l.title} testId=\"identity-verification-settings\">\n {card}\n </SettingsDisclosure>\n ) : (\n card\n )\n}\n\n// \u2500\u2500 Dialog \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface IdentityVerificationDialogProps {\n flow: IdentityVerificationFlow\n /** The account name as shown, compared with the name on the document. */\n accountName: string\n /** Allow closing; false blocks it. Default true. */\n dismissible?: boolean\n /** Open the host's billing to fix a refused payment (plan, card, address). */\n onManageBilling?: () => void\n labels?: Partial<IdentityVerificationLabels>\n}\n\n/** The verification dialog: pay the fee, verify in Didit's embedded frame, then the result. */\nexport function IdentityVerificationDialog({\n flow,\n accountName,\n dismissible = true,\n onManageBilling,\n labels,\n}: IdentityVerificationDialogProps) {\n const l = useLabels(labels)\n const { status } = flow\n const attempts = status?.attempts_per_fee ?? 0\n const docName = [status?.document_given_name, status?.document_family_name]\n .filter(Boolean)\n .join(' ')\n const spinner = <Loader2 className=\"mr-1 h-4 w-4 animate-spin\" />\n\n let body: ReactNode\n let footer: ReactNode = null\n if (flow.step === 'pay') {\n body = flow.paymentUrl ? (\n <a\n href={flow.paymentUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline\"\n >\n {l.confirmPayment}\n <ExternalLink className=\"h-3.5 w-3.5\" />\n </a>\n ) : (\n <p className=\"text-sm text-muted-foreground\">{l.payBody(flow.price ?? '', attempts)}</p>\n )\n footer = flow.paymentUrl ? (\n <Button onClick={flow.recheckPayment} disabled={flow.busy !== null}>\n {flow.busy === 'start' && spinner}\n {l.paymentConfirmed}\n </Button>\n ) : (\n <Button onClick={flow.pay} disabled={flow.busy !== null} data-testid=\"identity-pay\">\n {flow.busy === 'pay' && spinner}\n {l.pay}\n </Button>\n )\n } else if (flow.step === 'verify') {\n body = (\n <div className=\"space-y-3\">\n {flow.embedFailed ? (\n <p className=\"text-sm text-muted-foreground\">{l.embedFailed}</p>\n ) : (\n <div\n id={flow.verifyContainerId}\n ref={flow.verifyContainerRef}\n className=\"h-[560px] w-full overflow-hidden rounded-md bg-muted\"\n data-testid=\"identity-didit-frame\"\n >\n {flow.busy === 'start' && (\n <div className=\"flex h-full items-center justify-center\">\n <Loader2 className=\"h-6 w-6 animate-spin text-muted-foreground\" />\n </div>\n )}\n </div>\n )}\n </div>\n )\n footer = (\n <>\n {flow.embedFailed && (\n <Button variant=\"outline\" onClick={flow.openInNewTab}>\n <ExternalLink className=\"mr-1 h-4 w-4\" />\n {l.openInNewTab}\n </Button>\n )}\n <Button variant=\"ghost\" onClick={flow.checkResult} disabled={flow.busy !== null}>\n {flow.busy === 'refresh' && spinner}\n {l.checkResult}\n </Button>\n </>\n )\n } else if (status?.state === 'name_mismatch') {\n body = (\n <div className=\"space-y-3\" data-testid=\"identity-name-mismatch\">\n <p className=\"text-sm text-muted-foreground\">{l.nameMismatchBody}</p>\n <dl className=\"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm\">\n <dt className=\"text-muted-foreground\">{l.documentName}</dt>\n <dd className=\"font-medium\">{docName}</dd>\n <dt className=\"text-muted-foreground\">{l.accountName}</dt>\n <dd>{accountName}</dd>\n </dl>\n </div>\n )\n footer = (\n <>\n <Button variant=\"ghost\" onClick={flow.keepName} disabled={flow.busy !== null}>\n {l.keepName}\n </Button>\n <Button onClick={flow.acceptName} disabled={flow.busy !== null || !docName}>\n {flow.busy === 'accept' && spinner}\n {l.useDocumentName(docName)}\n </Button>\n </>\n )\n } else if (status?.verified) {\n body = (\n <p className=\"flex items-center gap-2 text-sm\">\n <VerifiedBadge className=\"h-4 w-4\" />\n {l.resultVerified}\n </p>\n )\n footer = <Button onClick={flow.close}>{l.close}</Button>\n } else if (status?.state === 'in_review') {\n body = <p className=\"text-sm text-muted-foreground\">{l.resultInReview}</p>\n footer = <Button onClick={flow.close}>{l.close}</Button>\n } else {\n const left = status?.attempts_left ?? 0\n body = <p className=\"text-sm text-muted-foreground\">{l.resultDeclined(left)}</p>\n footer =\n left > 0 ? (\n <Button onClick={flow.retry} disabled={flow.busy !== null}>\n {l.tryAgain}\n </Button>\n ) : (\n <Button onClick={flow.close}>{l.close}</Button>\n )\n }\n\n const title =\n status?.state === 'name_mismatch' && flow.step === 'result'\n ? l.nameMismatchTitle\n : flow.step === 'verify'\n ? l.verifyTitle\n : l.payTitle\n return (\n <ModalScaffold\n open={flow.isOpen}\n onOpenChange={(open) => (open ? flow.open() : flow.close())}\n title={title}\n icon={<ShieldCheck className=\"h-5 w-5\" />}\n size={flow.step === 'verify' ? 'lg' : 'md'}\n dismissible={dismissible}\n testId=\"identity-verification-dialog\"\n >\n <ModalScaffold.Body>\n {body}\n <Problem flow={flow} onManageBilling={onManageBilling} label={l.manageBilling} />\n </ModalScaffold.Body>\n <ModalScaffold.Footer>{footer}</ModalScaffold.Footer>\n </ModalScaffold>\n )\n}\n"],
5
- "mappings": ";AAuHI,SA2EE,UA1EA,KADF;AAjHJ,SAAS,eAA+B;AACxC,SAAS,cAAc,SAAS,mBAAmB;AACnD,SAAS,QAAQ,qBAAoD;AACrE,SAAS,qBAAqB;AAC9B,SAAS,cAAc,oBAAoB,mBAAmB;AA0CvD,MAAM,uCAAmE;AAAA,EAC9E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW,CAAC,OAAO,aAAa,GAAG,KAAK,SAAM,QAAQ;AAAA,EACtD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc,CAAC,MAAM,GAAG,CAAC,WAAW,MAAM,IAAI,KAAK,GAAG;AAAA,EACtD,UAAU;AAAA,EACV,gBAAgB,CAAC,Y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: the settings card, the dialog (pay \u2192 verify in Didit's frame \u2192\n * result) and a gate for deployments that require it. All take the `IdentityVerificationFlow` from\n * `@arbidocs/react` (`useIdentityVerification` with a provider, or `useIdentityVerificationFlow`\n * bound to a host's own API), so they work the same inside ARBI and on a customer's site.\n */\nimport { useMemo, type ReactNode } from 'react'\nimport { ExternalLink, Loader2, ShieldCheck } from 'lucide-react'\nimport { Button, VerifiedBadge, type IdentityVerificationFlow } from '@arbidocs/react/ui'\nimport { ModalScaffold } from './ModalScaffold'\nimport { SettingsCard, SettingsDisclosure, SettingsRow } from './SettingsPanel'\n\n/** Every fixed string of the identity verification blocks. */\nexport interface IdentityVerificationLabels {\n title: string\n intro: string\n /** \"\u00A35.00 incl. VAT \u00B7 3 attempts\" (`price` comes formatted, VAT note included). */\n priceLine: (price: string, attempts: number) => string\n proOnly: string\n seePlans: string\n manageBilling: string\n verify: string\n continue: string\n attemptsLeft: (n: number) => string\n verified: string\n verifiedDetail: (country: string) => string\n inReview: string\n finishName: string\n finish: string\n remove: string\n payTitle: string\n payBody: (price: string, attempts: number) => string\n pay: string\n confirmPayment: string\n paymentConfirmed: string\n verifyTitle: string\n embedFailed: string\n openInNewTab: string\n checkResult: string\n resultVerified: string\n resultDeclined: (attemptsLeft: number) => string\n tryAgain: string\n resultInReview: string\n nameMismatchTitle: string\n nameMismatchBody: string\n documentName: string\n accountName: string\n useDocumentName: (name: string) => string\n keepName: string\n close: string\n}\n\nexport const DEFAULT_IDENTITY_VERIFICATION_LABELS: IdentityVerificationLabels = {\n title: 'Identity verification',\n intro: 'Check your ID once to get a verified tick next to your name.',\n priceLine: (price, attempts) => `${price} \u00B7 ${attempts} attempts`,\n proOnly: 'Available on Pro subscriptions.',\n seePlans: 'See subscriptions',\n manageBilling: 'Manage billing',\n verify: 'Verify identity',\n continue: 'Continue',\n attemptsLeft: (n) => `${n} attempt${n === 1 ? '' : 's'} left`,\n verified: 'Verified',\n verifiedDetail: (country) => `ID issued in ${country}`,\n inReview: 'Your check is being reviewed. We\u2019ll update this when it\u2019s done.',\n finishName: 'Your ID was verified. Confirm your name to get the tick.',\n finish: 'Finish',\n remove: 'Remove',\n payTitle: 'Verify your identity',\n payBody: (price, attempts) =>\n `A one-time fee of ${price} is charged to the card on your Pro subscription. It covers up to ${attempts} attempts. Your ID is checked by our provider, Didit; ARBI does not keep your document.`,\n pay: 'Pay and continue',\n confirmPayment: 'Confirm payment with your bank',\n paymentConfirmed: 'I\u2019ve confirmed it',\n verifyTitle: 'Scan your ID',\n embedFailed: 'Your camera isn\u2019t available here. Continue in a new tab, then come back.',\n openInNewTab: 'Open in a new tab',\n checkResult: 'I\u2019ve finished',\n resultVerified: 'You\u2019re verified. The tick now shows next to your name.',\n resultDeclined: (n) =>\n n > 0\n ? `We couldn\u2019t verify your ID. You have ${n} attempt${n === 1 ? '' : 's'} left.`\n : 'We couldn\u2019t verify your ID and no attempts are left.',\n tryAgain: 'Try again',\n resultInReview: 'Your check needs a manual review. We\u2019ll show the result here when it\u2019s done.',\n nameMismatchTitle: 'Your ID was verified',\n nameMismatchBody:\n 'The name on your ID differs from your account name. The tick shows only with the name on your ID.',\n documentName: 'Name on your ID',\n accountName: 'Account name',\n useDocumentName: (name) => `Change my name to ${name}`,\n keepName: 'Keep my name',\n close: 'Close',\n}\n\nfunction useLabels(labels?: Partial<IdentityVerificationLabels>) {\n return useMemo(() => ({ ...DEFAULT_IDENTITY_VERIFICATION_LABELS, ...labels }), [labels])\n}\n\n/** Refusals the user fixes in billing (plan, card, address). */\nconst BILLING_CODES = [\n 'PRO_REQUIRED',\n 'PAYMENT_METHOD_REQUIRED',\n 'BILLING_ADDRESS_REQUIRED',\n 'PAYMENT_DECLINED',\n]\n\nfunction Problem({\n flow,\n onManageBilling,\n label,\n}: {\n flow: IdentityVerificationFlow\n onManageBilling?: () => void\n label: string\n}) {\n if (!flow.problem) return null\n const billing = onManageBilling && BILLING_CODES.includes(flow.problem.code ?? '')\n return (\n <div className=\"flex flex-wrap items-center gap-2\" data-testid=\"identity-problem\">\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {flow.problem.message}\n </p>\n {billing && (\n <Button size=\"sm\" variant=\"outline\" onClick={onManageBilling}>\n {label}\n </Button>\n )}\n </div>\n )\n}\n\n// \u2500\u2500 Card \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface IdentityVerificationCardProps {\n /** Secondary account settings start closed; payment and verification remain explicit actions. */\n collapsible?: boolean\n flow: IdentityVerificationFlow\n /** Open the host's plans / billing (upgrade to Pro, fix the card or address). */\n onManageBilling?: () => void\n labels?: Partial<IdentityVerificationLabels>\n}\n\n/** Settings row for the ID check: offer, progress, or the tick. Renders nothing when not offered. */\nexport function IdentityVerificationCard({\n collapsible = false,\n flow,\n onManageBilling,\n labels,\n}: IdentityVerificationCardProps) {\n const l = useLabels(labels)\n const { status } = flow\n if (!status?.enabled) return null\n const busy = flow.busy !== null\n\n let description: ReactNode\n let action: ReactNode = null\n if (status.verified) {\n description = (\n <span className=\"inline-flex items-center gap-1.5\">\n <VerifiedBadge />\n {l.verified}\n {status.document_country && (\n <span className=\"text-muted-foreground\">\n {' \u00B7 '}\n {l.verifiedDetail(status.document_country)}\n </span>\n )}\n </span>\n )\n action = (\n <Button size=\"sm\" variant=\"ghost\" onClick={flow.remove} disabled={busy}>\n {l.remove}\n </Button>\n )\n } else if (!status.eligible) {\n description = `${l.intro} ${l.proOnly}`\n action = onManageBilling ? (\n <Button size=\"sm\" variant=\"outline\" onClick={onManageBilling}>\n {l.seePlans}\n </Button>\n ) : null\n } else if (status.state === 'in_review') {\n description = l.inReview\n } else if (status.state === 'name_mismatch') {\n description = l.finishName\n action = (\n <Button size=\"sm\" onClick={flow.open}>\n {l.finish}\n </Button>\n )\n } else {\n const resuming = status.attempts_left > 0 || status.state === 'in_progress'\n description = (\n <>\n {l.intro}{' '}\n <span className=\"text-muted-foreground\">\n {resuming\n ? l.attemptsLeft(status.attempts_left)\n : l.priceLine(flow.price ?? '', status.attempts_per_fee)}\n </span>\n </>\n )\n action = (\n <Button size=\"sm\" onClick={flow.open} disabled={busy}>\n <ShieldCheck className=\"mr-1 h-4 w-4\" />\n {resuming ? l.continue : l.verify}\n </Button>\n )\n }\n\n const card = (\n <SettingsCard padding=\"sm\" data-testid=\"identity-verification-card\">\n <SettingsRow label={collapsible ? null : l.title} description={description}>\n {action}\n </SettingsRow>\n {!flow.isOpen && (\n <Problem flow={flow} onManageBilling={onManageBilling} label={l.manageBilling} />\n )}\n </SettingsCard>\n )\n return collapsible ? (\n <SettingsDisclosure title={l.title} testId=\"identity-verification-settings\">\n {card}\n </SettingsDisclosure>\n ) : (\n card\n )\n}\n\n// \u2500\u2500 Dialog \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface IdentityVerificationDialogProps {\n flow: IdentityVerificationFlow\n /** The account name as shown, compared with the name on the document. */\n accountName: string\n /** Allow closing; false blocks it. Default true. */\n dismissible?: boolean\n /** Open the host's billing to fix a refused payment (plan, card, address). */\n onManageBilling?: () => void\n labels?: Partial<IdentityVerificationLabels>\n}\n\n/** The verification dialog: pay the fee, verify in Didit's embedded frame, then the result. */\nexport function IdentityVerificationDialog({\n flow,\n accountName,\n dismissible = true,\n onManageBilling,\n labels,\n}: IdentityVerificationDialogProps) {\n const l = useLabels(labels)\n const { status } = flow\n const attempts = status?.attempts_per_fee ?? 0\n const docName = [status?.document_given_name, status?.document_family_name]\n .filter(Boolean)\n .join(' ')\n const spinner = <Loader2 className=\"mr-1 h-4 w-4 animate-spin\" />\n\n let body: ReactNode\n let footer: ReactNode = null\n if (flow.step === 'pay') {\n body = flow.paymentUrl ? (\n <a\n href={flow.paymentUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline\"\n >\n {l.confirmPayment}\n <ExternalLink className=\"h-3.5 w-3.5\" />\n </a>\n ) : (\n <p className=\"text-sm text-muted-foreground\">{l.payBody(flow.price ?? '', attempts)}</p>\n )\n footer = flow.paymentUrl ? (\n <Button onClick={flow.recheckPayment} disabled={flow.busy !== null}>\n {flow.busy === 'start' && spinner}\n {l.paymentConfirmed}\n </Button>\n ) : (\n <Button onClick={flow.pay} disabled={flow.busy !== null} data-testid=\"identity-pay\">\n {flow.busy === 'pay' && spinner}\n {l.pay}\n </Button>\n )\n } else if (flow.step === 'verify') {\n body = (\n <div className=\"space-y-3\">\n {flow.embedFailed ? (\n <p className=\"text-sm text-muted-foreground\">{l.embedFailed}</p>\n ) : (\n <div\n id={flow.verifyContainerId}\n ref={flow.verifyContainerRef}\n className=\"h-[560px] w-full overflow-hidden rounded-md bg-muted\"\n data-testid=\"identity-didit-frame\"\n >\n {flow.busy === 'start' && (\n <div className=\"flex h-full items-center justify-center\">\n <Loader2 className=\"h-6 w-6 animate-spin text-muted-foreground\" />\n </div>\n )}\n </div>\n )}\n </div>\n )\n footer = (\n <>\n {flow.embedFailed && (\n <Button variant=\"outline\" onClick={flow.openInNewTab}>\n <ExternalLink className=\"mr-1 h-4 w-4\" />\n {l.openInNewTab}\n </Button>\n )}\n <Button variant=\"ghost\" onClick={flow.checkResult} disabled={flow.busy !== null}>\n {flow.busy === 'refresh' && spinner}\n {l.checkResult}\n </Button>\n </>\n )\n } else if (status?.state === 'name_mismatch') {\n body = (\n <div className=\"space-y-3\" data-testid=\"identity-name-mismatch\">\n <p className=\"text-sm text-muted-foreground\">{l.nameMismatchBody}</p>\n <dl className=\"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm\">\n <dt className=\"text-muted-foreground\">{l.documentName}</dt>\n <dd className=\"font-medium\">{docName}</dd>\n <dt className=\"text-muted-foreground\">{l.accountName}</dt>\n <dd>{accountName}</dd>\n </dl>\n </div>\n )\n footer = (\n <>\n <Button variant=\"ghost\" onClick={flow.keepName} disabled={flow.busy !== null}>\n {l.keepName}\n </Button>\n <Button onClick={flow.acceptName} disabled={flow.busy !== null || !docName}>\n {flow.busy === 'accept' && spinner}\n {l.useDocumentName(docName)}\n </Button>\n </>\n )\n } else if (status?.verified) {\n body = (\n <p className=\"flex items-center gap-2 text-sm\">\n <VerifiedBadge className=\"h-4 w-4\" />\n {l.resultVerified}\n </p>\n )\n footer = <Button onClick={flow.close}>{l.close}</Button>\n } else if (status?.state === 'in_review') {\n body = <p className=\"text-sm text-muted-foreground\">{l.resultInReview}</p>\n footer = <Button onClick={flow.close}>{l.close}</Button>\n } else {\n const left = status?.attempts_left ?? 0\n body = <p className=\"text-sm text-muted-foreground\">{l.resultDeclined(left)}</p>\n footer =\n left > 0 ? (\n <Button onClick={flow.retry} disabled={flow.busy !== null}>\n {l.tryAgain}\n </Button>\n ) : (\n <Button onClick={flow.close}>{l.close}</Button>\n )\n }\n\n const title =\n status?.state === 'name_mismatch' && flow.step === 'result'\n ? l.nameMismatchTitle\n : flow.step === 'verify'\n ? l.verifyTitle\n : l.payTitle\n return (\n <ModalScaffold\n open={flow.isOpen}\n onOpenChange={(open) => (open ? flow.open() : flow.close())}\n title={title}\n icon={<ShieldCheck className=\"h-5 w-5\" />}\n size={flow.step === 'verify' ? 'lg' : 'md'}\n dismissible={dismissible}\n testId=\"identity-verification-dialog\"\n >\n <ModalScaffold.Body>\n {body}\n <Problem flow={flow} onManageBilling={onManageBilling} label={l.manageBilling} />\n </ModalScaffold.Body>\n <ModalScaffold.Footer>{footer}</ModalScaffold.Footer>\n </ModalScaffold>\n )\n}\n"],
5
+ "mappings": ";AAuHI,SA2EE,UA1EA,KADF;AAjHJ,SAAS,eAA+B;AACxC,SAAS,cAAc,SAAS,mBAAmB;AACnD,SAAS,QAAQ,qBAAoD;AACrE,SAAS,qBAAqB;AAC9B,SAAS,cAAc,oBAAoB,mBAAmB;AA0CvD,MAAM,uCAAmE;AAAA,EAC9E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW,CAAC,OAAO,aAAa,GAAG,KAAK,SAAM,QAAQ;AAAA,EACtD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc,CAAC,MAAM,GAAG,CAAC,WAAW,MAAM,IAAI,KAAK,GAAG;AAAA,EACtD,UAAU;AAAA,EACV,gBAAgB,CAAC,YAAY,gBAAgB,OAAO;AAAA,EACpD,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS,CAAC,OAAO,aACf,qBAAqB,KAAK,qEAAqE,QAAQ;AAAA,EACzG,KAAK;AAAA,EACL,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,cAAc;AAAA,EACd,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,gBAAgB,CAAC,MACf,IAAI,IACA,6CAAwC,CAAC,WAAW,MAAM,IAAI,KAAK,GAAG,WACtE;AAAA,EACN,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,kBACE;AAAA,EACF,cAAc;AAAA,EACd,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ACE,OAAO,IACL,oBAAC,UAAO,SAAS,KAAK,OAAO,UAAU,KAAK,SAAS,MAClD,YAAE,UACL,IAEA,oBAAC,UAAO,SAAS,KAAK,OAAQ,YAAE,OAAM;AAAA,EAE5C;AAEA,QAAM,QACJ,QAAQ,UAAU,mBAAmB,KAAK,SAAS,WAC/C,EAAE,oBACF,KAAK,SAAS,WACZ,EAAE,cACF,EAAE;AACV,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,KAAK;AAAA,MACX,cAAc,CAAC,SAAU,OAAO,KAAK,KAAK,IAAI,KAAK,MAAM;AAAA,MACzD;AAAA,MACA,MAAM,oBAAC,eAAY,WAAU,WAAU;AAAA,MACvC,MAAM,KAAK,SAAS,WAAW,OAAO;AAAA,MACtC;AAAA,MACA,QAAO;AAAA,MAEP;AAAA,6BAAC,cAAc,MAAd,EACE;AAAA;AAAA,UACD,oBAAC,WAAQ,MAAY,iBAAkC,OAAO,EAAE,eAAe;AAAA,WACjF;AAAA,QACA,oBAAC,cAAc,QAAd,EAAsB,kBAAO;AAAA;AAAA;AAAA,EAChC;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -16,6 +16,8 @@ export interface ModalScaffoldProps {
16
16
  /** Accessible description; visually hidden unless `showDescription`. */
17
17
  description?: ReactNode;
18
18
  showDescription?: boolean;
19
+ /** Retain the accessible title without a visible header block. */
20
+ hideHeader?: boolean;
19
21
  /** Icon shown before the title. */
20
22
  icon?: ReactNode;
21
23
  size?: ModalSize;
@@ -52,7 +54,7 @@ declare function ModalFooter({ className, ...props }: ComponentProps<typeof Dial
52
54
  * Standard dialog: icon + title + description header, then the compound
53
55
  * `ModalScaffold.Body` / `ModalScaffold.Footer` slots.
54
56
  */
55
- export declare function ModalScaffold({ open, onOpenChange, title, description, showDescription, icon, size, presentation, className, testId, role, initialFocusRef, dismissible, onInteractOutside, onEscapeKeyDown, children, }: ModalScaffoldProps): import("react").JSX.Element;
57
+ export declare function ModalScaffold({ open, onOpenChange, title, description, showDescription, hideHeader, icon, size, presentation, className, testId, role, initialFocusRef, dismissible, onInteractOutside, onEscapeKeyDown, children, }: ModalScaffoldProps): import("react").JSX.Element;
56
58
  export declare namespace ModalScaffold {
57
59
  var Body: typeof ModalBody;
58
60
  var Footer: typeof ModalFooter;
@@ -62,6 +62,7 @@ function ModalScaffold({
62
62
  title,
63
63
  description,
64
64
  showDescription = false,
65
+ hideHeader = false,
65
66
  icon,
66
67
  size = "md",
67
68
  presentation,
@@ -99,7 +100,7 @@ function ModalScaffold({
99
100
  },
100
101
  onCloseAutoFocus: restoreFocus.onCloseAutoFocus,
101
102
  children: [
102
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
103
+ /* @__PURE__ */ jsxs(ModalHeader, { className: hideHeader ? "sr-only !p-0" : void 0, children: [
103
104
  /* @__PURE__ */ jsxs(DialogTitle, { className: "flex items-center gap-2", children: [
104
105
  icon,
105
106
  title
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/settings/ModalScaffold.tsx"],
4
- "sourcesContent": ["import type { ComponentProps, ReactNode, RefObject } from 'react'\nimport {\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n type DialogPresentation,\n} from '@arbidocs/react/ui'\nimport { useRestoreFocus } from '../lib/useRestoreFocus'\n\n/** Tailwind classes for a modal section heading (also usable on a `Label`). */\nexport const MODAL_SECTION_TITLE_CLASS =\n 'mb-2 flex items-center gap-1 text-sm font-medium text-muted-foreground'\n\n/** Header of a hand-assembled modal: no tinted band, just space. */\nexport function ModalHeader({ className, ...props }: ComponentProps<typeof DialogHeader>) {\n return (\n <DialogHeader\n data-slot=\"modal-header\"\n className={cn('flex-shrink-0 rounded-t-lg bg-transparent p-6 pb-3 pr-12', className)}\n {...props}\n />\n )\n}\n\n/** A padded group inside a modal body. */\nexport function ModalSection({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"modal-section\" className={cn('pt-4', className)} {...props} />\n}\n\n/** Muted label above the content of a {@link ModalSection}. */\nexport function ModalSectionTitle({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"modal-section-title\"\n className={cn(MODAL_SECTION_TITLE_CLASS, className)}\n {...props}\n />\n )\n}\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'xl'\n\nconst SIZE_CLASS: Record<ModalSize, string> = {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-2xl',\n xl: 'sm:max-w-4xl',\n}\n\nexport interface ModalScaffoldProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n title: ReactNode\n /** Accessible description; visually hidden unless `showDescription`. */\n description?: ReactNode\n showDescription?: boolean\n /** Icon shown before the title. */\n icon?: ReactNode\n size?: ModalSize\n /** Phone presentation; defaults to a bottom sheet for `lg`/`xl`, a centred box otherwise. */\n presentation?: DialogPresentation\n className?: string\n testId?: string\n /**\n * `alertdialog` for a destructive or blocking confirmation: announced as an alert, dismissed\n * only through its own buttons or Escape (not by clicking outside).\n */\n role?: 'dialog' | 'alertdialog'\n /**\n * Block dismissal by outside click AND Escape; only the dialog's own buttons close it. For a\n * dialog that shows a secret once (a new API key). Default false. An `alertdialog` already\n * ignores outside clicks.\n */\n dismissible?: boolean\n /** Called on a pointer/focus interaction outside; `preventDefault()` keeps the dialog open. */\n onInteractOutside?: (event: Event) => void\n /** Called on Escape; `preventDefault()` keeps the dialog open. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /** Element that receives focus when the dialog opens (an alert dialog focuses its safe action). */\n initialFocusRef?: RefObject<HTMLElement | null>\n children?: ReactNode\n}\n\nfunction ModalBody({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"modal-body\" className={cn('space-y-4', className)} {...props} />\n}\n\n/**\n * Action row. Stacked full-width on phones (primary action on top), right-aligned on wider\n * screens. Sticks to the bottom of the scrolling dialog body so the actions stay reachable.\n */\nfunction ModalFooter({ className, ...props }: ComponentProps<typeof DialogFooter>) {\n return (\n <DialogFooter\n data-slot=\"modal-footer\"\n className={cn(\n 'sticky bottom-0 -mx-6 -mb-6 mt-4 border-t border-border bg-background px-6 py-3',\n className\n )}\n {...props}\n />\n )\n}\n\n/**\n * Standard dialog: icon + title + description header, then the compound\n * `ModalScaffold.Body` / `ModalScaffold.Footer` slots.\n */\nexport function ModalScaffold({\n open,\n onOpenChange,\n title,\n description,\n showDescription = false,\n icon,\n size = 'md',\n presentation,\n className,\n testId,\n role = 'dialog',\n initialFocusRef,\n dismissible = true,\n onInteractOutside,\n onEscapeKeyDown,\n children,\n}: ModalScaffoldProps) {\n const restoreFocus = useRestoreFocus()\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n role={role}\n presentation={presentation ?? (size === 'lg' || size === 'xl' ? 'sheet' : 'center')}\n className={cn(SIZE_CLASS[size], 'flex flex-col gap-0 overflow-hidden p-0', className)}\n data-testid={testId}\n onInteractOutside={(e) => {\n if (role === 'alertdialog' || !dismissible) e.preventDefault()\n onInteractOutside?.(e)\n }}\n onEscapeKeyDown={(e) => {\n if (!dismissible) e.preventDefault()\n onEscapeKeyDown?.(e)\n }}\n onOpenAutoFocus={(e) => {\n restoreFocus.onOpenAutoFocus(e)\n if (initialFocusRef?.current) {\n e.preventDefault()\n initialFocusRef.current.focus()\n }\n }}\n onCloseAutoFocus={restoreFocus.onCloseAutoFocus}\n >\n <ModalHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n {icon}\n {title}\n </DialogTitle>\n <DialogDescription className={showDescription ? undefined : 'sr-only'}>\n {description ?? title}\n </DialogDescription>\n </ModalHeader>\n <div\n data-slot=\"modal-scroll\"\n className=\"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6 pb-6\"\n >\n {children}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nModalScaffold.Body = ModalBody\nModalScaffold.Footer = ModalFooter\n"],
5
- "mappings": ";AAoBI,cAwIM,YAxIN;AAnBJ;A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d;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,eAAe,gBAAgB;AACrC,SACE,oBAAC,UAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,cAAc,iBAAiB,SAAS,QAAQ,SAAS,OAAO,UAAU;AAAA,MAC1E,WAAW,GAAG,WAAW,IAAI,GAAG,2CAA2C,SAAS;AAAA,MACpF,eAAa;AAAA,MACb,mBAAmB,CAAC,MAAM;AACxB,YAAI,SAAS,iBAAiB,CAAC,YAAa,GAAE,eAAe;AAC7D,4BAAoB,CAAC;AAAA,MACvB;AAAA,MACA,iBAAiB,CAAC,MAAM;AACtB,YAAI,CAAC,YAAa,GAAE,eAAe;AACnC,0BAAkB,CAAC;AAAA,MACrB;AAAA,MACA,iBAAiB,CAAC,MAAM;AACtB,qBAAa,gBAAgB,CAAC;AAC9B,YAAI,iBAAiB,SAAS;AAC5B,YAAE,eAAe;AACjB,0BAAgB,QAAQ,MAAM;AAAA,QAChC;AAAA,MACF;AAAA,MACA,kBAAkB,aAAa;AAAA,MAE/B;AAAA,6BAAC,eACC;AAAA,+BAAC,eAAY,WAAU,2BACpB;AAAA;AAAA,YACA;AAAA,aACH;AAAA,UACA,oBAAC,qBAAkB,WAAW,kBAAkB,SAAY,WACzD,yBAAe,OAClB;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,aAAU;AAAA,YACV,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,cAAc,OAAO;AACrB,cAAc,SAAS;",
4
+ "sourcesContent": ["import type { ComponentProps, ReactNode, RefObject } from 'react'\nimport {\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n type DialogPresentation,\n} from '@arbidocs/react/ui'\nimport { useRestoreFocus } from '../lib/useRestoreFocus'\n\n/** Tailwind classes for a modal section heading (also usable on a `Label`). */\nexport const MODAL_SECTION_TITLE_CLASS =\n 'mb-2 flex items-center gap-1 text-sm font-medium text-muted-foreground'\n\n/** Header of a hand-assembled modal: no tinted band, just space. */\nexport function ModalHeader({ className, ...props }: ComponentProps<typeof DialogHeader>) {\n return (\n <DialogHeader\n data-slot=\"modal-header\"\n className={cn('flex-shrink-0 rounded-t-lg bg-transparent p-6 pb-3 pr-12', className)}\n {...props}\n />\n )\n}\n\n/** A padded group inside a modal body. */\nexport function ModalSection({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"modal-section\" className={cn('pt-4', className)} {...props} />\n}\n\n/** Muted label above the content of a {@link ModalSection}. */\nexport function ModalSectionTitle({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"modal-section-title\"\n className={cn(MODAL_SECTION_TITLE_CLASS, className)}\n {...props}\n />\n )\n}\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'xl'\n\nconst SIZE_CLASS: Record<ModalSize, string> = {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-2xl',\n xl: 'sm:max-w-4xl',\n}\n\nexport interface ModalScaffoldProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n title: ReactNode\n /** Accessible description; visually hidden unless `showDescription`. */\n description?: ReactNode\n showDescription?: boolean\n /** Retain the accessible title without a visible header block. */\n hideHeader?: boolean\n /** Icon shown before the title. */\n icon?: ReactNode\n size?: ModalSize\n /** Phone presentation; defaults to a bottom sheet for `lg`/`xl`, a centred box otherwise. */\n presentation?: DialogPresentation\n className?: string\n testId?: string\n /**\n * `alertdialog` for a destructive or blocking confirmation: announced as an alert, dismissed\n * only through its own buttons or Escape (not by clicking outside).\n */\n role?: 'dialog' | 'alertdialog'\n /**\n * Block dismissal by outside click AND Escape; only the dialog's own buttons close it. For a\n * dialog that shows a secret once (a new API key). Default false. An `alertdialog` already\n * ignores outside clicks.\n */\n dismissible?: boolean\n /** Called on a pointer/focus interaction outside; `preventDefault()` keeps the dialog open. */\n onInteractOutside?: (event: Event) => void\n /** Called on Escape; `preventDefault()` keeps the dialog open. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /** Element that receives focus when the dialog opens (an alert dialog focuses its safe action). */\n initialFocusRef?: RefObject<HTMLElement | null>\n children?: ReactNode\n}\n\nfunction ModalBody({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"modal-body\" className={cn('space-y-4', className)} {...props} />\n}\n\n/**\n * Action row. Stacked full-width on phones (primary action on top), right-aligned on wider\n * screens. Sticks to the bottom of the scrolling dialog body so the actions stay reachable.\n */\nfunction ModalFooter({ className, ...props }: ComponentProps<typeof DialogFooter>) {\n return (\n <DialogFooter\n data-slot=\"modal-footer\"\n className={cn(\n 'sticky bottom-0 -mx-6 -mb-6 mt-4 border-t border-border bg-background px-6 py-3',\n className\n )}\n {...props}\n />\n )\n}\n\n/**\n * Standard dialog: icon + title + description header, then the compound\n * `ModalScaffold.Body` / `ModalScaffold.Footer` slots.\n */\nexport function ModalScaffold({\n open,\n onOpenChange,\n title,\n description,\n showDescription = false,\n hideHeader = false,\n icon,\n size = 'md',\n presentation,\n className,\n testId,\n role = 'dialog',\n initialFocusRef,\n dismissible = true,\n onInteractOutside,\n onEscapeKeyDown,\n children,\n}: ModalScaffoldProps) {\n const restoreFocus = useRestoreFocus()\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n role={role}\n presentation={presentation ?? (size === 'lg' || size === 'xl' ? 'sheet' : 'center')}\n className={cn(SIZE_CLASS[size], 'flex flex-col gap-0 overflow-hidden p-0', className)}\n data-testid={testId}\n onInteractOutside={(e) => {\n if (role === 'alertdialog' || !dismissible) e.preventDefault()\n onInteractOutside?.(e)\n }}\n onEscapeKeyDown={(e) => {\n if (!dismissible) e.preventDefault()\n onEscapeKeyDown?.(e)\n }}\n onOpenAutoFocus={(e) => {\n restoreFocus.onOpenAutoFocus(e)\n if (initialFocusRef?.current) {\n e.preventDefault()\n initialFocusRef.current.focus()\n }\n }}\n onCloseAutoFocus={restoreFocus.onCloseAutoFocus}\n >\n <ModalHeader className={hideHeader ? 'sr-only !p-0' : undefined}>\n <DialogTitle className=\"flex items-center gap-2\">\n {icon}\n {title}\n </DialogTitle>\n <DialogDescription className={showDescription ? undefined : 'sr-only'}>\n {description ?? title}\n </DialogDescription>\n </ModalHeader>\n <div\n data-slot=\"modal-scroll\"\n className=\"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6 pb-6\"\n >\n {children}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nModalScaffold.Body = ModalBody\nModalScaffold.Footer = ModalFooter\n"],
5
+ "mappings": ";AAoBI,cA2IM,YA3IN;AAnBJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,uBAAuB;AAGzB,MAAM,4BACX;AAGK,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAwC;AACxF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,4DAA4D,SAAS;AAAA,MAClF,GAAG;AAAA;AAAA,EACN;AAEJ;AAGO,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAA0B;AAC3E,SAAO,oBAAC,SAAI,aAAU,iBAAgB,WAAW,GAAG,QAAQ,SAAS,GAAI,GAAG,OAAO;AACrF;AAGO,SAAS,kBAAkB,EAAE,WAAW,GAAG,MAAM,GAA0B;AAChF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,2BAA2B,SAAS;AAAA,MACjD,GAAG;AAAA;AAAA,EACN;AAEJ;AAIA,MAAM,aAAwC;AAAA,EAC5C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAsCA,SAAS,UAAU,EAAE,WAAW,GAAG,MAAM,GAA0B;AACjE,SAAO,oBAAC,SAAI,aAAU,cAAa,WAA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BAAC,qBAAkB,WAAW,kBAAkB,SAAY,WACzD,yBAAe,OAClB;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,aAAU;AAAA,YACV,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,cAAc,OAAO;AACrB,cAAc,SAAS;",
6
6
  "names": []
7
7
  }
@@ -57,7 +57,7 @@ export interface PlanCardProps {
57
57
  onSelect: (id: number) => void;
58
58
  labels?: Partial<PlanCardLabels>;
59
59
  }
60
- /** Selectable plan tile. The current plan is marked and not selectable. */
60
+ /** Selectable plan tile. The current subscription is marked and not selectable. */
61
61
  export declare function PlanCard({ plan, onSelect, labels }: PlanCardProps): import("react").JSX.Element;
62
62
  /** Responsive grid of {@link PlanCard}s: one column on phones, stepping up with width. */
63
63
  export declare function PlanCardGrid({ plans, onSelect, labels, }: {
@@ -5,7 +5,7 @@ import { Check, Tag } from "lucide-react";
5
5
  import { cn, Input, Label } from "@arbidocs/react/ui";
6
6
  import { MoreInfo, MoreInfoList } from "./MoreInfo.js";
7
7
  const DEFAULT_PLAN_CARD_LABELS = {
8
- currentPlan: "Current plan",
8
+ currentPlan: "Current subscription",
9
9
  popular: "Popular",
10
10
  noMonthlyCost: "\xA30",
11
11
  perMonth: "/mo",
@@ -20,7 +20,7 @@ const DEFAULT_PLAN_CARD_LABELS = {
20
20
  pricingExplainer: "How pricing works",
21
21
  explainerTiers: [
22
22
  "Compare monthly and annual prices. Annual savings apply to add-ons too.",
23
- "Choose your monthly spend cap. Your plan price is included.",
23
+ "Choose your monthly spend cap. Your subscription price is included.",
24
24
  "We automatically add capacity when needed, stopping at your spend cap.",
25
25
  "Use + and \u2212 to adjust usage add-ons. Increases start now; reductions apply at renewal if your usage fits.",
26
26
  "Prices exclude VAT. You see the full total before paying."
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/settings/PlanCard.tsx"],
4
- "sourcesContent": ["import { useMemo, useState } from 'react'\nimport { Check, Tag } from 'lucide-react'\nimport { cn, Input, Label } from '@arbidocs/react/ui'\nimport { MoreInfo, MoreInfoList } from './MoreInfo'\n\n/** Every fixed string of the plan cards and their controls. */\nexport interface PlanCardLabels {\n currentPlan: string\n popular: string\n noMonthlyCost: string\n perMonth: string\n /** Short \"Current\" pill on a tier option. */\n current: string\n monthly: string\n annual: string\n annualBilling: string\n /** Savings pill: \"Save 20%\". */\n save: (percent: number) => string\n havePromoCode: string\n promoCode: string\n enterCode: string\n pricingExplainer: string\n /** One short line per idea, shown as a list. */\n explainerTiers: string[]\n explainerAiUsage: string\n seeModelList: string\n}\n\nexport const DEFAULT_PLAN_CARD_LABELS: PlanCardLabels = {\n currentPlan: 'Current plan',\n popular: 'Popular',\n noMonthlyCost: '\u00A30',\n perMonth: '/mo',\n current: 'Current',\n monthly: 'Monthly',\n annual: 'Annual',\n annualBilling: 'Annual billing',\n save: (percent) => `Save ${percent}%`,\n havePromoCode: 'Have a promo code?',\n promoCode: 'Promo Code',\n enterCode: 'Enter code',\n pricingExplainer: 'How pricing works',\n explainerTiers: [\n 'Compare monthly and annual prices. Annual savings apply to add-ons too.',\n 'Choose your monthly spend cap. Your plan price is included.',\n 'We automatically add capacity when needed, stopping at your spend cap.',\n 'Use + and \u2212 to adjust usage add-ons. Increases start now; reductions apply at renewal if your usage fits.',\n 'Prices exclude VAT. You see the full total before paying.',\n ],\n explainerAiUsage: 'AI credits depends on the model you choose and the size of your request.',\n seeModelList: 'AI model prices \u2192',\n}\n\n/** Pre-formatted price lines for a paid plan card. */\nexport interface PlanCardPrice {\n annual: boolean\n /** Struck-through no-discount yearly total (annual billing). */\n yearlyStrike?: string\n /** Yearly total (annual billing). */\n yearlyTotal?: string\n /** Interval suffix beside the yearly total, e.g. \"/yr\". */\n intervalLabel?: string\n /** Struck-through no-discount monthly price. */\n monthlyStrike?: string\n /** Effective monthly price. */\n monthly: string\n /** After the per-month price, e.g. \"ex VAT\" when the headline is ex VAT. */\n taxLabel?: string\n /** Small print under the price, e.g. \"\u00A342/mo incl. UK VAT\". */\n note?: string\n}\n\nexport interface PlanCardView {\n /** Pack count: the stable id of the tier. */\n id: number\n name: string\n /** Free plan: shows \"No monthly cost\" instead of a price. */\n isFree?: boolean\n isCurrent?: boolean\n isSelected?: boolean\n isPopular?: boolean\n price?: PlanCardPrice\n /** Entitlement lines, e.g. \"\u00A310 of AI credits / mo\". */\n features: string[]\n}\n\nexport interface PlanCardProps {\n plan: PlanCardView\n onSelect: (id: number) => void\n labels?: Partial<PlanCardLabels>\n}\n\n/** Selectable plan tile. The current plan is marked and not selectable. */\nexport function PlanCard({ plan, onSelect, labels }: PlanCardProps) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n const { id, name, isFree, isCurrent, isSelected, isPopular, price, features } = plan\n return (\n <button\n type=\"button\"\n disabled={isCurrent}\n aria-pressed={!!isSelected}\n onClick={() => !isCurrent && onSelect(id)}\n data-slot=\"plan-card\"\n data-testid={`tier-card-${id}`}\n className={cn(\n 'relative flex flex-col justify-start rounded-lg p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isCurrent\n ? 'cursor-default bg-blue-bg'\n : isSelected\n ? 'bg-accent ring-1 ring-primary/50'\n : 'bg-muted hover:bg-muted/70'\n )}\n >\n {isCurrent && (\n <span className=\"absolute -top-3 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-full bg-blue-bg px-3 py-1 text-xs font-semibold leading-none text-blue-text\">\n {l.currentPlan}\n </span>\n )}\n {isPopular && !isCurrent && (\n <span className=\"absolute -top-3 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-full bg-primary px-3 py-1 text-xs font-semibold leading-none text-primary-foreground\">\n {l.popular}\n </span>\n )}\n <div className=\"mb-3 flex items-baseline gap-2\">\n <span\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n isCurrent ? 'text-blue-text' : 'text-foreground'\n )}\n >\n {name}\n </span>\n </div>\n {isFree ? (\n <div className=\"text-2xl font-semibold leading-none tabular-nums text-foreground\">\n {l.noMonthlyCost}\n <span className=\"ml-0.5 text-sm font-medium text-muted-foreground\">{l.perMonth}</span>\n </div>\n ) : (\n price && (\n <div className=\"flex flex-col gap-1\">\n {price.annual && price.yearlyTotal && (\n <div className=\"flex items-baseline gap-x-2 whitespace-nowrap text-base tabular-nums\">\n {price.yearlyStrike && (\n <span className=\"font-medium text-muted-foreground line-through decoration-muted-foreground/70 decoration-1\">\n {price.yearlyStrike}\n </span>\n )}\n <span className=\"text-lg font-semibold text-foreground\">\n {price.yearlyTotal}\n <span className=\"ml-0.5 text-xs font-semibold text-muted-foreground\">\n {price.intervalLabel}\n </span>\n </span>\n </div>\n )}\n <div className=\"flex items-baseline gap-x-1.5 whitespace-nowrap\">\n {price.annual && (\n <span className=\"text-xl font-semibold leading-none text-muted-foreground\">=</span>\n )}\n {price.monthlyStrike && (\n <span className=\"text-base font-medium tabular-nums text-muted-foreground line-through decoration-muted-foreground/70 decoration-1\">\n {price.monthlyStrike}\n </span>\n )}\n <span className=\"text-2xl font-semibold leading-none tabular-nums text-foreground\">\n {price.monthly}\n <span className=\"ml-0.5 text-sm font-medium text-muted-foreground\">\n {l.perMonth}\n {price.taxLabel && ` ${price.taxLabel}`}\n </span>\n </span>\n </div>\n {price.note && (\n <div className=\"text-xs text-muted-foreground\" data-slot=\"plan-card-price-note\">\n {price.note}\n </div>\n )}\n </div>\n )\n )}\n <ul className=\"mt-4 space-y-1 border-t border-border pt-4 text-sm text-foreground\">\n {features.map((feature) => (\n <li key={feature}>{feature}</li>\n ))}\n </ul>\n </button>\n )\n}\n\n/** Responsive grid of {@link PlanCard}s: one column on phones, stepping up with width. */\nexport function PlanCardGrid({\n plans,\n onSelect,\n labels,\n}: {\n plans: PlanCardView[]\n onSelect: (id: number) => void\n labels?: Partial<PlanCardLabels>\n}) {\n return (\n <div className=\"@container space-y-2\" data-slot=\"plan-card-grid\">\n <div\n className={cn(\n 'grid gap-2',\n plans.length === 4\n ? 'grid-cols-1 @xl:grid-cols-2 @4xl:grid-cols-4'\n : plans.length === 2\n ? 'grid-cols-1 @xl:grid-cols-2'\n : 'grid-cols-1 @2xl:grid-cols-3'\n )}\n >\n {plans.map((plan) => (\n <PlanCard key={plan.id} plan={plan} onSelect={onSelect} labels={labels} />\n ))}\n </div>\n </div>\n )\n}\n\nexport interface PlanTierOptionView {\n id: number\n name: string\n isCurrent: boolean\n isSelected: boolean\n /** Formatted total with its interval, split so the suffix can be muted. */\n total?: string\n intervalLabel?: string\n /** Entitlement summary line. */\n summary: string\n}\n\n/** Compact row to move an existing subscription between tiers. */\nexport function PlanTierOption({\n option,\n onSelect,\n labels,\n}: {\n option: PlanTierOptionView\n onSelect: (id: number) => void\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n return (\n <button\n type=\"button\"\n onClick={() => onSelect(option.id)}\n aria-pressed={option.isSelected}\n data-slot=\"plan-tier-option\"\n data-testid={`tier-option-${option.id}`}\n className={cn(\n 'flex w-full items-center justify-between rounded-lg p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n option.isSelected ? 'bg-accent ring-1 ring-primary/50' : 'bg-muted hover:bg-muted/70'\n )}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"text-base font-semibold text-foreground\">{option.name}</span>\n {option.isCurrent && (\n <span className=\"rounded-full bg-background px-1.5 py-0.5 text-xs font-medium text-muted-foreground\">\n {l.current}\n </span>\n )}\n {option.isSelected && <Check className=\"h-4 w-4 text-primary\" />}\n </div>\n <div className=\"text-right\">\n {option.total && (\n <div className=\"font-semibold tabular-nums\">\n {option.total}\n <span className=\"text-xs font-normal text-muted-foreground\">\n {option.intervalLabel}\n </span>\n </div>\n )}\n <div className=\"text-xs tabular-nums text-muted-foreground\">{option.summary}</div>\n </div>\n </button>\n )\n}\n\n/** Monthly / Annual switch with an optional \"Save N%\" pill. */\nexport function PricingToggle({\n isAnnual,\n onToggle,\n savingsPercent,\n labels,\n}: {\n isAnnual: boolean\n onToggle: () => void\n savingsPercent?: number | null\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n return (\n <div className=\"flex items-center gap-2 text-sm\">\n <span className={isAnnual ? 'text-muted-foreground' : 'font-medium'}>{l.monthly}</span>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isAnnual}\n aria-label={l.annualBilling}\n onClick={onToggle}\n className={cn(\n 'relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isAnnual ? 'bg-primary' : 'bg-muted'\n )}\n >\n <span\n className={cn(\n 'inline-block h-3 w-3 transform rounded-full bg-card transition-transform',\n isAnnual ? 'translate-x-5' : 'translate-x-1'\n )}\n />\n </button>\n <span className={isAnnual ? 'font-medium' : 'text-muted-foreground'}>{l.annual}</span>\n {savingsPercent != null && savingsPercent > 0 && (\n <span className=\"rounded-full bg-green-bg px-1.5 py-0.5 text-sm font-semibold leading-none text-green-text\">\n {l.save(savingsPercent)}\n </span>\n )}\n </div>\n )\n}\n\n/** Collapsed \"Have a promo code?\" link that expands into an input. */\nexport function PromoCodeInput({\n value,\n onChange,\n labels,\n}: {\n value: string\n onChange: (value: string) => void\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n const [expanded, setExpanded] = useState(false)\n\n if (!expanded) {\n return (\n <button\n type=\"button\"\n onClick={() => setExpanded(true)}\n className=\"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground pointer-coarse:min-h-11\"\n >\n <Tag className=\"h-3 w-3\" />\n <span>{l.havePromoCode}</span>\n </button>\n )\n }\n\n return (\n <div className=\"space-y-1\">\n <Label className=\"text-sm text-muted-foreground\">{l.promoCode}</Label>\n <Input\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={l.enterCode}\n className=\"h-8 text-sm\"\n autoFocus\n />\n </div>\n )\n}\n\n/** \"How pricing works\": a link that opens the pricing explainer modal. `onOpenModelList` opens the AI model list. */\nexport function PlanInfoPopover({\n onOpenModelList,\n labels,\n}: {\n onOpenModelList: () => void\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n return (\n <MoreInfo title={l.pricingExplainer} label={l.pricingExplainer} testId=\"pricing-explainer\">\n <MoreInfoList items={l.explainerTiers.map((text) => ({ text }))} />\n <p>\n <button\n type=\"button\"\n onClick={onOpenModelList}\n className=\"font-medium text-foreground underline underline-offset-2 hover:text-primary/80\"\n >\n {l.seeModelList}\n </button>\n </p>\n </MoreInfo>\n )\n}\n"],
4
+ "sourcesContent": ["import { useMemo, useState } from 'react'\nimport { Check, Tag } from 'lucide-react'\nimport { cn, Input, Label } from '@arbidocs/react/ui'\nimport { MoreInfo, MoreInfoList } from './MoreInfo'\n\n/** Every fixed string of the plan cards and their controls. */\nexport interface PlanCardLabels {\n currentPlan: string\n popular: string\n noMonthlyCost: string\n perMonth: string\n /** Short \"Current\" pill on a tier option. */\n current: string\n monthly: string\n annual: string\n annualBilling: string\n /** Savings pill: \"Save 20%\". */\n save: (percent: number) => string\n havePromoCode: string\n promoCode: string\n enterCode: string\n pricingExplainer: string\n /** One short line per idea, shown as a list. */\n explainerTiers: string[]\n explainerAiUsage: string\n seeModelList: string\n}\n\nexport const DEFAULT_PLAN_CARD_LABELS: PlanCardLabels = {\n currentPlan: 'Current subscription',\n popular: 'Popular',\n noMonthlyCost: '\u00A30',\n perMonth: '/mo',\n current: 'Current',\n monthly: 'Monthly',\n annual: 'Annual',\n annualBilling: 'Annual billing',\n save: (percent) => `Save ${percent}%`,\n havePromoCode: 'Have a promo code?',\n promoCode: 'Promo Code',\n enterCode: 'Enter code',\n pricingExplainer: 'How pricing works',\n explainerTiers: [\n 'Compare monthly and annual prices. Annual savings apply to add-ons too.',\n 'Choose your monthly spend cap. Your subscription price is included.',\n 'We automatically add capacity when needed, stopping at your spend cap.',\n 'Use + and \u2212 to adjust usage add-ons. Increases start now; reductions apply at renewal if your usage fits.',\n 'Prices exclude VAT. You see the full total before paying.',\n ],\n explainerAiUsage: 'AI credits depends on the model you choose and the size of your request.',\n seeModelList: 'AI model prices \u2192',\n}\n\n/** Pre-formatted price lines for a paid plan card. */\nexport interface PlanCardPrice {\n annual: boolean\n /** Struck-through no-discount yearly total (annual billing). */\n yearlyStrike?: string\n /** Yearly total (annual billing). */\n yearlyTotal?: string\n /** Interval suffix beside the yearly total, e.g. \"/yr\". */\n intervalLabel?: string\n /** Struck-through no-discount monthly price. */\n monthlyStrike?: string\n /** Effective monthly price. */\n monthly: string\n /** After the per-month price, e.g. \"ex VAT\" when the headline is ex VAT. */\n taxLabel?: string\n /** Small print under the price, e.g. \"\u00A342/mo incl. UK VAT\". */\n note?: string\n}\n\nexport interface PlanCardView {\n /** Pack count: the stable id of the tier. */\n id: number\n name: string\n /** Free plan: shows \"No monthly cost\" instead of a price. */\n isFree?: boolean\n isCurrent?: boolean\n isSelected?: boolean\n isPopular?: boolean\n price?: PlanCardPrice\n /** Entitlement lines, e.g. \"\u00A310 of AI credits / mo\". */\n features: string[]\n}\n\nexport interface PlanCardProps {\n plan: PlanCardView\n onSelect: (id: number) => void\n labels?: Partial<PlanCardLabels>\n}\n\n/** Selectable plan tile. The current subscription is marked and not selectable. */\nexport function PlanCard({ plan, onSelect, labels }: PlanCardProps) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n const { id, name, isFree, isCurrent, isSelected, isPopular, price, features } = plan\n return (\n <button\n type=\"button\"\n disabled={isCurrent}\n aria-pressed={!!isSelected}\n onClick={() => !isCurrent && onSelect(id)}\n data-slot=\"plan-card\"\n data-testid={`tier-card-${id}`}\n className={cn(\n 'relative flex flex-col justify-start rounded-lg p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isCurrent\n ? 'cursor-default bg-blue-bg'\n : isSelected\n ? 'bg-accent ring-1 ring-primary/50'\n : 'bg-muted hover:bg-muted/70'\n )}\n >\n {isCurrent && (\n <span className=\"absolute -top-3 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-full bg-blue-bg px-3 py-1 text-xs font-semibold leading-none text-blue-text\">\n {l.currentPlan}\n </span>\n )}\n {isPopular && !isCurrent && (\n <span className=\"absolute -top-3 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-full bg-primary px-3 py-1 text-xs font-semibold leading-none text-primary-foreground\">\n {l.popular}\n </span>\n )}\n <div className=\"mb-3 flex items-baseline gap-2\">\n <span\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n isCurrent ? 'text-blue-text' : 'text-foreground'\n )}\n >\n {name}\n </span>\n </div>\n {isFree ? (\n <div className=\"text-2xl font-semibold leading-none tabular-nums text-foreground\">\n {l.noMonthlyCost}\n <span className=\"ml-0.5 text-sm font-medium text-muted-foreground\">{l.perMonth}</span>\n </div>\n ) : (\n price && (\n <div className=\"flex flex-col gap-1\">\n {price.annual && price.yearlyTotal && (\n <div className=\"flex items-baseline gap-x-2 whitespace-nowrap text-base tabular-nums\">\n {price.yearlyStrike && (\n <span className=\"font-medium text-muted-foreground line-through decoration-muted-foreground/70 decoration-1\">\n {price.yearlyStrike}\n </span>\n )}\n <span className=\"text-lg font-semibold text-foreground\">\n {price.yearlyTotal}\n <span className=\"ml-0.5 text-xs font-semibold text-muted-foreground\">\n {price.intervalLabel}\n </span>\n </span>\n </div>\n )}\n <div className=\"flex items-baseline gap-x-1.5 whitespace-nowrap\">\n {price.annual && (\n <span className=\"text-xl font-semibold leading-none text-muted-foreground\">=</span>\n )}\n {price.monthlyStrike && (\n <span className=\"text-base font-medium tabular-nums text-muted-foreground line-through decoration-muted-foreground/70 decoration-1\">\n {price.monthlyStrike}\n </span>\n )}\n <span className=\"text-2xl font-semibold leading-none tabular-nums text-foreground\">\n {price.monthly}\n <span className=\"ml-0.5 text-sm font-medium text-muted-foreground\">\n {l.perMonth}\n {price.taxLabel && ` ${price.taxLabel}`}\n </span>\n </span>\n </div>\n {price.note && (\n <div className=\"text-xs text-muted-foreground\" data-slot=\"plan-card-price-note\">\n {price.note}\n </div>\n )}\n </div>\n )\n )}\n <ul className=\"mt-4 space-y-1 border-t border-border pt-4 text-sm text-foreground\">\n {features.map((feature) => (\n <li key={feature}>{feature}</li>\n ))}\n </ul>\n </button>\n )\n}\n\n/** Responsive grid of {@link PlanCard}s: one column on phones, stepping up with width. */\nexport function PlanCardGrid({\n plans,\n onSelect,\n labels,\n}: {\n plans: PlanCardView[]\n onSelect: (id: number) => void\n labels?: Partial<PlanCardLabels>\n}) {\n return (\n <div className=\"@container space-y-2\" data-slot=\"plan-card-grid\">\n <div\n className={cn(\n 'grid gap-2',\n plans.length === 4\n ? 'grid-cols-1 @xl:grid-cols-2 @4xl:grid-cols-4'\n : plans.length === 2\n ? 'grid-cols-1 @xl:grid-cols-2'\n : 'grid-cols-1 @2xl:grid-cols-3'\n )}\n >\n {plans.map((plan) => (\n <PlanCard key={plan.id} plan={plan} onSelect={onSelect} labels={labels} />\n ))}\n </div>\n </div>\n )\n}\n\nexport interface PlanTierOptionView {\n id: number\n name: string\n isCurrent: boolean\n isSelected: boolean\n /** Formatted total with its interval, split so the suffix can be muted. */\n total?: string\n intervalLabel?: string\n /** Entitlement summary line. */\n summary: string\n}\n\n/** Compact row to move an existing subscription between tiers. */\nexport function PlanTierOption({\n option,\n onSelect,\n labels,\n}: {\n option: PlanTierOptionView\n onSelect: (id: number) => void\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n return (\n <button\n type=\"button\"\n onClick={() => onSelect(option.id)}\n aria-pressed={option.isSelected}\n data-slot=\"plan-tier-option\"\n data-testid={`tier-option-${option.id}`}\n className={cn(\n 'flex w-full items-center justify-between rounded-lg p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n option.isSelected ? 'bg-accent ring-1 ring-primary/50' : 'bg-muted hover:bg-muted/70'\n )}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"text-base font-semibold text-foreground\">{option.name}</span>\n {option.isCurrent && (\n <span className=\"rounded-full bg-background px-1.5 py-0.5 text-xs font-medium text-muted-foreground\">\n {l.current}\n </span>\n )}\n {option.isSelected && <Check className=\"h-4 w-4 text-primary\" />}\n </div>\n <div className=\"text-right\">\n {option.total && (\n <div className=\"font-semibold tabular-nums\">\n {option.total}\n <span className=\"text-xs font-normal text-muted-foreground\">\n {option.intervalLabel}\n </span>\n </div>\n )}\n <div className=\"text-xs tabular-nums text-muted-foreground\">{option.summary}</div>\n </div>\n </button>\n )\n}\n\n/** Monthly / Annual switch with an optional \"Save N%\" pill. */\nexport function PricingToggle({\n isAnnual,\n onToggle,\n savingsPercent,\n labels,\n}: {\n isAnnual: boolean\n onToggle: () => void\n savingsPercent?: number | null\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n return (\n <div className=\"flex items-center gap-2 text-sm\">\n <span className={isAnnual ? 'text-muted-foreground' : 'font-medium'}>{l.monthly}</span>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isAnnual}\n aria-label={l.annualBilling}\n onClick={onToggle}\n className={cn(\n 'relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isAnnual ? 'bg-primary' : 'bg-muted'\n )}\n >\n <span\n className={cn(\n 'inline-block h-3 w-3 transform rounded-full bg-card transition-transform',\n isAnnual ? 'translate-x-5' : 'translate-x-1'\n )}\n />\n </button>\n <span className={isAnnual ? 'font-medium' : 'text-muted-foreground'}>{l.annual}</span>\n {savingsPercent != null && savingsPercent > 0 && (\n <span className=\"rounded-full bg-green-bg px-1.5 py-0.5 text-sm font-semibold leading-none text-green-text\">\n {l.save(savingsPercent)}\n </span>\n )}\n </div>\n )\n}\n\n/** Collapsed \"Have a promo code?\" link that expands into an input. */\nexport function PromoCodeInput({\n value,\n onChange,\n labels,\n}: {\n value: string\n onChange: (value: string) => void\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n const [expanded, setExpanded] = useState(false)\n\n if (!expanded) {\n return (\n <button\n type=\"button\"\n onClick={() => setExpanded(true)}\n className=\"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground pointer-coarse:min-h-11\"\n >\n <Tag className=\"h-3 w-3\" />\n <span>{l.havePromoCode}</span>\n </button>\n )\n }\n\n return (\n <div className=\"space-y-1\">\n <Label className=\"text-sm text-muted-foreground\">{l.promoCode}</Label>\n <Input\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={l.enterCode}\n className=\"h-8 text-sm\"\n autoFocus\n />\n </div>\n )\n}\n\n/** \"How pricing works\": a link that opens the pricing explainer modal. `onOpenModelList` opens the AI model list. */\nexport function PlanInfoPopover({\n onOpenModelList,\n labels,\n}: {\n onOpenModelList: () => void\n labels?: Partial<PlanCardLabels>\n}) {\n const l = useMemo(() => ({ ...DEFAULT_PLAN_CARD_LABELS, ...labels }), [labels])\n return (\n <MoreInfo title={l.pricingExplainer} label={l.pricingExplainer} testId=\"pricing-explainer\">\n <MoreInfoList items={l.explainerTiers.map((text) => ({ text }))} />\n <p>\n <button\n type=\"button\"\n onClick={onOpenModelList}\n className=\"font-medium text-foreground underline underline-offset-2 hover:text-primary/80\"\n >\n {l.seeModelList}\n </button>\n </p>\n </MoreInfo>\n )\n}\n"],
5
5
  "mappings": ";AAkHQ,cAoBA,YApBA;AAl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,IAAI,QAAQ,OAAO,EAAE,GAAG,0BAA0B,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC;AAC9E,SACE,qBAAC,YAAS,OAAO,EAAE,kBAAkB,OAAO,EAAE,kBAAkB,QAAO,qBACrE;AAAA,wBAAC,gBAAa,OAAO,EAAE,eAAe,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG;AAAA,IACjE,oBAAC,OACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QAET,YAAE;AAAA;AAAA,IACL,GACF;AAAA,KACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -223,7 +223,7 @@ const DEFAULT_CHECKOUT_DIALOG_LABELS = {
223
223
  unavailableTitle: "Stripe Not Configured",
224
224
  unavailableDescription: "Stripe checkout is not available. Please contact support.",
225
225
  title: "Payment",
226
- description: "Enter your card to start the plan",
226
+ description: "Enter your card to start the subscription",
227
227
  loading: "Loading\u2026",
228
228
  error: "Checkout didn't load. Try again."
229
229
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/settings/SubscriptionParts.tsx"],
4
- "sourcesContent": ["import type { ComponentProps, ReactNode } from 'react'\nimport { ArrowLeft, type LucideIcon } from 'lucide-react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Progress,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n cn,\n getEntityLabel,\n} from '@arbidocs/react/ui'\nimport { UsageMeter } from '../components/UsageMeter'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { ModalScaffold, ModalSection } from './ModalScaffold'\n\n// ---------------------------------------------------------------------------\n// One-line notices and small layout slots shared by the plan flows\n// ---------------------------------------------------------------------------\n\n/** A single line of status text (loading, empty, error) inside a plan flow. */\nexport function PlanNotice({\n tone = 'muted',\n className,\n testId,\n children,\n}: {\n tone?: 'muted' | 'error'\n className?: string\n testId?: string\n children: ReactNode\n}) {\n return (\n <p\n data-slot=\"plan-notice\"\n data-testid={testId}\n className={cn(\n 'text-sm',\n tone === 'error' ? 'text-destructive' : 'text-muted-foreground',\n className\n )}\n >\n {children}\n </p>\n )\n}\n\n/** Vertical rhythm of a plan flow's sections. */\nexport function PlanStack({\n gap = 3,\n testId,\n className,\n children,\n}: {\n gap?: 2 | 3 | 4 | 5\n testId?: string\n className?: string\n children: ReactNode\n}) {\n const GAP = { 2: 'space-y-2', 3: 'space-y-3', 4: 'space-y-4', 5: 'space-y-5 pt-2' } as const\n return (\n <div data-slot=\"plan-stack\" data-testid={testId} className={cn(GAP[gap], className)}>\n {children}\n </div>\n )\n}\n\n/** Title + explainer on the left, billing toggle on the right; the toggle wraps when narrow. */\nexport function PlanPickerHeader({\n title,\n info,\n infoPlacement = 'title',\n toggle,\n className,\n}: {\n title: ReactNode\n info?: ReactNode\n /** `title`: the info trigger sits beside the title; `toggle`: grouped with the toggle. */\n infoPlacement?: 'title' | 'toggle'\n toggle?: ReactNode\n className?: string\n}) {\n return (\n <div\n data-slot=\"plan-picker-header\"\n className={cn('flex flex-wrap items-center justify-between gap-x-3 gap-y-2', className)}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"text-lg font-semibold\">{title}</span>\n {infoPlacement === 'title' && info}\n </div>\n {infoPlacement === 'toggle' ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n {info}\n {toggle}\n </div>\n ) : (\n toggle\n )}\n </div>\n )\n}\n\n/** Tinted card holding the tier picker (header + quantity grid). */\nexport function PlanPickerCard({ children }: { children: ReactNode }) {\n return (\n <div\n data-slot=\"plan-picker-card\"\n className=\"space-y-4 rounded-lg border border-border bg-card shadow-xs p-4\"\n >\n {children}\n </div>\n )\n}\n\n/** Decline on the left, commit on the right; stacked reversed so commit leads on narrow screens. */\nexport function PlanActionRow({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"plan-action-row\" className=\"flex flex-col-reverse gap-2 @xl:flex-row\">\n {children}\n </div>\n )\n}\n\n/** Full-width button of a plan flow (`fill` makes it share a row equally on wide screens). */\nexport function PlanActionButton({\n tone = 'primary',\n fill,\n ...props\n}: Omit<ComponentProps<typeof Button>, 'variant'> & {\n tone?: 'primary' | 'muted'\n fill?: boolean\n}) {\n return (\n <Button\n data-slot=\"plan-action-button\"\n variant={tone === 'muted' ? 'ghost' : 'default'}\n {...props}\n className={cn(\n 'w-full',\n fill && 'sm:flex-1',\n tone === 'muted' && 'text-muted-foreground',\n props.className\n )}\n />\n )\n}\n\n// ---------------------------------------------------------------------------\n// Subscription status\n// ---------------------------------------------------------------------------\n\nexport interface SubscriptionMeterView {\n key: string\n icon: LucideIcon\n label: string\n value: string\n pct: number\n}\n\nexport interface SubscriptionStatusViewProps {\n /** Formatted reset date (\"Aug 31\"); falsy when unknown. */\n resetDate?: string | null\n isCanceling: boolean\n meters: SubscriptionMeterView[]\n /** Prefix of each meter's test id (`<prefix>-<key>`); defaults to `project-quota`. */\n testIdPrefix?: string\n labels?: Partial<SubscriptionStatusLabels>\n}\n\nexport interface SubscriptionStatusLabels {\n aiUsageResets: (date: string) => string\n cancelsAtPeriodEnd: string\n cancelsAtEndOfBillingPeriod: string\n}\n\nexport const DEFAULT_SUBSCRIPTION_STATUS_LABELS: SubscriptionStatusLabels = {\n aiUsageResets: (date) => `AI credits reset ${date}`,\n cancelsAtPeriodEnd: '\u00B7 Cancels at period end',\n cancelsAtEndOfBillingPeriod: 'Cancels at end of billing period',\n}\n\n/** Expanded project status: reset date, canceling notice, stacked quota meters. */\nexport function SubscriptionStatusView({\n resetDate,\n isCanceling,\n meters,\n testIdPrefix,\n labels,\n}: SubscriptionStatusViewProps) {\n const l = { ...DEFAULT_SUBSCRIPTION_STATUS_LABELS, ...labels }\n return (\n <div data-slot=\"subscription-status\" className=\"space-y-3\">\n {resetDate && (\n <p className=\"text-sm text-muted-foreground\">\n {l.aiUsageResets(resetDate)}\n {isCanceling && <span className=\"ml-2 text-yellow-text\">{l.cancelsAtPeriodEnd}</span>}\n </p>\n )}\n {!resetDate && isCanceling && (\n <p className=\"text-sm text-yellow-text\">{l.cancelsAtEndOfBillingPeriod}</p>\n )}\n <div className=\"space-y-3\">\n {meters.map((m) => (\n <UsageMeter\n key={m.key}\n icon={m.icon}\n label={m.label}\n value={m.value}\n pct={m.pct}\n testId={prefixedTestId(testIdPrefix, m.key, { testId: `project-quota-${m.key}` })}\n />\n ))}\n </div>\n </div>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Dialogs\n// ---------------------------------------------------------------------------\n\nexport interface PlanDialogFrameProps {\n /** Return to the screen that opened the upgrade picker. */\n onBack?: () => void\n compact?: boolean\n className?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n title: ReactNode\n description: ReactNode\n /** Keep the description for screen readers only. */\n isDescriptionHidden?: boolean\n /** Name of the project the plan applies to, right of the title. */\n projectName?: string\n /** Test id of the project name; defaults to `change-plan-project`. */\n projectTestId?: string\n children?: ReactNode\n labels?: Partial<{ project: string }>\n}\n\n/** The one plan-picker dialog: offer title + reason, the project it applies to, then the flow. */\nexport function PlanDialogFrame({\n onBack,\n compact = false,\n className,\n open,\n onOpenChange,\n title,\n description,\n isDescriptionHidden,\n projectName,\n projectTestId,\n children,\n labels,\n}: PlanDialogFrameProps) {\n const heading = onBack ? (\n <span className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"project-purchase-back gap-1.5\"\n onClick={onBack}\n data-testid=\"upgrade-back\"\n >\n <ArrowLeft aria-hidden=\"true\" className=\"h-4 w-4\" />\n Back\n </Button>\n <span>{title}</span>\n </span>\n ) : (\n title\n )\n if (compact)\n return (\n <ModalScaffold\n open={open}\n onOpenChange={onOpenChange}\n title={heading}\n description={String(description)}\n showDescription={!isDescriptionHidden}\n size=\"md\"\n className={cn('project-purchase-modal sm:max-w-[640px]', className)}\n >\n {projectName !== undefined && (\n <p\n className=\"text-sm text-muted-foreground\"\n data-testid={testIdOr(projectTestId, { testId: 'change-plan-project' })}\n >\n {labels?.project ?? `${getEntityLabel('PROJECT')}:`}{' '}\n <span className=\"font-medium text-foreground\">{projectName}</span>\n </p>\n )}\n {children}\n </ModalScaffold>\n )\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className={cn('max-w-5xl', className)}>\n {/* pr-8 clears the close button. */}\n <DialogHeader className=\"flex-row items-start justify-between gap-3 space-y-0 pr-8\">\n <div className=\"space-y-1.5\">\n <DialogTitle>{heading}</DialogTitle>\n <DialogDescription className={isDescriptionHidden ? 'sr-only' : undefined}>\n {description}\n </DialogDescription>\n </div>\n {projectName !== undefined && (\n <span\n className=\"shrink-0 text-sm text-muted-foreground\"\n data-testid={testIdOr(projectTestId, { testId: 'change-plan-project' })}\n >\n {labels?.project ?? `${getEntityLabel('PROJECT')}:`}{' '}\n <span className=\"font-semibold text-foreground\">{projectName}</span>\n </span>\n )}\n </DialogHeader>\n {children}\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface CheckoutDialogFrameProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Stripe is not available: show the explanation instead of the checkout. */\n isUnavailable?: boolean\n isLoading?: boolean\n hasError?: boolean\n /** The embedded payment form (host-owned: needs the payment provider). */\n children?: ReactNode\n labels?: Partial<CheckoutDialogLabels>\n}\n\nexport interface CheckoutDialogLabels {\n unavailableTitle: string\n unavailableDescription: string\n title: string\n description: string\n loading: string\n error: string\n}\n\nexport const DEFAULT_CHECKOUT_DIALOG_LABELS: CheckoutDialogLabels = {\n unavailableTitle: 'Stripe Not Configured',\n unavailableDescription: 'Stripe checkout is not available. Please contact support.',\n title: 'Payment',\n description: 'Enter your card to start the plan',\n loading: 'Loading\u2026',\n error: \"Checkout didn't load. Try again.\",\n}\n\n/**\n * Checkout dialog chrome. Flex column capped at 90vh: the header is pinned and ONLY the checkout\n * region scrolls, so the embedded payment iframe (often taller than the viewport) never clips its\n * pay button. Outside click and Escape are blocked: a half-paid checkout must be closed on purpose.\n */\nexport function CheckoutDialogFrame({\n open,\n onOpenChange,\n isUnavailable,\n isLoading,\n hasError,\n children,\n labels,\n}: CheckoutDialogFrameProps) {\n const l = { ...DEFAULT_CHECKOUT_DIALOG_LABELS, ...labels }\n if (isUnavailable) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{l.unavailableTitle}</DialogTitle>\n <DialogDescription>{l.unavailableDescription}</DialogDescription>\n </DialogHeader>\n </DialogContent>\n </Dialog>\n )\n }\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n presentation=\"sheet\"\n className=\"flex max-h-[calc(100dvh-2rem)] max-w-2xl flex-col gap-0 overflow-hidden p-0\"\n onInteractOutside={(e) => e.preventDefault()}\n onEscapeKeyDown={(e) => e.preventDefault()}\n >\n <DialogHeader className=\"flex-shrink-0 px-6 pb-3 pt-6\">\n <DialogTitle>{l.title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{l.description}</DialogDescription>\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-6 pb-6\">\n {isLoading && <div className=\"py-8 text-center text-muted-foreground\">{l.loading}</div>}\n {hasError && <div className=\"py-8 text-center text-destructive\">{l.error}</div>}\n {children}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface QuotaExceededDialogViewProps {\n open: boolean\n onClose: () => void\n onUpgrade: () => void\n message: string\n /** Absent while the dialog closes (no usage to show). */\n usage?: {\n percent: number\n /** \"\u00A37.60 of \u00A310\". */\n readout: string\n projectId?: string | null\n }\n /** Replaces the Upgrade button (e.g. add-on actions for a project already on a paid plan). */\n actions?: ReactNode\n labels?: Partial<QuotaExceededDialogLabels>\n}\n\nexport interface QuotaExceededDialogLabels {\n title: string\n projectUsage: string\n progress: string\n project: string\n close: string\n upgrade: string\n}\n\nexport const DEFAULT_QUOTA_EXCEEDED_DIALOG_LABELS: QuotaExceededDialogLabels = {\n title: 'AI credits used up',\n get projectUsage() {\n return `${getEntityLabel('PROJECT')} usage`\n },\n progress: 'AI credits this month',\n get project() {\n return `${getEntityLabel('PROJECT')}:`\n },\n close: 'Not now',\n upgrade: 'Upgrade',\n}\n\n/** Shown when a project's AI budget is exhausted: how much was used, then close or upgrade. */\nexport function QuotaExceededDialogView({\n open,\n onClose,\n onUpgrade,\n message,\n usage,\n actions,\n labels,\n}: QuotaExceededDialogViewProps) {\n const l = { ...DEFAULT_QUOTA_EXCEEDED_DIALOG_LABELS, ...labels }\n return (\n <Dialog open={open} onOpenChange={(o) => !o && onClose()}>\n <DialogContent className=\"max-w-md\" data-testid=\"quota-exceeded-modal\">\n <DialogHeader>\n <DialogTitle>{l.title}</DialogTitle>\n <DialogDescription>{message}</DialogDescription>\n </DialogHeader>\n {usage && (\n <ModalSection className=\"space-y-2\">\n <Progress value={usage.percent} aria-label={l.progress} />\n <div\n className=\"flex flex-wrap items-center justify-between gap-x-3 text-sm text-muted-foreground\"\n data-testid=\"quota-usage-readout\"\n >\n <span className=\"tabular-nums\">{usage.readout}</span>\n {usage.projectId && <span className=\"truncate\">{usage.projectId}</span>}\n </div>\n </ModalSection>\n )}\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} data-testid=\"quota-close-button\">\n {l.close}\n </Button>\n {actions ?? (\n <Button onClick={onUpgrade} data-testid=\"quota-upgrade-button\">\n {l.upgrade}\n </Button>\n )}\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n\n/** Icon-only tooltip button of the usage panel's action slot (download, print). */\nexport function UsageActionButton({\n label,\n icon,\n onClick,\n}: {\n label: string\n icon: ReactNode\n onClick: () => void\n}) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-6 text-muted-foreground hover:text-foreground pointer-coarse:size-11\"\n aria-label={label}\n onClick={onClick}\n >\n {icon}\n </Button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n"],
4
+ "sourcesContent": ["import type { ComponentProps, ReactNode } from 'react'\nimport { ArrowLeft, type LucideIcon } from 'lucide-react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Progress,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n cn,\n getEntityLabel,\n} from '@arbidocs/react/ui'\nimport { UsageMeter } from '../components/UsageMeter'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { ModalScaffold, ModalSection } from './ModalScaffold'\n\n// ---------------------------------------------------------------------------\n// One-line notices and small layout slots shared by the plan flows\n// ---------------------------------------------------------------------------\n\n/** A single line of status text (loading, empty, error) inside a plan flow. */\nexport function PlanNotice({\n tone = 'muted',\n className,\n testId,\n children,\n}: {\n tone?: 'muted' | 'error'\n className?: string\n testId?: string\n children: ReactNode\n}) {\n return (\n <p\n data-slot=\"plan-notice\"\n data-testid={testId}\n className={cn(\n 'text-sm',\n tone === 'error' ? 'text-destructive' : 'text-muted-foreground',\n className\n )}\n >\n {children}\n </p>\n )\n}\n\n/** Vertical rhythm of a plan flow's sections. */\nexport function PlanStack({\n gap = 3,\n testId,\n className,\n children,\n}: {\n gap?: 2 | 3 | 4 | 5\n testId?: string\n className?: string\n children: ReactNode\n}) {\n const GAP = { 2: 'space-y-2', 3: 'space-y-3', 4: 'space-y-4', 5: 'space-y-5 pt-2' } as const\n return (\n <div data-slot=\"plan-stack\" data-testid={testId} className={cn(GAP[gap], className)}>\n {children}\n </div>\n )\n}\n\n/** Title + explainer on the left, billing toggle on the right; the toggle wraps when narrow. */\nexport function PlanPickerHeader({\n title,\n info,\n infoPlacement = 'title',\n toggle,\n className,\n}: {\n title: ReactNode\n info?: ReactNode\n /** `title`: the info trigger sits beside the title; `toggle`: grouped with the toggle. */\n infoPlacement?: 'title' | 'toggle'\n toggle?: ReactNode\n className?: string\n}) {\n return (\n <div\n data-slot=\"plan-picker-header\"\n className={cn('flex flex-wrap items-center justify-between gap-x-3 gap-y-2', className)}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"text-lg font-semibold\">{title}</span>\n {infoPlacement === 'title' && info}\n </div>\n {infoPlacement === 'toggle' ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n {info}\n {toggle}\n </div>\n ) : (\n toggle\n )}\n </div>\n )\n}\n\n/** Tinted card holding the tier picker (header + quantity grid). */\nexport function PlanPickerCard({ children }: { children: ReactNode }) {\n return (\n <div\n data-slot=\"plan-picker-card\"\n className=\"space-y-4 rounded-lg border border-border bg-card shadow-xs p-4\"\n >\n {children}\n </div>\n )\n}\n\n/** Decline on the left, commit on the right; stacked reversed so commit leads on narrow screens. */\nexport function PlanActionRow({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"plan-action-row\" className=\"flex flex-col-reverse gap-2 @xl:flex-row\">\n {children}\n </div>\n )\n}\n\n/** Full-width button of a plan flow (`fill` makes it share a row equally on wide screens). */\nexport function PlanActionButton({\n tone = 'primary',\n fill,\n ...props\n}: Omit<ComponentProps<typeof Button>, 'variant'> & {\n tone?: 'primary' | 'muted'\n fill?: boolean\n}) {\n return (\n <Button\n data-slot=\"plan-action-button\"\n variant={tone === 'muted' ? 'ghost' : 'default'}\n {...props}\n className={cn(\n 'w-full',\n fill && 'sm:flex-1',\n tone === 'muted' && 'text-muted-foreground',\n props.className\n )}\n />\n )\n}\n\n// ---------------------------------------------------------------------------\n// Subscription status\n// ---------------------------------------------------------------------------\n\nexport interface SubscriptionMeterView {\n key: string\n icon: LucideIcon\n label: string\n value: string\n pct: number\n}\n\nexport interface SubscriptionStatusViewProps {\n /** Formatted reset date (\"Aug 31\"); falsy when unknown. */\n resetDate?: string | null\n isCanceling: boolean\n meters: SubscriptionMeterView[]\n /** Prefix of each meter's test id (`<prefix>-<key>`); defaults to `project-quota`. */\n testIdPrefix?: string\n labels?: Partial<SubscriptionStatusLabels>\n}\n\nexport interface SubscriptionStatusLabels {\n aiUsageResets: (date: string) => string\n cancelsAtPeriodEnd: string\n cancelsAtEndOfBillingPeriod: string\n}\n\nexport const DEFAULT_SUBSCRIPTION_STATUS_LABELS: SubscriptionStatusLabels = {\n aiUsageResets: (date) => `AI credits reset ${date}`,\n cancelsAtPeriodEnd: '\u00B7 Cancels at period end',\n cancelsAtEndOfBillingPeriod: 'Cancels at end of billing period',\n}\n\n/** Expanded project status: reset date, canceling notice, stacked quota meters. */\nexport function SubscriptionStatusView({\n resetDate,\n isCanceling,\n meters,\n testIdPrefix,\n labels,\n}: SubscriptionStatusViewProps) {\n const l = { ...DEFAULT_SUBSCRIPTION_STATUS_LABELS, ...labels }\n return (\n <div data-slot=\"subscription-status\" className=\"space-y-3\">\n {resetDate && (\n <p className=\"text-sm text-muted-foreground\">\n {l.aiUsageResets(resetDate)}\n {isCanceling && <span className=\"ml-2 text-yellow-text\">{l.cancelsAtPeriodEnd}</span>}\n </p>\n )}\n {!resetDate && isCanceling && (\n <p className=\"text-sm text-yellow-text\">{l.cancelsAtEndOfBillingPeriod}</p>\n )}\n <div className=\"space-y-3\">\n {meters.map((m) => (\n <UsageMeter\n key={m.key}\n icon={m.icon}\n label={m.label}\n value={m.value}\n pct={m.pct}\n testId={prefixedTestId(testIdPrefix, m.key, { testId: `project-quota-${m.key}` })}\n />\n ))}\n </div>\n </div>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Dialogs\n// ---------------------------------------------------------------------------\n\nexport interface PlanDialogFrameProps {\n /** Return to the screen that opened the upgrade picker. */\n onBack?: () => void\n compact?: boolean\n className?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n title: ReactNode\n description: ReactNode\n /** Keep the description for screen readers only. */\n isDescriptionHidden?: boolean\n /** Name of the project the plan applies to, right of the title. */\n projectName?: string\n /** Test id of the project name; defaults to `change-plan-project`. */\n projectTestId?: string\n children?: ReactNode\n labels?: Partial<{ project: string }>\n}\n\n/** The one plan-picker dialog: offer title + reason, the project it applies to, then the flow. */\nexport function PlanDialogFrame({\n onBack,\n compact = false,\n className,\n open,\n onOpenChange,\n title,\n description,\n isDescriptionHidden,\n projectName,\n projectTestId,\n children,\n labels,\n}: PlanDialogFrameProps) {\n const heading = onBack ? (\n <span className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"project-purchase-back gap-1.5\"\n onClick={onBack}\n data-testid=\"upgrade-back\"\n >\n <ArrowLeft aria-hidden=\"true\" className=\"h-4 w-4\" />\n Back\n </Button>\n <span>{title}</span>\n </span>\n ) : (\n title\n )\n if (compact)\n return (\n <ModalScaffold\n open={open}\n onOpenChange={onOpenChange}\n title={heading}\n description={String(description)}\n showDescription={!isDescriptionHidden}\n size=\"md\"\n className={cn('project-purchase-modal sm:max-w-[640px]', className)}\n >\n {projectName !== undefined && (\n <p\n className=\"text-sm text-muted-foreground\"\n data-testid={testIdOr(projectTestId, { testId: 'change-plan-project' })}\n >\n {labels?.project ?? `${getEntityLabel('PROJECT')}:`}{' '}\n <span className=\"font-medium text-foreground\">{projectName}</span>\n </p>\n )}\n {children}\n </ModalScaffold>\n )\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className={cn('max-w-5xl', className)}>\n {/* pr-8 clears the close button. */}\n <DialogHeader className=\"flex-row items-start justify-between gap-3 space-y-0 pr-8\">\n <div className=\"space-y-1.5\">\n <DialogTitle>{heading}</DialogTitle>\n <DialogDescription className={isDescriptionHidden ? 'sr-only' : undefined}>\n {description}\n </DialogDescription>\n </div>\n {projectName !== undefined && (\n <span\n className=\"shrink-0 text-sm text-muted-foreground\"\n data-testid={testIdOr(projectTestId, { testId: 'change-plan-project' })}\n >\n {labels?.project ?? `${getEntityLabel('PROJECT')}:`}{' '}\n <span className=\"font-semibold text-foreground\">{projectName}</span>\n </span>\n )}\n </DialogHeader>\n {children}\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface CheckoutDialogFrameProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Stripe is not available: show the explanation instead of the checkout. */\n isUnavailable?: boolean\n isLoading?: boolean\n hasError?: boolean\n /** The embedded payment form (host-owned: needs the payment provider). */\n children?: ReactNode\n labels?: Partial<CheckoutDialogLabels>\n}\n\nexport interface CheckoutDialogLabels {\n unavailableTitle: string\n unavailableDescription: string\n title: string\n description: string\n loading: string\n error: string\n}\n\nexport const DEFAULT_CHECKOUT_DIALOG_LABELS: CheckoutDialogLabels = {\n unavailableTitle: 'Stripe Not Configured',\n unavailableDescription: 'Stripe checkout is not available. Please contact support.',\n title: 'Payment',\n description: 'Enter your card to start the subscription',\n loading: 'Loading\u2026',\n error: \"Checkout didn't load. Try again.\",\n}\n\n/**\n * Checkout dialog chrome. Flex column capped at 90vh: the header is pinned and ONLY the checkout\n * region scrolls, so the embedded payment iframe (often taller than the viewport) never clips its\n * pay button. Outside click and Escape are blocked: a half-paid checkout must be closed on purpose.\n */\nexport function CheckoutDialogFrame({\n open,\n onOpenChange,\n isUnavailable,\n isLoading,\n hasError,\n children,\n labels,\n}: CheckoutDialogFrameProps) {\n const l = { ...DEFAULT_CHECKOUT_DIALOG_LABELS, ...labels }\n if (isUnavailable) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{l.unavailableTitle}</DialogTitle>\n <DialogDescription>{l.unavailableDescription}</DialogDescription>\n </DialogHeader>\n </DialogContent>\n </Dialog>\n )\n }\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n presentation=\"sheet\"\n className=\"flex max-h-[calc(100dvh-2rem)] max-w-2xl flex-col gap-0 overflow-hidden p-0\"\n onInteractOutside={(e) => e.preventDefault()}\n onEscapeKeyDown={(e) => e.preventDefault()}\n >\n <DialogHeader className=\"flex-shrink-0 px-6 pb-3 pt-6\">\n <DialogTitle>{l.title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{l.description}</DialogDescription>\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-6 pb-6\">\n {isLoading && <div className=\"py-8 text-center text-muted-foreground\">{l.loading}</div>}\n {hasError && <div className=\"py-8 text-center text-destructive\">{l.error}</div>}\n {children}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport interface QuotaExceededDialogViewProps {\n open: boolean\n onClose: () => void\n onUpgrade: () => void\n message: string\n /** Absent while the dialog closes (no usage to show). */\n usage?: {\n percent: number\n /** \"\u00A37.60 of \u00A310\". */\n readout: string\n projectId?: string | null\n }\n /** Replaces the Upgrade button (e.g. add-on actions for a project already on a paid plan). */\n actions?: ReactNode\n labels?: Partial<QuotaExceededDialogLabels>\n}\n\nexport interface QuotaExceededDialogLabels {\n title: string\n projectUsage: string\n progress: string\n project: string\n close: string\n upgrade: string\n}\n\nexport const DEFAULT_QUOTA_EXCEEDED_DIALOG_LABELS: QuotaExceededDialogLabels = {\n title: 'AI credits used up',\n get projectUsage() {\n return `${getEntityLabel('PROJECT')} usage`\n },\n progress: 'AI credits this month',\n get project() {\n return `${getEntityLabel('PROJECT')}:`\n },\n close: 'Not now',\n upgrade: 'Upgrade',\n}\n\n/** Shown when a project's AI budget is exhausted: how much was used, then close or upgrade. */\nexport function QuotaExceededDialogView({\n open,\n onClose,\n onUpgrade,\n message,\n usage,\n actions,\n labels,\n}: QuotaExceededDialogViewProps) {\n const l = { ...DEFAULT_QUOTA_EXCEEDED_DIALOG_LABELS, ...labels }\n return (\n <Dialog open={open} onOpenChange={(o) => !o && onClose()}>\n <DialogContent className=\"max-w-md\" data-testid=\"quota-exceeded-modal\">\n <DialogHeader>\n <DialogTitle>{l.title}</DialogTitle>\n <DialogDescription>{message}</DialogDescription>\n </DialogHeader>\n {usage && (\n <ModalSection className=\"space-y-2\">\n <Progress value={usage.percent} aria-label={l.progress} />\n <div\n className=\"flex flex-wrap items-center justify-between gap-x-3 text-sm text-muted-foreground\"\n data-testid=\"quota-usage-readout\"\n >\n <span className=\"tabular-nums\">{usage.readout}</span>\n {usage.projectId && <span className=\"truncate\">{usage.projectId}</span>}\n </div>\n </ModalSection>\n )}\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} data-testid=\"quota-close-button\">\n {l.close}\n </Button>\n {actions ?? (\n <Button onClick={onUpgrade} data-testid=\"quota-upgrade-button\">\n {l.upgrade}\n </Button>\n )}\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n\n/** Icon-only tooltip button of the usage panel's action slot (download, print). */\nexport function UsageActionButton({\n label,\n icon,\n onClick,\n}: {\n label: string\n icon: ReactNode\n onClick: () => void\n}) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-6 text-muted-foreground hover:text-foreground pointer-coarse:size-11\"\n aria-label={label}\n onClick={onClick}\n >\n {icon}\n </Button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n"],
5
5
  "mappings": ";AAsCI,cAsDE,YAtDF;AArCJ,SAAS,iBAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB,gBAAgB;AACzC,SAAS,eAAe,oBAAoB;AAOrC,SAAS,WAAW;AAAA,EACzB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,eAAa;AAAA,MACb,WAAW;AAAA,QACT;AAAA,QACA,SAAS,UAAU,qBAAqB;AAAA,QACxC;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAGO,SAAS,UAAU;AAAA,EACxB,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,QAAM,MAAM,EAAE,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,GAAG,iBAAiB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