@shapio/cms 0.5.5 → 0.5.7

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 (360) hide show
  1. package/dist/admin/assets/{AssetTile-CaYPqR_F.js → AssetTile-H0hABhB2.js} +2 -2
  2. package/dist/admin/assets/{AssetTile-CaYPqR_F.js.map → AssetTile-H0hABhB2.js.map} +1 -1
  3. package/dist/admin/assets/AssistError-1s3PuY0X.js +2 -0
  4. package/dist/admin/assets/{AssistError-drmpXSbS.js.map → AssistError-1s3PuY0X.js.map} +1 -1
  5. package/dist/admin/assets/{BlockMenuItems-D-jZ0oaU.js → BlockMenuItems-a8zXdfcF.js} +2 -2
  6. package/dist/admin/assets/{BlockMenuItems-D-jZ0oaU.js.map → BlockMenuItems-a8zXdfcF.js.map} +1 -1
  7. package/dist/admin/assets/Body-BzZD-TZT.js +2 -0
  8. package/dist/admin/assets/{Body-Gn_z2KPN.js.map → Body-BzZD-TZT.js.map} +1 -1
  9. package/dist/admin/assets/Builder-60jO_nbS.js +2 -0
  10. package/dist/admin/assets/Builder-60jO_nbS.js.map +1 -0
  11. package/dist/admin/assets/{CodeEditor-CzRU6och.js → CodeEditor-BLbJZE9v.js} +2 -2
  12. package/dist/admin/assets/{CodeEditor-CzRU6och.js.map → CodeEditor-BLbJZE9v.js.map} +1 -1
  13. package/dist/admin/assets/{CopyButton-h4HYhnYp.js → CopyButton-BOtR_h1H.js} +2 -2
  14. package/dist/admin/assets/{CopyButton-h4HYhnYp.js.map → CopyButton-BOtR_h1H.js.map} +1 -1
  15. package/dist/admin/assets/{CursorPager-H4SpVYw7.js → CursorPager-DwLW13ov.js} +2 -2
  16. package/dist/admin/assets/{CursorPager-H4SpVYw7.js.map → CursorPager-DwLW13ov.js.map} +1 -1
  17. package/dist/admin/assets/{ExternalLink-BNq7nAYL.js → ExternalLink-BITMgS1K.js} +2 -2
  18. package/dist/admin/assets/{ExternalLink-BNq7nAYL.js.map → ExternalLink-BITMgS1K.js.map} +1 -1
  19. package/dist/admin/assets/{FocalPoint-CSeKI4Iw.js → FocalPoint-n-a_AXKN.js} +2 -2
  20. package/dist/admin/assets/{FocalPoint-CSeKI4Iw.js.map → FocalPoint-n-a_AXKN.js.map} +1 -1
  21. package/dist/admin/assets/Form-D_4fhOy0.js +2 -0
  22. package/dist/admin/assets/Form-D_4fhOy0.js.map +1 -0
  23. package/dist/admin/assets/{FormCheckboxGroup-V3IKrvzc.js → FormCheckboxGroup-1fYisXrr.js} +2 -2
  24. package/dist/admin/assets/FormCheckboxGroup-1fYisXrr.js.map +1 -0
  25. package/dist/admin/assets/{FormRadioGroup-DIv-MYgn.js → FormRadioGroup-B0VZyb1t.js} +2 -2
  26. package/dist/admin/assets/{FormRadioGroup-DIv-MYgn.js.map → FormRadioGroup-B0VZyb1t.js.map} +1 -1
  27. package/dist/admin/assets/{FormSelectField-CUhaPIMY.js → FormSelectField-Br8bkwRF.js} +2 -2
  28. package/dist/admin/assets/{FormSelectField-CUhaPIMY.js.map → FormSelectField-Br8bkwRF.js.map} +1 -1
  29. package/dist/admin/assets/{FormSwitchField-DW8ysyk_.js → FormSwitchField-d8G-YCSX.js} +2 -2
  30. package/dist/admin/assets/{FormSwitchField-DW8ysyk_.js.map → FormSwitchField-d8G-YCSX.js.map} +1 -1
  31. package/dist/admin/assets/{FormTextareaField-DbqZ-MwI.js → FormTextareaField-BSKNeTPW.js} +2 -2
  32. package/dist/admin/assets/{FormTextareaField-DbqZ-MwI.js.map → FormTextareaField-BSKNeTPW.js.map} +1 -1
  33. package/dist/admin/assets/{HintedLabel-BlLtqVVz.js → HintedLabel-CiTDE112.js} +2 -2
  34. package/dist/admin/assets/{HintedLabel-BlLtqVVz.js.map → HintedLabel-CiTDE112.js.map} +1 -1
  35. package/dist/admin/assets/{InfoHint-bYMd_t0J.js → InfoHint-B3XcXtiN.js} +2 -2
  36. package/dist/admin/assets/{InfoHint-bYMd_t0J.js.map → InfoHint-B3XcXtiN.js.map} +1 -1
  37. package/dist/admin/assets/InlineConfirm-BfsNH5S_.js +2 -0
  38. package/dist/admin/assets/InlineConfirm-BfsNH5S_.js.map +1 -0
  39. package/dist/admin/assets/InsertMenuItem-BGwDW_Lu.js +2 -0
  40. package/dist/admin/assets/InsertMenuItem-BGwDW_Lu.js.map +1 -0
  41. package/dist/admin/assets/{LinkTabs-ByB2eCIr.js → LinkTabs-8SmS1vCd.js} +2 -2
  42. package/dist/admin/assets/{LinkTabs-ByB2eCIr.js.map → LinkTabs-8SmS1vCd.js.map} +1 -1
  43. package/dist/admin/assets/{Match-GDx_orOH.js → Match-Dc8bXsKo.js} +2 -2
  44. package/dist/admin/assets/{Match-GDx_orOH.js.map → Match-Dc8bXsKo.js.map} +1 -1
  45. package/dist/admin/assets/NoAccess-CKEKPmqD.js +2 -0
  46. package/dist/admin/assets/NoAccess-CKEKPmqD.js.map +1 -0
  47. package/dist/admin/assets/Panel-Bcl09TtM.js +2 -0
  48. package/dist/admin/assets/Panel-Bcl09TtM.js.map +1 -0
  49. package/dist/admin/assets/{QueryView-UBO-U5Wo.js → QueryView-KFtwko9F.js} +2 -2
  50. package/dist/admin/assets/{QueryView-UBO-U5Wo.js.map → QueryView-KFtwko9F.js.map} +1 -1
  51. package/dist/admin/assets/{RadioTile-CJbIIV8t.js → RadioTile-CzfxWgHx.js} +2 -2
  52. package/dist/admin/assets/{RadioTile-CJbIIV8t.js.map → RadioTile-CzfxWgHx.js.map} +1 -1
  53. package/dist/admin/assets/{RichTextField-M7HyUhYF.js → RichTextField-BsBoOAP-.js} +5 -5
  54. package/dist/admin/assets/{RichTextField-M7HyUhYF.js.map → RichTextField-BsBoOAP-.js.map} +1 -1
  55. package/dist/admin/assets/{RowTitle-DoxDM1XL.js → RowTitle-Cn5mAU58.js} +2 -2
  56. package/dist/admin/assets/{RowTitle-DoxDM1XL.js.map → RowTitle-Cn5mAU58.js.map} +1 -1
  57. package/dist/admin/assets/SecretReveal-BCOJAisI.js +2 -0
  58. package/dist/admin/assets/SecretReveal-BCOJAisI.js.map +1 -0
  59. package/dist/admin/assets/{SharedGlyph-D1OMHXPf.js → SharedGlyph-CA8tb7UH.js} +2 -2
  60. package/dist/admin/assets/{SharedGlyph-D1OMHXPf.js.map → SharedGlyph-CA8tb7UH.js.map} +1 -1
  61. package/dist/admin/assets/StepList-sriwGP1e.js +2 -0
  62. package/dist/admin/assets/StepList-sriwGP1e.js.map +1 -0
  63. package/dist/admin/assets/{Structure-CO4aJZVP.js → Structure-B2HZ9UZu.js} +2 -2
  64. package/dist/admin/assets/{Structure-CO4aJZVP.js.map → Structure-B2HZ9UZu.js.map} +1 -1
  65. package/dist/admin/assets/{SubNavLink-CPJFIt1j.js → SubNavLink-CiCaVV8U.js} +2 -2
  66. package/dist/admin/assets/{SubNavLink-CPJFIt1j.js.map → SubNavLink-CiCaVV8U.js.map} +1 -1
  67. package/dist/admin/assets/{SuggestAltButton-CbRUxD5s.js → SuggestAltButton-CqDLAuoa.js} +2 -2
  68. package/dist/admin/assets/{SuggestAltButton-CbRUxD5s.js.map → SuggestAltButton-CqDLAuoa.js.map} +1 -1
  69. package/dist/admin/assets/{TextLink-DnrMaF2F.js → TextLink-HRn66VL1.js} +2 -2
  70. package/dist/admin/assets/{TextLink-DnrMaF2F.js.map → TextLink-HRn66VL1.js.map} +1 -1
  71. package/dist/admin/assets/Thumbnail-mFfESZiW.js +2 -0
  72. package/dist/admin/assets/Thumbnail-mFfESZiW.js.map +1 -0
  73. package/dist/admin/assets/UnsavedChangesGuard-C8cDQGEA.js +2 -0
  74. package/dist/admin/assets/UnsavedChangesGuard-C8cDQGEA.js.map +1 -0
  75. package/dist/admin/assets/{UserAvatar-Bl32IpG_.js → UserAvatar-BItYDTyH.js} +2 -2
  76. package/dist/admin/assets/{UserAvatar-Bl32IpG_.js.map → UserAvatar-BItYDTyH.js.map} +1 -1
  77. package/dist/admin/assets/auth-CQO4MBUj.js +2 -0
  78. package/dist/admin/assets/auth-CQO4MBUj.js.map +1 -0
  79. package/dist/admin/assets/badge-DNQwGXBl.js +2 -0
  80. package/dist/admin/assets/{badge-ydvfgE8a.js.map → badge-DNQwGXBl.js.map} +1 -1
  81. package/dist/admin/assets/{boxes-D6Y4Cenx.js → boxes-CAygw8zF.js} +2 -2
  82. package/dist/admin/assets/{boxes-D6Y4Cenx.js.map → boxes-CAygw8zF.js.map} +1 -1
  83. package/dist/admin/assets/{calendar-clock-DFUgXWXg.js → calendar-clock-BZGtAvWR.js} +2 -2
  84. package/dist/admin/assets/{calendar-clock-DFUgXWXg.js.map → calendar-clock-BZGtAvWR.js.map} +1 -1
  85. package/dist/admin/assets/changeSets-EMTUJT0M.js +2 -0
  86. package/dist/admin/assets/changeSets-EMTUJT0M.js.map +1 -0
  87. package/dist/admin/assets/chevron-left-DGU3HGYG.js +2 -0
  88. package/dist/admin/assets/{chevron-left-CZXrLV99.js.map → chevron-left-DGU3HGYG.js.map} +1 -1
  89. package/dist/admin/assets/{circle-check-De27poaB.js → circle-check-C37MSJqX.js} +2 -2
  90. package/dist/admin/assets/{circle-check-De27poaB.js.map → circle-check-C37MSJqX.js.map} +1 -1
  91. package/dist/admin/assets/{clock-BGAXsuo4.js → clock-2arjsgZ4.js} +2 -2
  92. package/dist/admin/assets/{clock-BGAXsuo4.js.map → clock-2arjsgZ4.js.map} +1 -1
  93. package/dist/admin/assets/{constants-esJAnNTh.js → constants-miV4q1ur.js} +2 -2
  94. package/dist/admin/assets/{constants-esJAnNTh.js.map → constants-miV4q1ur.js.map} +1 -1
  95. package/dist/admin/assets/content-CgZS_S7P.js +3 -0
  96. package/dist/admin/assets/content-CgZS_S7P.js.map +1 -0
  97. package/dist/admin/assets/contentCounts-DP7YYeZZ.js +2 -0
  98. package/dist/admin/assets/{contentCounts-DknqJ4kh.js.map → contentCounts-DP7YYeZZ.js.map} +1 -1
  99. package/dist/admin/assets/{contentTypes-C-AKiYu1.js → contentTypes-CQsHL657.js} +2 -2
  100. package/dist/admin/assets/{contentTypes-C-AKiYu1.js.map → contentTypes-CQsHL657.js.map} +1 -1
  101. package/dist/admin/assets/context-IKYdzQJ-.js +2 -0
  102. package/dist/admin/assets/{context-fImO9k99.js.map → context-IKYdzQJ-.js.map} +1 -1
  103. package/dist/admin/assets/{copy-B5owk67M.js → copy-CsSRHgKZ.js} +2 -2
  104. package/dist/admin/assets/{copy-B5owk67M.js.map → copy-CsSRHgKZ.js.map} +1 -1
  105. package/dist/admin/assets/createLucideIcon-CLmh7Go-.js +2 -0
  106. package/dist/admin/assets/createLucideIcon-CLmh7Go-.js.map +1 -0
  107. package/dist/admin/assets/develop-9ZeAjSIw.js +11 -0
  108. package/dist/admin/assets/develop-9ZeAjSIw.js.map +1 -0
  109. package/dist/admin/assets/{dropdown-menu-C53v9ioW.js → dropdown-menu-0dyAtBEd.js} +2 -2
  110. package/dist/admin/assets/{dropdown-menu-C53v9ioW.js.map → dropdown-menu-0dyAtBEd.js.map} +1 -1
  111. package/dist/admin/assets/{ellipsis-BHtU4ov6.js → ellipsis-F91991on.js} +2 -2
  112. package/dist/admin/assets/{ellipsis-BHtU4ov6.js.map → ellipsis-F91991on.js.map} +1 -1
  113. package/dist/admin/assets/entryLink-CVB-TdIn.js +2 -0
  114. package/dist/admin/assets/entryLink-CVB-TdIn.js.map +1 -0
  115. package/dist/admin/assets/es2015-BJge4oQL.js +42 -0
  116. package/dist/admin/assets/es2015-BJge4oQL.js.map +1 -0
  117. package/dist/admin/assets/{external-link-nZp2VpKw.js → external-link-CdG6kHfA.js} +2 -2
  118. package/dist/admin/assets/{external-link-nZp2VpKw.js.map → external-link-CdG6kHfA.js.map} +1 -1
  119. package/dist/admin/assets/{field-W1dB_h6d.js → field-C6NmRYUN.js} +2 -2
  120. package/dist/admin/assets/{field-W1dB_h6d.js.map → field-C6NmRYUN.js.map} +1 -1
  121. package/dist/admin/assets/{file-stack-8rRouTJj.js → file-stack-28ZtO1xW.js} +2 -2
  122. package/dist/admin/assets/{file-stack-8rRouTJj.js.map → file-stack-28ZtO1xW.js.map} +1 -1
  123. package/dist/admin/assets/{fileRoute-DzWMBrRx.js → fileRoute-Bm90K4UY.js} +2 -2
  124. package/dist/admin/assets/{fileRoute-DzWMBrRx.js.map → fileRoute-Bm90K4UY.js.map} +1 -1
  125. package/dist/admin/assets/{folder-plus-B3L3b389.js → folder-plus-DIk0pWkP.js} +2 -2
  126. package/dist/admin/assets/{folder-plus-B3L3b389.js.map → folder-plus-DIk0pWkP.js.map} +1 -1
  127. package/dist/admin/assets/followPlural-DEr2kxEc.js +2 -0
  128. package/dist/admin/assets/followPlural-DEr2kxEc.js.map +1 -0
  129. package/dist/admin/assets/{globe-DKkjr9MZ.js → globe-DFr3Gd2w.js} +2 -2
  130. package/dist/admin/assets/{globe-DKkjr9MZ.js.map → globe-DFr3Gd2w.js.map} +1 -1
  131. package/dist/admin/assets/{image-B6aL7hP8.js → image-DT79QFa_.js} +2 -2
  132. package/dist/admin/assets/{image-B6aL7hP8.js.map → image-DT79QFa_.js.map} +1 -1
  133. package/dist/admin/assets/{image-off-TVxEyb74.js → image-off-DFs5upyX.js} +2 -2
  134. package/dist/admin/assets/{image-off-TVxEyb74.js.map → image-off-DFs5upyX.js.map} +1 -1
  135. package/dist/admin/assets/inbox-B8XZ8L6s.js +2 -0
  136. package/dist/admin/assets/inbox-B8XZ8L6s.js.map +1 -0
  137. package/dist/admin/assets/{inbox-BKqu1EfP.js → inbox-CySnQydm.js} +2 -2
  138. package/dist/admin/assets/{inbox-BKqu1EfP.js.map → inbox-CySnQydm.js.map} +1 -1
  139. package/dist/admin/assets/index-DoJsnLI1.js +4 -0
  140. package/dist/admin/assets/index-DoJsnLI1.js.map +1 -0
  141. package/dist/admin/assets/index-lxe7WimO.css +2 -0
  142. package/dist/admin/assets/{key-round-Dmdr1vP5.js → key-round-D36CePnN.js} +2 -2
  143. package/dist/admin/assets/{key-round-Dmdr1vP5.js.map → key-round-D36CePnN.js.map} +1 -1
  144. package/dist/admin/assets/{labels-CHE0gg1n.js → labels-B2HIVxXg.js} +2 -2
  145. package/dist/admin/assets/{labels-CHE0gg1n.js.map → labels-B2HIVxXg.js.map} +1 -1
  146. package/dist/admin/assets/{languages-BbfFIygP.js → languages-CzbTaQv9.js} +2 -2
  147. package/dist/admin/assets/{languages-BbfFIygP.js.map → languages-CzbTaQv9.js.map} +1 -1
  148. package/dist/admin/assets/{layers-B0jT4rc4.js → layers-BmcodiaH.js} +2 -2
  149. package/dist/admin/assets/{layers-B0jT4rc4.js.map → layers-BmcodiaH.js.map} +1 -1
  150. package/dist/admin/assets/{link-2-off-DC06jLDj.js → link-2-off-CoJNwrxm.js} +2 -2
  151. package/dist/admin/assets/{link-2-off-DC06jLDj.js.map → link-2-off-CoJNwrxm.js.map} +1 -1
  152. package/dist/admin/assets/{link-B3O0VUVT.js → link-Pyr2Y35S.js} +2 -2
  153. package/dist/admin/assets/{link-B3O0VUVT.js.map → link-Pyr2Y35S.js.map} +1 -1
  154. package/dist/admin/assets/locales-Bg3htKo8.js +2 -0
  155. package/dist/admin/assets/{locales-e7B5t6id.js.map → locales-Bg3htKo8.js.map} +1 -1
  156. package/dist/admin/assets/media-BCnVhaDH.js +2 -0
  157. package/dist/admin/assets/{media-VCJUbYzJ.js.map → media-BCnVhaDH.js.map} +1 -1
  158. package/dist/admin/assets/media-CtbfNgc-.js +2 -0
  159. package/dist/admin/assets/media-CtbfNgc-.js.map +1 -0
  160. package/dist/admin/assets/network--5X46kWN.js +2 -0
  161. package/dist/admin/assets/network--5X46kWN.js.map +1 -0
  162. package/dist/admin/assets/{plus-WfYKHW7G.js → plus-BoDtdLCo.js} +2 -2
  163. package/dist/admin/assets/{plus-WfYKHW7G.js.map → plus-BoDtdLCo.js.map} +1 -1
  164. package/dist/admin/assets/publishing-DdmWXRaM.js +2 -0
  165. package/dist/admin/assets/{publishing-ClNjPLQ9.js.map → publishing-DdmWXRaM.js.map} +1 -1
  166. package/dist/admin/assets/{radio-group-rFxn7cz2.js → radio-group-BoN9R_3K.js} +2 -2
  167. package/dist/admin/assets/{radio-group-rFxn7cz2.js.map → radio-group-BoN9R_3K.js.map} +1 -1
  168. package/dist/admin/assets/{rotate-ccw-Cvc_uA58.js → rotate-ccw-DL6TzcZh.js} +2 -2
  169. package/dist/admin/assets/{rotate-ccw-Cvc_uA58.js.map → rotate-ccw-DL6TzcZh.js.map} +1 -1
  170. package/dist/admin/assets/schedules-BmB9Y73z.js +2 -0
  171. package/dist/admin/assets/{schedules-CBGpjEg7.js.map → schedules-BmB9Y73z.js.map} +1 -1
  172. package/dist/admin/assets/schema-D-qo7XSF.js +2 -0
  173. package/dist/admin/assets/schema-D-qo7XSF.js.map +1 -0
  174. package/dist/admin/assets/{scroll-text-gKYBbibb.js → scroll-text-PqeZm472.js} +2 -2
  175. package/dist/admin/assets/{scroll-text-gKYBbibb.js.map → scroll-text-PqeZm472.js.map} +1 -1
  176. package/dist/admin/assets/{search-CW3iBC4k.js → search-BdwIwOzC.js} +2 -2
  177. package/dist/admin/assets/{search-CW3iBC4k.js.map → search-BdwIwOzC.js.map} +1 -1
  178. package/dist/admin/assets/searchSchemas-DNjfDxmj.js +2 -0
  179. package/dist/admin/assets/{searchSchemas-C4qp-vCa.js.map → searchSchemas-DNjfDxmj.js.map} +1 -1
  180. package/dist/admin/assets/{sections-CN5fIoAr.js → sections-BTS683ur.js} +2 -2
  181. package/dist/admin/assets/{sections-CN5fIoAr.js.map → sections-BTS683ur.js.map} +1 -1
  182. package/dist/admin/assets/sections-BfxPwK0u.js +2 -0
  183. package/dist/admin/assets/{sections-C7Z6Xd8r.js.map → sections-BfxPwK0u.js.map} +1 -1
  184. package/dist/admin/assets/{select-DUhL27UN.js → select-Bp8kO5Ko.js} +2 -2
  185. package/dist/admin/assets/{select-DUhL27UN.js.map → select-Bp8kO5Ko.js.map} +1 -1
  186. package/dist/admin/assets/{send-DRA-Pe46.js → send-XPWo3m4u.js} +2 -2
  187. package/dist/admin/assets/{send-DRA-Pe46.js.map → send-XPWo3m4u.js.map} +1 -1
  188. package/dist/admin/assets/seo-CceGYTIX.js +2 -0
  189. package/dist/admin/assets/{seo-l1ZORjtv.js.map → seo-CceGYTIX.js.map} +1 -1
  190. package/dist/admin/assets/settings-TEbLvC-v.js +2 -0
  191. package/dist/admin/assets/settings-TEbLvC-v.js.map +1 -0
  192. package/dist/admin/assets/settle-CFU6YpQ0.js +2 -0
  193. package/dist/admin/assets/settle-CFU6YpQ0.js.map +1 -0
  194. package/dist/admin/assets/shapes-WrYO9Spf.js +6 -0
  195. package/dist/admin/assets/shapes-WrYO9Spf.js.map +1 -0
  196. package/dist/admin/assets/{skeleton-Dyi_b1wq.js → skeleton-vXOCdnJv.js} +2 -2
  197. package/dist/admin/assets/{skeleton-Dyi_b1wq.js.map → skeleton-vXOCdnJv.js.map} +1 -1
  198. package/dist/admin/assets/slugify-rYFum3Sc.js +2 -0
  199. package/dist/admin/assets/slugify-rYFum3Sc.js.map +1 -0
  200. package/dist/admin/assets/snapshots-DUI2t-qF.js +2 -0
  201. package/dist/admin/assets/snapshots-DUI2t-qF.js.map +1 -0
  202. package/dist/admin/assets/{sparkles-DCRAqbqD.js → sparkles-CvT-jxrW.js} +2 -2
  203. package/dist/admin/assets/{sparkles-DCRAqbqD.js.map → sparkles-CvT-jxrW.js.map} +1 -1
  204. package/dist/admin/assets/src-ndgTSYLX.js +7 -0
  205. package/dist/admin/assets/src-ndgTSYLX.js.map +1 -0
  206. package/dist/admin/assets/{stableId-iRkUbVIP.js → stableId-BrtQedPy.js} +2 -2
  207. package/dist/admin/assets/{stableId-iRkUbVIP.js.map → stableId-BrtQedPy.js.map} +1 -1
  208. package/dist/admin/assets/store-CdIFG90N.js +2 -0
  209. package/dist/admin/assets/{store-DknnssoQ.js.map → store-CdIFG90N.js.map} +1 -1
  210. package/dist/admin/assets/{switch-C3dDDUIk.js → switch-B1xClhNG.js} +2 -2
  211. package/dist/admin/assets/{switch-C3dDDUIk.js.map → switch-B1xClhNG.js.map} +1 -1
  212. package/dist/admin/assets/theme-65PB8uAu.js +2 -0
  213. package/dist/admin/assets/{theme-DPe080iG.js.map → theme-65PB8uAu.js.map} +1 -1
  214. package/dist/admin/assets/titles-CQiqqDw-.js +2 -0
  215. package/dist/admin/assets/titles-CQiqqDw-.js.map +1 -0
  216. package/dist/admin/assets/tokens-ixHjAkDK.js +2 -0
  217. package/dist/admin/assets/{tokens-BlIDIMY9.js.map → tokens-ixHjAkDK.js.map} +1 -1
  218. package/dist/admin/assets/{tooltip-BEaZkRPK.js → tooltip-CS_8cJu2.js} +2 -2
  219. package/dist/admin/assets/{tooltip-BEaZkRPK.js.map → tooltip-CS_8cJu2.js.map} +1 -1
  220. package/dist/admin/assets/{undo-2-Zd1OT6qk.js → undo-2-BiTANHFz.js} +2 -2
  221. package/dist/admin/assets/{undo-2-Zd1OT6qk.js.map → undo-2-BiTANHFz.js.map} +1 -1
  222. package/dist/admin/assets/useContentSchema-DtYfhsd2.js +2 -0
  223. package/dist/admin/assets/{useContentSchema-wLDa2L3f.js.map → useContentSchema-DtYfhsd2.js.map} +1 -1
  224. package/dist/admin/assets/useCursorPager-0zHjlm-7.js +2 -0
  225. package/dist/admin/assets/{useCursorPager-Dc-9B67j.js.map → useCursorPager-0zHjlm-7.js.map} +1 -1
  226. package/dist/admin/assets/useDiscardGuard-CMMJgkI2.js +2 -0
  227. package/dist/admin/assets/useDiscardGuard-CMMJgkI2.js.map +1 -0
  228. package/dist/admin/assets/useMediaPickerDialog-xvQ8cofO.js +2 -0
  229. package/dist/admin/assets/{useMediaPickerDialog-CFN9ZKfe.js.map → useMediaPickerDialog-xvQ8cofO.js.map} +1 -1
  230. package/dist/admin/assets/useMediaUploader-BVNTeSAU.js +2 -0
  231. package/dist/admin/assets/{useMediaUploader-B42H_CMG.js.map → useMediaUploader-BVNTeSAU.js.map} +1 -1
  232. package/dist/admin/assets/useNetworkPermission-Cts98h9d.js +2 -0
  233. package/dist/admin/assets/{useNetworkPermission-CegwqQXR.js.map → useNetworkPermission-Cts98h9d.js.map} +1 -1
  234. package/dist/admin/assets/usePaletteItems-DtReWmkd.js +2 -0
  235. package/dist/admin/assets/{usePaletteItems-B3y2t7Ly.js.map → usePaletteItems-DtReWmkd.js.map} +1 -1
  236. package/dist/admin/assets/usePlaces-DC47wVeU.js +2 -0
  237. package/dist/admin/assets/{usePlaces-CAXr-IO9.js.map → usePlaces-DC47wVeU.js.map} +1 -1
  238. package/dist/admin/assets/useQueries-CirW3Mvp.js +2 -0
  239. package/dist/admin/assets/{useQueries-CX6eFr24.js.map → useQueries-CirW3Mvp.js.map} +1 -1
  240. package/dist/admin/assets/{useResolvedScheme-aV0QDPi3.js → useResolvedScheme-CScQpr-P.js} +2 -2
  241. package/dist/admin/assets/{useResolvedScheme-aV0QDPi3.js.map → useResolvedScheme-CScQpr-P.js.map} +1 -1
  242. package/dist/admin/assets/{useSchemaScopeAccess-DyfiZnzs.js → useSchemaScopeAccess-ByrxIdKM.js} +2 -2
  243. package/dist/admin/assets/{useSchemaScopeAccess-DyfiZnzs.js.map → useSchemaScopeAccess-ByrxIdKM.js.map} +1 -1
  244. package/dist/admin/assets/users-2iJYwlJb.js +2 -0
  245. package/dist/admin/assets/users-2iJYwlJb.js.map +1 -0
  246. package/dist/admin/assets/{users-ohHZnBJW.js → users-DM7CXUBJ.js} +2 -2
  247. package/dist/admin/assets/{users-ohHZnBJW.js.map → users-DM7CXUBJ.js.map} +1 -1
  248. package/dist/admin/assets/{zod-C-k48Hnc.js → zod-hUh5nXnX.js} +2 -2
  249. package/dist/admin/assets/{zod-C-k48Hnc.js.map → zod-hUh5nXnX.js.map} +1 -1
  250. package/dist/admin/index.html +59 -60
  251. package/dist/cli.js +10 -5689
  252. package/dist/cli.js.map +1 -1
  253. package/dist/cliMain-D08HeAd_.js +5771 -0
  254. package/dist/cliMain-D08HeAd_.js.map +1 -0
  255. package/dist/config.d.ts +1 -1
  256. package/dist/config.js +1 -38
  257. package/dist/contentDisposition-DOL2Xt0l.js +90 -0
  258. package/dist/contentDisposition-DOL2Xt0l.js.map +1 -0
  259. package/dist/index.d.ts +30 -8
  260. package/dist/index.js +2 -2
  261. package/dist/public-B57h4F7Y.js +39 -0
  262. package/dist/public-B57h4F7Y.js.map +1 -0
  263. package/dist/{public-BO_wneBL.d.ts → public-COKbHR-N.d.ts} +47 -3
  264. package/dist/{s3Adapter-sL1zP4Zl.js → s3Adapter-U01iEAcK.js} +2 -2
  265. package/dist/{s3Adapter-sL1zP4Zl.js.map → s3Adapter-U01iEAcK.js.map} +1 -1
  266. package/dist/{worker-DMES6pqh.js → worker-jspgh10V.js} +6384 -4527
  267. package/dist/worker-jspgh10V.js.map +1 -0
  268. package/package.json +5 -5
  269. package/dist/admin/assets/AssistError-drmpXSbS.js +0 -2
  270. package/dist/admin/assets/Body-Gn_z2KPN.js +0 -2
  271. package/dist/admin/assets/Builder-DyCcikfS.js +0 -2
  272. package/dist/admin/assets/Builder-DyCcikfS.js.map +0 -1
  273. package/dist/admin/assets/ConfirmDialog-DZRJfdvH.js +0 -2
  274. package/dist/admin/assets/ConfirmDialog-DZRJfdvH.js.map +0 -1
  275. package/dist/admin/assets/Form-DF_YmR1G.js +0 -2
  276. package/dist/admin/assets/Form-DF_YmR1G.js.map +0 -1
  277. package/dist/admin/assets/FormCheckboxGroup-V3IKrvzc.js.map +0 -1
  278. package/dist/admin/assets/InsertMenuItem-D2HGERzb.js +0 -2
  279. package/dist/admin/assets/InsertMenuItem-D2HGERzb.js.map +0 -1
  280. package/dist/admin/assets/Panel-B1TkcP8V.js +0 -2
  281. package/dist/admin/assets/Panel-B1TkcP8V.js.map +0 -1
  282. package/dist/admin/assets/SecretReveal-kCkLH5jg.js +0 -2
  283. package/dist/admin/assets/SecretReveal-kCkLH5jg.js.map +0 -1
  284. package/dist/admin/assets/StepList-BIQjDaWQ.js +0 -2
  285. package/dist/admin/assets/StepList-BIQjDaWQ.js.map +0 -1
  286. package/dist/admin/assets/Thumbnail-D1XuDElk.js +0 -2
  287. package/dist/admin/assets/Thumbnail-D1XuDElk.js.map +0 -1
  288. package/dist/admin/assets/UnsavedChangesGuard-C1n7egF6.js +0 -2
  289. package/dist/admin/assets/UnsavedChangesGuard-C1n7egF6.js.map +0 -1
  290. package/dist/admin/assets/auth-C4fHG9Iu.js +0 -2
  291. package/dist/admin/assets/auth-C4fHG9Iu.js.map +0 -1
  292. package/dist/admin/assets/badge-ydvfgE8a.js +0 -2
  293. package/dist/admin/assets/changeSets-DgfCKja3.js +0 -2
  294. package/dist/admin/assets/changeSets-DgfCKja3.js.map +0 -1
  295. package/dist/admin/assets/chevron-left-CZXrLV99.js +0 -2
  296. package/dist/admin/assets/content-DsMSB6Wb.js +0 -3
  297. package/dist/admin/assets/content-DsMSB6Wb.js.map +0 -1
  298. package/dist/admin/assets/contentCounts-DknqJ4kh.js +0 -2
  299. package/dist/admin/assets/context-fImO9k99.js +0 -2
  300. package/dist/admin/assets/createLucideIcon-CqygG5K6.js +0 -2
  301. package/dist/admin/assets/createLucideIcon-CqygG5K6.js.map +0 -1
  302. package/dist/admin/assets/develop-DL-2W9jv.js +0 -11
  303. package/dist/admin/assets/develop-DL-2W9jv.js.map +0 -1
  304. package/dist/admin/assets/es2015-DrAA1N2V.js +0 -42
  305. package/dist/admin/assets/es2015-DrAA1N2V.js.map +0 -1
  306. package/dist/admin/assets/followPlural-D-5ZJqJF.js +0 -2
  307. package/dist/admin/assets/followPlural-D-5ZJqJF.js.map +0 -1
  308. package/dist/admin/assets/inbox-DUqOrFEA.js +0 -2
  309. package/dist/admin/assets/inbox-DUqOrFEA.js.map +0 -1
  310. package/dist/admin/assets/index-BEM45u2w.css +0 -2
  311. package/dist/admin/assets/index-D03RZB7e.js +0 -4
  312. package/dist/admin/assets/index-D03RZB7e.js.map +0 -1
  313. package/dist/admin/assets/loader-circle-C-9trZPI.js +0 -2
  314. package/dist/admin/assets/loader-circle-C-9trZPI.js.map +0 -1
  315. package/dist/admin/assets/locales-e7B5t6id.js +0 -2
  316. package/dist/admin/assets/media-BUUEsWxd.js +0 -2
  317. package/dist/admin/assets/media-BUUEsWxd.js.map +0 -1
  318. package/dist/admin/assets/media-VCJUbYzJ.js +0 -2
  319. package/dist/admin/assets/network-Bolr2lmf.js +0 -2
  320. package/dist/admin/assets/network-Bolr2lmf.js.map +0 -1
  321. package/dist/admin/assets/pencil-BVSFlU14.js +0 -2
  322. package/dist/admin/assets/pencil-BVSFlU14.js.map +0 -1
  323. package/dist/admin/assets/publishing-ClNjPLQ9.js +0 -2
  324. package/dist/admin/assets/schedules-CBGpjEg7.js +0 -2
  325. package/dist/admin/assets/schema-D9BgCVzZ.js +0 -2
  326. package/dist/admin/assets/schema-D9BgCVzZ.js.map +0 -1
  327. package/dist/admin/assets/searchSchemas-C4qp-vCa.js +0 -2
  328. package/dist/admin/assets/sections-C7Z6Xd8r.js +0 -2
  329. package/dist/admin/assets/seo-l1ZORjtv.js +0 -2
  330. package/dist/admin/assets/settings-DgoG3H8C.js +0 -2
  331. package/dist/admin/assets/settings-DgoG3H8C.js.map +0 -1
  332. package/dist/admin/assets/settle-LRKtTN_e.js +0 -2
  333. package/dist/admin/assets/settle-LRKtTN_e.js.map +0 -1
  334. package/dist/admin/assets/shapes-BZ87ap5s.js +0 -6
  335. package/dist/admin/assets/shapes-BZ87ap5s.js.map +0 -1
  336. package/dist/admin/assets/snapshots-CT-zs6Up.js +0 -2
  337. package/dist/admin/assets/snapshots-CT-zs6Up.js.map +0 -1
  338. package/dist/admin/assets/src-BcLeD2-K.js +0 -7
  339. package/dist/admin/assets/src-BcLeD2-K.js.map +0 -1
  340. package/dist/admin/assets/store-DknnssoQ.js +0 -2
  341. package/dist/admin/assets/theme-DPe080iG.js +0 -2
  342. package/dist/admin/assets/titles-C5PaMgFJ.js +0 -2
  343. package/dist/admin/assets/titles-C5PaMgFJ.js.map +0 -1
  344. package/dist/admin/assets/tokens-BlIDIMY9.js +0 -2
  345. package/dist/admin/assets/useAuditLabels-DWBpLOTB.js +0 -2
  346. package/dist/admin/assets/useAuditLabels-DWBpLOTB.js.map +0 -1
  347. package/dist/admin/assets/useContentSchema-wLDa2L3f.js +0 -2
  348. package/dist/admin/assets/useCursorPager-Dc-9B67j.js +0 -2
  349. package/dist/admin/assets/useDiscardGuard-WTUINqD5.js +0 -2
  350. package/dist/admin/assets/useDiscardGuard-WTUINqD5.js.map +0 -1
  351. package/dist/admin/assets/useMediaPickerDialog-CFN9ZKfe.js +0 -2
  352. package/dist/admin/assets/useMediaUploader-B42H_CMG.js +0 -2
  353. package/dist/admin/assets/useNetworkPermission-CegwqQXR.js +0 -2
  354. package/dist/admin/assets/usePaletteItems-B3y2t7Ly.js +0 -2
  355. package/dist/admin/assets/usePlaces-CAXr-IO9.js +0 -2
  356. package/dist/admin/assets/useQueries-CX6eFr24.js +0 -2
  357. package/dist/admin/assets/users-CDoJRL24.js +0 -2
  358. package/dist/admin/assets/users-CDoJRL24.js.map +0 -1
  359. package/dist/config.js.map +0 -1
  360. package/dist/worker-DMES6pqh.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";i7JAmBA,IAAIA,GAAgB,cAAcC,EAAa,CAC9C,GACA,GACA,GACA,YAAY,EAAS,CAAC,EAAG,CACxB,MAAM,EACN,KAAK,OAASC,EACd,KAAKC,GAA6B,IAAI,IACtC,KAAKC,GAA0B,IAAI,IACnC,KAAKC,GAAc,CACpB,CAEA,MAAM,EAAQ,EAAS,EAAO,CAC7B,IAAMC,EAAW,IAAIC,EAAS,CAC7B,SACA,cAAe,KACf,WAAY,EAAE,KAAKF,GACnB,QAASG,EAAO,uBAAuBC,CAAO,EAC9C,OACD,CAAC,EAED,OADA,KAAK,IAAIH,CAAQ,EACVA,CACR,CAEA,IAAI,EAAU,CACb,KAAKH,GAAW,IAAIG,CAAQ,EAC5B,IAAMI,EAAQC,GAASL,CAAQ,EAC/B,GAAI,OAAOI,GAAU,SAAU,CAC9B,IAAME,EAAkB,KAAKR,GAAQ,IAAIM,CAAK,EAC1CE,EAAiBA,EAAgB,KAAKN,CAAQ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B,EACzB,kBAAmB,EACrB,CAAC,EC7eU0d,OAAY,CACvB,GAAM,CAACrlB,IAAA,EAAe8D,YAASnE,EAAiB,EAC1C,CAACtlB,IAAA,EAAUypB,gBAAeshB,GAAgBplB,CAAW,CAAC,EAC5D,OACE,EAAAlN,EAAA,KAACwyB,GAAD,CAAqB,OAAQtlB,EAC3B,YAAAlN,EAAA,KAACc,GAAD,CAAwB,QAAS,EACd,EAEzB,ECTM2xB,GAAY,SAAS,eAAe,MAAM,EAChD,GAAI,CAACA,GACH,MAAU,MAAM,uBAAuB,EAGzC,MAAMC,GAAS,GAEfC,iBAAWF,EAAS,CAAC,CAAC,QACpB,EAAAzyB,EAAA,KAAC4yB,aAAD,WACE,EAAA5yB,EAAA,KAACuyB,GAAD,CAAM,EACI,EACd","names":["MutationCache","Subscribable","config","#mutations","#scopes","#mutationId","mutation","Mutation","client","options","scope","scopeFor","scopedMutations","index","firstPendingMutation","m","notifyManager","defaultedFilters","filters","matchMutation","listener","event","pausedMutations","x","noop","QueryCache","#queries","queryKey","queryHash","hashQueryKeyByOptions","query","Query","matchQuery","queries","QueryClient","#queryCache","#mutationCache","#defaultOptions","#queryDefaults","#mutationDefaults","#mountCount","#unsubscribeFocus","focusManager","focused","#unsubscribeOnline","onlineManager","online","defaultedOptions","cachedData","resolveQueryValue","state","prevData","data","functionalUpdate","updater","queryCache","matched","queriesToRefetch","defaultedCancelOptions","cancelOptions","promises","fetchOptions","promise","queryData","select","hashKey","defaults","result","partialMatchKey","queryDefault","mutationKey","skipToken","encode","key","obj","val","stringify","toValue","str","decode","searchParams","value","previousValue","jsonStart","defaultParseSearch","parseSearchWith","defaultStringifySearch","stringifySearchWith","isJsonParser","parser","searchStr","stringifyValue","search","createSieveCache","cache","hand","newest","entry","existing","max","node","SEGMENT_TYPE_INDEX","SEGMENT_TYPE_PATHLESS","getParamNames","cached","keys","segment","parseSegment","part","path","start","end","open","close","optional","nameStart","parseSegments","cursor","route","length","literalEnd","caseSensitive","defaultCaseSensitive","parseParams","interpolation","literalStart","parentInterpolation","tail","last","next","nextNode","name","staticChildren","existingNode","createSegmentNode","kind","prefix","suffix","actuallyCaseSensitive","siblings","s","dynamicListsToSort","segmentData","pathlessNode","isLeaf","indexNode","sortDynamic","a","b","parent","processRouteMasks","segmentTree","visit","segments","parentNode","child","routeList","nodes","findFlatMatch","processedTree","findMatch","findSingleMatch","from","tree","fuzzy","findRouteMatch","err","buildRouteBranch","processRouteTree","routesById","routesByPath","invariant","trimmedFullPath","trimPathRight","routeTree","parts","leaf","getNodeMatch","rawParams","extractParams","list","buildBranch","names","partIndex","nodeIndex","pathIndex","paramIndex","currentPathIndex","n","splat","trailingSlash","pathIsIndex","partsLength","stack","bestFuzzy","bestMatch","frame","isFrameMoreSpecific","validateParseParams","isBeyondPath","lowerPart","indexFrame","indexValid","dynamics","optionals","skipped","isPerfectStaticMatch","statics","i","suffixPart","nextSkipped","casePart","segmentScore","match","sliceIndex","prev","rewriteBasepath","trimmedBasepath","trimPath","basepath","normalizedBasepath","checkBasepath","checkBasepathWithSlash","basepathRewrite","pathname","url","cleanPath","rewrite","executeRewriteInput","executeRewriteOutput","res","createRouterStores","byRoute","status","createMutableStore","location","initialLocation","resolvedLocation","ids","matches","createReadonlyStore","id","__store","getMatchStore","matchStore","routeId","store","setMatches","previousIds","nextIds","nextMatches","batch","arraysEqual","nextMatch","stateIndexKey","popStateEvent","beforeUnloadEvent","protocolRelativePrefix","normalizeProtocolRelative","normalizeHref","href","character","createHistory","opts","subscribers","notify","subscriber","handleIndexChange","action","tryNavigation","actionInfo","navigateOpts","task","blockers","isPushOrReplace","blocker","nextLocation","parseHref","cb","currentIndex","assignKeyAndIndex","createRandomKey","createBrowserHistory","win","originalPushState","originalReplaceState","_getBlockers","_setBlockers","newBlockers","createHref","parseLocation","addedKey","currentLocation","rollbackLocation","nextPopIsGo","ignoreNextPop","skipBlockerNextPop","ignoreNextBeforeUnload","getLocation","flush","queueHistoryAction","destHref","hasPendingAction","isPush","onPushPop","history","onPushPopEvent","delta","isForward","isBack","isGo","onBeforeUnload","shouldBlock","shouldHaveBeforeUnload","ignoreBlocker","args","sanitizedHref","hashIndex","searchIndex","isExternalUrl","origin","getUrlPath","routeNeedsLoad","getLocationChangeInfo","_getUserHistoryState","_key","_tsrKey","_tsrIndex","_hashScroll","lifecycleEnd","runRouteLifecycle","previousEnd","previous","nextEnd","owner","router","candidate","RouterCore","fn","prevOptions","newOptions","nextBasepath","nextRewriteOption","rewriteChanged","processRouteTreeResult","setupScrollRestoration","routerEvent","parse","parsedSearch","hash","decodePath","nullReplaceEqualDeep","previousLocation","replaceEqualDeep","locationToParse","__tempLocation","__tempKey","parsedTempLocation","pathnameOrNext","locationSearchOrOpts","\"__root__\"","usedCurrent","build","dest","parsed","lightweight","current","currentMatch","to","nextTo","resolvePath","destRoute","isTemplate","destRoutes","matchedRoutes","foundRoute","nextParams","fromParams","resolveNextParams","hasKeys","createNull","needsInheritedParams","EMPTY_RECORD","nextPathname","interpolatePath","middlewares","getSearchMiddlewares","fromSearch","validatedSearch","validateSearch","nextSearch","applySearchMiddleware","hashStr","nextState","fullPath","publicHref","external","rewrittenUrl","encodePathLikeUrl","params","_from","maskParams","maskProps","documentNavigation","historyAction","isSameLocation","deepEqual","previousCommitPromise","resolve","commitPromise","done","nextHistory","maskedLocation","hashScrollIntoView","viewTransition","rest","hrefScheme","getUrlScheme","reloadDocument","publicLocation","reloadHref","loadClientRoute","shouldViewTransition","startViewTransitionParams","prevLocation","resolvedViewTransitionTypes","committedMatches","filter","preloads","invalidIds","consider","abort","controller","invalidate","d","flight","redirect","scheme","protocolRelativePrefixRegex","discarded","discardedIds","loadRouteChunk","preloadClientRoute","matchLocation","isPending","baseLocation","getStoreConfig","compileDecodeCharMap","DEFAULT_PROTOCOL_ALLOWLIST","caches","notFoundRoute","initialMatchedRoutes","isGlobalNotFound","_notFoundRouteId","findGlobalNotFoundRouteId","committed","previousAt","strictParams","parentMatch","preMatchSearch","strictMatchSearch","searchError","parentSearch","parentStrictSearch","strictSearch","searchParamError","SearchParamError","loaderDeps","loaderDepsHash","cause","usedParams","interpolatedPath","matchId","previousMatch","existingMatch","paramsError","extractStrictParams","isNotFound","isRedirect","PathParamError","_notFound","lastRouteId","lastStateMatch","lastStateMatchId","lastRoute","accumulatedSearch","canReuseParams","replace","input","spec","base","hasOwn","routeOptions","routeValidateSearch","includeValidateSearch","validated","meta","applyNext","currentSearch","collectMeta","nextMeta","newSearch","notFoundMode","fallback","routes","rootRouteId","accumulatedParams","preloadComponent","type","loadComponents","component","pending","onPendingReady","afterLazy","componentType","_id","lazyRoute","error","_getRenderedMatches","SUCCESS","ERROR","NOT_FOUND","REDIRECTED","CANCELED_OUTCOME","isControl","waitFor","signal","reject","getRoute","normalize","rejected","normalizeError","outcome","onErrorCause","normalizeLaneError","materializeRedirect","lane","contextualize","preload","parentContext","common","routeContext","releaseFlight","validationError","beforeLoad","previousStatus","retainedEnd","setFetching","planSuccessfulLane","releaseOwnedFlight","transferMatchResources","deferSameIdFlight","acquireMatchResources","presented","getLoaderContext","loadResource","loader","parentMatchPromise","settleInto","cacheLoaderMatch","planned","getParentSnapshot","createLoaderTask","plannedCacheMatch","configured","reload","reloadFailure","semanticParent","staleAge","routeLoader","isLoaderFn","preloadable","donor","background","loaded","blocking","onReady","onLazyReady","acceptedFlight","chunkFailure","chunk","candidateIndex","tasks","backgroundOutcome","getNotFoundBoundary","indexed","loading","discardBackground","settleTasks","loaderFailure","taskIndex","gate","redirectTasks","nextTask","nextOutcome","serialFailure","redirectOptions","resolved","failed","reduceLane","failure","settlement","redirectLimitExceeded","plannedBoundary","boundaryOf","found","readinessEnd","boundary","install","projectLane","context","head","scripts","executeClientLane","reduced","visible","reduction","foreground","offerPending","tx","session","success","presentedPending","delay","min","tookOver","remaining","offered","ack","rendered","finishPending","awaitPendingMinimum","timer","publishMatches","commitMatches","previousCached","resolvedPrefix","cut","now","superseded","awaitCurrent","followRedirect","runBackground","runClientTransaction","sync","forceStaleReload","follow","toLocation","changeInfo","previousOwner","pendingLocation","redirects","handoff","hydrationController","preflight","previousPreflight","sameHref","settle","run","active","createReactiveSystem","link","prevDep","sub","dep","nextDep","version","prevSub","newLink","unlink","nextSub","unwatched","propagate","flags","isValidLink","subSubs","checkDirty","checkDepth","dirty","update","subs","shallowPropagate","firstSub","hasMultipleSubs","checkLink","toObserver","isObserver","nextHandler","self","errorHandler","completionHandler","queuedEffects","cycle","atom","effect","purgeDeps","notifyIndex","queuedEffectsLength","activeSub","batchDepth","depsTail","createAtom","isComputed","valueOrFn","getter","obs","observerOrFn","observed","e","compare","getValue","oldValue","newValue","effectObj","settleOwner","Transitioner","useRouter","acknowledgement","expected","t","import_react","useLayoutEffect","unsub","Matches","rootRoute","pendingElement","renderPending","inner","import_jsx_runtime","Fragment","MatchesInner","useSelector","matchComponent","Match","CatchBoundary","useMatchRoute","getStoreFactory","createRouter","Router","RouterContextProvider","provider","routerContext","RouterProvider","useLocation","useStructuralSharing","voidElements","attrRE","parseTag","tagMatch","tag","endIndex","reg","attr","arr","eq","tagRE","tagNameRE","whitespaceRE","rawTextRE","sentinel","empty","restoreSentinels","components","allowedTags","restoreNeeded","isAllowed","out","pos","am","html","nameMatch","level","inComponent","rawUntil","htmlLower","lts","gts","secondLt","quote","j","c","validSplit","firstPart","secondPart","isOpen","isComment","nextChar","isText","nextTag","comment","text","isRawText","closeIndex","contentEnd","content","attrString","buff","attrs","stringifyNode","doc","tagEnd","token","rootEl","hasChildren","checkLength","getChildren","children","getAsArray","hasValidReactChildren","isValidElement","mergeProps","newTarget","target","source","getValuesFromChildren","values","getData","childs","isString","isObject","nodesToString","stringNode","childrenArray","keepArray","i18nOptions","childPropsCount","props","shouldKeepChild","childChildren","childIndex","cnt","i18n","i18nKey","warn","clone","format","renderNodes","targetString","emptyChildrenButNeedsHandling","keep","knownComponentsMap","shouldUnescape","knownNames","ast","HTML","combinedTOpts","renderInner","mappedChildren","mapAST","rootReactNode","pushTranslatedJSX","mem","cloneElement","isVoid","Children","freshProps","k","createElement","override","reactNodes","reactNode","astNodes","astNode","keepTagOccurrence","translationContent","tmp","p","unescape","isElement","isValidTranslationWithChildren","isEmptyTransWithHTML","isKnownComponent","occurrence","seen","r","rn","innerScope","wrapTextNodes","unescapeFn","getDefaults","fixComponentProps","componentKey","comp","translation","Componentized","generateArrayComponents","generateObjectComponents","componentMap","generateComponents","warnOnce","isComponentsMap","object","acc","Trans","i18nFromProps","tFromProps","additionalProps","getI18n","reactI18nextOptions","namespaces","ns","mergedTOptions","transDefaultProps","tOptions","mergedShouldUnescape","mergedValues","mergedComponents","nodeAsString","defaultValue","keyFromSelector","hashTransKey","valuesFromChildren","count","interpolationOverride","generatedComponents","indexedChildren","componentsMap","useAsParent","i18nFromContext","defaultNSFromContext","useContext","I18nContext","TransWithoutContext","MAX_RETRIES","AUTH_KEYS","SITE_ACCESS_CODES","isSiteAccessError","hasErrorCode","code","shouldRetry","failureCount","isUnauthorized","isForbidden","createQueryClient","handleSessionEnded","isAuthRequest","useSessionStore","hasUnsavedEdits","queryClient","queryKeys","handleSiteAccessLost","isMeQuery","inPlace","logError","reportError","__iconData","Activity","createLucideIcon","GitPullRequestArrow","LogIn","LogOut","MailCheck","OctagonX","PanelLeft","Server","Settings","SquareTerminal","UsersRound","Zap","Card","cn","className","CardHeader","CardDescription","CardContent","ThemeMenuThemes","useTranslation","useLookSelection","DropdownMenuRadioGroup","selectedLook","selectLook","looks","DropdownMenuRadioItem","look","ThemeSwatches","ThemeMenuContent","_Fragment","DropdownMenuLabel","ThemeMenu","DropdownMenu","DropdownMenuTrigger","Button","Palette","DropdownMenuContent","LETTERS_VIEWBOX","LETTER_PATHS","wordmarkVariants","cva","Wordmark","Logo","variant","PITCHES","Braces","BrandPanel","Icon","AuthLayout","title","description","readFragmentToken","useFragmentToken","useState","acceptInvitationSchema","withPasswordConfirmation","requiredText","newPasswordField","useAcceptInvitationForm","navigate","useNavigate","accept","useAcceptInvitation","inspection","useInspectInvitation","form","useForm","zodResolver","AcceptInvitation","hasToken","LoadingState","FormError","onSubmit","FieldGroup","FormTextField","SubmitButton","Alert","AlertCircle","AlertDescription","graphqlSearchSchema","z.object","z.string","schemaSearchSchema","forgotPasswordSchema","emailField","useForgotPasswordForm","requestReset","useRequestPasswordReset","ForgotPassword","sentTo","TextLink","PROBE_ORIGIN","CONTROL_CHARACTERS","safeRedirectPath","loginSchema","useLoginForm","useSearch","login","useLogin","Login","BrandMessage","actions","NotFound","Link","resetPasswordSchema","useResetPasswordForm","confirmReset","useConfirmPasswordReset","ResetPassword","SiteNotFound","routerBasePath","useRetryAndLogRouteError","useCallback","reset","RouteError","retry","buildSetupSchema","requiresToken","useSetupFormAndTokenRequirement","setup","useSetup","useSetupStatus","schema","useMemo","setupToken","Setup","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","useSidebar","SidebarProvider","openProp","setOpenProp","isMobile","useIsMobile","openMobile","setOpenMobile","_open","_setOpen","defaultOpen","setOpen","openState","toggleSidebar","handleKeyDown","contextValue","TooltipProvider","style","Sidebar","collapsible","Sheet","SheetContent","SheetHeader","SheetTitle","SheetDescription","side","SidebarTrigger","onClick","PanelLeftIcon","SidebarRail","SidebarInset","SidebarHeader","SidebarFooter","SidebarContent","SidebarGroup","SidebarGroupLabel","Comp","asChild","Slot.Root","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariants","SidebarMenuButton","button","size","isActive","tooltip","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuBadge","useOpenCommandPalette","usePaletteStore","UserMenu","me","useMe","logout","useLogout","unsavedEdits","signOut","useDiscardGuard","displayName","user","avatar","Avatar","AvatarFallback","initialsOf","DropdownMenuSeparator","DropdownMenuItem","UserRound","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent","ChevronsUpDown","MobileBar","openPalette","searchable","Search","NavItem","item","SharedGlyph","SearchButton","shortcut","useShortcutLabel","useIsNetworkView","isNetworkPath","useSiteSwitcher","isNetworkView","site","openSite","goToSite","openNetwork","canSeeNetwork","TILE","SiteSwitcher","currentName","Globe","sites","isCurrent","Check","showNetwork","Group","labelId","useId","group","activeKey","memo","SidebarRoot","groups","StatusBar","schemaVersion","useSchemaVersion","section","Frame","sidebarOpen","useUiStore","setSidebarOpen","usePaletteShortcut","onKeyDown","Body","lazy","module","CommandPalette","DialogPrimitive.Root","DialogPrimitive.Portal","DialogPrimitive.Overlay","DialogPrimitive.Content","DialogPrimitive.Title","Suspense","useActiveNavKey","matchRoute","best","isVisible","access","INBOX_ITEM","Inbox","CONTENT_ITEMS","Image","Send","DEVELOP_ITEMS","Camera","FileCode2","Blocks","KeyRound","Webhook","WORKSPACE_ITEMS","Users","Globe2","NETWORK_ITEMS","Boxes","ShieldCheck","ScrollText","useNavAccess","hasSchemaPermission","canSeeDevelop","PLACE_ICONS","FileStack","FileText","fromDefinitions","definitions","label","linkOptions","placeItem","place","multiSite","useNetworkNavGroups","enabled","useShellNavGroups","siteGroups","useSiteNavGroups","networkGroups","places","usePlaces","useSchemaScopeAccess","placeItems","addType","Plus","useGoToItems","items","listed","settings","SETTINGS_GROUPS","network","useCreateItems","FilePlus2","useShellPaletteItems","usePaletteItems","Navigated","Outlet","NoSiteAccess","elsewhere","Page","PageHeader","EmptyState","Lock","resumeSchema","useResumeSessionForm","resume","useResumeSession","ResumeSession","email","SheetBody","Shell","signInRequired","hasSiteRole","useAppUsers","useQuery","adminApi","keepPreviousData","useUpdateAppUser","useQueryClient","useMutation","withCsrf","useSetAppUserBlocked","useRemoveAppUser","useResendAppUserConfirmation","useAppUserActions","setBlocked","resend","remove","toast","i18next","blocked","useAppUsersSearch","previousCursors","setPreviousCursors","go","changes","cursors","nextCursor","useSearchInput","onQueryChange","SearchIcon","Input","setText","RoleBadges","roleIds","Badge","roleNames","roleId","RolesPopover","selection","returnFocus","useReturnFocus","Popover","requestOpenChange","PopoverAnchor","PopoverContent","emptyMessage","FormRadioGroup","FormCheckboxGroup","discardPrompt","useAppRoleOptions","roles","useAppRoles","role","appUserRolesSchema","z.array","useAppUserRolesForm","updateAppUser","onDone","RolesEditor","rolesError","onOpenChange","PROVIDERS","isKnownProvider","SignInMethods","methods","useConfirmCopy","Row","editingRoles","setEditingRoles","setAction","confirming","setConfirming","copy","ask","TableRow","TableCell","Person","StatusChip","formatDateTime","formatRelativeTime","InlineConfirm","onConfirmed","MoreHorizontal","onResendConfirmation","UserCheck","UserX","Trash2","Table","TableRoot","TableHeader","TableHead","TableBody","users","TeamHint","useNetworkPermission","AppUsers","useAppRoleNames","TableCard","setQuery","CursorPager","goFirst","goPrevious","goNext","QueryView","redirectModelsIndex","tab","redirectNewModel","redirectComponentBuilder","redirectModelBuilder","modelId","definitionsQueryOptions","find","definition","model","requireNetworkView","meQueryOptions","requireNetworkPermission","Toaster","theme","useResolvedScheme","Sonner","CircleCheckIcon","InfoIcon","TriangleAlertIcon","OctagonXIcon","Loader2Icon","useApplyTheme","useThemeStore","useReconcileTheme","useThemeOptions","appearance","variants","setLook","isComplete","themes","option","resolveScheme","DEFAULT_THEME_KEY","DEFAULT_THEME_VARIANTS","RootLayout","isSetupRequired","setupStatusQueryOptions","settleSite","settleSiteKey","hasRole","currentSite","rememberSite","needsSitePrefix","currentRouterPath","showSiteInAddressBar","requireSession","currentHref","redirectIfSignedIn","destination","requireSetupPending","redirectToSetupIfPending","createSiteRewrite","splitSitePath","withSitePrefix","siteKey","createRootRouteWithContext","setupRoute","createRoute","loginRoute","loginSearchSchema","forgotPasswordRoute","resetPasswordRoute","acceptInvitationRoute","appRoute","homeRoute","__vitePreload","usersRoute","appUsersRoute","appUsersSearchSchema","modelsRoute","modelsSearchSchema","newModelRoute","newModelSearchSchema","modelBuilderRoute","componentBuilderRoute","contentTypesLazy","newContentTypeRoute","componentsRoute","newComponentRoute","componentRoute","mediaRoute","mediaSearchSchema","contentLazy","contentRoute","modelContentRoute","contentListSearchSchema","newEntryRoute","entrySearchSchema","entryRoute","settingsLazy","settingsRoute","settingsIndexRoute","settingsChild","profileRoute","sessionsRoute","appearanceRoute","localesRoute","seoRoute","assistRoute","apiTokensRoute","rolesRedirectRoute","appRolesRedirectRoute","appRoleRedirectRoute","auditLogRedirectRoute","auditSearchSchema","networkLazy","networkRoute","networkIndexRoute","networkChild","sitesRoute","siteRoute","networkUsersRoute","networkRolesRoute","networkRoleRoute","networkAppRolesRoute","networkAppRoleRoute","networkContentTypesRoute","networkContentTypesIndexRoute","networkNewContentTypeRoute","networkAuditLogRoute","publishingLazy","publishingRoute","publishingIndexRoute","firstPermittedSection","publishingChild","scheduledRoute","schedulesSearchSchema","deploymentsRoute","cursorSearchSchema","connectionRoute","runRoute","webhooksRoute","webhookRoute","developLazy","developRoute","changesRoute","changeSetRoute","changeSetSearchSchema","snapshotsRoute","snapshotsSearchSchema","snapshotRoute","snapshotSearchSchema","liveRoute","schemaRoute","apiExplorerRoute","apiExplorerSearchSchema","graphqlRoute","createAppRouter","App","QueryClientProvider","container","initI18n","createRoot","StrictMode"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.104.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.104.0/node_modules/@tanstack/query-core/build/modern/queryCache.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.104.0/node_modules/@tanstack/query-core/build/modern/queryClient.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/qss.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/searchParams.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/sieve-cache.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/rewrite.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/stores.js","../../../../node_modules/.pnpm/@tanstack+history@1.162.4/node_modules/@tanstack/history/dist/esm/index.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/router.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/load-client.js","../../../../node_modules/.pnpm/@tanstack+store@0.11.2/node_modules/@tanstack/store/dist/alien.js","../../../../node_modules/.pnpm/@tanstack+store@0.11.2/node_modules/@tanstack/store/dist/atom.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/Transitioner.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/Matches.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/routerStores.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/router.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/RouterProvider.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useLocation.js","../../../../node_modules/.pnpm/html-parse-stringify@4.0.1/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.js","../../../../node_modules/.pnpm/react-i18next@17.0.15_i18next@26.4.2_typescript@6.0.3__react-dom@19.3.0_react@19.3.0__react@19.3.0_typescript@6.0.3/node_modules/react-i18next/dist/es/TransWithoutContext.js","../../../../node_modules/.pnpm/react-i18next@17.0.15_i18next@26.4.2_typescript@6.0.3__react-dom@19.3.0_react@19.3.0__react@19.3.0_typescript@6.0.3/node_modules/react-i18next/dist/es/Trans.js","../../src/app/queryClient.ts","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/activity.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/git-pull-request-arrow.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/log-in.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/log-out.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/mail-check.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/octagon-x.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/panel-left.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/server.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/settings.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/square-terminal.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/users-round.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/zap.mjs","../../src/components/ui/card.tsx","../../src/components/ThemeMenu/Themes/index.tsx","../../src/components/ThemeMenu/Content/index.tsx","../../src/components/ThemeMenu/index.tsx","../../src/components/Wordmark/letters.ts","../../src/components/Wordmark/index.tsx","../../src/components/AuthLayout/BrandPanel/index.tsx","../../src/components/AuthLayout/index.tsx","../../src/hooks/useFragmentToken.ts","../../src/features/AcceptInvitation/hooks/useAcceptInvitationForm.ts","../../src/features/AcceptInvitation/index.tsx","../../src/features/Develop/Graphql/searchSchema.ts","../../src/features/Develop/Schema/searchSchema.ts","../../src/features/ForgotPassword/hooks/useForgotPasswordForm.ts","../../src/features/ForgotPassword/index.tsx","../../src/helpers/safeRedirect.ts","../../src/features/Login/hooks/useLoginForm.ts","../../src/features/Login/index.tsx","../../src/components/BrandMessage/index.tsx","../../src/features/NotFound/index.tsx","../../src/features/ResetPassword/hooks/useResetPasswordForm.ts","../../src/features/ResetPassword/index.tsx","../../src/features/SiteNotFound/index.tsx","../../src/features/RouteError/hooks/useRetryAndLogRouteError.ts","../../src/features/RouteError/index.tsx","../../src/features/Setup/hooks/useSetupFormAndTokenRequirement.ts","../../src/features/Setup/index.tsx","../../src/components/ui/sidebar.tsx","../../src/components/CommandPalette/hooks/useOpenCommandPalette.ts","../../src/features/Shell/UserMenu/index.tsx","../../src/features/Shell/MobileBar/index.tsx","../../src/features/Shell/NavItem/index.tsx","../../src/features/Shell/SearchButton/index.tsx","../../src/features/Shell/hooks/useIsNetworkView.ts","../../src/features/Shell/hooks/useSiteSwitcher.ts","../../src/features/Shell/SiteSwitcher/index.tsx","../../src/features/Shell/Sidebar/index.tsx","../../src/features/Shell/StatusBar/index.tsx","../../src/features/Shell/Frame/index.tsx","../../src/components/CommandPalette/hooks/usePaletteShortcut.ts","../../src/components/CommandPalette/index.tsx","../../src/features/Shell/hooks/useActiveNavKey.ts","../../src/features/Shell/navItems.ts","../../src/features/Shell/hooks/useNavAccess.ts","../../src/features/Shell/hooks/useShellNavGroups.ts","../../src/features/Shell/hooks/useShellPaletteItems.ts","../../src/features/Shell/Navigated/index.tsx","../../src/features/Shell/NoSiteAccess/index.tsx","../../src/features/Shell/ResumeSession/hooks/useResumeSessionForm.ts","../../src/features/Shell/ResumeSession/index.tsx","../../src/features/Shell/index.tsx","../../src/api/appUsers.ts","../../src/features/Users/AppUsers/hooks/useAppUserActions.ts","../../src/features/Users/AppUsers/hooks/useAppUsersSearch.ts","../../src/features/Users/AppUsers/Search/index.tsx","../../src/features/Users/RoleBadges/index.tsx","../../src/features/Users/RolesPopover/index.tsx","../../src/features/Users/AppUsers/hooks/useAppRoleOptions.ts","../../src/features/Users/AppUsers/hooks/useAppUserRolesForm.ts","../../src/features/Users/AppUsers/RolesEditor/index.tsx","../../src/features/Users/AppUsers/SignInMethods/index.tsx","../../src/features/Users/AppUsers/SignInMethods/icons.tsx","../../src/features/Users/AppUsers/Table/Row/hooks/useConfirmCopy.ts","../../src/features/Users/AppUsers/Table/Row/index.tsx","../../src/features/Users/AppUsers/Table/index.tsx","../../src/features/Users/AppUsers/TeamHint/index.tsx","../../src/features/Users/AppUsers/index.tsx","../../src/app/modelRedirects.ts","../../src/app/networkGuards.ts","../../src/components/ui/sonner.tsx","../../src/hooks/useApplyTheme.ts","../../src/hooks/useReconcileTheme.ts","../../src/app/RootLayout.tsx","../../src/app/routeGuards.ts","../../src/app/siteRewrite.ts","../../src/app/router.tsx","../../src/app/App/index.tsx","../../src/main.tsx"],"sourcesContent":["import { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\n//#region src/mutationCache.ts\n/**\n* The `MutationCache` is the storage for mutations.\n*\n* Normally, you will not interact with the `MutationCache` directly and instead use a\n* `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of\n* safe/known updates to the cache, such as mutations being added, removed, or updated.\n*\n* @example\n* ```ts\n* const unsubscribe = mutationCache.subscribe((event) => {\n* console.log(event.type, event.mutation)\n* })\n* ```\n*/\nvar MutationCache = class extends Subscribable {\n\t#mutations;\n\t#scopes;\n\t#mutationId;\n\tconstructor(config = {}) {\n\t\tsuper();\n\t\tthis.config = config;\n\t\tthis.#mutations = /* @__PURE__ */ new Set();\n\t\tthis.#scopes = /* @__PURE__ */ new Map();\n\t\tthis.#mutationId = 0;\n\t}\n\t/** @internal */\n\tbuild(client, options, state) {\n\t\tconst mutation = new Mutation({\n\t\t\tclient,\n\t\t\tmutationCache: this,\n\t\t\tmutationId: ++this.#mutationId,\n\t\t\toptions: client.defaultMutationOptions(options),\n\t\t\tstate\n\t\t});\n\t\tthis.add(mutation);\n\t\treturn mutation;\n\t}\n\t/** @internal */\n\tadd(mutation) {\n\t\tthis.#mutations.add(mutation);\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") {\n\t\t\tconst scopedMutations = this.#scopes.get(scope);\n\t\t\tif (scopedMutations) scopedMutations.push(mutation);\n\t\t\telse this.#scopes.set(scope, [mutation]);\n\t\t}\n\t\tthis.notify({\n\t\t\ttype: \"added\",\n\t\t\tmutation\n\t\t});\n\t}\n\t/** @internal */\n\tremove(mutation) {\n\t\tif (this.#mutations.delete(mutation)) {\n\t\t\tconst scope = scopeFor(mutation);\n\t\t\tif (typeof scope === \"string\") {\n\t\t\t\tconst scopedMutations = this.#scopes.get(scope);\n\t\t\t\tif (scopedMutations) {\n\t\t\t\t\tif (scopedMutations.length > 1) {\n\t\t\t\t\t\tconst index = scopedMutations.indexOf(mutation);\n\t\t\t\t\t\tif (index !== -1) scopedMutations.splice(index, 1);\n\t\t\t\t\t} else if (scopedMutations[0] === mutation) this.#scopes.delete(scope);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.notify({\n\t\t\ttype: \"removed\",\n\t\t\tmutation\n\t\t});\n\t}\n\t/** @internal */\n\tcanRun(mutation) {\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") {\n\t\t\tconst firstPendingMutation = this.#scopes.get(scope)?.find((m) => m.state.status === \"pending\");\n\t\t\treturn !firstPendingMutation || firstPendingMutation === mutation;\n\t\t} else return true;\n\t}\n\t/** @internal */\n\trunNext(mutation) {\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") return (this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused))?.continue() ?? Promise.resolve();\n\t\telse return Promise.resolve();\n\t}\n\t/**\n\t* Removes all mutations from the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* mutationCache.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.#mutations.forEach((mutation) => {\n\t\t\t\tthis.notify({\n\t\t\t\t\ttype: \"removed\",\n\t\t\t\t\tmutation\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.#mutations.clear();\n\t\t\tthis.#scopes.clear();\n\t\t});\n\t}\n\t/**\n\t* Returns all mutations within the cache.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a mutation in rare scenarios.\n\t*\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutations = mutationCache.getAll()\n\t* ```\n\t*/\n\tgetAll() {\n\t\treturn Array.from(this.#mutations);\n\t}\n\t/**\n\t* A slightly more advanced method that can be used to get an existing mutation instance from\n\t* the cache. If the mutation does not exist, `undefined` is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a mutation in rare scenarios.\n\t*\n\t* @see {@link MutationCache#findAll}\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n\t* ```\n\t*/\n\tfind(filters) {\n\t\tconst defaultedFilters = {\n\t\t\texact: true,\n\t\t\t...filters\n\t\t};\n\t\treturn this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));\n\t}\n\t/**\n\t* An even more advanced method that can be used to get existing mutation instances from the\n\t* cache that match the given filters. If no mutations match, an empty array is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about mutations in rare scenarios.\n\t*\n\t* @see {@link MutationCache#find}\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutations = mutationCache.findAll({ mutationKey: ['addPost'] })\n\t* ```\n\t*/\n\tfindAll(filters = {}) {\n\t\treturn this.getAll().filter((mutation) => matchMutation(filters, mutation));\n\t}\n\t/** @internal */\n\tnotify(event) {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(event);\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tresumePausedMutations() {\n\t\tconst pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n\t\treturn notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));\n\t}\n};\nfunction scopeFor(mutation) {\n\treturn mutation.options.scope?.id;\n}\n//#endregion\nexport { MutationCache };\n\n//# sourceMappingURL=mutationCache.js.map","import { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Query } from \"./query.js\";\n//#region src/queryCache.ts\n/**\n* The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta\n* information, and state of the queries it contains.\n*\n* Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient`\n* for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of\n* safe/known updates to the cache, such as queries being added, removed, or updated — updates made\n* outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do\n* not notify subscribers.\n*\n* @example\n* ```ts\n* const unsubscribe = queryCache.subscribe((event) => {\n* console.log(event.type, event.query)\n* })\n* ```\n*/\nvar QueryCache = class extends Subscribable {\n\t#queries;\n\tconstructor(config = {}) {\n\t\tsuper();\n\t\tthis.config = config;\n\t\tthis.#queries = /* @__PURE__ */ new Map();\n\t}\n\t/**\n\t* Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or\n\t* builds and adds a new one to the cache if none exists yet. Used by framework adapters and\n\t* plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing\n\t* the reactive `QueryObserver` machinery.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const query = queryCache.build(queryClient, {\n\t* queryKey: ['posts'],\n\t* queryFn: fetchPosts,\n\t* })\n\t* ```\n\t*/\n\tbuild(client, options, state) {\n\t\tconst queryKey = options.queryKey;\n\t\tconst queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n\t\tlet query = this.get(queryHash);\n\t\tif (!query) {\n\t\t\tquery = new Query({\n\t\t\t\tclient,\n\t\t\t\tqueryKey,\n\t\t\t\tqueryHash,\n\t\t\t\toptions: client.defaultQueryOptions(options),\n\t\t\t\tstate,\n\t\t\t\tdefaultOptions: client.getQueryDefaults(queryKey)\n\t\t\t});\n\t\t\tthis.add(query);\n\t\t}\n\t\treturn query;\n\t}\n\t/** @internal */\n\tadd(query) {\n\t\tif (!this.#queries.has(query.queryHash)) {\n\t\t\tthis.#queries.set(query.queryHash, query);\n\t\t\tthis.notify({\n\t\t\t\ttype: \"added\",\n\t\t\t\tquery\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Destroys the given `Query` and removes it from the cache, notifying subscribers with a\n\t* `'removed'` event. A no-op if the query is no longer the one currently stored under its hash\n\t* (e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror\n\t* removals across `QueryCache` instances.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t* const query = queryCache.find({ queryKey: ['posts'] })\n\t*\n\t* if (query) {\n\t* queryCache.remove(query)\n\t* }\n\t* ```\n\t*/\n\tremove(query) {\n\t\tif (this.#queries.get(query.queryHash) === query) {\n\t\t\tquery.destroy();\n\t\t\tthis.#queries.delete(query.queryHash);\n\t\t\tthis.notify({\n\t\t\t\ttype: \"removed\",\n\t\t\t\tquery\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Removes all queries from the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* queryCache.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tthis.remove(query);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none\n\t* exists. Unlike {@link QueryCache#find}, this looks up by the already-computed hash rather\n\t* than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash\n\t* to look up directly.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t* const queryHash = hashKey(['posts'])\n\t*\n\t* const query = queryCache.get(queryHash)\n\t* ```\n\t*/\n\tget(queryHash) {\n\t\treturn this.#queries.get(queryHash);\n\t}\n\t/**\n\t* Returns all queries within the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const queries = queryCache.getAll()\n\t* ```\n\t*/\n\tgetAll() {\n\t\treturn [...this.#queries.values()];\n\t}\n\t/**\n\t* A slightly more advanced method that can be used to get an existing query instance from the\n\t* cache. This instance not only contains all the state for the query, but all of the instances,\n\t* and underlying guts of the query as well. If the query does not exist, `undefined` is\n\t* returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to\n\t* decide whether a query is fresh enough to be used as an initial value).\n\t*\n\t* @see {@link QueryCache#findAll}\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const query = queryCache.find({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tfind(filters) {\n\t\tconst defaultedFilters = {\n\t\t\texact: true,\n\t\t\t...filters\n\t\t};\n\t\treturn this.getAll().find((query) => matchQuery(defaultedFilters, query));\n\t}\n\t/**\n\t* An even more advanced method that can be used to get existing query instances from the cache\n\t* that partially match a query key. If no queries match, an empty array is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about queries in rare scenarios.\n\t*\n\t* @see {@link QueryCache#find}\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const queries = queryCache.findAll({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tfindAll(filters = {}) {\n\t\tconst queries = this.getAll();\n\t\treturn Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n\t}\n\t/** @internal */\n\tnotify(event) {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(event);\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tonFocus() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tquery.onFocus();\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tonOnline() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tquery.onOnline();\n\t\t\t});\n\t\t});\n\t}\n};\n//#endregion\nexport { QueryCache };\n\n//# sourceMappingURL=queryCache.js.map","import { functionalUpdate, hashKey, hashQueryKeyByOptions, noop, partialMatchKey, resolveQueryValue, skipToken } from \"./utils.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { QueryCache } from \"./queryCache.js\";\n//#region src/queryClient.ts\n/**\n* `QueryClient` is used to interact with a cache of queries and mutations. It owns a\n* `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds\n* the default options that are applied to queries and mutations created through it.\n*\n* @example\n* ```ts\n* const queryClient = new QueryClient({\n* defaultOptions: {\n* queries: {\n* staleTime: Infinity,\n* },\n* },\n* })\n*\n* await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts })\n* ```\n*/\nvar QueryClient = class {\n\t#queryCache;\n\t#mutationCache;\n\t#defaultOptions;\n\t#queryDefaults;\n\t#mutationDefaults;\n\t#mountCount;\n\t#unsubscribeFocus;\n\t#unsubscribeOnline;\n\tconstructor(config = {}) {\n\t\tthis.#queryCache = config.queryCache || new QueryCache();\n\t\tthis.#mutationCache = config.mutationCache || new MutationCache();\n\t\tthis.#defaultOptions = config.defaultOptions || {};\n\t\tthis.#queryDefaults = /* @__PURE__ */ new Map();\n\t\tthis.#mutationDefaults = /* @__PURE__ */ new Map();\n\t\tthis.#mountCount = 0;\n\t}\n\t/**\n\t* Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start\n\t* listening for focus/online events and resume paused mutations. Ref-counted via an internal\n\t* mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down\n\t* the shared listeners until the last one unmounts.\n\t*/\n\tmount() {\n\t\tthis.#mountCount++;\n\t\tif (this.#mountCount !== 1) return;\n\t\tthis.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n\t\t\tif (focused) {\n\t\t\t\tawait this.resumePausedMutations();\n\t\t\t\tthis.#queryCache.onFocus();\n\t\t\t}\n\t\t});\n\t\tthis.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n\t\t\tif (online) {\n\t\t\t\tawait this.resumePausedMutations();\n\t\t\t\tthis.#queryCache.onOnline();\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* The inverse of {@link QueryClient#mount} — called by a framework adapter's\n\t* `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online\n\t* listeners once the mount count returns to `0`.\n\t*/\n\tunmount() {\n\t\tthis.#mountCount--;\n\t\tif (this.#mountCount !== 0) return;\n\t\tthis.#unsubscribeFocus?.();\n\t\tthis.#unsubscribeFocus = void 0;\n\t\tthis.#unsubscribeOnline?.();\n\t\tthis.#unsubscribeOnline = void 0;\n\t}\n\t/**\n\t* Returns the number of queries in the cache that are currently fetching, optionally\n\t* matching a set of filters. This includes background-fetching, loading new pages, and\n\t* loading more infinite query results.\n\t*\n\t* @example\n\t* ```ts\n\t* if (queryClient.isFetching()) {\n\t* console.log('At least one query is fetching!')\n\t* }\n\t* ```\n\t*/\n\tisFetching(filters) {\n\t\treturn this.#queryCache.findAll({\n\t\t\t...filters,\n\t\t\tfetchStatus: \"fetching\"\n\t\t}).length;\n\t}\n\t/**\n\t* Returns the number of mutations in the cache that are currently pending, optionally\n\t* matching a set of filters.\n\t*\n\t* @example\n\t* ```ts\n\t* if (queryClient.isMutating()) {\n\t* console.log('At least one mutation is pending!')\n\t* }\n\t* ```\n\t*/\n\tisMutating(filters) {\n\t\treturn this.#mutationCache.findAll({\n\t\t\t...filters,\n\t\t\tstatus: \"pending\"\n\t\t}).length;\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve data for a QueryKey.\n\t* Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n\t*\n\t* Hint: Do not use this function inside a component, because it won't receive updates.\n\t* Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n\t*\n\t* @returns The cached data for the query, or `undefined` if no query with this key has been observed yet.\n\t* @see {@link QueryClient#getQueriesData}\n\t*/\n\tgetQueryData(queryKey) {\n\t\tconst options = this.defaultQueryOptions({ queryKey });\n\t\treturn this.#queryCache.get(options.queryHash)?.state.data;\n\t}\n\t/**\n\t* @deprecated Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.\n\t*/\n\tensureQueryData(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\tconst cachedData = query.state.data;\n\t\tif (cachedData === void 0) return this.fetchQuery(options);\n\t\tif (options.revalidateIfStale && query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);\n\t\treturn Promise.resolve(cachedData);\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve the cached data of multiple queries at once.\n\t* Only queries matching the given filters are returned; if none match, an empty array is\n\t* returned.\n\t*\n\t* Because the matched queries can hold data of different shapes (e.g. a broad filter can match\n\t* queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather\n\t* than being inferred. Passing a more specific type is a convenience for call sites that know\n\t* every matched query holds the same shape — it is not checked against the actual cache\n\t* contents.\n\t*\n\t* @returns An array of query key and data pairs. The data is `undefined` for a query with no cached data.\n\t* @see {@link QueryClient#getQueryData}\n\t* @example\n\t* ```ts\n\t* const data = queryClient.getQueriesData({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tgetQueriesData(filters) {\n\t\treturn this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n\t\t\treturn [queryKey, state.data];\n\t\t});\n\t}\n\t/**\n\t* Synchronous way to immediately update a query's cached data. If the updater (or the value\n\t* passed) resolves to `undefined`, the cache is left untouched and no query is created;\n\t* otherwise, if the query does not exist yet, it will be created. To update multiple queries\n\t* at once by partially matching query keys, use {@link QueryClient#setQueriesData} instead.\n\t*\n\t* Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved\n\t* via {@link QueryClient#getQueryData}, in place.\n\t*\n\t* @param queryKey - The query key to set data for.\n\t* @param updater - Either the new data, or a function that receives the current data (which\n\t* may be `undefined`) and returns the new data.\n\t* @param options - Set `updatedAt` to override the timestamp the written data is recorded with.\n\t* @returns The data that was written, or `undefined` if the updater returned `undefined` — in that case\n\t* the write is skipped and the cache is left unchanged.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueryData(['posts'], newPosts)\n\t*\n\t* // Or, using an updater function that receives the current data:\n\t* queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost])\n\t* ```\n\t*/\n\tsetQueryData(queryKey, updater, options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions({ queryKey });\n\t\tconst prevData = this.#queryCache.get(defaultedOptions.queryHash)?.state.data;\n\t\tconst data = functionalUpdate(updater, prevData);\n\t\tif (data === void 0) return;\n\t\treturn this.#queryCache.build(this, defaultedOptions).setData(data, {\n\t\t\t...options,\n\t\t\tmanual: true\n\t\t});\n\t}\n\t/**\n\t* Synchronous way to immediately update the cached data of multiple queries at once, using\n\t* filters or partial query key matching. Only queries that already exist and match the given\n\t* filters are updated; no new cache entries are created. Internally this calls\n\t* {@link QueryClient#setQueryData} for each matching query.\n\t*\n\t* @returns One `[queryKey, data]` tuple per matched query, in the same shape and with the same\n\t* `undefined` case as {@link QueryClient#setQueryData}.\n\t* @example\n\t* ```ts\n\t* queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) =>\n\t* oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts,\n\t* )\n\t* ```\n\t*/\n\tsetQueriesData(filters, updater, options) {\n\t\treturn notifyManager.batch(() => this.#queryCache.findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve an existing query's state. If the query does not\n\t* exist, `undefined` is returned.\n\t*\n\t* @example\n\t* ```ts\n\t* const state = queryClient.getQueryState(['posts'])\n\t* console.log(state?.dataUpdatedAt)\n\t* ```\n\t*/\n\tgetQueryState(queryKey) {\n\t\tconst options = this.defaultQueryOptions({ queryKey });\n\t\treturn this.#queryCache.get(options.queryHash)?.state;\n\t}\n\t/**\n\t* Removes queries from the cache that match the given filters. Unlike\n\t* {@link QueryClient#invalidateQueries} or {@link QueryClient#refetchQueries}, this removes\n\t* matching queries from the cache instead of refetching them. Without filters, every query in\n\t* the cache is removed.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.removeQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tremoveQueries(filters) {\n\t\tconst queryCache = this.#queryCache;\n\t\tnotifyManager.batch(() => {\n\t\t\tqueryCache.findAll(filters).forEach((query) => {\n\t\t\t\tqueryCache.remove(query);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Resets queries matching the given filters back to their initial state (e.g. any\n\t* `initialData`), notifying subscribers rather than removing them. Active queries among the\n\t* matched set are then refetched, and the returned promise resolves once that refetch settles.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.resetQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tresetQueries(filters, options) {\n\t\tconst queryCache = this.#queryCache;\n\t\treturn notifyManager.batch(() => {\n\t\t\tconst matched = queryCache.findAll(filters);\n\t\t\tconst queriesToRefetch = new Set(matched);\n\t\t\tmatched.forEach((query) => {\n\t\t\t\tquery.reset();\n\t\t\t});\n\t\t\treturn this.refetchQueries({\n\t\t\t\ttype: \"active\",\n\t\t\t\tpredicate: (query) => queriesToRefetch.has(query)\n\t\t\t}, options);\n\t\t});\n\t}\n\t/**\n\t* Cancels outgoing fetches for queries matching the given filters. Most useful when performing\n\t* optimistic updates, since any outgoing refetch that resolves afterwards would otherwise\n\t* overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is\n\t* reverted to its state before the outgoing fetch started.\n\t*\n\t* The returned promise never rejects, even if individual cancellations fail.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.cancelQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tcancelQueries(filters, cancelOptions = {}) {\n\t\tconst defaultedCancelOptions = {\n\t\t\trevert: true,\n\t\t\t...cancelOptions\n\t\t};\n\t\tconst promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));\n\t\treturn Promise.all(promises).then(noop).catch(noop);\n\t}\n\t/**\n\t* Marks queries matching the given filters as invalidated. Unlike\n\t* {@link QueryClient#removeQueries}, invalidated queries stay in the cache.\n\t*\n\t* Unless `filters.refetchType` is `'none'`, matching queries are then refetched via\n\t* {@link QueryClient#refetchQueries}, using `filters.refetchType` if set, otherwise\n\t* `filters.type`, otherwise `'active'`.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' })\n\t* ```\n\t*/\n\tinvalidateQueries(filters, options = {}) {\n\t\treturn notifyManager.batch(() => {\n\t\t\tthis.#queryCache.findAll(filters).forEach((query) => {\n\t\t\t\tquery.invalidate();\n\t\t\t});\n\t\t\tif (filters?.refetchType === \"none\") return Promise.resolve();\n\t\t\treturn this.refetchQueries({\n\t\t\t\t...filters,\n\t\t\t\ttype: filters?.refetchType ?? filters?.type ?? \"active\"\n\t\t\t}, options);\n\t\t});\n\t}\n\t/**\n\t* Refetches queries matching the given filters, regardless of whether they are stale. Without\n\t* filters, every query in the cache is refetched. Queries that are disabled, or static (only\n\t* have observers with a static `staleTime`), are never refetched.\n\t*\n\t* By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new\n\t* one starts. The returned promise resolves once all matching queries have settled; it does\n\t* not reject on individual query failures unless `throwOnError` is set.\n\t*\n\t* @example\n\t* ```ts\n\t* // refetch all active queries partially matching a query key:\n\t* await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' })\n\t* ```\n\t*/\n\trefetchQueries(filters, options = {}) {\n\t\tconst fetchOptions = {\n\t\t\t...options,\n\t\t\tcancelRefetch: options.cancelRefetch ?? true\n\t\t};\n\t\tconst promises = notifyManager.batch(() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {\n\t\t\tlet promise = query.fetch(void 0, fetchOptions);\n\t\t\tif (!fetchOptions.throwOnError) promise = promise.catch(noop);\n\t\t\treturn query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n\t\t}));\n\t\treturn Promise.all(promises).then(noop);\n\t}\n\t/**\n\t* Asynchronous method to fetch and cache a query, resolving with the data or throwing with\n\t* the error.\n\t*\n\t* If the query already exists in the cache and its data is not stale (per the given\n\t* `staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched\n\t* and the promise resolves once the fetch settles. If a `select` function is provided, it is\n\t* applied to the data in both cases (cached or freshly fetched) before it is returned.\n\t*\n\t* Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless\n\t* explicitly configured, since there is no component to catch a thrown error and retry through\n\t* re-render.\n\t*\n\t* The accepted options are `QueryObserverOptions` minus the fields that only make sense for a\n\t* reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`,\n\t* `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`,\n\t* `notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this\n\t* method's options.\n\t*\n\t* This method replaces the deprecated `fetchQuery`, and — combined with\n\t* `{ staleTime: 'static' }` — the deprecated `ensureQueryData`.\n\t*\n\t* @example\n\t* ```ts\n\t* try {\n\t* const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 })\n\t* } catch (error) {\n\t* console.log(error)\n\t* }\n\t* ```\n\t*/\n\tasync query(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tif (defaultedOptions.retry === void 0) defaultedOptions.retry = false;\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\tconst queryData = query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? await query.fetch(defaultedOptions) : query.state.data;\n\t\tconst select = defaultedOptions.select;\n\t\tif (select) return select(queryData);\n\t\treturn queryData;\n\t}\n\t/**\n\t* @deprecated Use queryClient.query(options) instead. This method will be removed in the next major version.\n\t*/\n\tfetchQuery(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tif (defaultedOptions.retry === void 0) defaultedOptions.retry = false;\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\treturn query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n\t}\n\t/**\n\t* @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.\n\t*/\n\tprefetchQuery(options) {\n\t\treturn this.fetchQuery(options).then(noop).catch(noop);\n\t}\n\t/**\n\t* Asynchronous method to fetch and cache an infinite query, resolving with an\n\t* {@link InfiniteData} object or throwing with the error.\n\t*\n\t* Behaves like {@link QueryClient#query}, accepting the same options (minus\n\t* `initialPageParam`), plus the required `initialPageParam`, and an optional `pages` /\n\t* `getNextPageParam` pair used to refetch a fixed number of pages from the start.\n\t*\n\t* This method replaces the deprecated `fetchInfiniteQuery`, and — combined with\n\t* `{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`.\n\t*\n\t* @example\n\t* ```ts\n\t* try {\n\t* const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 })\n\t* console.log(data.pages)\n\t* } catch (error) {\n\t* console.log(error)\n\t* }\n\t* ```\n\t*/\n\tinfiniteQuery(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.query(options);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.\n\t*/\n\tfetchInfiniteQuery(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.fetchQuery(options);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.\n\t*/\n\tprefetchInfiniteQuery(options) {\n\t\treturn this.fetchInfiniteQuery(options).then(noop).catch(noop);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.\n\t*/\n\tensureInfiniteQueryData(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.ensureQueryData(options);\n\t}\n\t/**\n\t* Resumes mutations that were paused because there was no network connection. Does nothing\n\t* (resolving immediately) if the client is currently offline.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* await queryClient.resumePausedMutations()\n\t* ```\n\t*/\n\tresumePausedMutations() {\n\t\tif (onlineManager.isOnline()) return this.#mutationCache.resumePausedMutations();\n\t\treturn Promise.resolve();\n\t}\n\t/**\n\t* Returns the query cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const queryCache = queryClient.getQueryCache()\n\t* const queries = queryCache.findAll({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tgetQueryCache() {\n\t\treturn this.#queryCache;\n\t}\n\t/**\n\t* Returns the mutation cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const mutationCache = queryClient.getMutationCache()\n\t* const mutations = mutationCache.findAll({ status: 'pending' })\n\t* ```\n\t*/\n\tgetMutationCache() {\n\t\treturn this.#mutationCache;\n\t}\n\t/**\n\t* Returns the default options that were set when creating the client, or via\n\t* {@link QueryClient#setDefaultOptions}.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const defaultOptions = queryClient.getDefaultOptions()\n\t* ```\n\t*/\n\tgetDefaultOptions() {\n\t\treturn this.#defaultOptions;\n\t}\n\t/**\n\t* Dynamically sets the default options for this client, overwriting any previously defined\n\t* default options.\n\t*\n\t* @see {@link QueryClient#getDefaultOptions}\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* queryClient.setDefaultOptions({\n\t* queries: {\n\t* staleTime: Infinity,\n\t* },\n\t* })\n\t* ```\n\t*/\n\tsetDefaultOptions(options) {\n\t\tthis.#defaultOptions = options;\n\t}\n\t/**\n\t* Sets default options for queries whose query key partially matches the given `queryKey`.\n\t*\n\t* If several registered query defaults match a given query key, they are merged together in\n\t* registration order by {@link QueryClient#getQueryDefaults}, so register defaults from the\n\t* most generic key to the least generic one — more specific defaults should be registered\n\t* after more generic ones so they take precedence.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts })\n\t*\n\t* await queryClient.query({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tsetQueryDefaults(queryKey, options) {\n\t\tthis.#queryDefaults.set(hashKey(queryKey), {\n\t\t\tqueryKey,\n\t\t\tdefaultOptions: options\n\t\t});\n\t}\n\t/**\n\t* Returns the default options registered for queries whose query key partially matches the\n\t* given `queryKey`, via {@link QueryClient#setQueryDefaults}. If multiple registered defaults\n\t* match, they are merged together in registration order.\n\t*\n\t* @example\n\t* ```ts\n\t* const defaultOptions = queryClient.getQueryDefaults(['posts'])\n\t* ```\n\t*/\n\tgetQueryDefaults(queryKey) {\n\t\tconst defaults = [...this.#queryDefaults.values()];\n\t\tconst result = {};\n\t\tdefaults.forEach((queryDefault) => {\n\t\t\tif (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);\n\t\t});\n\t\treturn result;\n\t}\n\t/**\n\t* Sets default options for mutations whose mutation key partially matches the given\n\t* `mutationKey`. As with {@link QueryClient#setQueryDefaults}, the order of registration\n\t* matters when several registered defaults match the same mutation key.\n\t*\n\t* @see {@link QueryClient#getMutationDefaults}\n\t* @example\n\t* ```ts\n\t* queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost })\n\t* ```\n\t*/\n\tsetMutationDefaults(mutationKey, options) {\n\t\tthis.#mutationDefaults.set(hashKey(mutationKey), {\n\t\t\tmutationKey,\n\t\t\tdefaultOptions: options\n\t\t});\n\t}\n\t/**\n\t* Returns the default options registered for mutations whose mutation key partially matches\n\t* the given `mutationKey`, via {@link QueryClient#setMutationDefaults}. If multiple registered\n\t* defaults match, they are merged together in registration order.\n\t*\n\t* @example\n\t* ```ts\n\t* const defaultOptions = queryClient.getMutationDefaults(['addPost'])\n\t* ```\n\t*/\n\tgetMutationDefaults(mutationKey) {\n\t\tconst defaults = [...this.#mutationDefaults.values()];\n\t\tconst result = {};\n\t\tdefaults.forEach((queryDefault) => {\n\t\t\tif (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);\n\t\t});\n\t\treturn result;\n\t}\n\t/**\n\t* Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the\n\t* caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the\n\t* given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options\n\t* on top. A no-op if the options are already defaulted (`_defaulted: true`).\n\t*/\n\tdefaultQueryOptions(options) {\n\t\tif (options._defaulted) return options;\n\t\tconst defaultedOptions = {\n\t\t\t...this.#defaultOptions.queries,\n\t\t\t...this.getQueryDefaults(options.queryKey),\n\t\t\t...options,\n\t\t\t_defaulted: true\n\t\t};\n\t\tif (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n\t\tif (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n\t\tif (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n\t\tif (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = \"offlineFirst\";\n\t\tif (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;\n\t\treturn defaultedOptions;\n\t}\n\t/**\n\t* The mutation counterpart of {@link QueryClient#defaultQueryOptions}. Called by framework\n\t* adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the\n\t* given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options\n\t* on top. A no-op if the options are already defaulted (`_defaulted: true`).\n\t*/\n\tdefaultMutationOptions(options) {\n\t\tif (options?._defaulted) return options;\n\t\treturn {\n\t\t\t...this.#defaultOptions.mutations,\n\t\t\t...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n\t\t\t...options,\n\t\t\t_defaulted: true\n\t\t};\n\t}\n\t/**\n\t* Clears both the query cache and the mutation cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* queryClient.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tthis.#queryCache.clear();\n\t\tthis.#mutationCache.clear();\n\t}\n};\n//#endregion\nexport { QueryClient };\n\n//# sourceMappingURL=queryClient.js.map","//#region src/qss.ts\n/**\n* Program is a reimplementation of the `qss` package:\n* Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License\n* https://github.com/lukeed/qss/blob/master/license.md\n*\n* This reimplementation uses modern browser APIs\n* (namely URLSearchParams) and TypeScript while still\n* maintaining the original functionality and interface.\n*\n* Update: this implementation has also been mangled to\n* fit exactly our use-case (single value per key in encoding).\n*/\n/**\n* Encodes an object into a query string.\n* @param obj - The object to encode into a query string.\n* @param stringify - An optional custom stringify function.\n* @returns The encoded query string.\n* @example\n* ```\n* // Example input: encode({ token: 'foo', key: 'value' })\n* // Expected output: \"token=foo&key=value\"\n* ```\n*/\nfunction encode(obj, stringify = String) {\n\tlet result;\n\tfor (const key in obj) {\n\t\tconst val = obj[key];\n\t\tif (val !== void 0) (result ||= new URLSearchParams()).set(key, stringify(val));\n\t}\n\treturn result ? result.toString() : \"\";\n}\n/**\n* Converts a string value to its appropriate type (string, number, boolean).\n* @param mix - The string value to convert.\n* @returns The converted value.\n* @example\n* // Example input: toValue(\"123\")\n* // Expected output: 123\n*/\nfunction toValue(str) {\n\tif (!str) return \"\";\n\tif (str === \"false\") return false;\n\tif (str === \"true\") return true;\n\treturn +str * 0 === 0 && +str + \"\" === str ? +str : str;\n}\n/**\n* Decodes a query string into an object.\n* @param str - The query string to decode.\n* @returns The decoded key-value pairs in an object format.\n* @example\n* // Example input: decode(\"token=foo&key=value\")\n* // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n*/\nfunction decode(str) {\n\tconst searchParams = new URLSearchParams(str);\n\tconst result = Object.create(null);\n\tfor (const [key, value] of searchParams.entries()) {\n\t\tconst previousValue = result[key];\n\t\tif (previousValue == null) result[key] = toValue(value);\n\t\telse if (Array.isArray(previousValue)) previousValue.push(toValue(value));\n\t\telse result[key] = [previousValue, toValue(value)];\n\t}\n\treturn result;\n}\n//#endregion\nexport { decode, encode };\n\n//# sourceMappingURL=qss.js.map","import { decode, encode } from \"./qss.js\";\n//#region src/searchParams.ts\nconst jsonStart = /^(?:\\s|[\"[{\\d-]|fa|nu|tr)/;\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\nconst defaultParseSearch = parseSearchWith(JSON.parse);\n/** Default `stringifySearch` using JSON.stringify for complex values. */\nconst defaultStringifySearch = stringifySearchWith(JSON.stringify, JSON.parse);\n/**\n* Build a `parseSearch` function using a provided JSON-like parser.\n*\n* The returned function strips a leading `?`, decodes values, and attempts to\n* JSON-parse string values using the given `parser`.\n*\n* @param parser Function to parse a string value (e.g. `JSON.parse`).\n* @returns A `parseSearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction parseSearchWith(parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\treturn (searchStr) => {\n\t\tif (searchStr[0] === \"?\") searchStr = searchStr.substring(1);\n\t\tconst query = decode(searchStr);\n\t\tfor (const key in query) {\n\t\t\tconst value = query[key];\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tif (isJsonParser && !jsonStart.test(value)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tquery[key] = parser(value);\n\t\t\t\t} catch (_err) {}\n\t\t\t}\n\t\t}\n\t\treturn query;\n\t};\n}\n/**\n* Build a `stringifySearch` function using a provided serializer.\n*\n* Non-primitive values are serialized with `stringify`. If a `parser` is\n* supplied, string values that are parseable are re-serialized to ensure\n* symmetry with `parseSearch`.\n*\n* @param stringify Function to serialize a value (e.g. `JSON.stringify`).\n* @param parser Optional parser to detect parseable strings.\n* @returns A `stringifySearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction stringifySearchWith(stringify, parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\tfunction stringifyValue(val) {\n\t\tif (val && typeof val === \"object\") try {\n\t\t\treturn stringify(val);\n\t\t} catch (_err) {}\n\t\telse if (parser && typeof val === \"string\") {\n\t\t\tif (isJsonParser && !jsonStart.test(val)) return val;\n\t\t\ttry {\n\t\t\t\tparser(val);\n\t\t\t\treturn stringify(val);\n\t\t\t} catch (_err) {}\n\t\t}\n\t\treturn val;\n\t}\n\treturn (search) => {\n\t\tconst searchStr = encode(search, stringifyValue);\n\t\treturn searchStr ? `?${searchStr}` : \"\";\n\t};\n}\n//#endregion\nexport { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith };\n\n//# sourceMappingURL=searchParams.js.map","//#region src/sieve-cache.ts\n/**\n* A fixed-capacity cache using the SIEVE eviction algorithm\n* (https://cachemon.github.io/SIEVE-website/).\n*\n* Entries live in the Map's FIFO insertion order; a hit only flips a `visited`\n* bit instead of relinking the entry, which makes `get` (by far the hottest\n* operation here) one `Map.get` plus a boolean store. Eviction sweeps a `hand`\n* from the oldest entry towards the newest, clearing `visited` bits until it\n* finds an unvisited entry to drop, so entries touched since the last sweep\n* survive one more round. This keeps LRU-like hit ratios while being\n* scan-resistant.\n*/\nfunction createSieveCache(max) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tlet hand;\n\tlet newest;\n\treturn {\n\t\tget(key) {\n\t\t\tconst entry = cache.get(key);\n\t\t\tif (!entry) return;\n\t\t\tentry.visited = true;\n\t\t\treturn entry.value;\n\t\t},\n\t\tset(key, value) {\n\t\t\tconst existing = cache.get(key);\n\t\t\tif (existing) {\n\t\t\t\texisting.value = value;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cache.size >= max) {\n\t\t\t\tlet node = hand?.next().value;\n\t\t\t\twhile (!node || node.visited) {\n\t\t\t\t\tif (node) node.visited = false;\n\t\t\t\t\telse hand = cache.values();\n\t\t\t\t\tnode = hand.next().value;\n\t\t\t\t}\n\t\t\t\tif (node === newest) hand = void 0;\n\t\t\t\tcache.delete(node.key);\n\t\t\t}\n\t\t\tconst entry = {\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\tvisited: false\n\t\t\t};\n\t\t\tnewest = entry;\n\t\t\tcache.set(key, entry);\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t\thand = void 0;\n\t\t\tnewest = void 0;\n\t\t}\n\t};\n}\n//#endregion\nexport { createSieveCache };\n\n//# sourceMappingURL=sieve-cache.js.map","import { last } from \"./utils.js\";\nimport { invariant } from \"./invariant.js\";\nimport { trimPathRight } from \"./path.js\";\nimport { createSieveCache } from \"./sieve-cache.js\";\nconst SEGMENT_TYPE_INDEX = 4;\nconst SEGMENT_TYPE_PATHLESS = 5;\nfunction getParamNames(data) {\n\tconst cached = data.names;\n\tif (cached) return cached;\n\tconst keys = [];\n\tfor (const segment of data) if (typeof segment !== \"string\") keys.push(segment[1]);\n\treturn data.names = keys;\n}\n/** Parse one segment for matching and retain the same record for interpolation. */\nfunction parseSegment(path, start, end) {\n\tconst part = path.substring(start, end);\n\tif (part.charCodeAt(0) === 36) return part.length === 1 ? [\n\t\t2,\n\t\t\"_splat\",\n\t\t\"\",\n\t\tvoid 0\n\t] : [\n\t\t1,\n\t\tpart.substring(1),\n\t\t\"\",\n\t\t\"\"\n\t];\n\tconst open = part.indexOf(\"{\");\n\tif (open >= 0) {\n\t\tconst close = part.indexOf(\"}\", open);\n\t\tconst optional = part.charCodeAt(open + 1) === 45;\n\t\tconst nameStart = open + (optional ? 3 : 2);\n\t\tif (close >= 0 && part.charCodeAt(nameStart - 1) === 36 && (!optional || nameStart < close)) {\n\t\t\tconst key = part.substring(nameStart, close);\n\t\t\treturn [\n\t\t\t\toptional ? 3 : key ? 1 : 2,\n\t\t\t\tkey || \"_splat\",\n\t\t\t\tpart.substring(0, open),\n\t\t\t\tpath.substring(start + close + 1, key ? end : path.length)\n\t\t\t];\n\t\t}\n\t}\n\treturn part;\n}\nfunction parseSegments(defaultCaseSensitive, route, start, node, dynamicListsToSort, parentInterpolation) {\n\tlet cursor = start;\n\tconst path = route.fullPath ?? route.from;\n\tconst options = route.options;\n\tconst length = path.length;\n\tconst literalEnd = path.endsWith(\"/\") ? length - 1 : length;\n\tconst caseSensitive = options?.caseSensitive ?? defaultCaseSensitive;\n\tconst parseParams = options?.params?.parse ?? options?.parseParams;\n\tlet interpolation;\n\tlet literalStart = parentInterpolation ? start - 1 : 0;\n\tif (!node || path.includes(\"$\")) {\n\t\tinterpolation = parentInterpolation?.slice() ?? [];\n\t\tconst tail = last(interpolation);\n\t\tif (tail && typeof tail !== \"string\" && tail[0] === 2) {\n\t\t\tinterpolation[interpolation.length - 1] = [\n\t\t\t\ttail[0],\n\t\t\t\ttail[1],\n\t\t\t\ttail[2],\n\t\t\t\ttail[3] === void 0 ? void 0 : tail[3] + path.substring(start - (path[start - 2] === \"/\" ? 2 : 1), literalEnd)\n\t\t\t];\n\t\t\tliteralStart = length;\n\t\t}\n\t}\n\twhile (cursor < length) {\n\t\tconst start = cursor;\n\t\tconst next = path.indexOf(\"/\", start);\n\t\tlet end = next === -1 ? length : next;\n\t\tconst segment = parseSegment(path, start, end);\n\t\tcursor = end + 1;\n\t\tlet nextNode;\n\t\tif (typeof segment === \"string\") {\n\t\t\tif (!node) continue;\n\t\t\tlet name = segment;\n\t\t\tlet staticChildren;\n\t\t\tif (caseSensitive) staticChildren = node.static ??= /* @__PURE__ */ new Map();\n\t\t\telse {\n\t\t\t\tname = segment.toLowerCase();\n\t\t\t\tstaticChildren = node.staticInsensitive ??= /* @__PURE__ */ new Map();\n\t\t\t}\n\t\t\tconst existingNode = staticChildren.get(name);\n\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\telse {\n\t\t\t\tconst next = createSegmentNode(node);\n\t\t\t\tnextNode = next;\n\t\t\t\tstaticChildren.set(name, next);\n\t\t\t}\n\t\t} else {\n\t\t\tconst kind = segment[0];\n\t\t\tlet prefix = segment[2];\n\t\t\tlet suffix = segment[3] ?? \"\";\n\t\t\tif (kind === 2) {\n\t\t\t\tend = length;\n\t\t\t\tcursor = end + 1;\n\t\t\t}\n\t\t\tif (interpolation && literalStart < end) {\n\t\t\t\tif (literalStart < start - 1) interpolation.push(path.substring(literalStart, start - 1));\n\t\t\t\tsegment[2] = \"/\" + prefix;\n\t\t\t\tif (kind === 2 && segment[3] !== void 0 && literalEnd < length) segment[3] = suffix.slice(0, -1);\n\t\t\t\tinterpolation.push(segment);\n\t\t\t\tliteralStart = end;\n\t\t\t}\n\t\t\tif (!node) continue;\n\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix || suffix);\n\t\t\tif (!caseSensitive) {\n\t\t\t\tprefix = prefix.toLowerCase();\n\t\t\t\tsuffix = suffix.toLowerCase();\n\t\t\t}\n\t\t\tconst siblings = kind === 1 ? node.dynamic ??= [] : kind === 3 ? node.optional ??= [] : node.wildcard ??= [];\n\t\t\tconst existingNode = kind !== 2 && !parseParams && siblings.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);\n\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\telse {\n\t\t\t\tconst next = createSegmentNode(node, kind, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\tnextNode = next;\n\t\t\t\tsiblings.push(next);\n\t\t\t\tif (siblings.length === 2) dynamicListsToSort?.push(siblings);\n\t\t\t}\n\t\t}\n\t\tnode = nextNode;\n\t}\n\tif (interpolation && literalStart < literalEnd) interpolation.push(path.substring(literalStart, literalEnd));\n\tconst segmentData = interpolation?.slice();\n\tif (!node) return segmentData;\n\tif (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf(\"/\") + 1) === 95) {\n\t\tconst pathlessNode = createSegmentNode(node, SEGMENT_TYPE_PATHLESS);\n\t\t(node.pathless ??= []).push(pathlessNode);\n\t\tnode = pathlessNode;\n\t}\n\tconst isLeaf = (route.path || !route.children) && !route.isRoot;\n\tif (isLeaf && literalEnd < length) {\n\t\tconst indexNode = createSegmentNode(node, SEGMENT_TYPE_INDEX);\n\t\tnode.index = indexNode;\n\t\tnode = indexNode;\n\t}\n\tnode.parse = parseParams ?? null;\n\tnode.priority = options?.params?.priority ?? 0;\n\tif (!node.route) {\n\t\tnode.data = segmentData;\n\t\tif (isLeaf) node.route = route;\n\t}\n\treturn [\n\t\tnode,\n\t\tcursor,\n\t\tsegmentData\n\t];\n}\nfunction sortDynamic(a, b) {\n\tif (a.parse && !b.parse) return -1;\n\tif (!a.parse && b.parse) return 1;\n\tif (a.parse && b.parse && (a.priority || b.priority)) return b.priority - a.priority;\n\tif (a.prefix && b.prefix && a.prefix !== b.prefix) {\n\t\tif (a.prefix.startsWith(b.prefix)) return -1;\n\t\tif (b.prefix.startsWith(a.prefix)) return 1;\n\t}\n\tif (a.suffix && b.suffix && a.suffix !== b.suffix) {\n\t\tif (a.suffix.endsWith(b.suffix)) return -1;\n\t\tif (b.suffix.endsWith(a.suffix)) return 1;\n\t}\n\tif (a.prefix && !b.prefix) return -1;\n\tif (!a.prefix && b.prefix) return 1;\n\tif (a.suffix && !b.suffix) return -1;\n\tif (!a.suffix && b.suffix) return 1;\n\tif (a.caseSensitive && !b.caseSensitive) return -1;\n\tif (!a.caseSensitive && b.caseSensitive) return 1;\n\treturn 0;\n}\nfunction createSegmentNode(parent, kind = 0, caseSensitive, prefix, suffix) {\n\treturn {\n\t\tkind,\n\t\tdepth: parent ? parent.depth + 1 : 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tdata: void 0,\n\t\tparent,\n\t\tparse: null,\n\t\tpriority: 0,\n\t\tcaseSensitive,\n\t\tprefix,\n\t\tsuffix\n\t};\n}\nfunction processRouteMasks(routeList, processedTree) {\n\tconst segmentTree = createSegmentNode();\n\tconst dynamicListsToSort = [];\n\tfunction visit(route, start, parentNode, parentInterpolation) {\n\t\tconst [node, cursor, segments] = parseSegments(false, route, start, parentNode, dynamicListsToSort, parentInterpolation);\n\t\tif (route.children) for (const child of route.children) visit(child, cursor, node, segments);\n\t}\n\tfor (const route of routeList) visit(route, 1, segmentTree);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\tprocessedTree.masksTree = segmentTree;\n\tprocessedTree.flatCache = createSieveCache(1e3);\n}\n/**\n* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.\n*/\nfunction findFlatMatch(path, processedTree) {\n\tpath ||= \"/\";\n\tconst cached = processedTree.flatCache.get(path);\n\tif (cached !== void 0) return cached;\n\tconst result = findMatch(path, processedTree.masksTree);\n\tprocessedTree.flatCache.set(path, result);\n\treturn result;\n}\n/**\n* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree\n*/\nfunction findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {\n\tfrom ||= \"/\";\n\tpath ||= \"/\";\n\tconst key = caseSensitive ? `case\\0${from}` : from;\n\tlet tree = processedTree.singleCache.get(key);\n\tif (!tree) {\n\t\ttree = createSegmentNode();\n\t\tparseSegments(caseSensitive, { from }, 1, tree);\n\t\tprocessedTree.singleCache.set(key, tree);\n\t}\n\treturn findMatch(path, tree, fuzzy);\n}\nfunction findRouteMatch(path, processedTree, fuzzy = false) {\n\tconst key = fuzzy ? path : `nofuzz\\0${path}`;\n\tconst cached = processedTree.matchCache.get(key);\n\tif (cached !== void 0) return cached;\n\tpath ||= \"/\";\n\tlet result;\n\ttry {\n\t\tresult = findMatch(path, processedTree.segmentTree, fuzzy);\n\t} catch (err) {\n\t\tif (err instanceof URIError) result = null;\n\t\telse throw err;\n\t}\n\tif (result) result.branch = buildRouteBranch(result.route);\n\tprocessedTree.matchCache.set(key, result);\n\treturn result;\n}\n/**\n* Processes a route tree into a segment trie for efficient path matching.\n* Also builds lookup maps for routes by ID and by trimmed full path.\n*/\nfunction processRouteTree(routeTree, caseSensitive = false) {\n\tconst segmentTree = createSegmentNode();\n\tconst dynamicListsToSort = [];\n\tconst routesById = {};\n\tconst routesByPath = {};\n\tlet index = 0;\n\tfunction visit(route, start, parentNode, parentInterpolation) {\n\t\troute.init(index);\n\t\tif (route.id in routesById) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);\n\t\t\tinvariant();\n\t\t}\n\t\troutesById[route.id] = route;\n\t\tif (index !== 0 && route.path) {\n\t\t\tconst trimmedFullPath = trimPathRight(route.fullPath);\n\t\t\tif (!routesByPath[trimmedFullPath] || route.fullPath.endsWith(\"/\")) routesByPath[trimmedFullPath] = route;\n\t\t}\n\t\tindex++;\n\t\tconst [node, cursor, segments] = parseSegments(caseSensitive, route, start, parentNode, dynamicListsToSort, parentInterpolation);\n\t\troute._interpolation = segments;\n\t\tif (route.children) for (const child of route.children) visit(child, cursor, node, segments);\n\t}\n\tvisit(routeTree, 1, segmentTree);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\treturn {\n\t\tprocessedTree: {\n\t\t\tsegmentTree,\n\t\t\tsingleCache: createSieveCache(1e3),\n\t\t\tmatchCache: createSieveCache(1e3),\n\t\t\tflatCache: null,\n\t\t\tmasksTree: null\n\t\t},\n\t\troutesById,\n\t\troutesByPath\n\t};\n}\nfunction findMatch(path, segmentTree, fuzzy = false) {\n\tconst parts = path.split(\"/\");\n\tconst leaf = getNodeMatch(path, parts, segmentTree, fuzzy);\n\tif (!leaf) return null;\n\tconst [rawParams] = extractParams(path, parts, leaf);\n\treturn {\n\t\troute: leaf.node.route,\n\t\trawParams\n\t};\n}\n/**\n* This function is \"resumable\":\n* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call\n* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off\n*\n* Inputs are *not* mutated.\n*/\nfunction extractParams(path, parts, leaf) {\n\tconst list = buildBranch(leaf.node);\n\tconst names = leaf.node.data && getParamNames(leaf.node.data);\n\tconst rawParams = Object.create(null);\n\t/** which segment of the path we're currently processing */\n\tlet partIndex = leaf.extract?.part ?? 0;\n\t/** which node of the route tree branch we're currently processing */\n\tlet nodeIndex = leaf.extract?.node ?? 0;\n\t/** index of the 1st character of the segment we're processing in the path string */\n\tlet pathIndex = leaf.extract?.path ?? 0;\n\t/** Next original parameter name, independent of pathless/static nodes. */\n\tlet paramIndex = leaf.extract?.param ?? 0;\n\tfor (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++) {\n\t\tconst node = list[nodeIndex];\n\t\tif (node.kind === SEGMENT_TYPE_INDEX) break;\n\t\tif (node.kind === SEGMENT_TYPE_PATHLESS) {\n\t\t\tpartIndex--;\n\t\t\tpathIndex--;\n\t\t\tcontinue;\n\t\t}\n\t\tconst part = parts[partIndex];\n\t\tconst currentPathIndex = pathIndex;\n\t\tif (part) pathIndex += part.length;\n\t\tif (node.kind === 1 || node.kind === 3) {\n\t\t\tconst name = names[paramIndex++];\n\t\t\tif (node.kind === 3 && leaf.skipped & 1 << nodeIndex) {\n\t\t\t\tpartIndex--;\n\t\t\t\tpathIndex = currentPathIndex - 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = node.suffix || node.prefix ? part.substring(node.prefix.length, part.length - node.suffix.length) : part;\n\t\t\tif (value || node.kind === 1) rawParams[name] = decodeURIComponent(value);\n\t\t} else if (node.kind === 2) {\n\t\t\tconst n = node;\n\t\t\tconst value = path.substring(currentPathIndex + n.prefix.length, path.length - n.suffix.length);\n\t\t\tconst splat = decodeURIComponent(value);\n\t\t\trawParams[\"*\"] = splat;\n\t\t\trawParams._splat = splat;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);\n\treturn [rawParams, {\n\t\tpart: partIndex,\n\t\tnode: nodeIndex,\n\t\tpath: pathIndex,\n\t\tparam: paramIndex\n\t}];\n}\nfunction buildRouteBranch(route) {\n\tconst list = [route];\n\twhile (route.parentRoute) {\n\t\troute = route.parentRoute;\n\t\tlist.push(route);\n\t}\n\tlist.reverse();\n\treturn list;\n}\nfunction buildBranch(node) {\n\tconst list = Array(node.depth + 1);\n\tdo {\n\t\tlist[node.depth] = node;\n\t\tnode = node.parent;\n\t} while (node);\n\treturn list;\n}\nfunction getNodeMatch(path, parts, segmentTree, fuzzy) {\n\tif (path === \"/\" && segmentTree.index) return {\n\t\tnode: segmentTree.index,\n\t\tskipped: 0\n\t};\n\tconst trailingSlash = !last(parts);\n\tconst pathIsIndex = trailingSlash && path !== \"/\";\n\tconst partsLength = parts.length - (trailingSlash ? 1 : 0);\n\tconst stack = [{\n\t\tnode: segmentTree,\n\t\tindex: 1,\n\t\tskipped: 0,\n\t\tstatics: 0,\n\t\tdynamics: 0,\n\t\toptionals: 0\n\t}];\n\tlet bestFuzzy = null;\n\tlet bestMatch = null;\n\twhile (stack.length) {\n\t\tconst frame = stack.pop();\n\t\tconst { node, index, skipped, statics, dynamics, optionals } = frame;\n\t\tlet { extract, rawParams } = frame;\n\t\tif (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;\n\t\tif (node.parse) {\n\t\t\tif (!validateParseParams(path, parts, frame)) continue;\n\t\t\trawParams = frame.rawParams;\n\t\t\textract = frame.extract;\n\t\t}\n\t\tif (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;\n\t\tconst isBeyondPath = index === partsLength;\n\t\tif (isBeyondPath) {\n\t\t\tif (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;\n\t\t\tif (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;\n\t\t}\n\t\tconst part = isBeyondPath ? void 0 : parts[index];\n\t\tlet lowerPart;\n\t\tif (isBeyondPath && node.index) {\n\t\t\tconst indexFrame = {\n\t\t\t\tnode: node.index,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t};\n\t\t\tlet indexValid = true;\n\t\t\tif (node.index.parse) {\n\t\t\t\tif (!validateParseParams(path, parts, indexFrame)) indexValid = false;\n\t\t\t}\n\t\t\tif (indexValid) {\n\t\t\t\tif (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;\n\t\t\t\tif (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;\n\t\t\t}\n\t\t}\n\t\tif (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.wildcard[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tif (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;\n\t\t\t}\n\t\t\tif (suffix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tconst end = parts.slice(index).join(\"/\");\n\t\t\t\tconst suffixPart = end.slice(-suffix.length);\n\t\t\t\tif ((segment.caseSensitive ? suffixPart : suffixPart.toLowerCase()) !== suffix || end.length - suffix.length < prefix.length) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: partsLength,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.optional) {\n\t\t\tconst nextSkipped = skipped | 1 << node.depth + 1;\n\t\t\tfor (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex,\n\t\t\t\t\tskipped: nextSkipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals,\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tconst { prefix, suffix } = segment;\n\t\t\t\tif (prefix || suffix) {\n\t\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\t\tif (suffix && casePart.indexOf(suffix, casePart.length - suffix.length) < prefix.length) continue;\n\t\t\t\t}\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex: index + 1,\n\t\t\t\t\tskipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals: optionals + segmentScore(partsLength, index),\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.dynamic[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix || suffix) {\n\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\tif (suffix && casePart.indexOf(suffix, casePart.length - suffix.length) < prefix.length) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics: dynamics + segmentScore(partsLength, index),\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.staticInsensitive) {\n\t\t\tconst match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.static) {\n\t\t\tconst match = node.static.get(part);\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.pathless) for (let i = node.pathless.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.pathless[i];\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t}\n\tif (bestMatch) return bestMatch;\n\tif (fuzzy && bestFuzzy) {\n\t\tlet sliceIndex = bestFuzzy.index;\n\t\tfor (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;\n\t\tconst splat = sliceIndex === path.length ? \"/\" : path.slice(sliceIndex);\n\t\tbestFuzzy.rawParams ??= Object.create(null);\n\t\tbestFuzzy.rawParams[\"**\"] = decodeURIComponent(splat);\n\t\treturn bestFuzzy;\n\t}\n\treturn null;\n}\nfunction segmentScore(partsLength, index) {\n\treturn 2 ** (partsLength - index - 1);\n}\nfunction isPerfectStaticMatch(statics, partsLength) {\n\treturn statics === 2 ** (partsLength - 1) - 1;\n}\nfunction validateParseParams(path, parts, frame) {\n\tlet rawParams;\n\tlet state;\n\ttry {\n\t\t[rawParams, state] = extractParams(path, parts, frame);\n\t} catch {\n\t\treturn null;\n\t}\n\tframe.rawParams = rawParams;\n\tframe.extract = state;\n\tif (!frame.node.parse) return true;\n\ttry {\n\t\tif (frame.node.parse(rawParams) === false) return null;\n\t} catch {}\n\treturn true;\n}\nfunction isFrameMoreSpecific(prev, next) {\n\tif (!prev) return true;\n\treturn next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.node.depth > prev.node.depth)));\n}\n//#endregion\nexport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegments, processRouteMasks, processRouteTree };\n\n//# sourceMappingURL=new-process-route-tree.js.map","import { cleanPath, trimPath } from \"./path.js\";\n//#region src/rewrite.ts\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\nfunction composeRewrites(rewrites) {\n\treturn {\n\t\tinput: ({ url }) => {\n\t\t\tfor (const rewrite of rewrites) url = executeRewriteInput(rewrite, url);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\tfor (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url);\n\t\t\treturn url;\n\t\t}\n\t};\n}\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\nfunction rewriteBasepath(basepath, caseSensitive, rewrite) {\n\tconst trimmedBasepath = trimPath(basepath);\n\tconst normalizedBasepath = `/${trimmedBasepath}`;\n\tconst checkBasepath = caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase();\n\tconst checkBasepathWithSlash = `${checkBasepath}/`;\n\tconst basepathRewrite = {\n\t\tinput: ({ url }) => {\n\t\t\tconst pathname = caseSensitive ? url.pathname : url.pathname.toLowerCase();\n\t\t\tif (pathname === checkBasepath) url.pathname = \"/\";\n\t\t\telse if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\turl.pathname = cleanPath(`/${trimmedBasepath}${url.pathname}`);\n\t\t\treturn url;\n\t\t}\n\t};\n\treturn rewrite ? {\n\t\tinput: ({ url }) => executeRewriteInput(rewrite, basepathRewrite.input({ url })),\n\t\toutput: ({ url }) => basepathRewrite.output({ url: executeRewriteOutput(rewrite, url) })\n\t} : basepathRewrite;\n}\n/** Execute a location input rewrite if provided. */\nfunction executeRewriteInput(rewrite, url) {\n\tconst res = rewrite?.input?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n/** Execute a location output rewrite if provided. */\nfunction executeRewriteOutput(rewrite, url) {\n\tconst res = rewrite?.output?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n//#endregion\nexport { composeRewrites, executeRewriteInput, executeRewriteOutput, rewriteBasepath };\n\n//# sourceMappingURL=rewrite.js.map","import { arraysEqual, functionalUpdate } from \"./utils.js\";\n//#region src/stores.ts\n/** SSR non-reactive createMutableStore */\nfunction createNonReactiveMutableStore(initialValue) {\n\tlet value = initialValue;\n\treturn {\n\t\tget() {\n\t\t\treturn value;\n\t\t},\n\t\tset(nextOrUpdater) {\n\t\t\tvalue = functionalUpdate(nextOrUpdater, value);\n\t\t}\n\t};\n}\n/** SSR non-reactive createReadonlyStore */\nfunction createNonReactiveReadonlyStore(read) {\n\treturn { get() {\n\t\treturn read();\n\t} };\n}\nfunction createRouterStores(initialLocation, config) {\n\tconst { createMutableStore, createReadonlyStore, batch } = config;\n\tconst byRoute = /* @__PURE__ */ new Map();\n\tconst status = createMutableStore(\"idle\");\n\tconst location = createMutableStore(initialLocation);\n\tconst resolvedLocation = createMutableStore(void 0);\n\tconst ids = createMutableStore([]);\n\tconst matches = createReadonlyStore(() => ids.get().map((id) => byRoute.get(id).get()));\n\tconst __store = createReadonlyStore(() => ({\n\t\tstatus: status.get(),\n\t\tisLoading: status.get() === \"pending\",\n\t\tmatches: matches.get(),\n\t\tlocation: location.get(),\n\t\tresolvedLocation: resolvedLocation.get()\n\t}));\n\tfunction getMatchStore(routeId) {\n\t\tlet matchStore = byRoute.get(routeId);\n\t\tif (!matchStore) {\n\t\t\tmatchStore = createMutableStore(void 0);\n\t\t\tbyRoute.set(routeId, matchStore);\n\t\t}\n\t\treturn matchStore;\n\t}\n\tconst store = {\n\t\tstatus,\n\t\tlocation,\n\t\tresolvedLocation,\n\t\tids,\n\t\tmatches,\n\t\tbyRoute,\n\t\t__store,\n\t\tgetMatchStore,\n\t\tsetMatches\n\t};\n\tfunction setMatches(nextMatches) {\n\t\tconst previousIds = ids.get();\n\t\tconst nextIds = nextMatches.map((match) => match.routeId);\n\t\tbatch(() => {\n\t\t\tif (!arraysEqual(previousIds, nextIds)) ids.set(nextIds);\n\t\t\tfor (const id of previousIds) if (!nextIds.includes(id)) byRoute.get(id).set(() => void 0);\n\t\t\tfor (const nextMatch of nextMatches) {\n\t\t\t\tconst matchStore = getMatchStore(nextMatch.routeId);\n\t\t\t\tif (matchStore.get() !== nextMatch) matchStore.set(nextMatch);\n\t\t\t}\n\t\t});\n\t}\n\treturn store;\n}\n//#endregion\nexport { createNonReactiveMutableStore, createNonReactiveReadonlyStore, createRouterStores };\n\n//# sourceMappingURL=stores.js.map","//#region src/index.ts\nvar stateIndexKey = \"__TSR_index\";\nvar popStateEvent = \"popstate\";\nvar beforeUnloadEvent = \"beforeunload\";\n/**\n* Turn protocol-relative inputs such as \"//evil.example\" into paths\n* such as \"/evil.example\", keeping navigation on the current origin.\n*\n* For HTTP(S) URLs, WHATWG parsing ignores leading C0 controls and spaces,\n* removes tabs/newlines, and treats backslashes as slashes, so inputs like\n* \"/\\evil.example\" also need normalization. This only allocates when those\n* rules would make the input protocol-relative.\n*/\nvar protocolRelativePrefix = /^[\\x00-\\x20]*(?:[\\\\/][\\t\\n\\r]*){2,}/;\nfunction normalizeProtocolRelative(url) {\n\tconst match = protocolRelativePrefix.exec(url);\n\treturn match ? \"/\" + url.slice(match[0].length) : url;\n}\nfunction normalizeHref(href) {\n\tif (/[\\x00-\\x1f\\x7f]/.test(href)) href = href.replace(/[\\x00-\\x1f\\x7f]/g, (character) => \"\t\\n\\r\".includes(character) ? \"\" : encodeURIComponent(character));\n\treturn normalizeProtocolRelative(href);\n}\nfunction createHistory(opts) {\n\tlet location = opts.getLocation();\n\tconst subscribers = /* @__PURE__ */ new Set();\n\tconst notify = (action) => {\n\t\tlocation = opts.getLocation();\n\t\tsubscribers.forEach((subscriber) => subscriber({\n\t\t\tlocation,\n\t\t\taction\n\t\t}));\n\t};\n\tconst handleIndexChange = (action) => {\n\t\tif (opts.notifyOnIndexChange ?? true) notify(action);\n\t\telse location = opts.getLocation();\n\t};\n\tconst tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => {\n\t\tif (navigateOpts?.ignoreBlocker ?? false) {\n\t\t\ttask();\n\t\t\treturn;\n\t\t}\n\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\tconst isPushOrReplace = actionInfo.type === \"PUSH\" || actionInfo.type === \"REPLACE\";\n\t\tif (typeof document !== \"undefined\" && blockers.length && isPushOrReplace) for (const blocker of blockers) {\n\t\t\tconst nextLocation = parseHref(actionInfo.path, actionInfo.state);\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: location,\n\t\t\t\tnextLocation,\n\t\t\t\taction: actionInfo.type\n\t\t\t})) {\n\t\t\t\topts.onBlocked?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\ttask();\n\t};\n\treturn {\n\t\tget location() {\n\t\t\treturn location;\n\t\t},\n\t\tget length() {\n\t\t\treturn opts.getLength();\n\t\t},\n\t\tsubscribers,\n\t\tsubscribe: (cb) => {\n\t\t\tsubscribers.add(cb);\n\t\t\treturn () => {\n\t\t\t\tsubscribers.delete(cb);\n\t\t\t};\n\t\t},\n\t\tpush: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex + 1, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.pushState(path, state);\n\t\t\t\t\tnotify({ type: \"PUSH\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"PUSH\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\treplace: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.replaceState(path, state);\n\t\t\t\t\tnotify({ type: \"REPLACE\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"REPLACE\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\tgo: (index, navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.go(index, navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({\n\t\t\t\t\t\ttype: \"GO\",\n\t\t\t\t\t\tindex\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"GO\"\n\t\t\t});\n\t\t},\n\t\tback: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.back(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"BACK\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"BACK\"\n\t\t\t});\n\t\t},\n\t\tforward: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.forward(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"FORWARD\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"FORWARD\"\n\t\t\t});\n\t\t},\n\t\tcanGoBack: () => location.state[stateIndexKey] !== 0,\n\t\tcreateHref: (str) => opts.createHref(str),\n\t\tblock: (blocker) => {\n\t\t\tif (!opts.setBlockers) return () => {};\n\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\topts.setBlockers([...blockers, blocker]);\n\t\t\treturn () => {\n\t\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\t\topts.setBlockers?.(blockers.filter((b) => b !== blocker));\n\t\t\t};\n\t\t},\n\t\tflush: () => opts.flush?.(),\n\t\tdestroy: () => opts.destroy?.(),\n\t\tnotify,\n\t\t_getBlockers: () => opts.getBlockers?.() ?? []\n\t};\n}\nfunction assignKeyAndIndex(index, state) {\n\tconst key = createRandomKey();\n\treturn {\n\t\t...state,\n\t\tkey,\n\t\t__TSR_key: key,\n\t\t[stateIndexKey]: index\n\t};\n}\n/**\n* Creates a history object that can be used to interact with the browser's\n* navigation. This is a lightweight API wrapping the browser's native methods.\n* It is designed to work with TanStack Router, but could be used as a standalone API as well.\n* IMPORTANT: This API implements history throttling via a microtask to prevent\n* excessive calls to the history API. In some browsers, calling history.pushState or\n* history.replaceState in quick succession can cause the browser to ignore subsequent\n* calls. This API smooths out those differences and ensures that your application\n* state will *eventually* match the browser state. In most cases, this is not a problem,\n* but if you need to ensure that the browser state is up to date, you can use the\n* `history.flush` method to immediately flush all pending state changes to the browser URL.\n* @param opts\n* @param opts.getHref A function that returns the current href (path + search + hash)\n* @param opts.createHref A function that takes a path and returns a href (path + search + hash)\n* @returns A history instance\n*/\nfunction createBrowserHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\tconst originalPushState = win.history.pushState;\n\tconst originalReplaceState = win.history.replaceState;\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\tconst createHref = (path) => normalizeHref(opts?.createHref ? opts.createHref(path) : path);\n\tconst parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));\n\tif (!win.history.state?.__TSR_key && !win.history.state?.key) {\n\t\tconst addedKey = createRandomKey();\n\t\twin.history.replaceState({\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey: addedKey,\n\t\t\t__TSR_key: addedKey\n\t\t}, \"\");\n\t}\n\tlet currentLocation = parseLocation();\n\tlet rollbackLocation;\n\tlet nextPopIsGo = false;\n\tlet ignoreNextPop = false;\n\tlet skipBlockerNextPop = false;\n\tlet ignoreNextBeforeUnload = false;\n\tconst getLocation = () => currentLocation;\n\tlet next;\n\tconst flush = () => {\n\t\tif (!next) return;\n\t\thistory._ignoreSubscribers = true;\n\t\t(next[2] ? win.history.pushState : win.history.replaceState)(next[1], \"\", next[0]);\n\t\thistory._ignoreSubscribers = false;\n\t\tnext = void 0;\n\t\trollbackLocation = void 0;\n\t};\n\tconst queueHistoryAction = (isPush, destHref, state) => {\n\t\tconst href = opts?.createHref ? createHref(destHref) : void 0;\n\t\tconst hasPendingAction = !!next;\n\t\tif (!hasPendingAction) rollbackLocation = currentLocation;\n\t\tcurrentLocation = parseHref(destHref, state);\n\t\tnext = [\n\t\t\thref ?? currentLocation.href,\n\t\t\tstate,\n\t\t\tnext?.[2] || isPush\n\t\t];\n\t\tif (!hasPendingAction) queueMicrotask(() => flush());\n\t};\n\tconst onPushPop = (type) => {\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify({ type });\n\t};\n\tconst onPushPopEvent = async () => {\n\t\tignoreNextBeforeUnload = false;\n\t\tif (ignoreNextPop) {\n\t\t\tignoreNextPop = false;\n\t\t\treturn;\n\t\t}\n\t\tconst nextLocation = parseLocation();\n\t\tconst delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];\n\t\tconst isForward = delta === 1;\n\t\tconst isBack = delta === -1;\n\t\tconst isGo = !isForward && !isBack || nextPopIsGo;\n\t\tnextPopIsGo = false;\n\t\tconst action = isGo ? \"GO\" : isBack ? \"BACK\" : \"FORWARD\";\n\t\tconst notify = isGo ? {\n\t\t\ttype: \"GO\",\n\t\t\tindex: delta\n\t\t} : { type: isBack ? \"BACK\" : \"FORWARD\" };\n\t\tif (skipBlockerNextPop) skipBlockerNextPop = false;\n\t\telse {\n\t\t\tconst blockers = _getBlockers();\n\t\t\tif (typeof document !== \"undefined\" && blockers.length) {\n\t\t\t\tfor (const blocker of blockers) if (await blocker.blockerFn({\n\t\t\t\t\tcurrentLocation,\n\t\t\t\t\tnextLocation,\n\t\t\t\t\taction\n\t\t\t\t})) {\n\t\t\t\t\tignoreNextPop = true;\n\t\t\t\t\twin.history.go(-delta);\n\t\t\t\t\thistory.notify(notify);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify(notify);\n\t};\n\tconst onBeforeUnload = (e) => {\n\t\tif (ignoreNextBeforeUnload) {\n\t\t\tignoreNextBeforeUnload = false;\n\t\t\treturn;\n\t\t}\n\t\tlet shouldBlock = false;\n\t\tconst blockers = _getBlockers();\n\t\tif (typeof document !== \"undefined\" && blockers.length) for (const blocker of blockers) {\n\t\t\tconst shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;\n\t\t\tif (shouldHaveBeforeUnload === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (typeof shouldHaveBeforeUnload === \"function\" && shouldHaveBeforeUnload() === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (shouldBlock) {\n\t\t\te.preventDefault();\n\t\t\treturn e.returnValue = \"\";\n\t\t}\n\t};\n\tconst history = createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => win.history.length,\n\t\tpushState: (href, state) => queueHistoryAction(true, href, state),\n\t\treplaceState: (href, state) => queueHistoryAction(false, href, state),\n\t\tback: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\treturn win.history.back();\n\t\t},\n\t\tforward: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\twin.history.forward();\n\t\t},\n\t\tgo: (n, ignoreBlocker) => {\n\t\t\tnextPopIsGo = true;\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\twin.history.go(n);\n\t\t},\n\t\tcreateHref: (href) => createHref(href),\n\t\tflush,\n\t\tdestroy: () => {\n\t\t\twin.history.pushState = originalPushState;\n\t\t\twin.history.replaceState = originalReplaceState;\n\t\t\twin.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\t\t\twin.removeEventListener(popStateEvent, onPushPopEvent);\n\t\t},\n\t\tonBlocked: () => {\n\t\t\tif (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;\n\t\t},\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers,\n\t\tnotifyOnIndexChange: false\n\t});\n\thistory._ignoreNextBeforeUnload = (href) => {\n\t\tignoreNextBeforeUnload = false;\n\t\ttry {\n\t\t\thref = new URL(href, win.document.baseURI).href;\n\t\t\tignoreNextBeforeUnload = /^https?:/.test(href) && (!href.includes(\"#\") || href.split(\"#\")[0] !== win.location.href.split(\"#\")[0]);\n\t\t} catch {}\n\t};\n\twin.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\twin.addEventListener(popStateEvent, onPushPopEvent);\n\twin.history.pushState = function(...args) {\n\t\tconst res = originalPushState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"PUSH\");\n\t\treturn res;\n\t};\n\twin.history.replaceState = function(...args) {\n\t\tconst res = originalReplaceState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"REPLACE\");\n\t\treturn res;\n\t};\n\treturn history;\n}\n/**\n* Create a hash-based history implementation.\n* Useful for static hosts or environments without server URL rewriting.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createHashHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\treturn createBrowserHistory({\n\t\twindow: win,\n\t\tparseLocation: () => {\n\t\t\tconst hashSplit = win.location.hash.split(\"#\").slice(1);\n\t\t\tconst pathPart = hashSplit[0] ?? \"/\";\n\t\t\tconst searchPart = win.location.search;\n\t\t\tconst hashEntries = hashSplit.slice(1);\n\t\t\treturn parseHref(`${pathPart}${searchPart}${hashEntries.length === 0 ? \"\" : `#${hashEntries.join(\"#\")}`}`, win.history.state);\n\t\t},\n\t\tcreateHref: (href) => `${win.location.pathname}${win.location.search}#${href}`\n\t});\n}\n/**\n* Create an in-memory history implementation.\n* Ideal for server rendering, tests, and non-DOM environments.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createMemoryHistory(opts = { initialEntries: [\"/\"] }) {\n\tconst entries = opts.initialEntries;\n\tlet index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;\n\tconst states = entries.map((_entry, index) => assignKeyAndIndex(index, void 0));\n\tconst getLocation = () => parseHref(entries[index], states[index]);\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\treturn createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => entries.length,\n\t\tpushState: (path, state) => {\n\t\t\tindex = index < entries.length - 1 ? index + 1 : entries.length;\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t\tif (index < entries.length - 1) {\n\t\t\t\tentries.length = index + 1;\n\t\t\t\tstates.length = index + 1;\n\t\t\t}\n\t\t},\n\t\treplaceState: (path, state) => {\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t},\n\t\tback: () => {\n\t\t\tindex = Math.max(index - 1, 0);\n\t\t},\n\t\tforward: () => {\n\t\t\tindex = Math.min(index + 1, entries.length - 1);\n\t\t},\n\t\tgo: (n) => {\n\t\t\tindex = Math.min(Math.max(index + n, 0), entries.length - 1);\n\t\t},\n\t\tcreateHref: normalizeHref,\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers\n\t});\n}\nvar noop = () => {};\nvar ServerHistory = class {\n\tconstructor(location) {\n\t\tthis.location = location;\n\t}\n\tget length() {\n\t\treturn 1;\n\t}\n\tget subscribers() {\n\t\treturn this._subscribers ??= /* @__PURE__ */ new Set();\n\t}\n\tsubscribe() {\n\t\treturn noop;\n\t}\n\tpush() {}\n\treplace() {}\n\tgo() {}\n\tback() {}\n\tforward() {}\n\tcanGoBack() {\n\t\treturn false;\n\t}\n\tcreateHref(href) {\n\t\treturn normalizeHref(href);\n\t}\n\tblock() {\n\t\treturn noop;\n\t}\n\tflush() {}\n\tdestroy() {}\n\tnotify() {}\n\t_getBlockers() {\n\t\treturn [];\n\t}\n};\n/** A fixed request location; server navigation is a no-op. */\nfunction createServerHistory(href) {\n\treturn new ServerHistory(parseHref(href, void 0));\n}\nfunction parseHref(href, state) {\n\tconst sanitizedHref = normalizeHref(href);\n\tconst hashIndex = sanitizedHref.indexOf(\"#\");\n\tconst searchIndex = sanitizedHref.indexOf(\"?\");\n\tif (!state) {\n\t\tconst key = createRandomKey();\n\t\tstate = {\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey,\n\t\t\t__TSR_key: key\n\t\t};\n\t}\n\treturn {\n\t\thref: sanitizedHref,\n\t\tpathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),\n\t\thash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : \"\",\n\t\tsearch: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : \"\",\n\t\tstate\n\t};\n}\nfunction createRandomKey() {\n\treturn (Math.random() + 1).toString(36).substring(7);\n}\n//#endregion\nexport { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory, createServerHistory, normalizeProtocolRelative, parseHref };\n\n//# sourceMappingURL=index.js.map","import { DEFAULT_PROTOCOL_ALLOWLIST, createNull, decodePath, deepEqual, encodePathLikeUrl, findLast, functionalUpdate, getUrlScheme, hasKeys, hasOwn, isDangerousProtocol, last, nullReplaceEqualDeep, protocolRelativePrefixRegex, replaceEqualDeep } from \"./utils.js\";\nimport { compileDecodeCharMap, interpolatePath, resolvePath, trimPath, trimPathRight } from \"./path.js\";\nimport { createSieveCache } from \"./sieve-cache.js\";\nimport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegments, processRouteMasks, processRouteTree } from \"./new-process-route-tree.js\";\nimport { isNotFound } from \"./not-found.js\";\nimport { setupScrollRestoration } from \"./scroll-restoration.js\";\nimport { defaultParseSearch, defaultStringifySearch } from \"./searchParams.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk } from \"./load-client.js\";\nimport { executeRewriteInput, executeRewriteOutput, rewriteBasepath } from \"./rewrite.js\";\nimport { createRouterStores } from \"./stores.js\";\nimport { createBrowserHistory, normalizeProtocolRelative, parseHref } from \"@tanstack/history\";\nimport { isServer, loadServerRoute } from \"@tanstack/router-core/isServer\";\n//#region src/router.ts\nfunction isExternalUrl(url, origin) {\n\treturn url.protocol !== \"http:\" && url.protocol !== \"https:\" || url.origin !== origin || !!url.username || !!url.password;\n}\nfunction getUrlPath(url) {\n\treturn url.pathname + url.search + url.hash;\n}\nfunction routeNeedsLoad(route) {\n\treturn route.options.loader || route.options.beforeLoad || route.lazyFn || route.options.component?.preload || route.options.pendingComponent?.preload;\n}\n/**\n* Convert an unknown error into a minimal, serializable object.\n* Includes name and message (and stack in development).\n*/\nfunction defaultSerializeError(err) {\n\tif (err instanceof Error) {\n\t\tconst obj = {\n\t\t\tname: err.name,\n\t\t\tmessage: err.message\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") obj.stack = err.stack;\n\t\treturn obj;\n\t}\n\treturn { data: err };\n}\n/** Options for configuring trailing-slash behavior. */\nconst trailingSlashOptions = {\n\talways: \"always\",\n\tnever: \"never\",\n\tpreserve: \"preserve\"\n};\n/**\n* Compute whether path, href or hash changed between previous and current\n* resolved locations.\n*/\nfunction getLocationChangeInfo(location, resolvedLocation) {\n\treturn {\n\t\tfromLocation: resolvedLocation,\n\t\ttoLocation: location,\n\t\tpathChanged: resolvedLocation?.pathname !== location.pathname,\n\t\threfChanged: resolvedLocation?.href !== location.href,\n\t\thashChanged: resolvedLocation?.hash !== location.hash\n\t};\n}\n/**\n* Return only state owned by the application, excluding volatile history\n* bookkeeping. Mask payloads (`__tempLocation`/`__tempKey`) are kept: they\n* distinguish otherwise-identical locations.\n*/\nfunction _getUserHistoryState({ key: _key, __TSR_key: _tsrKey, __TSR_index: _tsrIndex, __hashScrollIntoViewOptions: _hashScroll, ...state }) {\n\treturn state;\n}\nfunction lifecycleEnd(matches) {\n\treturn matches.findIndex((match) => match.status === \"error\" || match.status === \"notFound\" || match._notFound) + 1;\n}\n/** Run route lifecycle callbacks in leave/enter/stay phases. */\nfunction runRouteLifecycle(router, previous, matches, previousEnd, nextEnd, owner) {\n\tif (previousEnd) previous = previous.slice(0, previousEnd);\n\tif (nextEnd) matches = matches.slice(0, nextEnd);\n\tfor (const match of previous) {\n\t\tif (owner && router._tx !== owner) return;\n\t\tif (!matches.some((candidate) => candidate.routeId === match.routeId)) router.routesById[match.routeId].options.onLeave?.(match);\n\t}\n\tfor (const match of matches) {\n\t\tif (owner && router._tx !== owner) return;\n\t\trouter.routesById[match.routeId].options[previous.some((candidate) => candidate.routeId === match.routeId) ? \"onStay\" : \"onEnter\"]?.(match);\n\t}\n}\n/**\n* Core, framework-agnostic router engine that powers TanStack Router.\n*\n* Provides navigation, matching, loading, preloading, caching and event APIs\n* used by framework adapters (React/Solid). Prefer framework helpers like\n* `createRouter` in app code.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType\n*/\nvar RouterCore = class {\n\t/**\n\t* @deprecated Use the `createRouter` function instead\n\t*/\n\tconstructor(options, getStoreConfig) {\n\t\tthis.tempLocationKey = `${Math.round(Math.random() * 1e7)}`;\n\t\tthis._scroll = { n: true };\n\t\tthis.subscribers = /* @__PURE__ */ new Set();\n\t\tthis._cache = /* @__PURE__ */ new Map();\n\t\tthis._committed = [];\n\t\tthis.startTransition = async (fn) => {\n\t\t\tfn();\n\t\t\treturn false;\n\t\t};\n\t\tthis.update = (newOptions) => {\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tif (newOptions.notFoundRoute) console.warn(\"The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.\");\n\t\t\t}\n\t\t\tconst prevOptions = this.options;\n\t\t\tthis.options = {\n\t\t\t\t...prevOptions,\n\t\t\t\t...newOptions\n\t\t\t};\n\t\t\tthis.isServer = this.options.isServer ?? isServer ?? typeof document === \"undefined\";\n\t\t\tif (!(isServer ?? this.isServer)) this.staticLocations = /* @__PURE__ */ new WeakMap();\n\t\t\tthis.protocolAllowlist = new Set(this.options.protocolAllowlist);\n\t\t\tif (!this.history || this.options.history && this.options.history !== this.history) if (!this.options.history) {\n\t\t\t\tif (!(isServer ?? this.isServer)) this.history = createBrowserHistory();\n\t\t\t} else this.history = this.options.history;\n\t\t\tthis.origin = this.options.origin;\n\t\t\tif (!this.origin) if (!(isServer ?? this.isServer) && window?.origin && window.origin !== \"null\") this.origin = window.origin;\n\t\t\telse this.origin = \"http://localhost\";\n\t\t\tconst nextBasepath = this.options.basepath ?? \"/\";\n\t\t\tconst nextRewriteOption = this.options.rewrite;\n\t\t\tconst rewriteChanged = this.basepath !== nextBasepath || prevOptions?.rewrite !== nextRewriteOption || prevOptions?.caseSensitive !== this.options.caseSensitive;\n\t\t\tif (rewriteChanged) {\n\t\t\t\tthis.basepath = nextBasepath;\n\t\t\t\tthis.rewrite = nextBasepath !== \"/\" && trimPath(nextBasepath) ? rewriteBasepath(nextBasepath, this.options.caseSensitive, nextRewriteOption) : nextRewriteOption;\n\t\t\t}\n\t\t\tif (this.history) this.updateLatestLocation();\n\t\t\tif (this.options.routeTree !== this.routeTree || (isServer ?? this.isServer) && prevOptions?.caseSensitive !== this.options.caseSensitive) {\n\t\t\t\tthis.routeTree = this.options.routeTree;\n\t\t\t\tlet processRouteTreeResult;\n\t\t\t\tif (process.env.NODE_ENV !== \"development\" && (isServer ?? this.isServer) && globalThis.__TSR_CACHE__ && globalThis.__TSR_CACHE__.routeTree === this.routeTree && globalThis.__TSR_CACHE__.caseSensitive === this.options.caseSensitive) processRouteTreeResult = globalThis.__TSR_CACHE__.processRouteTreeResult;\n\t\t\t\telse {\n\t\t\t\t\tprocessRouteTreeResult = this.buildRouteTree();\n\t\t\t\t\tif (process.env.NODE_ENV !== \"development\" && (isServer ?? this.isServer) && globalThis.__TSR_CACHE__ === void 0) globalThis.__TSR_CACHE__ = {\n\t\t\t\t\t\trouteTree: this.routeTree,\n\t\t\t\t\t\tcaseSensitive: this.options.caseSensitive,\n\t\t\t\t\t\tprocessRouteTreeResult\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.setRoutes(processRouteTreeResult);\n\t\t\t}\n\t\t\tif (!this.stores) {\n\t\t\t\tif (this.latestLocation) {\n\t\t\t\t\tconst config = this.getStoreConfig(this);\n\t\t\t\t\tthis.batch = config.batch;\n\t\t\t\t\tthis.stores = createRouterStores(this.latestLocation, config);\n\t\t\t\t\tif (!(isServer ?? this.isServer)) setupScrollRestoration(this);\n\t\t\t\t}\n\t\t\t} else if (rewriteChanged) this.stores.location.set(this.latestLocation);\n\t\t};\n\t\tthis.updateLatestLocation = () => {\n\t\t\tthis.latestLocation = this.parseLocation(this.history.location, this.latestLocation);\n\t\t};\n\t\tthis.buildRouteTree = () => {\n\t\t\tconst result = processRouteTree(this.routeTree, this.options.caseSensitive);\n\t\t\tif (this.options.routeMasks) processRouteMasks(this.options.routeMasks, result.processedTree);\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\tresolvePathCache: createSieveCache(1e3)\n\t\t\t};\n\t\t};\n\t\tthis.subscribe = (eventType, fn) => {\n\t\t\tconst listener = {\n\t\t\t\teventType,\n\t\t\t\tfn\n\t\t\t};\n\t\t\tthis.subscribers.add(listener);\n\t\t\treturn () => {\n\t\t\t\tthis.subscribers.delete(listener);\n\t\t\t};\n\t\t};\n\t\tthis.emit = (routerEvent) => {\n\t\t\tfor (const listener of this.subscribers) if (listener.eventType === routerEvent.type) try {\n\t\t\t\tlistener.fn(routerEvent);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t};\n\t\tthis.parseLocation = (locationToParse, previousLocation) => {\n\t\t\tconst parse = ({ pathname, search, hash, href }, state) => {\n\t\t\t\tif (!this.rewrite && !/[ \\x00-\\x1f\\x7f\\u0080-\\uffff]/.test(pathname)) {\n\t\t\t\t\tconst parsedSearch = this.options.parseSearch(search);\n\t\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\t\treturn {\n\t\t\t\t\t\thref: pathname + searchStr + hash,\n\t\t\t\t\t\tpublicHref: pathname + searchStr + hash,\n\t\t\t\t\t\tpathname: decodePath(pathname),\n\t\t\t\t\t\texternal: false,\n\t\t\t\t\t\tsearchStr,\n\t\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\t\thash: decodePath(hash.slice(1)),\n\t\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst url = executeRewriteInput(this.rewrite, new URL(href, this.origin));\n\t\t\t\tconst parsedSearch = this.options.parseSearch(url.search);\n\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\turl.search = searchStr;\n\t\t\t\treturn {\n\t\t\t\t\thref: url.href.replace(url.origin, \"\"),\n\t\t\t\t\tpublicHref: href,\n\t\t\t\t\tpathname: decodePath(normalizeProtocolRelative(url.pathname)),\n\t\t\t\t\texternal: !!this.rewrite && isExternalUrl(url, this.origin),\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\thash: decodePath(url.hash.slice(1)),\n\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst location = parse(locationToParse, locationToParse.state);\n\t\t\tconst { __tempLocation, __tempKey } = location.state;\n\t\t\tif (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {\n\t\t\t\tconst parsedTempLocation = parse(__tempLocation, {\n\t\t\t\t\t...__tempLocation.state,\n\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\tkey: location.state.key,\n\t\t\t\t\t__TSR_key: location.state.__TSR_key\n\t\t\t\t});\n\t\t\t\tparsedTempLocation.maskedLocation = location;\n\t\t\t\treturn parsedTempLocation;\n\t\t\t}\n\t\t\treturn location;\n\t\t};\n\t\tthis.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => {\n\t\t\tif (typeof pathnameOrNext === \"string\") return this.matchRoutesInternal({\n\t\t\t\tpathname: pathnameOrNext,\n\t\t\t\tsearch: locationSearchOrOpts\n\t\t\t}, opts);\n\t\t\treturn this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts);\n\t\t};\n\t\tthis.getMatchedRoutes = (pathname) => {\n\t\t\tconst rawParams = Object.create(null);\n\t\t\tconst match = findRouteMatch(trimPathRight(pathname), this.processedTree, true);\n\t\t\tif (match) Object.assign(rawParams, match.rawParams);\n\t\t\treturn [\n\t\t\t\tmatch?.branch || [this.routesById[\"__root__\"]],\n\t\t\t\trawParams,\n\t\t\t\tmatch?.route\n\t\t\t];\n\t\t};\n\t\tthis.buildLocation = (opts) => {\n\t\t\tif (!(isServer ?? this.isServer)) {\n\t\t\t\tconst cached = this.staticLocations.get(opts);\n\t\t\t\tif (cached) return cached;\n\t\t\t}\n\t\t\tlet usedCurrent = false;\n\t\t\tconst build = (dest = {}) => {\n\t\t\t\tif (dest.href) {\n\t\t\t\t\tconst parsed = parseHref(dest.href, {});\n\t\t\t\t\tdest = {\n\t\t\t\t\t\t...dest,\n\t\t\t\t\t\tto: executeRewriteInput(this.rewrite, new URL(parsed.pathname, this.origin)).pathname,\n\t\t\t\t\t\tsearch: this.options.parseSearch(parsed.search),\n\t\t\t\t\t\thash: parsed.hash.slice(1)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst currentLocation = dest._fromLocation || this._pendingLocation || this.latestLocation;\n\t\t\t\tlet lightweight;\n\t\t\t\tconst current = () => {\n\t\t\t\t\tusedCurrent = true;\n\t\t\t\t\treturn currentLocation;\n\t\t\t\t};\n\t\t\t\tconst currentMatch = () => {\n\t\t\t\t\tusedCurrent = true;\n\t\t\t\t\treturn lightweight ??= this.matchRoutesLightweight(currentLocation);\n\t\t\t\t};\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && dest.from && dest._isNavigate) {\n\t\t\t\t\tconst [allFromMatches] = this.getMatchedRoutes(dest.from);\n\t\t\t\t\tconst [matchedRoutes, fullPath] = currentMatch();\n\t\t\t\t\tconst matchedFrom = findLast(matchedRoutes, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, dest.from);\n\t\t\t\t\t});\n\t\t\t\t\tconst matchedCurrent = findLast(allFromMatches, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, fullPath);\n\t\t\t\t\t});\n\t\t\t\t\tif (!matchedFrom && !matchedCurrent) console.warn(`Could not find match for from: ${dest.from}`);\n\t\t\t\t}\n\t\t\t\tconst to = dest.to ? `${dest.to}` : \".\";\n\t\t\t\tconst nextTo = resolvePath(to[0] === \"/\" ? \"\" : dest.unsafeRelative === \"path\" ? current().pathname : dest.from ?? currentMatch()[1], to, this.options.trailingSlash, this.resolvePathCache);\n\t\t\t\tconst destRoute = this.routesByPath[trimPathRight(nextTo)];\n\t\t\t\tconst isTemplate = nextTo.includes(\"$\");\n\t\t\t\tlet destRoutes;\n\t\t\t\tif (destRoute) destRoutes = destRoute._branch ??= buildRouteBranch(destRoute);\n\t\t\t\telse if (isTemplate) destRoutes = [];\n\t\t\t\telse {\n\t\t\t\t\tconst [matchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(nextTo);\n\t\t\t\t\tdestRoutes = matchedRoutes;\n\t\t\t\t\tif (this.options.notFoundRoute && (!foundRoute || foundRoute.path !== \"/\" && rawParams[\"**\"])) destRoutes = [...destRoutes, this.options.notFoundRoute];\n\t\t\t\t}\n\t\t\t\tconst interpolation = isTemplate ? destRoute?._interpolation ?? parseSegments(false, { fullPath: nextTo }, 0) : void 0;\n\t\t\t\tlet nextParams;\n\t\t\t\tfor (const route of destRoutes) {\n\t\t\t\t\tconst fn = route.options.params?.stringify ?? route.options.stringifyParams;\n\t\t\t\t\tif (fn) {\n\t\t\t\t\t\tconst fromParams = currentMatch()[3];\n\t\t\t\t\t\tnextParams ??= resolveNextParams(dest.params, fromParams);\n\t\t\t\t\t\tif (!hasKeys(nextParams)) break;\n\t\t\t\t\t\tif (nextParams === fromParams) nextParams = Object.assign(createNull(), nextParams);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tObject.assign(nextParams, fn(nextParams));\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextParams ??= resolveNextParams(dest.params, needsInheritedParams(dest.params, interpolation) ? currentMatch()[3] : EMPTY_RECORD);\n\t\t\t\tconst nextPathname = opts.leaveParams ? nextTo : normalizeProtocolRelative(decodePath(interpolation ? interpolatePath(nextTo, interpolation, nextParams, this.pathParamsDecoder) : nextTo));\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && destRoute && !opts.leaveParams) try {\n\t\t\t\t\tconst foundRoute = this.getMatchedRoutes(nextPathname)[2];\n\t\t\t\t\tif (foundRoute?.id !== destRoute.id) console.warn(`Generated path \"${nextPathname}\" for route \"${destRoute.id}\" matched route \"${foundRoute?.id}\" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`);\n\t\t\t\t} catch {}\n\t\t\t\tconst middlewares = getSearchMiddlewares(destRoutes, opts._includeValidateSearch);\n\t\t\t\tconst fromSearch = () => {\n\t\t\t\t\tlet search = currentMatch()[2];\n\t\t\t\t\tif (opts._includeValidateSearch && this.options.search?.strict) {\n\t\t\t\t\t\tconst validatedSearch = {};\n\t\t\t\t\t\tdestRoutes.forEach((route) => {\n\t\t\t\t\t\t\tif (route.options.validateSearch) try {\n\t\t\t\t\t\t\t\tObject.assign(validatedSearch, validateSearch(route.options.validateSearch, {\n\t\t\t\t\t\t\t\t\t...validatedSearch,\n\t\t\t\t\t\t\t\t\t...search\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsearch = validatedSearch;\n\t\t\t\t\t}\n\t\t\t\t\treturn search;\n\t\t\t\t};\n\t\t\t\tconst nextSearch = middlewares.length ? applySearchMiddleware(middlewares, fromSearch(), dest) : dest.search === true ? fromSearch() : typeof dest.search === \"function\" ? dest.search(fromSearch()) : dest.search || EMPTY_RECORD;\n\t\t\t\tconst searchStr = this.options.stringifySearch(nextSearch);\n\t\t\t\tconst hash = dest.hash === true ? current().hash : typeof dest.hash === \"function\" ? dest.hash(current().hash) : dest.hash || void 0;\n\t\t\t\tconst hashStr = hash ? `#${hash}` : \"\";\n\t\t\t\tconst nextState = !dest.state ? EMPTY_RECORD : dest.state === true ? current().state : typeof dest.state === \"function\" ? dest.state(current().state) : dest.state;\n\t\t\t\tconst fullPath = `${nextPathname}${searchStr}${hashStr}`;\n\t\t\t\tlet href;\n\t\t\t\tlet publicHref;\n\t\t\t\tlet external = false;\n\t\t\t\tif (this.rewrite) {\n\t\t\t\t\tconst url = new URL(fullPath, this.origin);\n\t\t\t\t\tconst origin = url.origin;\n\t\t\t\t\tconst rewrittenUrl = executeRewriteOutput(this.rewrite, url);\n\t\t\t\t\thref = getUrlPath(url);\n\t\t\t\t\tif (isExternalUrl(rewrittenUrl, origin)) {\n\t\t\t\t\t\tpublicHref = rewrittenUrl.href;\n\t\t\t\t\t\texternal = true;\n\t\t\t\t\t} else publicHref = normalizeProtocolRelative(getUrlPath(rewrittenUrl));\n\t\t\t\t} else {\n\t\t\t\t\thref = encodePathLikeUrl(fullPath);\n\t\t\t\t\tpublicHref = href;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tpublicHref,\n\t\t\t\t\thref,\n\t\t\t\t\tpathname: nextPathname,\n\t\t\t\t\tsearch: nextSearch,\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tstate: nextState,\n\t\t\t\t\thash: hash ?? \"\",\n\t\t\t\t\texternal,\n\t\t\t\t\tunmaskOnReload: dest.unmaskOnReload\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst next = build(opts);\n\t\t\tif (opts.mask) next.maskedLocation = build({\n\t\t\t\tfrom: opts.from,\n\t\t\t\t...opts.mask\n\t\t\t});\n\t\t\telse if (this.options.routeMasks) {\n\t\t\t\tconst match = findFlatMatch(next.pathname, this.processedTree);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst params = Object.assign(createNull(), match.rawParams);\n\t\t\t\t\tconst { from: _from, params: maskParams, ...maskProps } = match.route;\n\t\t\t\t\tconst nextParams = resolveNextParams(maskParams, params);\n\t\t\t\t\tnext.maskedLocation = build({\n\t\t\t\t\t\tfrom: opts.from,\n\t\t\t\t\t\t...maskProps,\n\t\t\t\t\t\tparams: nextParams\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!(isServer ?? this.isServer) && !usedCurrent && opts._fromLocation && !next.maskedLocation) this.staticLocations.set(opts, next);\n\t\t\treturn next;\n\t\t};\n\t\tthis.commitLocation = async ({ viewTransition, ignoreBlocker, ...next }) => {\n\t\t\tif (isServer ?? this.isServer) return;\n\t\t\tconst nextLocation = next.maskedLocation ?? next;\n\t\t\tif (nextLocation.external && !(isServer ?? this.isServer)) return documentNavigation(this, nextLocation.publicHref, {\n\t\t\t\treplace: next.replace,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tlet historyAction;\n\t\t\tconst isSameLocation = trimPathRight(this.latestLocation.href) === trimPathRight(next.href) && deepEqual(_getUserHistoryState(next.state), _getUserHistoryState(this.latestLocation.state));\n\t\t\tconst previousCommitPromise = this._commitPromise;\n\t\t\tlet resolve;\n\t\t\tconst commitPromise = new Promise((done) => {\n\t\t\t\tresolve = done;\n\t\t\t});\n\t\t\tcommitPromise.resolve = () => {\n\t\t\t\tresolve();\n\t\t\t\tpreviousCommitPromise?.resolve();\n\t\t\t};\n\t\t\tthis._commitPromise = commitPromise;\n\t\t\tif (isSameLocation) this.load();\n\t\t\telse {\n\t\t\t\tlet { maskedLocation, hashScrollIntoView, ...nextHistory } = next;\n\t\t\t\tif (maskedLocation) {\n\t\t\t\t\tnextHistory = {\n\t\t\t\t\t\t...maskedLocation,\n\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t...maskedLocation.state,\n\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t__tempLocation: {\n\t\t\t\t\t\t\t\t...nextHistory,\n\t\t\t\t\t\t\t\tsearch: nextHistory.searchStr,\n\t\t\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\t\t\t\t\t__TSR_key: void 0,\n\t\t\t\t\t\t\t\t\tkey: void 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) nextHistory.state.__tempKey = this.tempLocationKey;\n\t\t\t\t}\n\t\t\t\tnextHistory.state = {\n\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t__hashScrollIntoViewOptions: hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true\n\t\t\t\t};\n\t\t\t\tthis.shouldViewTransition = viewTransition;\n\t\t\t\thistoryAction = next.replace ? \"REPLACE\" : \"PUSH\";\n\t\t\t\tthis.history[historyAction === \"REPLACE\" ? \"replace\" : \"push\"](nextHistory.publicHref, nextHistory.state, { ignoreBlocker });\n\t\t\t\tif (!this.history.subscribers.size) this.load({ action: { type: historyAction } });\n\t\t\t}\n\t\t\tthis._scroll.n = next.resetScroll ?? true;\n\t\t\treturn this._commitPromise;\n\t\t};\n\t\tthis.buildAndCommitLocation = ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, ...rest } = {}) => {\n\t\t\tif (isServer ?? this.isServer) return Promise.resolve();\n\t\t\tconst location = this.buildLocation({\n\t\t\t\t...rest,\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tthis._pendingLocation = location;\n\t\t\tconst commitPromise = this.commitLocation({\n\t\t\t\t...location,\n\t\t\t\tviewTransition,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (this._pendingLocation === location) this._pendingLocation = void 0;\n\t\t\t});\n\t\t\treturn commitPromise;\n\t\t};\n\t\tthis.navigate = async ({ to, reloadDocument, href, publicHref, ...rest }) => {\n\t\t\tif (isServer ?? this.isServer) return;\n\t\t\tconst hrefScheme = href ? getUrlScheme(href) : void 0;\n\t\t\tif (hrefScheme || reloadDocument) {\n\t\t\t\tif (to !== void 0 || !href) {\n\t\t\t\t\tconst location = this.buildLocation({\n\t\t\t\t\t\tto,\n\t\t\t\t\t\t...rest\n\t\t\t\t\t});\n\t\t\t\t\tconst publicLocation = location.maskedLocation ?? location;\n\t\t\t\t\thref ??= publicLocation.publicHref;\n\t\t\t\t\tpublicHref ??= publicLocation.publicHref;\n\t\t\t\t}\n\t\t\t\tconst reloadHref = !hrefScheme && publicHref ? publicHref : href;\n\t\t\t\treturn documentNavigation(this, reloadHref, rest);\n\t\t\t}\n\t\t\treturn this.buildAndCommitLocation({\n\t\t\t\t...rest,\n\t\t\t\thref,\n\t\t\t\tto,\n\t\t\t\t_isNavigate: true\n\t\t\t});\n\t\t};\n\t\tthis.load = async (opts) => {\n\t\t\tif (isServer ?? this.isServer) return loadServerRoute(this, opts);\n\t\t\tthis.updateLatestLocation();\n\t\t\tif (opts?.action) this._scroll.h = opts.action.type === \"PUSH\" || opts.action.type === \"REPLACE\";\n\t\t\tawait loadClientRoute(this, opts);\n\t\t};\n\t\tthis.startViewTransition = (fn) => {\n\t\t\tconst shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;\n\t\t\tthis.shouldViewTransition = void 0;\n\t\t\tif (shouldViewTransition && !(isServer ?? typeof document === \"undefined\") && typeof document.startViewTransition === \"function\") {\n\t\t\t\tlet startViewTransitionParams;\n\t\t\t\tif (typeof shouldViewTransition === \"object\" && window.CSS?.supports?.(\"selector(:active-view-transition-type(a))\")) {\n\t\t\t\t\tconst next = this.latestLocation;\n\t\t\t\t\tconst prevLocation = this.stores.resolvedLocation.get();\n\t\t\t\t\tconst resolvedViewTransitionTypes = typeof shouldViewTransition.types === \"function\" ? shouldViewTransition.types(getLocationChangeInfo(next, prevLocation)) : shouldViewTransition.types;\n\t\t\t\t\tif (resolvedViewTransitionTypes === false) return fn();\n\t\t\t\t\tstartViewTransitionParams = {\n\t\t\t\t\t\tupdate: fn,\n\t\t\t\t\t\ttypes: resolvedViewTransitionTypes\n\t\t\t\t\t};\n\t\t\t\t} else startViewTransitionParams = fn;\n\t\t\t\treturn document.startViewTransition(startViewTransitionParams).updateCallbackDone;\n\t\t\t}\n\t\t\treturn fn();\n\t\t};\n\t\tthis.invalidate = (opts) => {\n\t\t\tconst committedMatches = this._committed;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst invalidIds = /* @__PURE__ */ new Set();\n\t\t\tconst consider = (match) => {\n\t\t\t\tif (!filter || filter(match)) invalidIds.add(match.id);\n\t\t\t};\n\t\t\tcommittedMatches.forEach(consider);\n\t\t\tthis._cache.forEach(consider);\n\t\t\tpreloads?.forEach((matches) => matches.forEach(consider));\n\t\t\tthis._tx?.[3].forEach(consider);\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (matches.some((match) => invalidIds.has(match.id))) {\n\t\t\t\tpreloads.delete(controller);\n\t\t\t\tabort.push(controller);\n\t\t\t}\n\t\t\tconst invalidate = (d) => {\n\t\t\t\tif (invalidIds.has(d.id)) {\n\t\t\t\t\tconst route = this.routesById[d.routeId];\n\t\t\t\t\tconst next = {\n\t\t\t\t\t\t...d,\n\t\t\t\t\t\tinvalid: true,\n\t\t\t\t\t\t...(opts?.forcePending || d.status === \"error\" || d.status === \"notFound\") && routeNeedsLoad(route) ? {\n\t\t\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\t\t\terror: void 0\n\t\t\t\t\t\t} : void 0\n\t\t\t\t\t};\n\t\t\t\t\td._flight = void 0;\n\t\t\t\t\treturn next;\n\t\t\t\t}\n\t\t\t\treturn d;\n\t\t\t};\n\t\t\tthis._committed = committedMatches.map(invalidate);\n\t\t\tfor (const [id, match] of this._cache) if (invalidIds.has(id)) {\n\t\t\t\tmatch.invalid = true;\n\t\t\t\tif (opts?.forcePending) match.status = \"pending\";\n\t\t\t}\n\t\t\tfor (const id of invalidIds) {\n\t\t\t\tconst flight = this._flights?.get(id);\n\t\t\t\tthis._flights?.delete(id);\n\t\t\t\tif (flight && !flight[2]) abort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t\tthis.shouldViewTransition = false;\n\t\t\treturn this.load({ sync: opts?.sync });\n\t\t};\n\t\tthis.resolveRedirect = (redirect) => {\n\t\t\tconst options = redirect.options;\n\t\t\tlet href = redirect.headers.get(\"Location\") || options.href;\n\t\t\tif (!href) {\n\t\t\t\tconst location = this.buildLocation(options);\n\t\t\t\thref = (location.maskedLocation ?? location).publicHref || \"/\";\n\t\t\t}\n\t\t\tlet scheme;\n\t\t\tif (protocolRelativePrefixRegex.test(href) || (scheme = getUrlScheme(href)) && !this.protocolAllowlist.has(scheme)) throw new Error(process.env.NODE_ENV !== \"production\" ? `Redirect blocked: unsafe protocol in href \"${href}\". Allowed protocols: ${Array.from(this.protocolAllowlist).join(\", \")}.` : \"Redirect blocked: unsafe protocol\");\n\t\t\tif (scheme === \"http:\" || scheme === \"https:\") {\n\t\t\t\tconst url = new URL(href);\n\t\t\t\tif (url.pathname.startsWith(\"//\")) href = url.href;\n\t\t\t\telse if (!isExternalUrl(url, this.origin)) {\n\t\t\t\t\thref = getUrlPath(url);\n\t\t\t\t\tscheme = void 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (scheme) options.reloadDocument = true;\n\t\t\toptions.href = href;\n\t\t\tredirect.headers.set(\"Location\", href);\n\t\t\treturn redirect;\n\t\t};\n\t\tthis.clearCache = (opts) => {\n\t\t\tconst cached = this._cache;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst discarded = [];\n\t\t\tconst discardedIds = [];\n\t\t\tfor (const [id, match] of cached) if (!filter || filter(match)) {\n\t\t\t\tdiscardedIds.push(id);\n\t\t\t\tdiscarded.push(match);\n\t\t\t}\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (!filter || matches.some(filter)) {\n\t\t\t\tabort.push(controller);\n\t\t\t\tdiscarded.push(...matches);\n\t\t\t}\n\t\t\tfor (const id of discardedIds) cached.delete(id);\n\t\t\tfor (const controller of abort) preloads.delete(controller);\n\t\t\tfor (const match of discarded) {\n\t\t\t\tconst flight = match._flight;\n\t\t\t\tmatch._flight = void 0;\n\t\t\t\tif (flight && !--flight[2]) {\n\t\t\t\t\tif (this._flights?.get(match.id) === flight) this._flights.delete(match.id);\n\t\t\t\t\tabort.push(flight[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t};\n\t\tthis.loadRouteChunk = loadRouteChunk;\n\t\tthis.preloadRoute = (opts) => preloadClientRoute(this, opts);\n\t\tthis.matchRoute = (location, opts) => {\n\t\t\tconst matchLocation = {\n\t\t\t\t...location,\n\t\t\t\tto: location.to ? resolvePath(location.from || \"\", location.to, this.options.trailingSlash, this.resolvePathCache) : void 0,\n\t\t\t\tparams: location.params || {},\n\t\t\t\tleaveParams: true\n\t\t\t};\n\t\t\tconst next = this.buildLocation(matchLocation);\n\t\t\tconst isPending = this.stores.status.get() === \"pending\";\n\t\t\tif (opts?.pending && !isPending) return false;\n\t\t\tconst baseLocation = opts?.pending ?? !isPending ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get();\n\t\t\tconst match = findSingleMatch(next.pathname, opts?.caseSensitive ?? false, opts?.fuzzy ?? false, baseLocation.pathname, this.processedTree);\n\t\t\tif (!match) return false;\n\t\t\tif (location.params) {\n\t\t\t\tif (!deepEqual(match.rawParams, location.params, true)) return false;\n\t\t\t}\n\t\t\tif (opts?.includeSearch ?? true) return deepEqual(baseLocation.search, next.search, true) ? match.rawParams : false;\n\t\t\treturn match.rawParams;\n\t\t};\n\t\tthis.getStoreConfig = getStoreConfig;\n\t\tif (options.pathParamsAllowedCharacters?.length) this.pathParamsDecoder = compileDecodeCharMap(options.pathParamsAllowedCharacters);\n\t\tthis.update({\n\t\t\tdefaultPreloadDelay: 50,\n\t\t\tdefaultPendingMs: 1e3,\n\t\t\tdefaultPendingMinMs: 500,\n\t\t\tcontext: void 0,\n\t\t\t...options,\n\t\t\tcaseSensitive: options.caseSensitive ?? false,\n\t\t\tnotFoundMode: options.notFoundMode ?? \"fuzzy\",\n\t\t\tstringifySearch: options.stringifySearch ?? defaultStringifySearch,\n\t\t\tparseSearch: options.parseSearch ?? defaultParseSearch,\n\t\t\tprotocolAllowlist: options.protocolAllowlist ?? DEFAULT_PROTOCOL_ALLOWLIST\n\t\t});\n\t\tif (!(isServer ?? typeof document === \"undefined\")) self.__TSR_ROUTER__ = this;\n\t}\n\tisShell() {\n\t\treturn !!this.options.isShell;\n\t}\n\tget state() {\n\t\treturn this.stores.__store.get();\n\t}\n\tsetRoutes(caches) {\n\t\tObject.assign(this, caches);\n\t\tthis.lightweightCache = /* @__PURE__ */ new WeakMap();\n\t\tif (!(isServer ?? this.isServer)) this.staticLocations = /* @__PURE__ */ new WeakMap();\n\t\tconst notFoundRoute = this.options.notFoundRoute;\n\t\tif (notFoundRoute) {\n\t\t\tnotFoundRoute.init(99999999999);\n\t\t\tif (this.routesById[notFoundRoute.id] !== notFoundRoute) notFoundRoute._interpolation = parseSegments(false, notFoundRoute, 0);\n\t\t\tthis.routesById[notFoundRoute.id] = notFoundRoute;\n\t\t}\n\t}\n\tmatchRoutesInternal(next, opts) {\n\t\tconst [initialMatchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(next.pathname);\n\t\tlet matchedRoutes = initialMatchedRoutes;\n\t\tlet isGlobalNotFound = false;\n\t\tif (foundRoute ? foundRoute.path !== \"/\" && rawParams[\"**\"] : trimPathRight(next.pathname)) if (this.options.notFoundRoute) matchedRoutes = [...matchedRoutes, this.options.notFoundRoute];\n\t\telse isGlobalNotFound = true;\n\t\tconst _notFoundRouteId = isGlobalNotFound ? findGlobalNotFoundRouteId(this.options.notFoundMode, matchedRoutes) : void 0;\n\t\tconst matches = new Array(matchedRoutes.length);\n\t\tconst committed = this._committed;\n\t\tconst previousAt = (route, index) => {\n\t\t\tconst match = committed[index];\n\t\t\treturn match?.routeId === route.id ? match : route === this.options.notFoundRoute ? committed.find((candidate) => candidate.routeId === route.id) : void 0;\n\t\t};\n\t\tlet strictParams;\n\t\tfor (let index = 0; index < matchedRoutes.length; index++) {\n\t\t\tconst route = matchedRoutes[index];\n\t\t\tconst parentMatch = matches[index - 1];\n\t\t\tlet preMatchSearch;\n\t\t\tlet strictMatchSearch;\n\t\t\tlet searchError;\n\t\t\t{\n\t\t\t\tconst parentSearch = parentMatch?.search ?? next.search;\n\t\t\t\tconst parentStrictSearch = parentMatch?._strictSearch ?? void 0;\n\t\t\t\ttry {\n\t\t\t\t\tconst strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0;\n\t\t\t\t\tpreMatchSearch = {\n\t\t\t\t\t\t...parentSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t\tstrictMatchSearch = {\n\t\t\t\t\t\t...parentStrictSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlet searchParamError = err;\n\t\t\t\t\tif (!(err instanceof SearchParamError)) searchParamError = new SearchParamError(err.message, { cause: err });\n\t\t\t\t\tif (opts?.throwOnError) throw searchParamError;\n\t\t\t\t\tpreMatchSearch = parentSearch;\n\t\t\t\t\tstrictMatchSearch = {};\n\t\t\t\t\tsearchError = searchParamError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet loaderDeps = \"\";\n\t\t\tlet loaderDepsHash = \"\";\n\t\t\ttry {\n\t\t\t\tloaderDeps = route.options.loaderDeps?.({ search: preMatchSearch }) ?? \"\";\n\t\t\t\tloaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) || \"\" : \"\";\n\t\t\t} catch (cause) {\n\t\t\t\tif (opts?.throwOnError) throw cause;\n\t\t\t\tsearchError ??= cause;\n\t\t\t}\n\t\t\tconst usedParams = createNull();\n\t\t\tconst interpolatedPath = route._interpolation ? interpolatePath(route.fullPath, route._interpolation, rawParams, this.pathParamsDecoder, usedParams) : route.fullPath;\n\t\t\tconst matchId = route.id + interpolatedPath + loaderDepsHash;\n\t\t\tconst previousMatch = previousAt(route, index);\n\t\t\tconst existingMatch = process.env.NODE_ENV !== \"production\" && opts?._rematerialize ? void 0 : this._cache.get(matchId) ?? (previousMatch?.id === matchId ? previousMatch : void 0);\n\t\t\tstrictParams = existingMatch?._strictParams ?? Object.assign(usedParams, strictParams);\n\t\t\tlet paramsError;\n\t\t\tif (!existingMatch) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch (err) {\n\t\t\t\tif (isNotFound(err) || isRedirect(err)) paramsError = err;\n\t\t\t\telse paramsError = new PathParamError(err.message, { cause: err });\n\t\t\t\tif (opts?.throwOnError) throw paramsError;\n\t\t\t}\n\t\t\tconst cause = previousMatch ? \"stay\" : \"enter\";\n\t\t\tlet match;\n\t\t\tif (existingMatch) match = {\n\t\t\t\t...existingMatch,\n\t\t\t\tcause,\n\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : nullReplaceEqualDeep(existingMatch.search, preMatchSearch),\n\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\tsearchError\n\t\t\t};\n\t\t\telse {\n\t\t\t\tconst status = routeNeedsLoad(route) ? \"pending\" : \"success\";\n\t\t\t\tmatch = {\n\t\t\t\t\tid: matchId,\n\t\t\t\t\tssr: isServer ?? this.isServer ? void 0 : route.options.ssr,\n\t\t\t\t\tindex,\n\t\t\t\t\trouteId: route.id,\n\t\t\t\t\tparams: previousMatch?.params ?? strictParams,\n\t\t\t\t\t_strictParams: strictParams,\n\t\t\t\t\tpathname: interpolatedPath,\n\t\t\t\t\tupdatedAt: Date.now(),\n\t\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch,\n\t\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\t\tsearchError,\n\t\t\t\t\tstatus,\n\t\t\t\t\tisFetching: false,\n\t\t\t\t\terror: void 0,\n\t\t\t\t\tparamsError,\n\t\t\t\t\tcontext: {},\n\t\t\t\t\tabortController: opts?._controller ?? new AbortController(),\n\t\t\t\t\tcause,\n\t\t\t\t\tloaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps,\n\t\t\t\t\tinvalid: false,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tstaticData: route.options.staticData || {},\n\t\t\t\t\tfullPath: route.fullPath\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst _notFound = _notFoundRouteId === route.id;\n\t\t\tif (match._notFound && !_notFound) match.error = void 0;\n\t\t\tmatch._notFound = _notFound;\n\t\t\tmatches[index] = match;\n\t\t}\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tmatch.params = match.cause === \"stay\" ? nullReplaceEqualDeep(match.params, strictParams) : strictParams;\n\t\t\tif (opts?._controller) match.context = {};\n\t\t}\n\t\treturn matches;\n\t}\n\t/**\n\t* Lightweight route matching for buildLocation.\n\t* Only computes fullPath, accumulated search, and params - skipping expensive\n\t* operations like AbortController, loaderDeps, and full match objects.\n\t*/\n\tmatchRoutesLightweight(location) {\n\t\tconst lastRouteId = last(this.stores.ids.get());\n\t\tconst lastStateMatch = lastRouteId ? this.stores.byRoute.get(lastRouteId).get() : void 0;\n\t\tconst lastStateMatchId = lastStateMatch?.id;\n\t\tconst cached = this.lightweightCache.get(location);\n\t\tif (cached && cached[0] === lastStateMatchId) return cached[1];\n\t\tconst [matchedRoutes, rawParams] = this.getMatchedRoutes(location.pathname);\n\t\tconst lastRoute = last(matchedRoutes);\n\t\tconst accumulatedSearch = { ...location.search };\n\t\tfor (const route of matchedRoutes) try {\n\t\t\tObject.assign(accumulatedSearch, validateSearch(route.options.validateSearch, accumulatedSearch));\n\t\t} catch {}\n\t\tconst canReuseParams = lastStateMatch && lastStateMatch.routeId === lastRoute.id && lastStateMatch.pathname === location.pathname;\n\t\tlet params;\n\t\tif (canReuseParams) params = lastStateMatch.params;\n\t\telse {\n\t\t\tconst strictParams = rawParams;\n\t\t\tfor (const route of matchedRoutes) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch {}\n\t\t\tparams = strictParams;\n\t\t}\n\t\tconst result = [\n\t\t\tmatchedRoutes,\n\t\t\tlastRoute.fullPath,\n\t\t\taccumulatedSearch,\n\t\t\tparams\n\t\t];\n\t\tthis.lightweightCache.set(location, [lastStateMatchId, result]);\n\t\treturn result;\n\t}\n};\nasync function documentNavigation(router, href, { replace, ignoreBlocker }) {\n\tif (isDangerousProtocol(href, router.protocolAllowlist)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked navigation to dangerous protocol: ${href}`);\n\t\treturn;\n\t}\n\tif (!ignoreBlocker) {\n\t\tconst blockers = router.history._getBlockers();\n\t\tfor (const blocker of blockers) if (blocker?.blockerFn) {\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: router.history.location,\n\t\t\t\tnextLocation: router.history.location,\n\t\t\t\taction: replace ? \"REPLACE\" : \"PUSH\"\n\t\t\t})) return;\n\t\t}\n\t}\n\trouter.history._ignoreNextBeforeUnload?.(href);\n\tif (replace) window.location.replace(href);\n\telse window.location.href = href;\n}\n/**\n* In non-production environments,\n* augment the RouterCore class with a `_refreshRoute` method\n* dedicated to HMR.\n*/\nif (process.env.NODE_ENV !== \"production\") {\n\tRouterCore.prototype._replaceRouteChunk = replaceRouteChunk;\n\tRouterCore.prototype._refreshRoute = async function() {\n\t\tthis._serverResult = void 0;\n\t\tthis.updateLatestLocation();\n\t\tawait refreshClientRoute(this);\n\t};\n}\n/** Error thrown when search parameter validation fails. */\nvar SearchParamError = class extends Error {};\n/** Error thrown when path parameter parsing/validation fails. */\nvar PathParamError = class extends Error {};\nconst normalize = (str) => str.endsWith(\"/\") && str.length > 1 ? str.slice(0, -1) : str;\nfunction comparePaths(a, b) {\n\treturn normalize(a) === normalize(b);\n}\n/**\n* Lazily import a module function and forward arguments to it, retaining\n* parameter and return types for the selected export key.\n*/\nfunction lazyFn(fn, key) {\n\treturn async (...args) => {\n\t\treturn (await fn())[key || \"default\"](...args);\n\t};\n}\n/** Create an initial RouterState from a parsed location. */\nfunction getInitialRouterState(location) {\n\treturn {\n\t\tisLoading: false,\n\t\tstatus: \"idle\",\n\t\tresolvedLocation: void 0,\n\t\tlocation,\n\t\tmatches: []\n\t};\n}\nfunction validateSearch(validateSearch, input) {\n\tif (validateSearch == null) return {};\n\tif (\"~standard\" in validateSearch) {\n\t\tconst result = validateSearch[\"~standard\"].validate(input);\n\t\tif (result instanceof Promise) throw new SearchParamError(\"Async validation not supported\");\n\t\tif (result.issues) throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { cause: result });\n\t\treturn result.value;\n\t}\n\tif (\"parse\" in validateSearch) return validateSearch.parse(input);\n\tif (typeof validateSearch === \"function\") return validateSearch(input);\n\treturn {};\n}\nfunction resolveNextParams(spec, base) {\n\tif (spec === void 0 || spec === true) return base;\n\tconst next = Object.create(null);\n\tif (spec === false || spec === null) return next;\n\tif (typeof spec === \"function\") {\n\t\tObject.assign(next, base);\n\t\treturn Object.assign(next, spec(next));\n\t}\n\treturn Object.assign(next, base, spec);\n}\nfunction needsInheritedParams(spec, interpolation) {\n\tif (typeof spec === \"function\") return true;\n\tif (!interpolation || spec === false || spec === null) return false;\n\treturn spec === void 0 || spec === true || interpolation.some((part) => typeof part !== \"string\" && !hasOwn.call(spec, part[1]));\n}\nconst EMPTY_RECORD = Object.freeze({});\nfunction getSearchMiddlewares(destRoutes, includeValidateSearch) {\n\tconst middlewares = [];\n\tfor (let i = 0; i < destRoutes.length; i++) {\n\t\tconst routeOptions = destRoutes[i].options;\n\t\tif (\"search\" in routeOptions) {\n\t\t\tif (routeOptions.search?.middlewares) middlewares.push(...routeOptions.search.middlewares);\n\t\t} else if (routeOptions.preSearchFilters || routeOptions.postSearchFilters) {\n\t\t\tconst legacyMiddleware = ({ search, next }) => {\n\t\t\t\tconst result = next(routeOptions.preSearchFilters ? routeOptions.preSearchFilters.reduce((prev, next) => next(prev), search) : search);\n\t\t\t\treturn routeOptions.postSearchFilters ? routeOptions.postSearchFilters.reduce((prev, next) => next(prev), result) : result;\n\t\t\t};\n\t\t\tmiddlewares.push(legacyMiddleware);\n\t\t}\n\t\tconst routeValidateSearch = routeOptions.validateSearch;\n\t\tif (includeValidateSearch && routeValidateSearch) {\n\t\t\tconst validate = ({ search, next, meta }) => {\n\t\t\t\tconst result = next(search);\n\t\t\t\ttry {\n\t\t\t\t\tconst validated = validateSearch(routeValidateSearch, result);\n\t\t\t\t\tif (meta && validated) {\n\t\t\t\t\t\tfor (const key in validated) if (!(key in result)) (meta.defaulted ||= /* @__PURE__ */ new Map()).set(key, validated[key]);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\t...validated\n\t\t\t\t\t};\n\t\t\t\t} catch {}\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\tmiddlewares.push(validate);\n\t\t}\n\t}\n\treturn middlewares;\n}\nfunction applySearchMiddleware(middlewares, search, dest) {\n\tconst applyNext = (index, currentSearch, meta) => {\n\t\tif (index >= middlewares.length) {\n\t\t\tif (!dest.search) return {};\n\t\t\tif (dest.search === true) return currentSearch;\n\t\t\tconst result = functionalUpdate(dest.search, currentSearch);\n\t\t\tif (meta) meta.explicit = result;\n\t\t\treturn result;\n\t\t}\n\t\tconst next = (newSearch, collectMeta) => {\n\t\t\tif (collectMeta) {\n\t\t\t\tconst nextMeta = meta || {};\n\t\t\t\treturn {\n\t\t\t\t\tsearch: applyNext(index + 1, newSearch, nextMeta),\n\t\t\t\t\tmeta: nextMeta\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn applyNext(index + 1, newSearch, meta);\n\t\t};\n\t\treturn middlewares[index]({\n\t\t\tsearch: currentSearch,\n\t\t\tnext,\n\t\t\tmeta\n\t\t});\n\t};\n\treturn applyNext(0, search);\n}\nfunction findGlobalNotFoundRouteId(notFoundMode, routes) {\n\tif (notFoundMode !== \"root\") {\n\t\tlet fallback;\n\t\tfor (let i = routes.length - 1; i >= 0; i--) {\n\t\t\tconst route = routes[i];\n\t\t\tif (route.options.notFoundComponent) return route.id;\n\t\t\tfallback ||= route.children && route.id;\n\t\t}\n\t\tif (fallback) return fallback;\n\t}\n\treturn rootRouteId;\n}\nfunction extractStrictParams(route, accumulatedParams) {\n\tconst parseParams = route.options.params?.parse ?? route.options.parseParams;\n\tif (parseParams) Object.assign(accumulatedParams, parseParams(accumulatedParams));\n}\n//#endregion\nexport { PathParamError, RouterCore, SearchParamError, defaultSerializeError, getInitialRouterState, getLocationChangeInfo, lazyFn, lifecycleEnd, runRouteLifecycle, trailingSlashOptions };\n\n//# sourceMappingURL=router.js.map","import { isNotFound } from \"./not-found.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { hydrateSsrMatchId } from \"./ssr/ssr-match-id.js\";\nimport { getLocationChangeInfo, lifecycleEnd, runRouteLifecycle } from \"./router.js\";\n//#region src/load-client.ts\nfunction replaceRouteChunk(route, lazyFn) {\n\troute.lazyFn = lazyFn ?? route.lazyFn;\n\troute._lazy = void 0;\n}\nfunction preloadComponent(route, type) {\n\treturn route.options[type]?.preload?.();\n}\nfunction loadComponents(route, onPendingReady) {\n\tconst component = preloadComponent(route, \"component\");\n\tlet pending = preloadComponent(route, \"pendingComponent\");\n\tif (onPendingReady) if (pending) pending = pending.then(onPendingReady);\n\telse onPendingReady();\n\tif (component && pending) return Promise.all([component, pending]).then(() => {});\n\treturn component ?? pending;\n}\nfunction loadRouteChunk(route, componentType, onPendingReady) {\n\tconst afterLazy = () => componentType === false ? void 0 : componentType ? preloadComponent(route, componentType) : loadComponents(route, onPendingReady);\n\tconst current = route._lazy;\n\tif (current) return current === true ? afterLazy() : current.then(afterLazy);\n\tif (!route.lazyFn) return afterLazy();\n\tconst promise = route.lazyFn().then((lazyRoute) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) {\n\t\t\tconst { id: _id, ...options } = lazyRoute.options;\n\t\t\tObject.assign(route.options, options);\n\t\t\troute._lazy = true;\n\t\t}\n\t}, (error) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) route._lazy = void 0;\n\t\tthrow error;\n\t});\n\troute._lazy = promise;\n\treturn promise.then(afterLazy);\n}\n/** Return the structural lane through the first terminal render boundary. */\nfunction _getRenderedMatches(matches) {\n\tconst end = matches.findIndex((match) => match.status !== \"success\" || match._notFound) + 1;\n\treturn end && end < matches.length ? matches.slice(0, end) : matches;\n}\n/** Return the lane whose document assets belong to the current presentation. */\nfunction _getAssetMatches(matches) {\n\tlet end = matches.length;\n\tfor (let index = 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tif (match._assetEnd !== void 0) {\n\t\t\tend = Math.min(end, Math.max(index + 1, match._assetEnd));\n\t\t\tcontinue;\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) {\n\t\t\tend = index + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn end < matches.length ? matches.slice(0, end) : matches;\n}\nconst SUCCESS = 0;\nconst ERROR = 1;\nconst NOT_FOUND = 2;\nconst REDIRECTED = 3;\nconst CANCELED_OUTCOME = [4];\nfunction isControl(result) {\n\treturn typeof result[0] === \"number\";\n}\nfunction waitFor(value, signal) {\n\tif (signal.aborted) return Promise.race([Promise.reject(signal), value]);\n\treturn new Promise((resolve, reject) => {\n\t\tconst abort = () => reject(signal);\n\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\tPromise.resolve(value).then(resolve, reject).then(() => signal.removeEventListener(\"abort\", abort));\n\t});\n}\nfunction getRoute(router, match) {\n\treturn router.routesById[match.routeId];\n}\nfunction normalize(value, rejected, routeId) {\n\tif (isRedirect(value)) return [REDIRECTED, value];\n\tif (isNotFound(value)) {\n\t\tvalue.routeId ||= routeId;\n\t\treturn [NOT_FOUND, value];\n\t}\n\tif (!rejected) return [SUCCESS, value];\n\tif (typeof value?.then === \"function\") value = new Error(\"A Promise was thrown\", { cause: value });\n\treturn [ERROR, value];\n}\nfunction normalizeError(route, cause) {\n\tlet outcome = normalize(cause, true, route.id);\n\tif (outcome[0] !== ERROR) return outcome;\n\ttry {\n\t\troute.options.onError?.(outcome[1]);\n\t} catch (onErrorCause) {\n\t\toutcome = normalize(onErrorCause, true, route.id);\n\t}\n\treturn outcome;\n}\nfunction normalizeLaneError(router, lane, route, cause, options) {\n\tif (options[0].signal.aborted) return CANCELED_OUTCOME;\n\treturn materializeRedirect(router, lane, route, normalizeError(route, cause), options);\n}\nasync function contextualize(router, lane, options, end, planSuccessfulLane, retainedEnd) {\n\tconst [location, matches] = lane;\n\tconst signal = options[0].signal;\n\tconst preload = !!options[3];\n\tfor (let index = options[6] ?? 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst route = getRoute(router, match);\n\t\tmatch.abortController = options[0];\n\t\tconst parentContext = matches[index - 1]?.context ?? router.options.context ?? {};\n\t\tconst common = {\n\t\t\tparams: match.params,\n\t\t\tlocation,\n\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t...opts,\n\t\t\t\t_fromLocation: location\n\t\t\t}),\n\t\t\tbuildLocation: router.buildLocation,\n\t\t\tcause: preload ? \"preload\" : match.cause,\n\t\t\tabortController: options[0],\n\t\t\tpreload,\n\t\t\tmatches,\n\t\t\trouteId: route.id\n\t\t};\n\t\ttry {\n\t\t\tconst routeContext = match._ctx ||= route.options.context ? route.options.context({\n\t\t\t\t...common,\n\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\tcontext: parentContext\n\t\t\t}) || {} : void 0;\n\t\t\tmatch.context = {\n\t\t\t\t...parentContext,\n\t\t\t\t...routeContext\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\tconst validationError = match.paramsError ?? match.searchError;\n\t\tif (validationError !== void 0) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, validationError, options)];\n\t\t}\n\t\tconst beforeLoad = route.options.beforeLoad;\n\t\tif (!beforeLoad) continue;\n\t\tconst previousStatus = match.status;\n\t\tif (index >= retainedEnd) {\n\t\t\tmatch.status = \"pending\";\n\t\t\toptions[7]?.();\n\t\t}\n\t\ttry {\n\t\t\tsetFetching(router, match, \"beforeLoad\", options[0]);\n\t\t\tconst value = beforeLoad({\n\t\t\t\t...common,\n\t\t\t\tsearch: match.search,\n\t\t\t\tcontext: match.context,\n\t\t\t\t...router.options.additionalContext\n\t\t\t});\n\t\t\tconst result = await (typeof value?.then === \"function\" ? waitFor(value, signal) : value);\n\t\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\t\tconst outcome = materializeRedirect(router, lane, route, normalize(result, false, route.id), options);\n\t\t\tif (outcome[0] !== SUCCESS) {\n\t\t\t\treleaseFlight(router, match);\n\t\t\t\treturn [index, outcome];\n\t\t\t}\n\t\t\tmatch.context = {\n\t\t\t\t...match.context,\n\t\t\t\t...result\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t} finally {\n\t\t\tmatch.status = previousStatus;\n\t\t\tsetFetching(router, match, false, options[0]);\n\t\t}\n\t}\n\tplanSuccessfulLane();\n}\nfunction releaseOwnedFlight(router, match, flight) {\n\tif (!flight || --flight[2]) return;\n\tif (router._flights?.get(match.id) === flight) {\n\t\tconst current = router._tx;\n\t\tif (current && !current[0].signal.aborted && !current[3].includes(match) && current[3].some((candidate) => candidate.id === match.id) && current[3].some((candidate) => candidate.isFetching === \"beforeLoad\")) return;\n\t\trouter._flights.delete(match.id);\n\t}\n\treturn flight[1];\n}\nfunction releaseFlight(router, match) {\n\tconst flight = match._flight;\n\tmatch._flight = void 0;\n\treleaseOwnedFlight(router, match, flight)?.abort();\n}\n/**\n* Not passing in a `next` ownership recipient\n* is equivalent to discarding the match resources\n*/\nfunction transferMatchResources(router, previous, next, deferSameIdFlight) {\n\tconst abort = [];\n\tfor (const match of previous) if (!next?.includes(match)) {\n\t\tconst flight = match._flight;\n\t\tmatch._flight = void 0;\n\t\tif (deferSameIdFlight && flight?.[2] === 1 && router._flights?.get(match.id) === flight && next?.some((candidate) => candidate.id === match.id)) flight[2] = 0;\n\t\telse {\n\t\t\tconst controller = releaseOwnedFlight(router, match, flight);\n\t\t\tif (controller) abort.push(controller);\n\t\t}\n\t}\n\tfor (const controller of abort) controller.abort();\n}\nfunction acquireMatchResources(matches) {\n\tfor (const match of matches) {\n\t\tconst flight = match._flight;\n\t\tif (flight) flight[2]++;\n\t}\n}\nfunction setFetching(router, match, value, owner) {\n\tmatch.isFetching = value;\n\tif (owner && router._tx?.[0] !== owner) return;\n\tconst store = router.stores.byRoute.get(match.routeId);\n\tconst presented = store?.get();\n\tif (presented?.id === match.id) store.set({\n\t\t...presented,\n\t\tisFetching: value\n\t});\n}\nfunction getLoaderContext(router, lane, match, route, controller, parentMatchPromise, preload) {\n\tconst location = lane[0];\n\treturn {\n\t\tparams: match.params,\n\t\tlocation,\n\t\tnavigate: (opts) => router.navigate({\n\t\t\t...opts,\n\t\t\t_fromLocation: location\n\t\t}),\n\t\tcause: preload ? \"preload\" : match.cause,\n\t\tabortController: controller,\n\t\tpreload,\n\t\tdeps: match.loaderDeps,\n\t\tparentMatchPromise,\n\t\tcontext: match.context,\n\t\troute,\n\t\t...router.options.additionalContext\n\t};\n}\nasync function loadResource(router, lane, match, route, loader, parentMatchPromise, options) {\n\tconst owner = options[0];\n\tconst signal = owner.signal;\n\tif (signal.aborted) return CANCELED_OUTCOME;\n\tif (!loader) return [SUCCESS, void 0];\n\tlet flight = match._flight;\n\tsetFetching(router, match, \"loader\", owner);\n\ttry {\n\t\tif (!flight) {\n\t\t\tconst controller = new AbortController();\n\t\t\tflight = [\n\t\t\t\tPromise.resolve().then(() => loader(getLoaderContext(router, lane, match, route, controller, parentMatchPromise, !!options[3]))).then((value) => normalize(value, false, route.id), (cause) => normalize(cause, true, route.id)).then((result) => {\n\t\t\t\t\tif (result[0] !== SUCCESS && router._flights?.get(match.id) === flight) {\n\t\t\t\t\t\trouter._flights.delete(match.id);\n\t\t\t\t\t\tif (!flight[2]) controller.abort();\n\t\t\t\t\t}\n\t\t\t\t\treturn result[0] === ERROR && flight[2] ? normalizeError(route, result[1]) : result;\n\t\t\t\t}),\n\t\t\t\tcontroller,\n\t\t\t\t1\n\t\t\t];\n\t\t\t(router._flights ??= /* @__PURE__ */ new Map()).set(match.id, flight);\n\t\t}\n\t\tmatch._flight = flight;\n\t\tmatch.abortController = flight[1];\n\t\treturn materializeRedirect(router, lane, route, await waitFor(flight[0], signal), options);\n\t} catch (cause) {\n\t\tif (cause !== signal || !signal.aborted) throw cause;\n\t\treleaseFlight(router, match);\n\t\treturn CANCELED_OUTCOME;\n\t} finally {\n\t\tsetFetching(router, match, false, owner);\n\t}\n}\nfunction settleInto(match, result, preload) {\n\tif (result[0] === REDIRECTED) return;\n\tmatch.status = \"success\";\n\tmatch.error = void 0;\n\tif (result[0] === SUCCESS) {\n\t\tmatch.loaderData = result[1];\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t\tmatch.preload = preload;\n\t} else match.invalid = true;\n}\nfunction cacheLoaderMatch(router, match, planned) {\n\tconst current = router._cache.get(match.id);\n\tif (current !== planned || router._committed.some((candidate) => candidate.id === match.id && candidate._flight === match._flight)) return;\n\tconst cached = {\n\t\t...match,\n\t\t_notFound: void 0,\n\t\tcontext: {}\n\t};\n\tif (cached._flight) cached._flight[2]++;\n\trouter._cache.set(match.id, cached);\n\tif (current) releaseFlight(router, current);\n}\nfunction getParentSnapshot(match, outcome) {\n\tif (outcome[0] === ERROR || outcome[0] === NOT_FOUND) return {\n\t\t...match,\n\t\tstatus: outcome[0] === ERROR ? \"error\" : \"notFound\",\n\t\terror: outcome[1],\n\t\t_flight: void 0\n\t};\n\treturn match;\n}\nfunction createLoaderTask(router, lane, index, tasks, semanticParent, options, retainedEnd) {\n\tconst match = lane[1][index];\n\tconst route = getRoute(router, match);\n\tconst preload = !!options[3];\n\tconst plannedCacheMatch = router._cache.get(match.id);\n\tlet configured;\n\tlet reload = false;\n\tlet reloadFailure;\n\ttry {\n\t\tif (match.status === \"success\") {\n\t\t\tconfigured = route.options.shouldReload;\n\t\t\tif (typeof configured === \"function\") configured = configured(getLoaderContext(router, lane, match, route, options[0], semanticParent, preload));\n\t\t\tif (options[0].signal.aborted) reloadFailure = CANCELED_OUTCOME;\n\t\t}\n\t\tif (!reloadFailure) if (match.status !== \"success\") reload = true;\n\t\telse {\n\t\t\tconst staleAge = preload || match.preload ? route.options.preloadStaleTime ?? router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? router.options.defaultStaleTime ?? 0;\n\t\t\treload = !!(match.invalid || configured || configured === void 0 && Date.now() - match.updatedAt >= staleAge && (options[5] || match.cause === \"enter\" || options[2].some((candidate) => candidate.routeId === match.routeId && candidate.id !== match.id)));\n\t\t}\n\t} catch (cause) {\n\t\tmatch.invalid = true;\n\t\treleaseFlight(router, match);\n\t\treloadFailure = normalizeLaneError(router, lane, route, cause, options);\n\t}\n\tconst routeLoader = route.options.loader;\n\tconst isLoaderFn = typeof routeLoader === \"function\";\n\tconst loader = isLoaderFn ? routeLoader : routeLoader?.handler;\n\tconst preloadable = !preload || route.options.preload !== false;\n\tlet donor = preloadable && routeLoader && !(process.env.NODE_ENV !== \"production\" && router._tx?.[6]) ? router._flights?.get(match.id) : void 0;\n\tif (donor === match._flight || reloadFailure) donor = void 0;\n\telse if (donor && !reload && !preload && configured === void 0) reload = true;\n\telse if (!reload) donor = void 0;\n\tconst background = !!(routeLoader && reload && match.status === \"success\" && !preload && !options[4] && ((isLoaderFn ? void 0 : routeLoader.staleReloadMode) ?? router.options.defaultStaleReloadMode) !== \"blocking\");\n\tconst loaded = reload && preloadable;\n\tconst blocking = loaded && !background && (match.status !== \"success\" || !!routeLoader);\n\tconst onReady = index >= retainedEnd ? options[7] : void 0;\n\tconst onLazyReady = route.lazyFn && route._lazy !== true ? onReady : void 0;\n\tif (loaded && !routeLoader) {\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t}\n\tif (donor) donor[2]++;\n\tif (blocking) {\n\t\tconst acceptedFlight = match._flight;\n\t\tmatch._flight = donor;\n\t\treleaseOwnedFlight(router, match, acceptedFlight)?.abort();\n\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\tonReady?.();\n\t}\n\tif (!loaded) match.isFetching = false;\n\tconst outcome = !reloadFailure && blocking ? loadResource(router, lane, match, route, loader, semanticParent, options).then((result) => {\n\t\tsettleInto(match, result, preload);\n\t\tif (result[0] === SUCCESS) {\n\t\t\tif (routeLoader && !options[0].signal.aborted) cacheLoaderMatch(router, match, plannedCacheMatch);\n\t\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\t}\n\t\treturn result;\n\t}) : Promise.resolve(reloadFailure ?? [SUCCESS, match.loaderData]);\n\tconst chunkFailure = (async () => {\n\t\ttry {\n\t\t\tconst chunk = loadRouteChunk(route, void 0, onLazyReady);\n\t\t\tif (chunk) await waitFor(chunk, options[0].signal);\n\t\t} catch (cause) {\n\t\t\tif (!lane[1].some((candidate, candidateIndex) => candidateIndex <= index && (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound))) return [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tconst result = await outcome;\n\t\tif (blocking && result[0] === SUCCESS && match.status === \"pending\" && !options[0].signal.aborted) {\n\t\t\tmatch.status = \"success\";\n\t\t\tonReady?.();\n\t\t}\n\t})();\n\ttasks.push([\n\t\tindex,\n\t\toutcome,\n\t\tchunkFailure\n\t]);\n\tif (!background) return outcome.then((result) => getParentSnapshot(match, result));\n\tconst candidate = {\n\t\t...match,\n\t\tstatus: \"pending\",\n\t\tpreload: false,\n\t\t_flight: donor\n\t};\n\tmatch.invalid = false;\n\tmatch.isFetching = \"loader\";\n\tconst backgroundOutcome = loadResource(router, lane, candidate, route, loader, semanticParent, options).then((result) => {\n\t\tmatch.isFetching = false;\n\t\tsettleInto(candidate, result, false);\n\t\treturn result;\n\t});\n\t(lane[2] ??= []).push([\n\t\tindex,\n\t\tbackgroundOutcome,\n\t\tchunkFailure,\n\t\tcandidate\n\t]);\n\treturn backgroundOutcome.then((result) => getParentSnapshot(candidate, result));\n}\nasync function getNotFoundBoundary(router, matches, indexed, signal, fallback = 0) {\n\tconst cause = indexed?.[1][1];\n\tlet index = cause?.routeId ? matches.findIndex((match) => match.routeId === cause.routeId) : indexed?.[0] ?? matches.length - 1;\n\tif (index < 0) index = 0;\n\tfor (let i = index; i >= 0; i--) {\n\t\tconst route = getRoute(router, matches[i]);\n\t\ttry {\n\t\t\tconst loading = loadRouteChunk(route, false);\n\t\t\tif (loading) await waitFor(loading, signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) throw cause;\n\t\t}\n\t\tif (route.options.notFoundComponent) return i;\n\t}\n\treturn cause?.routeId ? index : fallback;\n}\nfunction discardBackground(router, lane) {\n\tif (lane[2]) {\n\t\ttransferMatchResources(router, lane[2].map((task) => task[3]));\n\t\tlane[2] = void 0;\n\t}\n}\nasync function settleTasks(tasks, serialFailure, redirectTasks, gate) {\n\tlet loaderFailure;\n\ttry {\n\t\tawait Promise.all(tasks.map((task) => task[1].then(async (outcome) => {\n\t\t\tconst taskIndex = task[0];\n\t\t\tif (gate && taskIndex >= await gate) return;\n\t\t\tif (outcome[0] >= REDIRECTED) throw [taskIndex, outcome];\n\t\t\tif (!loaderFailure && outcome[0] !== SUCCESS) {\n\t\t\t\tloaderFailure = [taskIndex, outcome];\n\t\t\t\tawait Promise.all((redirectTasks ?? []).map((nextTask) => {\n\t\t\t\t\tif (nextTask[0] <= taskIndex) return;\n\t\t\t\t\treturn nextTask[1].then((nextOutcome) => {\n\t\t\t\t\t\tif (nextOutcome[0] === REDIRECTED) throw [nextTask[0], nextOutcome];\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t}\n\t\t})));\n\t} catch (cause) {\n\t\treturn cause;\n\t}\n\treturn serialFailure ?? loaderFailure;\n}\nfunction materializeRedirect(router, lane, route, outcome, options, failed) {\n\twhile (outcome[0] === REDIRECTED) {\n\t\tconst redirect = outcome[1];\n\t\tconst redirectOptions = redirect.options;\n\t\ttry {\n\t\t\tif (redirectOptions.href || redirect.headers.has(\"Location\")) {\n\t\t\t\trouter.resolveRedirect(redirect);\n\t\t\t\tif (redirectOptions.reloadDocument) return outcome;\n\t\t\t}\n\t\t\tif (redirectOptions.reloadDocument ? options[3] : options[1] >= 20) return outcome;\n\t\t\tconst location = router.buildLocation({\n\t\t\t\t...redirectOptions,\n\t\t\t\t_fromLocation: lane[0],\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tconst publicLocation = location.maskedLocation ?? location;\n\t\t\tif (publicLocation.external) {\n\t\t\t\tconst resolved = redirect.clone();\n\t\t\t\tresolved.options = { ...redirectOptions };\n\t\t\t\tresolved.headers.set(\"Location\", publicLocation.publicHref);\n\t\t\t\trouter.resolveRedirect(resolved);\n\t\t\t\treturn options[3] ? [REDIRECTED, resolved] : [\n\t\t\t\t\tREDIRECTED,\n\t\t\t\t\tresolved,\n\t\t\t\t\tpublicLocation\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tREDIRECTED,\n\t\t\t\tredirect,\n\t\t\t\tlocation\n\t\t\t];\n\t\t} catch (cause) {\n\t\t\toutcome = failed ? [ERROR, cause] : normalizeError(route, cause);\n\t\t\tfailed = true;\n\t\t}\n\t}\n\treturn outcome;\n}\nasync function reduceLane(router, lane, tasks, controller, settlement, onReady) {\n\tconst matches = lane[1];\n\tlet failure = await settlement;\n\tlet redirectLimitExceeded = false;\n\tconst plannedBoundary = matches.findIndex((match) => match._notFound);\n\tconst boundaryOf = (found) => found[1][0] === NOT_FOUND ? getNotFoundBoundary(router, matches, found, controller.signal) : found[0];\n\tlet readinessEnd = plannedBoundary < 0 ? matches.length : plannedBoundary;\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) readinessEnd = 0;\n\telse if (failure) {\n\t\treadinessEnd = failure[2] ??= await boundaryOf(failure);\n\t\tfor (const task of tasks) {\n\t\t\tif (task[0] >= readinessEnd) break;\n\t\t\tconst outcome = await task[1];\n\t\t\tif (outcome[0] !== SUCCESS && outcome[0] < REDIRECTED && !(\"loaderData\" in matches[task[0]])) {\n\t\t\t\tfailure = [task[0], outcome];\n\t\t\t\treadinessEnd = failure[2] = await boundaryOf(failure);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const task of tasks) {\n\t\tif (task[0] >= readinessEnd) break;\n\t\tconst chunkFailure = await task[2];\n\t\tif (!chunkFailure) continue;\n\t\tfailure = chunkFailure;\n\t\tbreak;\n\t}\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) {\n\t\tconst outcome = failure[1];\n\t\tif (outcome[0] !== REDIRECTED || outcome[1].options.reloadDocument || outcome[2]) {\n\t\t\tdiscardBackground(router, lane);\n\t\t\treturn outcome;\n\t\t}\n\t\tredirectLimitExceeded = true;\n\t\tfailure = [0, [ERROR, /* @__PURE__ */ new Error(\"Too many redirects\")]];\n\t}\n\tconst boundary = failure ? failure[2] ?? await boundaryOf(failure) : plannedBoundary;\n\tif (boundary >= 0) {\n\t\tconst outcome = failure?.[1];\n\t\tconst kind = outcome?.[0];\n\t\tconst match = matches[boundary];\n\t\tconst cause = outcome?.[1];\n\t\tconst install = () => {\n\t\t\tif (outcome) {\n\t\t\t\tmatch._notFound = void 0;\n\t\t\t\tif (kind === ERROR) match.status = \"error\";\n\t\t\t\telse {\n\t\t\t\t\tcause.routeId = match.routeId;\n\t\t\t\t\tif (match.routeId === router.routeTree.id) {\n\t\t\t\t\t\tmatch.status = \"success\";\n\t\t\t\t\t\tmatch._notFound = true;\n\t\t\t\t\t} else match.status = \"notFound\";\n\t\t\t\t}\n\t\t\t\tmatch.error = cause;\n\t\t\t\tmatch.isFetching = false;\n\t\t\t}\n\t\t};\n\t\tinstall();\n\t\tif (!outcome) onReady?.();\n\t\tconst route = getRoute(router, match);\n\t\ttry {\n\t\t\tawait waitFor(outcome ? Promise.resolve().then(() => loadRouteChunk(route, kind === ERROR ? \"errorComponent\" : \"notFoundComponent\")) : Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]), controller.signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === controller.signal && controller.signal.aborted) {\n\t\t\t\tdiscardBackground(router, lane);\n\t\t\t\treturn CANCELED_OUTCOME;\n\t\t\t}\n\t\t}\n\t\tif (!outcome) match.status = \"success\";\n\t\telse if (redirectLimitExceeded) {\n\t\t\tcontroller.abort();\n\t\t\tawait Promise.all([\n\t\t\t\t...tasks.map((task) => task[1]),\n\t\t\t\t...tasks.map((task) => task[2]),\n\t\t\t\t...(lane[2] ?? []).map((task) => task[1])\n\t\t\t]);\n\t\t\tdiscardBackground(router, lane);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tinstall();\n\t\t}\n\t}\n\treturn lane;\n}\nasync function projectLane(router, lane, signal, start = 0, end = lane[1].length) {\n\tconst matches = lane[1];\n\tfor (let index = start; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst routeOptions = getRoute(router, match).options;\n\t\tif (routeOptions.head || routeOptions.scripts) try {\n\t\t\tconst context = {\n\t\t\t\tssr: router.options.ssr,\n\t\t\t\tmatches,\n\t\t\t\tmatch,\n\t\t\t\tparams: match.params,\n\t\t\t\tloaderData: match.loaderData\n\t\t\t};\n\t\t\tconst [head, scripts] = await waitFor(Promise.all([routeOptions.head?.(context), routeOptions.scripts?.(context)]), signal);\n\t\t\tmatch.meta = head?.meta;\n\t\t\tmatch.links = head?.links;\n\t\t\tmatch.headScripts = head?.scripts;\n\t\t\tmatch.styles = head?.styles;\n\t\t\tmatch.scripts = scripts;\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) break;\n\t\t\tconsole.error(cause);\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) break;\n\t}\n\treturn lane;\n}\nasync function executeClientLane(router, location, matches, options) {\n\tconst matched = [location, matches];\n\tconst signal = options[0].signal;\n\tlet reduced;\n\ttry {\n\t\tconst presented = router.stores.matches.get();\n\t\tlet plannedBoundary = matches.findIndex((match) => match._notFound);\n\t\tif (router.options.notFoundMode !== \"root\" && plannedBoundary >= 0) {\n\t\t\tconst boundary = await getNotFoundBoundary(router, matches, void 0, signal, plannedBoundary);\n\t\t\tmatches[plannedBoundary]._notFound = void 0;\n\t\t\tmatches[boundary]._notFound = true;\n\t\t\tplannedBoundary = boundary;\n\t\t}\n\t\tlet end = plannedBoundary < 0 ? matches.length : plannedBoundary + 1;\n\t\tlet retainedEnd = 0;\n\t\twhile (retainedEnd < end && retainedEnd !== plannedBoundary) {\n\t\t\tconst match = matches[retainedEnd];\n\t\t\tconst committed = options[2][retainedEnd];\n\t\t\tconst visible = presented[retainedEnd];\n\t\t\tif (committed?.id !== match.id || committed.status !== \"success\" || match.preload || visible?.id !== match.id || visible.status !== \"success\") break;\n\t\t\tretainedEnd++;\n\t\t\tif (committed._notFound || visible._notFound) break;\n\t\t}\n\t\tconst tasks = [];\n\t\tconst start = options[6] ?? 0;\n\t\tlet semanticParent = start ? Promise.resolve(matches[start - 1]) : void 0;\n\t\tconst planSuccessfulLane = () => {\n\t\t\tfor (let index = start; index < end; index++) {\n\t\t\t\tif (signal.aborted) break;\n\t\t\t\tsemanticParent = createLoaderTask(router, matched, index, tasks, semanticParent, options, retainedEnd);\n\t\t\t}\n\t\t};\n\t\tconst failure = await contextualize(router, matched, options, end, planSuccessfulLane, retainedEnd);\n\t\tif (failure) {\n\t\t\toptions[4] = true;\n\t\t\tend = failure[0];\n\t\t\tif (failure[1][0] === NOT_FOUND) {\n\t\t\t\tconst boundary = await getNotFoundBoundary(router, matches, failure, signal);\n\t\t\t\tfailure[2] = boundary;\n\t\t\t\tend = Math.min(end, boundary + 1);\n\t\t\t} else if (failure[1][0] >= REDIRECTED) end = 0;\n\t\t\tplanSuccessfulLane();\n\t\t}\n\t\tif (!signal.aborted && !options[3]) {\n\t\t\tconst abort = [];\n\t\t\tfor (const [id, flight] of router._flights ?? []) if (!flight[2]) {\n\t\t\t\trouter._flights.delete(id);\n\t\t\t\tabort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t}\n\t\tconst reduction = reduceLane(router, matched, tasks, options[0], settleTasks(tasks, failure, matched[2]), options[7]);\n\t\tif (matched[2]?.length) matched[3] = settleTasks(matched[2], void 0, void 0, reduction.then((foreground) => isControl(foreground) ? 0 : _getRenderedMatches(matches).length, () => 0));\n\t\treduced = await reduction;\n\t} catch (cause) {\n\t\tdiscardBackground(router, matched);\n\t\tif (cause === signal && signal.aborted) return CANCELED_OUTCOME;\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) return reduced;\n\treturn projectLane(router, reduced, signal, options[6] === matches.length ? options[6] : 0);\n}\n/**\n* Waits for `pendingMs`, then presents the complete lane. Rendering applies the\n* selected boundary cutoff while retaining every match's structural state.\n* A replacement load for the same match keeps the timer; choosing a different\n* match resets it. `pendingMinMs` starts after the fallback renders.\n*/\nfunction offerPending(router, tx) {\n\tif (router._tx !== tx) return;\n\tconst matches = tx[3];\n\tconst presented = router.stores.matches.get();\n\tlet session = router._pending;\n\tfor (let index = 0; index < matches.length; index++) {\n\t\tconst match = matches[index];\n\t\tconst success = match.status === \"success\" && !match._notFound;\n\t\tconst presentedPending = presented[index]?.id === match.id && presented[index]?.status === \"pending\";\n\t\tif (success && !presentedPending) continue;\n\t\tconst route = getRoute(router, match);\n\t\tconst delay = success || match.invalid ? 0 : route.options.pendingMs ?? router.options.defaultPendingMs;\n\t\tconst component = route.options.pendingComponent ?? router.options.defaultPendingComponent;\n\t\tif (!component || typeof delay !== \"number\" || delay === Infinity) {\n\t\t\tif (session) {\n\t\t\t\tsession[0] = tx;\n\t\t\t\tsession[2] = 0;\n\t\t\t\tsession[4] = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst min = route.options.pendingMinMs ?? router.options.defaultPendingMinMs ?? 0;\n\t\tlet tookOver = false;\n\t\tif (session?.[1] === match.id) {\n\t\t\ttookOver = session[0] !== tx;\n\t\t\tsession[0] = tx;\n\t\t} else {\n\t\t\tclearTimeout(session?.[3]);\n\t\t\trouter._pending = session = void 0;\n\t\t}\n\t\tif (!session) router._pending = session = [\n\t\t\ttx,\n\t\t\tmatch.id,\n\t\t\tpresentedPending ? Date.now() + min : tx[4] + delay,\n\t\t\tvoid 0,\n\t\t\tpresentedPending || void 0,\n\t\t\tcomponent\n\t\t];\n\t\tif (session[4] && !tookOver && session[5] === component) return;\n\t\tsession[5] = component;\n\t\tif (!session[4]) {\n\t\t\tclearTimeout(session[3]);\n\t\t\tconst remaining = session[2] - Date.now();\n\t\t\tif (remaining > 0) {\n\t\t\t\tsession[3] = setTimeout(() => offerPending(router, tx), remaining);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsession[2] = 0;\n\t\t}\n\t\tconst offered = matches.map((match) => ({\n\t\t\t...match,\n\t\t\t_flight: void 0\n\t\t}));\n\t\toffered[index].status = \"pending\";\n\t\tconst ack = session[4] = router.startTransition(() => router.stores.setMatches(offered), offered).then((rendered) => {\n\t\t\tif (rendered && router._pending === session && session[4] === ack && !session[2]) session[2] = Date.now() + min;\n\t\t\treturn rendered;\n\t\t});\n\t\treturn;\n\t}\n}\n/**\n* Cancels pending UI timing unless the current successor can take over the\n* same boundary that remains painted.\n*/\nfunction finishPending(router, tx) {\n\tconst session = router._pending;\n\tif (router._tx === tx || !router._tx?.[3].some((match) => match.id === session?.[1])) {\n\t\tclearTimeout(session?.[3]);\n\t\trouter._pending = void 0;\n\t}\n}\nasync function awaitPendingMinimum(router, tx) {\n\tconst session = router._pending;\n\tif (!session) return;\n\tclearTimeout(session[3]);\n\tconst remaining = session[2] - Date.now();\n\tif (!session[4] || remaining <= 0 || !_getRenderedMatches(tx[3]).some((match) => match.id === session[1])) return;\n\tlet timer;\n\ttry {\n\t\tawait waitFor(new Promise((resolve) => {\n\t\t\ttimer = setTimeout(resolve, remaining);\n\t\t}), tx[0].signal);\n\t} catch {}\n\tclearTimeout(timer);\n}\nfunction publishMatches(router, matches) {\n\trouter._committed = matches;\n\trouter.stores.setMatches(matches);\n}\nfunction commitMatches(router, tx, matches, resolvedPrefix) {\n\tconst previous = router._committed;\n\tconst previousEnd = router._lifecycleEnd;\n\tconst previousCached = router._cache;\n\tfor (const match of matches) {\n\t\tmatch.preload = false;\n\t\tif (resolvedPrefix) match._assetEnd = void 0;\n\t}\n\tconst cut = _getRenderedMatches(matches).length;\n\tconst cached = /* @__PURE__ */ new Map();\n\tif (process.env.NODE_ENV === \"production\" || !tx[6]) {\n\t\tconst now = Date.now();\n\t\tconst superseded = /* @__PURE__ */ new Set();\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tif (index < cut || match.status === \"success\") superseded.add(match.id);\n\t\t}\n\t\tfor (const match of [...previous, ...previousCached.values()]) {\n\t\t\tif (match.status !== \"success\" || superseded.has(match.id)) continue;\n\t\t\tconst route = getRoute(router, match);\n\t\t\tif (!route.options.loader || now - match.updatedAt >= (match.preload ? route.options.preloadGcTime ?? router.options.defaultPreloadGcTime ?? 3e5 : route.options.gcTime ?? router.options.defaultGcTime ?? 3e5)) continue;\n\t\t\tcached.set(match.id, previousCached.get(match.id) === match ? match : {\n\t\t\t\t...match,\n\t\t\t\t_flight: void 0,\n\t\t\t\tisFetching: false,\n\t\t\t\tcontext: {}\n\t\t\t});\n\t\t}\n\t}\n\ttx[3] = [];\n\trouter._cache = cached;\n\tconst nextEnd = router._lifecycleEnd = lifecycleEnd(matches);\n\tpublishMatches(router, matches);\n\ttransferMatchResources(router, [...previousCached.values(), ...previous].filter((match) => match._flight && cached.get(match.id) !== match), matches);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst handoff = tx[6]?.[0];\n\t\tif (handoff && router._handoff === handoff) handoff[1]();\n\t}\n\trunRouteLifecycle(router, previous, matches, previousEnd, nextEnd, tx);\n}\n/**\n* Resolve once the router has settled on a transaction other than `owner`.\n* Each transaction's completion follows its current successor, so all waiters\n* share the same chain instead of polling every successor independently.\n*/\nasync function awaitCurrent(router, owner) {\n\tlet current = router._tx;\n\twhile (current && current !== owner) {\n\t\towner = current;\n\t\tawait current[5];\n\t\tcurrent = router._tx;\n\t}\n}\nfunction followRedirect(router, tx, outcome) {\n\tconst options = outcome[1].options;\n\tconst location = outcome[2];\n\tif (!location) return router.navigate({\n\t\t...options,\n\t\treplace: true,\n\t\tignoreBlocker: true\n\t});\n\tif (options.reloadDocument) return router.navigate({\n\t\thref: (location.maskedLocation ?? location).publicHref,\n\t\treloadDocument: true,\n\t\treplace: true,\n\t\tignoreBlocker: true\n\t});\n\tlocation._redirects = tx[1] + 1;\n\trouter._pendingLocation = location;\n\tconst committed = router.commitLocation({\n\t\t...location,\n\t\tviewTransition: options.viewTransition,\n\t\treplace: true,\n\t\tresetScroll: options.resetScroll,\n\t\thashScrollIntoView: options.hashScrollIntoView,\n\t\tignoreBlocker: true\n\t});\n\tqueueMicrotask(() => {\n\t\tif (router._pendingLocation === location) router._pendingLocation = void 0;\n\t});\n\treturn committed;\n}\nasync function runBackground(router, tx, base, tasks, settlement) {\n\tconst next = base.map((match) => ({ ...match }));\n\tacquireMatchResources(next);\n\tfor (const task of tasks) {\n\t\treleaseFlight(router, next[task[0]]);\n\t\tnext[task[0]] = task[3];\n\t}\n\tconst lane = [tx[2], next];\n\tlet reduced;\n\ttry {\n\t\treduced = await reduceLane(router, lane, tasks, tx[0], settlement);\n\t} catch (cause) {\n\t\ttransferMatchResources(router, next);\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) {\n\t\ttransferMatchResources(router, next);\n\t\tif (reduced[0] === REDIRECTED && router._tx === tx && router._committed === base) await followRedirect(router, tx, reduced);\n\t\treturn;\n\t}\n\tawait projectLane(router, reduced, tx[0].signal);\n\tif (router._tx !== tx || router._committed !== base) {\n\t\ttransferMatchResources(router, next);\n\t\treturn;\n\t}\n\tfor (const match of next) {\n\t\tconst cached = router._cache.get(match.id);\n\t\tif (cached?._flight && cached._flight === match._flight) {\n\t\t\trouter._cache.delete(match.id);\n\t\t\treleaseFlight(router, cached);\n\t\t}\n\t}\n\tpublishMatches(router, next);\n\ttransferMatchResources(router, base, next);\n}\nasync function runClientTransaction(router, tx, forceStaleReload, onReady, sync, resolvedPrefix) {\n\tconst result = await executeClientLane(router, tx[2], tx[3], [\n\t\ttx[0],\n\t\ttx[1],\n\t\trouter._committed,\n\t\tvoid 0,\n\t\tsync,\n\t\tforceStaleReload,\n\t\tresolvedPrefix,\n\t\tonReady\n\t]);\n\tif (isControl(result)) {\n\t\tconst follow = result[0] === REDIRECTED && router._tx === tx;\n\t\tif (!follow || result[1].options.reloadDocument) finishPending(router, tx);\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tif (!follow) return;\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) router._refreshNextLoad = true;\n\t\tawait followRedirect(router, tx, result);\n\t\treturn;\n\t}\n\tconst matches = result[1];\n\tif (router._tx === tx) await awaitPendingMinimum(router, tx);\n\tif (router._tx !== tx) {\n\t\tfinishPending(router, tx);\n\t\ttransferMatchResources(router, matches);\n\t\tdiscardBackground(router, result);\n\t\treturn;\n\t}\n\tconst toLocation = tx[2];\n\tconst changeInfo = getLocationChangeInfo(toLocation, router.stores.resolvedLocation.get());\n\tconst background = result[2];\n\tawait router.startViewTransition(async () => {\n\t\tif (router._tx === tx) await awaitPendingMinimum(router, tx);\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tconst commit = () => {\n\t\t\tfinishPending(router, tx);\n\t\t\tcommitMatches(router, tx, matches, resolvedPrefix);\n\t\t\tif (router._tx !== tx) return;\n\t\t\trouter.emit({\n\t\t\t\ttype: \"onLoad\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onBeforeRouteMount\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t};\n\t\tconst rendered = await router.startTransition(commit, matches);\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) tx[6] = void 0;\n\t\tif (router._tx !== tx) {\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tif (background?.length) runBackground(router, tx, matches, background, result[3]).catch(console.error);\n\t\trouter.batch(() => {\n\t\t\trouter.stores.resolvedLocation.set(toLocation);\n\t\t\trouter.stores.status.set(\"idle\");\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onResolved\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (rendered && router._tx === tx) router.emit({\n\t\t\t\ttype: \"onRendered\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t});\n\t\tif (router._tx !== tx) return;\n\t\trouter._commitPromise?.resolve();\n\t\trouter._commitPromise = void 0;\n\t});\n}\nasync function loadClientRoute(router, opts) {\n\tlet rematerialize = false;\n\tif (process.env.NODE_ENV !== \"production\") rematerialize = !!router._refreshNextLoad || !!router._tx?.[6];\n\tconst previousOwner = router._tx;\n\tconst resolvedLocation = router.stores.resolvedLocation.get();\n\tconst previousLocation = resolvedLocation ?? router.stores.location.get();\n\tconst location = router.latestLocation;\n\tconst pendingLocation = router._pendingLocation;\n\tconst redirects = pendingLocation?.href === location.href ? pendingLocation._redirects ?? 0 : 0;\n\tconst handoff = router._handoff;\n\tconst hydrationController = rematerialize ? void 0 : handoff?.[0]();\n\tconst preflight = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = preflight;\n\tif (!rematerialize && !hydrationController) handoff?.[1]();\n\tpreviousPreflight?.abort();\n\tif (!preflight.signal.aborted) {\n\t\tconst changeInfo = getLocationChangeInfo(location, resolvedLocation);\n\t\trouter.emit({\n\t\t\ttype: \"onBeforeNavigate\",\n\t\t\t...changeInfo\n\t\t});\n\t\tif (!preflight.signal.aborted) router.emit({\n\t\t\ttype: \"onBeforeLoad\",\n\t\t\t...changeInfo\n\t\t});\n\t}\n\tif (preflight.signal.aborted) {\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\tconst sameHref = previousLocation.href === location.href;\n\tlet controller = preflight;\n\tconst matches = process.env.NODE_ENV !== \"production\" && rematerialize ? router.matchRoutes(location, {\n\t\t_controller: preflight,\n\t\t_rematerialize: true\n\t}) : router.matchRoutes(location, { _controller: preflight });\n\tacquireMatchResources(matches);\n\tconst resolvedPrefix = hydrationController ? handoff[1](matches) : void 0;\n\tif (resolvedPrefix) controller = hydrationController;\n\telse hydrationController?.abort();\n\tif (preflight.signal.aborted) {\n\t\ttransferMatchResources(router, matches);\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\trouter._preflight = void 0;\n\tlet settle;\n\tconst run = () => runClientTransaction(router, tx, sameHref, () => offerPending(router, tx), opts?.sync, resolvedPrefix);\n\tconst done = opts?.sync ? new Promise((resolve) => settle = resolve) : Promise.resolve().then(run);\n\tconst tx = [\n\t\tcontroller,\n\t\tredirects,\n\t\tlocation,\n\t\tmatches,\n\t\tDate.now(),\n\t\tdone.then(() => awaitCurrent(router, tx))\n\t];\n\tif (process.env.NODE_ENV !== \"production\" && rematerialize) {\n\t\ttx[6] = [handoff];\n\t\trouter._refreshNextLoad = void 0;\n\t}\n\trouter._tx = tx;\n\tif (previousOwner) {\n\t\tfor (const match of router.stores.matches.get()) {\n\t\t\tif (router._tx !== tx) break;\n\t\t\tif (match.isFetching) setFetching(router, match, false);\n\t\t}\n\t\tpreviousOwner[0].abort();\n\t\ttransferMatchResources(router, previousOwner[3], tx[3], true);\n\t}\n\tif (router._tx !== tx) {\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tsettle?.();\n\t\tawait awaitCurrent(router, tx);\n\t\treturn;\n\t}\n\trouter.batch(() => {\n\t\trouter.stores.status.set(\"pending\");\n\t\trouter.stores.location.set(location);\n\t});\n\tif (resolvedPrefix || !router._committed.length && matches[0]?.status !== \"success\" && !matches.some((match) => match._notFound)) offerPending(router, tx);\n\tsettle?.(run());\n\tawait tx[5];\n}\nasync function refreshClientRoute(router) {\n\tconst pending = router._tx;\n\tif (pending && !pending[6] && router.stores.status.get() === \"pending\") {\n\t\tawait pending[5];\n\t\tif (router._tx !== pending) await awaitCurrent(router, pending);\n\t}\n\trouter._flights?.clear();\n\trouter.clearCache();\n\trouter._refreshNextLoad = true;\n\tawait loadClientRoute(router, { sync: true });\n}\nasync function preloadClientRoute(router, opts) {\n\tif (process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\tlet location = router.buildLocation(opts);\n\tfor (let redirects = 0;; redirects++) {\n\t\tconst base = router._committed;\n\t\tconst controller = new AbortController();\n\t\tlet matches;\n\t\tlet active;\n\t\tlet result;\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tmatches = router.matchRoutes(location, { _controller: controller });\n\t\t\t\tacquireMatchResources(matches);\n\t\t\t\tactive = (router._preloads ??= /* @__PURE__ */ new Map()).set(controller, matches);\n\t\t\t\tresult = await executeClientLane(router, location, matches, [\n\t\t\t\t\tcontroller,\n\t\t\t\t\tredirects,\n\t\t\t\t\tbase,\n\t\t\t\t\ttrue\n\t\t\t\t]);\n\t\t\t} finally {\n\t\t\t\tif (active) {\n\t\t\t\t\tactive = active.delete(controller);\n\t\t\t\t\ttransferMatchResources(router, matches);\n\t\t\t\t}\n\t\t\t\tcontroller.abort();\n\t\t\t}\n\t\t\tif (!isControl(result)) return result[1];\n\t\t\tif (!active || result.length < 3 || process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\t\t\tlocation = result[2];\n\t\t} catch (cause) {\n\t\t\tif (!isNotFound(cause)) console.error(cause);\n\t\t\treturn;\n\t\t}\n\t}\n}\nasync function hydrate(router) {\n\tif (process.env.NODE_ENV !== \"production\" && !window.$_TSR) throw new Error(\"Invariant failed: Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!\");\n\tconst tsr = window.$_TSR;\n\tconst adapters = router.options.serializationAdapters;\n\tif (adapters?.length) {\n\t\ttsr.t = new Map(adapters.map((adapter) => [adapter.key, adapter.fromSerializable]));\n\t\ttsr.buffer.forEach((script) => script());\n\t}\n\ttsr.initialized = true;\n\tconst dehydratedRouter = tsr.router;\n\tif (process.env.NODE_ENV !== \"production\" && !dehydratedRouter) throw new Error(\"Invariant failed: Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!\");\n\trouter.ssr = { manifest: dehydratedRouter.manifest };\n\trouter.options.ssr = { nonce: document.querySelector(\"meta[property=\\\"csp-nonce\\\"]\")?.content };\n\tconst dehydratedMatches = dehydratedRouter.matches;\n\tconst controller = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = controller;\n\tpreviousPreflight?.abort();\n\tconst isCurrent = () => router._preflight === controller;\n\tlet location;\n\tlet candidates;\n\tlet handoffHistoryHref;\n\tlet handoffHistoryState;\n\ttry {\n\t\tawait waitFor(router.options.hydrate?.(dehydratedRouter.dehydratedData), controller.signal);\n\t\tif (!isCurrent()) return;\n\t\tconst historyLocation = router.history.location;\n\t\thandoffHistoryHref = historyLocation.href;\n\t\thandoffHistoryState = historyLocation.state;\n\t\trouter.updateLatestLocation();\n\t\tlocation = router.latestLocation;\n\t\trouter.stores.location.set(location);\n\t\tcandidates = router.matchRoutes(location, { _controller: controller });\n\t} catch (cause) {\n\t\tif (isCurrent()) router._preflight = void 0;\n\t\tcontroller.abort(cause);\n\t\tif (cause !== controller.signal) throw cause;\n\t}\n\tif (!isCurrent()) return;\n\tconst committed = [];\n\tlet pendingBoundary;\n\tlet verifiedAssetEnd = 0;\n\tconst retryFrom = (index) => {\n\t\tverifiedAssetEnd = Math.min(verifiedAssetEnd, index + 1);\n\t\tconst removed = committed.splice(index);\n\t\tfor (const match of removed) if (getRoute(router, match).options.loader && (match.status === \"success\" || !match.invalid && \"loaderData\" in match)) cacheLoaderMatch(router, {\n\t\t\t...match,\n\t\t\tstatus: \"success\",\n\t\t\terror: void 0,\n\t\t\tpreload: true\n\t\t}, router._cache.get(match.id));\n\t\ttransferMatchResources(router, removed);\n\t};\n\tconst shared = dehydratedMatches.length > candidates.length ? candidates.findIndex((match) => match._notFound) + 1 : dehydratedMatches.length;\n\tlet isTerminal = false;\n\tfor (let index = 0; index < shared; index++) {\n\t\tconst candidate = candidates[index];\n\t\tconst dehydrated = dehydratedMatches[index];\n\t\tif (typeof dehydrated.i !== \"string\" || hydrateSsrMatchId(dehydrated.i) !== candidate.id) {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tverifiedAssetEnd = index + 1;\n\t\tconst route = getRoute(router, candidate);\n\t\tif (\"l\" in dehydrated || dehydrated.s === \"success\" && dehydrated.e === void 0 && route.options.loader) candidate.loaderData = dehydrated.l;\n\t\tcandidate.status = dehydrated.s;\n\t\tcandidate.ssr = dehydrated.ssr;\n\t\troute.options.ssr = candidate.ssr;\n\t\tcandidate.updatedAt = dehydrated.u;\n\t\tcandidate.error = dehydrated.e;\n\t\tcandidate._notFound ||= dehydrated.g;\n\t\tif (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound) {\n\t\t\tisTerminal = true;\n\t\t\tcommitted.push(candidate);\n\t\t\tif (candidate.ssr === false || candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tif (candidate.status === \"pending\") {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tcommitted.push(candidate);\n\t\tif (candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t}\n\tif (!isTerminal && committed.length === shared && shared < candidates.length) pendingBoundary = shared;\n\tconst chunks = committed.map(async (match) => {\n\t\ttry {\n\t\t\tconst route = getRoute(router, match);\n\t\t\tawait (match._notFound ? Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]) : loadRouteChunk(route, match.status === \"error\" ? \"errorComponent\" : match.status === \"notFound\" ? \"notFoundComponent\" : void 0));\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t});\n\tlet chunkFailure = 0;\n\ttry {\n\t\twhile (chunkFailure < chunks.length && await waitFor(chunks[chunkFailure], controller.signal)) chunkFailure++;\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isCurrent()) return;\n\tif (chunkFailure < committed.length) retryFrom(chunkFailure);\n\tconst contextEnd = Math.max(pendingBoundary === committed.length ? committed.length + 1 : committed.length, chunkFailure < chunks.length ? chunkFailure : verifiedAssetEnd);\n\tfor (let index = 0; index < contextEnd; index++) {\n\t\tconst match = candidates[index];\n\t\tconst route = getRoute(router, match);\n\t\tconst parentContext = candidates[index - 1]?.context ?? router.options.context ?? {};\n\t\tlet routeContext;\n\t\tif (route.options.context) {\n\t\t\ttry {\n\t\t\t\trouteContext = match._ctx = route.options.context({\n\t\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\t\tparams: match.params,\n\t\t\t\t\tcontext: parentContext,\n\t\t\t\t\tlocation,\n\t\t\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t\t\t...opts,\n\t\t\t\t\t\t_fromLocation: location\n\t\t\t\t\t}),\n\t\t\t\t\tbuildLocation: router.buildLocation,\n\t\t\t\t\tcause: match.cause,\n\t\t\t\t\tabortController: controller,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tmatches: candidates,\n\t\t\t\t\trouteId: route.id\n\t\t\t\t}) || {};\n\t\t\t} catch {\n\t\t\t\tif (!isCurrent()) return;\n\t\t\t\tif (match.status !== \"error\" && match.status !== \"notFound\" && !match._notFound) {\n\t\t\t\t\tpendingBoundary = Math.min(pendingBoundary ?? index, index);\n\t\t\t\t\tretryFrom(index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isCurrent()) return;\n\t\t}\n\t\tmatch.context = {\n\t\t\t...parentContext,\n\t\t\t...routeContext,\n\t\t\t...committed[index] && dehydratedMatches[index].b\n\t\t};\n\t}\n\tawait projectLane(router, [location, candidates], controller.signal, 0, verifiedAssetEnd);\n\tif (!isCurrent()) return;\n\tconst needsClientLoad = pendingBoundary !== void 0 || committed.length < shared;\n\tconst committedMatches = isTerminal && committed.length === shared ? candidates : committed;\n\tlet presented = needsClientLoad ? candidates : committedMatches;\n\tlet dataOnlyAssetEnd;\n\tif (needsClientLoad && pendingBoundary !== void 0) {\n\t\tconst boundary = presented[pendingBoundary];\n\t\tdataOnlyAssetEnd = boundary.ssr === \"data-only\" && verifiedAssetEnd > pendingBoundary + 1 ? verifiedAssetEnd : void 0;\n\t\tpresented = presented.slice();\n\t\tpresented[pendingBoundary] = {\n\t\t\t...boundary,\n\t\t\tstatus: \"pending\",\n\t\t\tssr: boundary.ssr === \"data-only\" ? \"data-only\" : false,\n\t\t\t_assetEnd: dataOnlyAssetEnd\n\t\t};\n\t}\n\tconst claim = () => {\n\t\tconst historyLocation = router.history.location;\n\t\treturn needsClientLoad && !router._tx && historyLocation.href === handoffHistoryHref && historyLocation.state === handoffHistoryState && router._committed === committedMatches && committedMatches.length && !controller.signal.aborted ? controller : void 0;\n\t};\n\tconst handoff = [claim, (matches) => {\n\t\tif (router._handoff !== handoff) return;\n\t\trouter._handoff = void 0;\n\t\tconst prefix = committedMatches.length;\n\t\tif (!matches || !claim() || committedMatches.some((match, index) => match.id !== matches[index]?.id)) {\n\t\t\tcontroller.abort();\n\t\t\treturn;\n\t\t}\n\t\tlet handoffAssetEnd = dataOnlyAssetEnd;\n\t\tif (handoffAssetEnd !== void 0) {\n\t\t\tfor (let index = prefix; index < handoffAssetEnd; index++) if (candidates[index]?.id !== matches[index]?.id) {\n\t\t\t\thandoffAssetEnd = index > pendingBoundary + 1 ? index : void 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst clones = committedMatches.map((match) => ({ ...match }));\n\t\tif (handoffAssetEnd !== void 0) clones[pendingBoundary]._assetEnd = handoffAssetEnd;\n\t\ttransferMatchResources(router, matches.splice(0, prefix, ...clones));\n\t\tfor (let index = prefix; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tconst hydrated = candidates[index];\n\t\t\tif (hydrated?.id === match.id && hydrated._ctx) match._ctx = hydrated._ctx;\n\t\t\tmatch.abortController = controller;\n\t\t}\n\t\treturn prefix;\n\t}];\n\trouter._committed = committedMatches;\n\trouter._lifecycleEnd = lifecycleEnd(committedMatches);\n\trouter._handoff = handoff;\n\trouter._preflight = void 0;\n\trouter.batch(() => {\n\t\trouter.stores.setMatches(presented);\n\t\trouter.stores.status.set(\"idle\");\n\t\tif (!needsClientLoad) router.stores.resolvedLocation.set(router.stores.location.get());\n\t});\n}\n//#endregion\nexport { _getAssetMatches, _getRenderedMatches, hydrate, loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk };\n\n//# sourceMappingURL=load-client.js.map","//#region src/alien.ts\nconst NONE = 0;\nconst MUTABLE = 1;\nconst WATCHING = 2;\nconst RECURSED_CHECK = 4;\nconst RECURSED = 8;\nconst DIRTY = 16;\nconst PENDING = 32;\n/* @__NO_SIDE_EFFECTS__ */\nfunction createReactiveSystem({ update, notify, unwatched }) {\n\treturn {\n\t\tlink,\n\t\tunlink,\n\t\tpropagate,\n\t\tcheckDirty,\n\t\tshallowPropagate\n\t};\n\tfunction link(dep, sub, version) {\n\t\tconst prevDep = sub.depsTail;\n\t\tif (prevDep !== void 0 && prevDep.dep === dep) return;\n\t\tconst nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;\n\t\tif (nextDep !== void 0 && nextDep.dep === dep) {\n\t\t\tnextDep.version = version;\n\t\t\tsub.depsTail = nextDep;\n\t\t\treturn;\n\t\t}\n\t\tconst prevSub = dep.subsTail;\n\t\tif (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return;\n\t\tconst newLink = sub.depsTail = dep.subsTail = {\n\t\t\tversion,\n\t\t\tdep,\n\t\t\tsub,\n\t\t\tprevDep,\n\t\t\tnextDep,\n\t\t\tprevSub,\n\t\t\tnextSub: void 0\n\t\t};\n\t\tif (nextDep !== void 0) nextDep.prevDep = newLink;\n\t\tif (prevDep !== void 0) prevDep.nextDep = newLink;\n\t\telse sub.deps = newLink;\n\t\tif (prevSub !== void 0) prevSub.nextSub = newLink;\n\t\telse dep.subs = newLink;\n\t}\n\tfunction unlink(link, sub = link.sub) {\n\t\tconst dep = link.dep;\n\t\tconst prevDep = link.prevDep;\n\t\tconst nextDep = link.nextDep;\n\t\tconst nextSub = link.nextSub;\n\t\tconst prevSub = link.prevSub;\n\t\tif (nextDep !== void 0) nextDep.prevDep = prevDep;\n\t\telse sub.depsTail = prevDep;\n\t\tif (prevDep !== void 0) prevDep.nextDep = nextDep;\n\t\telse sub.deps = nextDep;\n\t\tif (nextSub !== void 0) nextSub.prevSub = prevSub;\n\t\telse dep.subsTail = prevSub;\n\t\tif (prevSub !== void 0) prevSub.nextSub = nextSub;\n\t\telse if ((dep.subs = nextSub) === void 0) unwatched(dep);\n\t\treturn nextDep;\n\t}\n\tfunction propagate(link) {\n\t\tlet next = link.nextSub;\n\t\tlet stack;\n\t\ttop: do {\n\t\t\tconst sub = link.sub;\n\t\t\tlet flags = sub.flags;\n\t\t\tif (!(flags & 60)) sub.flags = flags | 32;\n\t\t\telse if (!(flags & (4 | 8))) flags = 0;\n\t\t\telse if (!(flags & 4)) sub.flags = flags & ~8 | 32;\n\t\t\telse if (!(flags & (16 | 32)) && isValidLink(link, sub)) {\n\t\t\t\tsub.flags = flags | (8 | 32);\n\t\t\t\tflags &= 1;\n\t\t\t} else flags = 0;\n\t\t\tif (flags & 2) notify(sub);\n\t\t\tif (flags & 1) {\n\t\t\t\tconst subSubs = sub.subs;\n\t\t\t\tif (subSubs !== void 0) {\n\t\t\t\t\tconst nextSub = (link = subSubs).nextSub;\n\t\t\t\t\tif (nextSub !== void 0) {\n\t\t\t\t\t\tstack = {\n\t\t\t\t\t\t\tvalue: next,\n\t\t\t\t\t\t\tprev: stack\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnext = nextSub;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((link = next) !== void 0) {\n\t\t\t\tnext = link.nextSub;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twhile (stack !== void 0) {\n\t\t\t\tlink = stack.value;\n\t\t\t\tstack = stack.prev;\n\t\t\t\tif (link !== void 0) {\n\t\t\t\t\tnext = link.nextSub;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t} while (true);\n\t}\n\tfunction checkDirty(link, sub) {\n\t\tlet stack;\n\t\tlet checkDepth = 0;\n\t\tlet dirty = false;\n\t\ttop: do {\n\t\t\tconst dep = link.dep;\n\t\t\tconst flags = dep.flags;\n\t\t\tif (sub.flags & 16) dirty = true;\n\t\t\telse if ((flags & (1 | 16)) === (1 | 16)) {\n\t\t\t\tif (update(dep)) {\n\t\t\t\t\tconst subs = dep.subs;\n\t\t\t\t\tif (subs.nextSub !== void 0) shallowPropagate(subs);\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t} else if ((flags & (1 | 32)) === (1 | 32)) {\n\t\t\t\tif (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {\n\t\t\t\t\tvalue: link,\n\t\t\t\t\tprev: stack\n\t\t\t\t};\n\t\t\t\tlink = dep.deps;\n\t\t\t\tsub = dep;\n\t\t\t\t++checkDepth;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!dirty) {\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (checkDepth--) {\n\t\t\t\tconst firstSub = sub.subs;\n\t\t\t\tconst hasMultipleSubs = firstSub.nextSub !== void 0;\n\t\t\t\tif (hasMultipleSubs) {\n\t\t\t\t\tlink = stack.value;\n\t\t\t\t\tstack = stack.prev;\n\t\t\t\t} else link = firstSub;\n\t\t\t\tif (dirty) {\n\t\t\t\t\tif (update(sub)) {\n\t\t\t\t\t\tif (hasMultipleSubs) shallowPropagate(firstSub);\n\t\t\t\t\t\tsub = link.sub;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdirty = false;\n\t\t\t\t} else sub.flags &= ~32;\n\t\t\t\tsub = link.sub;\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dirty;\n\t\t} while (true);\n\t}\n\tfunction shallowPropagate(link) {\n\t\tdo {\n\t\t\tconst sub = link.sub;\n\t\t\tconst flags = sub.flags;\n\t\t\tif ((flags & (32 | 16)) === 32) {\n\t\t\t\tsub.flags = flags | 16;\n\t\t\t\tif ((flags & (2 | 4)) === 2) notify(sub);\n\t\t\t}\n\t\t} while ((link = link.nextSub) !== void 0);\n\t}\n\tfunction isValidLink(checkLink, sub) {\n\t\tlet link = sub.depsTail;\n\t\twhile (link !== void 0) {\n\t\t\tif (link === checkLink) return true;\n\t\t\tlink = link.prevDep;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n//#endregion\nexport { createReactiveSystem };\n//# sourceMappingURL=alien.js.map","import { createReactiveSystem } from \"./alien.js\";\n\n//#region src/atom.ts\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n\tconst isObserver = typeof nextHandler === \"object\";\n\tconst self = isObserver ? nextHandler : void 0;\n\treturn {\n\t\tnext: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n\t\terror: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n\t\tcomplete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)\n\t};\n}\nconst queuedEffects = [];\nlet cycle = 0;\nconst { link, unlink, propagate, checkDirty, shallowPropagate } = /* @__PURE__ */ createReactiveSystem({\n\tupdate(atom) {\n\t\treturn atom._update();\n\t},\n\tnotify(effect) {\n\t\tqueuedEffects[queuedEffectsLength++] = effect;\n\t\teffect.flags &= ~2;\n\t},\n\tunwatched(atom) {\n\t\tif (atom.depsTail !== void 0) {\n\t\t\tatom.depsTail = void 0;\n\t\t\tatom.flags = 1 | 16;\n\t\t\tpurgeDeps(atom);\n\t\t}\n\t}\n});\nlet notifyIndex = 0;\nlet queuedEffectsLength = 0;\nlet activeSub;\nlet batchDepth = 0;\nfunction batch(fn) {\n\ttry {\n\t\t++batchDepth;\n\t\tfn();\n\t} finally {\n\t\tif (!--batchDepth) flush();\n\t}\n}\nfunction purgeDeps(sub) {\n\tconst depsTail = sub.depsTail;\n\tlet dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;\n\twhile (dep !== void 0) dep = unlink(dep, sub);\n}\nfunction flush() {\n\tif (batchDepth > 0) return;\n\twhile (notifyIndex < queuedEffectsLength) {\n\t\tconst effect = queuedEffects[notifyIndex];\n\t\tqueuedEffects[notifyIndex++] = void 0;\n\t\teffect.notify();\n\t}\n\tnotifyIndex = 0;\n\tqueuedEffectsLength = 0;\n}\nfunction createAsyncAtom(getValue, options) {\n\tconst ref = {};\n\tconst atom = createAtom(() => {\n\t\tgetValue().then((data) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"done\",\n\t\t\t\tdata\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { status: \"pending\" };\n\t}, options);\n\tref.current = atom;\n\treturn atom;\n}\nfunction createAtom(valueOrFn, options) {\n\tconst isComputed = typeof valueOrFn === \"function\";\n\tconst getter = valueOrFn;\n\tconst atom = {\n\t\t_snapshot: isComputed ? void 0 : valueOrFn,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tflags: isComputed ? 0 : 1,\n\t\tget() {\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t},\n\t\tsubscribe(observerOrFn) {\n\t\t\tconst obs = toObserver(observerOrFn);\n\t\t\tconst observed = { current: false };\n\t\t\tconst e = effect(() => {\n\t\t\t\tatom.get();\n\t\t\t\tif (!observed.current) observed.current = true;\n\t\t\t\telse {\n\t\t\t\t\tactiveSub = void 0;\n\t\t\t\t\tobs.next?.(atom._snapshot);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn { unsubscribe: () => {\n\t\t\t\te.stop();\n\t\t\t} };\n\t\t},\n\t\t_update(getValue) {\n\t\t\tconst prevSub = activeSub;\n\t\t\tconst compare = options?.compare ?? Object.is;\n\t\t\tif (isComputed) {\n\t\t\t\tactiveSub = atom;\n\t\t\t\t++cycle;\n\t\t\t\tatom.depsTail = void 0;\n\t\t\t} else if (getValue === void 0) return false;\n\t\t\tif (isComputed) atom.flags = 1 | 4;\n\t\t\ttry {\n\t\t\t\tconst oldValue = atom._snapshot;\n\t\t\t\tconst newValue = typeof getValue === \"function\" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;\n\t\t\t\tif (oldValue === void 0 || !compare(oldValue, newValue)) {\n\t\t\t\t\tatom._snapshot = newValue;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} finally {\n\t\t\t\tactiveSub = prevSub;\n\t\t\t\tif (isComputed) atom.flags &= ~4;\n\t\t\t\tpurgeDeps(atom);\n\t\t\t}\n\t\t}\n\t};\n\tif (isComputed) {\n\t\tatom.flags = 1 | 16;\n\t\tatom.get = function() {\n\t\t\tconst flags = atom.flags;\n\t\t\tif (flags & 16 || flags & 32 && checkDirty(atom.deps, atom)) {\n\t\t\t\tif (atom._update()) {\n\t\t\t\t\tconst subs = atom.subs;\n\t\t\t\t\tif (subs !== void 0) shallowPropagate(subs);\n\t\t\t\t}\n\t\t\t} else if (flags & 32) atom.flags = flags & ~32;\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t};\n\t} else atom.set = function(valueOrFn) {\n\t\tif (atom._update(valueOrFn)) {\n\t\t\tconst subs = atom.subs;\n\t\t\tif (subs !== void 0) {\n\t\t\t\tpropagate(subs);\n\t\t\t\tshallowPropagate(subs);\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\t};\n\treturn atom;\n}\nfunction effect(fn) {\n\tconst run = () => {\n\t\tconst prevSub = activeSub;\n\t\tactiveSub = effectObj;\n\t\t++cycle;\n\t\teffectObj.depsTail = void 0;\n\t\teffectObj.flags = 2 | 4;\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tactiveSub = prevSub;\n\t\t\teffectObj.flags &= ~4;\n\t\t\tpurgeDeps(effectObj);\n\t\t}\n\t};\n\tconst effectObj = {\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tflags: 2 | 4,\n\t\tnotify() {\n\t\t\tconst flags = this.flags;\n\t\t\tif (flags & 16 || flags & 32 && checkDirty(this.deps, this)) run();\n\t\t\telse this.flags = 2;\n\t\t},\n\t\tstop() {\n\t\t\tthis.flags = 0;\n\t\t\tthis.depsTail = void 0;\n\t\t\tpurgeDeps(this);\n\t\t}\n\t};\n\trun();\n\treturn effectObj;\n}\n\n//#endregion\nexport { batch, createAsyncAtom, createAtom, flush, toObserver };\n//# sourceMappingURL=atom.js.map","\"use client\";\nimport { useLayoutEffect } from \"./utils.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { getLocationChangeInfo, trimPathRight } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\n//#region src/Transitioner.tsx\nfunction settleOwner(owner, rendered) {\n\tconst settle = owner[1];\n\towner.length = 0;\n\tsettle?.(rendered);\n}\nfunction Transitioner({ t }) {\n\tconst router = useRouter();\n\tconst acknowledgement = router._rendered ??= [];\n\tconst mounted = process.env.NODE_ENV !== \"production\" ? React$1.useRef(false) : void 0;\n\trouter.startTransition = (fn, expected) => new Promise((resolve) => {\n\t\tsettleOwner(acknowledgement, false);\n\t\tacknowledgement.push(expected, resolve);\n\t\tt(router);\n\t\tReact$1.startTransition(fn);\n\t});\n\tuseLayoutEffect(() => {\n\t\tconst unsub = router.history.subscribe(router.load);\n\t\tif (mounted?.current) return unsub;\n\t\tif (mounted) mounted.current = true;\n\t\trouter.updateLatestLocation();\n\t\tconst location = router.latestLocation;\n\t\tconst nextLocation = router.buildLocation({\n\t\t\tto: location.pathname,\n\t\t\tsearch: true,\n\t\t\tparams: true,\n\t\t\thash: true,\n\t\t\tstate: true,\n\t\t\t_includeValidateSearch: true\n\t\t});\n\t\tif (trimPathRight(location.publicHref) !== trimPathRight(nextLocation.publicHref)) {\n\t\t\trouter.commitLocation({\n\t\t\t\t...nextLocation,\n\t\t\t\treplace: true,\n\t\t\t\tignoreBlocker: true\n\t\t\t});\n\t\t\treturn unsub;\n\t\t}\n\t\tconst resolvedLocation = router.stores.resolvedLocation.get();\n\t\tif (resolvedLocation?.href === location.href && resolvedLocation.state.__TSR_key === location.state.__TSR_key) acknowledgement.push(router.stores.matches.get(), (rendered) => {\n\t\t\tif (rendered) router.emit({\n\t\t\t\ttype: \"onRendered\",\n\t\t\t\t...getLocationChangeInfo(resolvedLocation, resolvedLocation)\n\t\t\t});\n\t\t});\n\t\telse if (!router._tx) router.load({ sync: true }).catch(console.error);\n\t\treturn unsub;\n\t}, [router, router.history]);\n\treturn null;\n}\n//#endregion\nexport { Transitioner, settleOwner };\n\n//# sourceMappingURL=Transitioner.js.map","\"use client\";\nimport { useLayoutEffect } from \"./utils.js\";\nimport { CatchBoundary } from \"./CatchBoundary.js\";\nimport { matchContext } from \"./matchContext.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { useStructuralSharing } from \"./useMatch.js\";\nimport { Transitioner, settleOwner } from \"./Transitioner.js\";\nimport { Match, renderPending } from \"./Match.js\";\nimport { rootRouteId } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useSelector } from \"@tanstack/react-store\";\n//#region src/Matches.tsx\n/**\n* Internal component that renders the router's active match tree with\n* suspense, error, and not-found boundaries. Rendered by `RouterProvider`.\n*/\nfunction Matches() {\n\tconst router = useRouter();\n\tconst rootRoute = router.routesById[rootRouteId];\n\tconst pendingElement = renderPending(router, rootRoute);\n\tconst inner = /* @__PURE__ */ jsxs(Fragment, { children: [!(isServer ?? router.isServer) && /* @__PURE__ */ jsx(Transitioner, { t: React$1.useState()[1] }), (isServer ?? router.isServer) || router.ssr ? /* @__PURE__ */ jsx(MatchesInner, {}) : /* @__PURE__ */ jsx(React$1.Suspense, {\n\t\tfallback: pendingElement,\n\t\tchildren: /* @__PURE__ */ jsx(MatchesInner, {})\n\t})] });\n\treturn router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;\n}\nfunction MatchesInner() {\n\tconst router = useRouter();\n\tconst acknowledgement = router._rendered;\n\tconst matches = isServer ?? router.isServer ? router.stores.matches.get() : useSelector(router.stores.matches, (value) => acknowledgement[0] ?? value);\n\tconst match = matches[0];\n\tconst routeId = match?.routeId;\n\tuseLayoutEffect(() => {\n\t\tif (acknowledgement[0] === matches) settleOwner(acknowledgement, true);\n\t}, [acknowledgement, matches]);\n\tconst matchComponent = routeId ? /* @__PURE__ */ jsx(Match, { routeId }) : null;\n\treturn router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ jsx(CatchBoundary, {\n\t\tgetResetKey: () => match,\n\t\tonCatch: process.env.NODE_ENV !== \"production\" ? (error) => {\n\t\t\tconsole.warn(`Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`);\n\t\t\tconsole.warn(\"Warning:\", error);\n\t\t} : void 0,\n\t\tchildren: matchComponent\n\t});\n}\n/**\n* Create a matcher function for testing locations against route definitions.\n*\n* The returned function accepts standard navigation options (`to`, `params`,\n* `search`, etc.) and returns either `false` (no match) or the matched params\n* object when the route matches the current or pending location.\n*\n* Useful for conditional rendering and active UI states because it subscribes\n* the component to the router state used for matching. The returned function's\n* identity changes when that state changes. For imperative checks in event\n* handlers, get the router with `useRouter` and call `router.matchRoute(...)`\n* to avoid that subscription.\n*\n* @returns A `matchRoute(options)` function that returns `false` or params.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchRouteHook\n*/\nfunction useMatchRoute() {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) return (opts) => {\n\t\tconst { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;\n\t\treturn router.matchRoute(rest, {\n\t\t\tpending,\n\t\t\tcaseSensitive,\n\t\t\tfuzzy,\n\t\t\tincludeSearch\n\t\t});\n\t};\n\treturn React$1.useCallback((opts) => {\n\t\tconst { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;\n\t\treturn router.matchRoute(rest, {\n\t\t\tpending,\n\t\t\tcaseSensitive,\n\t\t\tfuzzy,\n\t\t\tincludeSearch\n\t\t});\n\t}, [\n\t\trouter,\n\t\tuseSelector(router.stores.location, (location) => location.href),\n\t\tuseSelector(router.stores.resolvedLocation, (location) => location?.href),\n\t\tuseSelector(router.stores.status)\n\t]);\n}\n/**\n* Component that conditionally renders its children based on whether a route\n* matches the provided `from`/`to` options. If `children` is a function, it\n* receives the matched params object.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/matchRouteComponent\n*/\nfunction MatchRoute(props) {\n\tconst params = useMatchRoute()(props);\n\tif (typeof props.children === \"function\") return props.children(params);\n\treturn params ? props.children : null;\n}\nfunction useMatches(opts) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) {\n\t\tconst matches = router.stores.matches.get();\n\t\treturn opts?.select ? opts.select(matches) : matches;\n\t}\n\treturn useSelector(router.stores.matches, useStructuralSharing(opts, router));\n}\n/**\n* Read the presented route matches above the current match, or select a\n* derived value from them.\n*/\nfunction useParentMatches(opts) {\n\tconst contextRouteId = React$1.useContext(matchContext);\n\treturn useMatches({\n\t\tselect: (matches) => {\n\t\t\tmatches = matches.slice(0, matches.findIndex((d) => d.routeId === contextRouteId));\n\t\t\treturn opts?.select ? opts.select(matches) : matches;\n\t\t},\n\t\tstructuralSharing: opts?.structuralSharing\n\t});\n}\n/**\n* Read the presented route matches below the current match, or select a\n* derived value from them.\n*/\nfunction useChildMatches(opts) {\n\tconst contextRouteId = React$1.useContext(matchContext);\n\treturn useMatches({\n\t\tselect: (matches) => {\n\t\t\tmatches = matches.slice(matches.findIndex((d) => d.routeId === contextRouteId) + 1);\n\t\t\treturn opts?.select ? opts.select(matches) : matches;\n\t\t},\n\t\tstructuralSharing: opts?.structuralSharing\n\t});\n}\n//#endregion\nexport { MatchRoute, Matches, useChildMatches, useMatchRoute, useMatches, useParentMatches };\n\n//# sourceMappingURL=Matches.js.map","import { createNonReactiveMutableStore, createNonReactiveReadonlyStore } from \"@tanstack/router-core\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { batch, createAtom } from \"@tanstack/react-store\";\n//#region src/routerStores.ts\nvar getStoreFactory = (opts) => {\n\tif (isServer ?? opts.isServer) return {\n\t\tcreateMutableStore: createNonReactiveMutableStore,\n\t\tcreateReadonlyStore: createNonReactiveReadonlyStore,\n\t\tbatch: (fn) => fn()\n\t};\n\treturn {\n\t\tcreateMutableStore: createAtom,\n\t\tcreateReadonlyStore: createAtom,\n\t\tbatch\n\t};\n};\n//#endregion\nexport { getStoreFactory };\n\n//# sourceMappingURL=routerStores.js.map","import { getStoreFactory } from \"./routerStores.js\";\nimport { RouterCore } from \"@tanstack/router-core\";\n//#region src/router.ts\n/**\n* Creates a new Router instance for React.\n*\n* Pass the returned router to `RouterProvider` to enable routing.\n* Notable options: `routeTree` (your route definitions) and `context`\n* (required if the root route was created with `createRootRouteWithContext`).\n*\n* @param options Router options used to configure the router.\n* @returns A Router instance to be provided to `RouterProvider`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n*/\nvar createRouter = (options) => {\n\treturn new Router(options);\n};\nvar Router = class extends RouterCore {\n\tconstructor(options) {\n\t\tsuper(options, getStoreFactory);\n\t}\n};\n//#endregion\nexport { Router, createRouter };\n\n//# sourceMappingURL=router.js.map","\"use client\";\nimport { routerContext } from \"./routerContext.js\";\nimport { Matches } from \"./Matches.js\";\nimport { hasKeys } from \"@tanstack/router-core\";\nimport \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/RouterProvider.tsx\n/**\n* Low-level provider that places the router into React context and optionally\n* updates router options from props. Most apps should use `RouterProvider`.\n*/\nfunction RouterContextProvider({ router, children, ...rest }) {\n\tif (hasKeys(rest)) router.update({\n\t\t...router.options,\n\t\t...rest,\n\t\tcontext: {\n\t\t\t...router.options.context,\n\t\t\t...rest.context\n\t\t}\n\t});\n\tconst provider = /* @__PURE__ */ jsx(routerContext.Provider, {\n\t\tvalue: router,\n\t\tchildren\n\t});\n\tif (router.options.Wrap) return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider });\n\treturn provider;\n}\n/**\n* Renders the current match presentation and provides the router to the React\n* tree via context.\n*\n* Accepts mutable router options via props. Configure initialization-only\n* options with `createRouter`.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n*/\nfunction RouterProvider({ router, ...rest }) {\n\treturn /* @__PURE__ */ jsx(RouterContextProvider, {\n\t\trouter,\n\t\t...rest,\n\t\tchildren: /* @__PURE__ */ jsx(Matches, {})\n\t});\n}\n//#endregion\nexport { RouterContextProvider, RouterProvider };\n\n//# sourceMappingURL=RouterProvider.js.map","\"use client\";\nimport { useRouter } from \"./useRouter.js\";\nimport { useStructuralSharing } from \"./useMatch.js\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { useSelector } from \"@tanstack/react-store\";\n//#region src/useLocation.tsx\n/**\n* Read the current location from the router state with optional selection.\n* Useful for subscribing to just the pieces of location you care about.\n*\n* Options:\n* - `select`: Project the `location` object to a derived value\n* - `structuralSharing`: Enable structural sharing for stable references\n*\n* @returns The current location (or selected value).\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook\n*/\nfunction useLocation(opts) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) {\n\t\tconst location = router.stores.location.get();\n\t\treturn opts?.select ? opts.select(location) : location;\n\t}\n\treturn useSelector(router.stores.location, useStructuralSharing(opts, router));\n}\n//#endregion\nexport { useLocation };\n\n//# sourceMappingURL=useLocation.js.map","// inlined from the former `void-elements` dependency, so the package has\n// zero runtime dependencies. `!doctype`/`!DOCTYPE` are treated as void so a\n// doctype parses as a childless node instead of swallowing the document.\nconst voidElements = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true,\n '!doctype': true,\n '!DOCTYPE': true,\n};\n\nconst attrRE = /\\s([^'\"/\\s><]+?)[\\s/>]|([^\\s=]+)=\\s?(\"[^\"]*\"|'[^']*')/g;\n\nfunction parseTag(tag) {\n const res = {\n type: 'tag',\n name: '',\n voidElement: false,\n attrs: {},\n children: [],\n };\n\n const tagMatch = tag.match(/<\\/?([^\\s]+?)[/\\s>]/);\n if (tagMatch) {\n res.name = tagMatch[1];\n // void-element lookup stays case sensitive on purpose: react-i18next\n // relies on `<Br>` NOT being treated as a void `<br>` (see 1df0f9d)\n if (voidElements[tagMatch[1]] || tag.charAt(tag.length - 2) === '/') {\n res.voidElement = true;\n }\n\n // handle comment tag\n if (res.name.startsWith('!--')) {\n const endIndex = tag.indexOf('-->');\n return {\n type: 'comment',\n comment: endIndex !== -1 ? tag.slice(4, endIndex) : '',\n }\n }\n }\n\n const reg = new RegExp(attrRE);\n let result = null;\n for (;;) {\n result = reg.exec(tag);\n\n if (result === null) {\n break\n }\n\n if (!result[0].trim()) {\n continue\n }\n\n if (result[1]) {\n const attr = result[1].trim();\n // boolean attributes carry `null` so stringify can render them bare\n // (`<input disabled/>` instead of `<input disabled=\"\"/>`)\n let arr = [attr, null];\n\n const eq = attr.indexOf('=');\n if (eq > -1) {\n // split at the first `=` only, so `data-x=a=b` keeps its full value\n arr = [attr.slice(0, eq), attr.slice(eq + 1)];\n }\n\n res.attrs[arr[0]] = arr[1];\n reg.lastIndex--;\n } else if (result[2]) {\n res.attrs[result[2]] = result[3].trim().substring(1, result[3].length - 1);\n }\n }\n\n return res\n}\n\n// comments are matched as a whole (so `>` inside them is fine), everything\n// else tag-shaped is matched by the second alternative\nconst tagRE = /<!--[\\s\\S]*?-->|<[a-zA-Z0-9\\-!/](?:\"[^\"]*\"|'[^']*'|[^'\">])*>/g;\nconst tagNameRE = /<\\/?([^\\s]+?)[/\\s>]/;\nconst whitespaceRE = /^\\s*$/;\n// tags whose content is raw text: nothing inside them is markup\nconst rawTextRE = /^(script|style)$/i;\n\n// placeholder for `<` of tags rejected by options.allowedTags; restored to a\n// literal `<` in text/attr/comment content after parsing (U+0000 cannot appear\n// in sane input, and a collision would merely render as an extra `<`)\nconst sentinel = '\\u0000';\n\n// re-used obj for quick lookups of components\nconst empty = Object.create(null);\n\nfunction restoreSentinels(nodes) {\n nodes.forEach(function (node) {\n if (node.type === 'text') {\n node.content = node.content.split(sentinel).join('<');\n return\n }\n if (node.type === 'comment') {\n node.comment = node.comment.split(sentinel).join('<');\n return\n }\n for (const key in node.attrs) {\n const value = node.attrs[key];\n if (typeof value === 'string' && value.indexOf(sentinel) > -1) {\n node.attrs[key] = value.split(sentinel).join('<');\n }\n }\n if (node.children.length) {\n restoreSentinels(node.children);\n }\n });\n}\n\nfunction parse(html, options) {\n const components = (options && options.components) || empty;\n const allowedTags = options && options.allowedTags;\n let restoreNeeded = false;\n if (allowedTags) {\n const isAllowed =\n typeof allowedTags === 'function'\n ? allowedTags\n : function (name) {\n return allowedTags.indexOf(name) > -1\n };\n // neutralize tags whose name is not allowed, so they parse as text.\n // on a disallowed match only the leading `<` is escaped and scanning\n // resumes right after it, so a valid tag glued into the same match\n // (e.g. `<bold>` inside `<10, <20, and <bold>`) still gets recognized\n let out = '';\n let pos = 0;\n tagRE.lastIndex = 0;\n let am;\n while ((am = tagRE.exec(html))) {\n const tag = am[0];\n out += html.slice(pos, am.index);\n const nameMatch = tag.match(tagNameRE);\n if (tag.startsWith('<!--') || (nameMatch && isAllowed(nameMatch[1]))) {\n out += tag;\n pos = am.index + tag.length;\n } else {\n restoreNeeded = true;\n out += sentinel;\n pos = am.index + 1;\n tagRE.lastIndex = pos;\n }\n }\n html = out + html.slice(pos);\n }\n const result = [];\n const arr = [];\n let current;\n let level = -1;\n let inComponent = false;\n // while parsing raw-text content (script/style), tag-looking matches\n // before this index belong to the content and must be skipped\n let rawUntil = 0;\n // lazily created lowercase copy for case-insensitive raw-text close-tag search\n let htmlLower;\n\n // handle text at top level\n if (html.indexOf('<') !== 0) {\n const end = html.indexOf('<');\n result.push({\n type: 'text',\n content: end === -1 ? html : html.substring(0, end),\n });\n }\n\n // collect matches with an exec loop instead of matchAll to keep ES5 API compat\n const matches = [];\n let m;\n while ((m = tagRE.exec(html))) {\n matches.push(m);\n }\n matches.forEach(function (match, i) {\n const tag = match[0];\n if (!tag) return\n // comments match as a whole; their content must not trigger the\n // mismatched-bracket split below\n if (tag.startsWith('<!--')) return\n // count brackets outside quoted attribute values, so `<` inside an\n // attribute (e.g. title=\"1 < 2\") can't trigger a bogus split\n let lts = 0;\n let gts = 0;\n let secondLt = -1;\n let quote = null;\n for (let j = 0; j < tag.length; j++) {\n const c = tag.charAt(j);\n if (quote) {\n if (c === quote) quote = null;\n } else if (c === '\"' || c === \"'\") {\n quote = c;\n } else if (c === '<') {\n lts++;\n if (lts === 2) secondLt = j;\n } else if (c === '>') {\n gts++;\n }\n }\n // only split when the remainder is itself a valid tag start; otherwise\n // a fragment like `< <!-->` desyncs the string-level isComment check\n // from parseTag's name-based comment detection and crashes the walker\n const validSplit =\n secondLt > -1 && /[a-zA-Z0-9\\-!/]/.test(tag.charAt(secondLt + 1));\n if (lts > gts && validSplit) {\n const firstPart = tag.substring(0, secondLt);\n const secondPart = tag.substring(firstPart.length);\n matches[i][0] = secondPart;\n matches[i].index += firstPart.length;\n }\n });\n matches.forEach(function (match, i) {\n const tag = match[0];\n if (!tag) return\n const index = match.index;\n if (index < rawUntil) return\n if (inComponent) {\n if (tag !== '</' + current.name + '>') {\n return\n } else {\n inComponent = false;\n }\n }\n const isOpen = tag.charAt(1) !== '/';\n const isComment = tag.startsWith('<!--');\n const start = index + tag.length;\n const nextChar = html.charAt(start);\n const nextMatch = matches[i + 1];\n let isText;\n if (nextChar === '<' && nextMatch) {\n const nextTag = html.substring(start, nextMatch.index);\n isText = nextTag.split('<').length > nextTag.split('>').length;\n }\n\n let parent;\n\n if (isComment) {\n const comment = parseTag(tag);\n\n // if we're at root, push new base node\n if (level < 0) {\n result.push(comment);\n return result\n }\n parent = arr[level];\n parent.children.push(comment);\n\n const text = html.slice(start, nextMatch ? nextMatch.index : undefined);\n if (text.length > 0) {\n parent.children.push({\n type: 'text',\n content: text,\n });\n }\n return result\n }\n\n if (isOpen) {\n level++;\n\n current = parseTag(tag);\n if (current.type === 'tag' && components[current.name]) {\n current.type = 'component';\n inComponent = true;\n }\n\n let isRawText = false;\n if (\n !inComponent &&\n !current.voidElement &&\n rawTextRE.test(current.name)\n ) {\n // raw-text element: everything up to the matching close tag is one\n // text child, regardless of what it looks like\n isRawText = true;\n htmlLower || (htmlLower = html.toLowerCase());\n const closeIndex = htmlLower.indexOf(\n '</' + current.name.toLowerCase() + '>',\n start,\n );\n const contentEnd = closeIndex === -1 ? html.length : closeIndex;\n const content = html.slice(start, contentEnd);\n if (content) {\n current.children.push({\n type: 'text',\n content,\n });\n }\n rawUntil = contentEnd;\n }\n\n if (\n !current.voidElement &&\n !inComponent &&\n !isRawText &&\n nextChar &&\n nextChar !== '<'\n ) {\n // text content runs to the next actual tag match; stray `<`\n // characters in between are part of the text\n current.children.push({\n type: 'text',\n content: html.slice(start, nextMatch ? nextMatch.index : undefined),\n });\n }\n\n // if we're at root, push new base node\n if (level === 0) {\n result.push(current);\n }\n\n parent = arr[level - 1];\n\n if (parent) {\n parent.children.push(current);\n }\n\n arr[level] = current;\n }\n\n if (!isOpen || current.voidElement) {\n if (\n level > -1 &&\n (current.voidElement || current.name === tag.slice(2, -1))\n ) {\n level--;\n // move current up a level to match the end tag\n current = level === -1 ? result : arr[level];\n }\n if (!inComponent && (nextChar !== '<' || isText) && nextChar) {\n // trailing text node\n // if we're at the root, push a base text node. otherwise add as\n // a child to the current node.\n parent = level === -1 ? result : arr[level].children;\n\n // the text node runs to the next actual tag match; -1 means\n // there's no tag after it (trailing text)\n const end = nextMatch ? nextMatch.index : -1;\n let content = html.slice(start, end === -1 ? undefined : end);\n // if a node is nothing but whitespace, collapse it as the spec states:\n // https://www.w3.org/TR/html4/struct/text.html#h-9.1\n if (whitespaceRE.test(content)) {\n content = ' ';\n }\n // don't add whitespace-only text nodes if they would be trailing text nodes\n // or if they would be leading whitespace-only text nodes:\n // * end > -1 indicates this is not a trailing text node\n // * leading node is when level is -1 and parent has length 0\n if ((end > -1 && level + parent.length >= 0) || content !== ' ') {\n parent.push({\n type: 'text',\n content,\n });\n }\n }\n }\n });\n\n if (restoreNeeded) {\n restoreSentinels(result);\n }\n\n return result\n}\n\nfunction attrString(attrs) {\n const buff = [];\n for (const key in attrs) {\n if (attrs[key] === null) {\n // boolean attribute, render bare\n buff.push(key);\n } else {\n // escape double quotes so values parsed from single-quoted or\n // multiline attributes can't break out of the generated markup\n buff.push(key + '=\"' + String(attrs[key]).replace(/\"/g, '&quot;') + '\"');\n }\n }\n if (!buff.length) {\n return ''\n }\n return ' ' + buff.join(' ')\n}\n\nfunction stringifyNode(buff, doc) {\n switch (doc.type) {\n case 'text':\n return buff + doc.content\n case 'tag': {\n // a doctype is void but must not self-close: `<!DOCTYPE html>` not `<!DOCTYPE html/>`\n const tagEnd =\n doc.voidElement && doc.name.toLowerCase() !== '!doctype' ? '/>' : '>';\n buff += '<' + doc.name + (doc.attrs ? attrString(doc.attrs) : '') + tagEnd;\n if (doc.voidElement) {\n return buff\n }\n return (\n buff + doc.children.reduce(stringifyNode, '') + '</' + doc.name + '>'\n )\n }\n case 'comment':\n buff += '<!--' + doc.comment + '-->';\n return buff\n }\n}\n\nfunction stringify(doc) {\n return doc.reduce(function (token, rootEl) {\n return token + stringifyNode('', rootEl)\n }, '')\n}\n\nvar index = {\n parse,\n stringify,\n};\n\nexport { index as default, parse, stringify };\n","import { Fragment, isValidElement, cloneElement, createElement, Children } from 'react';\nimport { keyFromSelector } from 'i18next';\nimport HTML from 'html-parse-stringify';\nimport { isObject, isString, warn, warnOnce } from './utils.js';\nimport { getDefaults } from './defaults.js';\nimport { getI18n } from './i18nInstance.js';\nimport { unescape } from './unescape.js';\nconst hasChildren = (node, checkLength) => {\n if (!node) return false;\n const base = node.props?.children ?? node.children;\n if (checkLength) return base.length > 0;\n return !!base;\n};\nconst getChildren = node => {\n if (!node) return [];\n const children = node.props?.children ?? node.children;\n return node.props?.i18nIsDynamicList ? getAsArray(children) : children;\n};\nconst hasValidReactChildren = children => getAsArray(children).every(isValidElement);\nconst getAsArray = data => Array.isArray(data) ? data : [data];\nconst mergeProps = (source, target) => {\n const newTarget = {\n ...target\n };\n newTarget.props = {\n ...target.props,\n ...source.props\n };\n return newTarget;\n};\nconst getValuesFromChildren = children => {\n const values = {};\n if (!children) return values;\n const getData = childs => {\n const childrenArray = getAsArray(childs);\n childrenArray.forEach(child => {\n if (isString(child)) return;\n if (hasChildren(child)) getData(getChildren(child));else if (isObject(child) && !isValidElement(child)) Object.assign(values, child);\n });\n };\n getData(children);\n return values;\n};\nexport const nodesToString = (children, i18nOptions, i18n, i18nKey) => {\n if (!children) return '';\n let stringNode = '';\n const childrenArray = getAsArray(children);\n const keepArray = i18nOptions?.transSupportBasicHtmlNodes ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : [];\n childrenArray.forEach((child, childIndex) => {\n if (isString(child)) {\n stringNode += `${child}`;\n return;\n }\n if (isValidElement(child)) {\n const {\n props,\n type\n } = child;\n const childPropsCount = Object.keys(props).length;\n const shouldKeepChild = keepArray.indexOf(type) > -1;\n const childChildren = props.children;\n if (!childChildren && shouldKeepChild && !childPropsCount) {\n stringNode += `<${type}/>`;\n return;\n }\n if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {\n stringNode += `<${childIndex}></${childIndex}>`;\n return;\n }\n if (shouldKeepChild && childPropsCount <= 1) {\n const cnt = isString(childChildren) ? childChildren : nodesToString(childChildren, i18nOptions, i18n, i18nKey);\n stringNode += `<${type}>${cnt}</${type}>`;\n return;\n }\n const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);\n stringNode += `<${childIndex}>${content}</${childIndex}>`;\n return;\n }\n if (child === null) {\n warn(i18n, 'TRANS_NULL_VALUE', `Passed in a null value as child`, {\n i18nKey\n });\n return;\n }\n if (isObject(child)) {\n const {\n format,\n ...clone\n } = child;\n const keys = Object.keys(clone);\n if (keys.length === 1) {\n const value = format ? `${keys[0]}, ${format}` : keys[0];\n stringNode += `{{${value}}}`;\n return;\n }\n warn(i18n, 'TRANS_INVALID_OBJ', `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, {\n i18nKey,\n child\n });\n return;\n }\n warn(i18n, 'TRANS_INVALID_VAR', `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, {\n i18nKey,\n child\n });\n });\n return stringNode;\n};\nconst renderNodes = (children, knownComponentsMap, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => {\n if (targetString === '') return [];\n const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];\n const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map(keep => `<${keep}`).join('|')).test(targetString);\n if (!children && !knownComponentsMap && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];\n const data = knownComponentsMap ?? {};\n const getData = childs => {\n const childrenArray = getAsArray(childs);\n childrenArray.forEach(child => {\n if (isString(child)) return;\n if (hasChildren(child)) getData(getChildren(child));else if (isObject(child) && !isValidElement(child)) Object.assign(data, child);\n });\n };\n getData(children);\n const knownNames = Object.keys(data);\n const allowedTags = name => /^\\d+$/.test(name) || keepArray.indexOf(name) > -1 || knownNames.indexOf(name) > -1;\n const ast = HTML.parse(`<0>${targetString}</0>`, {\n allowedTags\n });\n const opts = {\n ...data,\n ...combinedTOpts\n };\n const renderInner = (child, node, rootReactNode) => {\n const childs = getChildren(child);\n const mappedChildren = mapAST(childs, node.children, rootReactNode);\n return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props?.i18nIsDynamicList ? childs : mappedChildren;\n };\n const pushTranslatedJSX = (child, inner, mem, i, isVoid) => {\n if (child.dummy) {\n child.children = inner;\n mem.push(cloneElement(child, {\n key: i\n }, isVoid ? undefined : inner));\n } else {\n mem.push(...Children.map([child], c => {\n if (c.type === Fragment || c.props?.i18nIsDynamicList !== undefined) {\n const freshProps = {\n key: i\n };\n if (c && c.props) {\n Object.keys(c.props).forEach(k => {\n if (k === 'children' || k === 'i18nIsDynamicList') return;\n freshProps[k] = c.props[k];\n });\n }\n return createElement(c.type, freshProps, isVoid ? null : inner);\n }\n const override = {\n key: i\n };\n if (c && c.props) {\n Object.keys(c.props).forEach(k => {\n if (k === 'ref' || k === 'children') return;\n override[k] = c.props[k];\n });\n }\n return cloneElement(c, override, isVoid ? null : inner);\n }));\n }\n };\n const mapAST = (reactNode, astNode, rootReactNode) => {\n const reactNodes = getAsArray(reactNode);\n const astNodes = getAsArray(astNode);\n const keepTagOccurrence = {};\n return astNodes.reduce((mem, node, i) => {\n const translationContent = node.children?.[0]?.content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);\n if (node.type === 'tag') {\n let tmp = reactNodes[parseInt(node.name, 10)];\n if (!tmp && knownComponentsMap) tmp = knownComponentsMap[node.name];\n if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];\n if (!tmp) tmp = {};\n const props = {\n ...node.attrs\n };\n if (shouldUnescape) {\n Object.keys(props).forEach(p => {\n const val = props[p];\n if (isString(val)) {\n props[p] = unescape(val);\n }\n });\n }\n const child = Object.keys(props).length !== 0 ? mergeProps({\n props\n }, tmp) : tmp;\n const isElement = isValidElement(child);\n const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;\n const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject(child) && child.dummy && !isElement;\n const isKnownComponent = isObject(knownComponentsMap) && Object.hasOwnProperty.call(knownComponentsMap, node.name);\n if (isString(child)) {\n const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);\n mem.push(value);\n } else if (hasChildren(child) || isValidTranslationWithChildren) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (isEmptyTransWithHTML) {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (Number.isNaN(parseFloat(node.name))) {\n if (isKnownComponent) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i, node.voidElement);\n } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {\n if (node.voidElement) {\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }));\n } else {\n const occurrence = keepTagOccurrence[node.name] || 0;\n keepTagOccurrence[node.name] = occurrence + 1;\n let matched;\n let seen = 0;\n for (let r = 0; r < reactNodes.length; r += 1) {\n const rn = reactNodes[r];\n if (isValidElement(rn) && rn.type === node.name) {\n if (seen === occurrence) {\n matched = rn;\n break;\n }\n seen += 1;\n }\n }\n const innerScope = matched ? getAsArray(getChildren(matched)) : reactNodes;\n const inner = mapAST(innerScope, node.children, rootReactNode);\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }, inner));\n }\n } else if (node.voidElement) {\n mem.push(`<${node.name} />`);\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(`<${node.name}>${inner}</${node.name}>`);\n }\n } else if (isObject(child) && !isElement) {\n const content = node.children[0] ? translationContent : null;\n if (content) mem.push(content);\n } else {\n pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent);\n }\n } else if (node.type === 'text') {\n const wrapTextNodes = i18nOptions.transWrapTextNodes;\n const unescapeFn = typeof i18nOptions.unescape === 'function' ? i18nOptions.unescape : getDefaults().unescape;\n const content = shouldUnescape ? unescapeFn(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);\n if (wrapTextNodes) {\n mem.push(createElement(wrapTextNodes, {\n key: `${node.name}-${i}`\n }, content));\n } else {\n mem.push(content);\n }\n }\n return mem;\n }, []);\n };\n const result = mapAST([{\n dummy: true,\n children: children || []\n }], ast, getAsArray(children || []));\n return getChildren(result[0]);\n};\nconst fixComponentProps = (component, index, translation) => {\n const componentKey = component.key || index;\n const comp = cloneElement(component, {\n key: componentKey\n });\n if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {\n return comp;\n }\n function Componentized() {\n return createElement(Fragment, null, comp);\n }\n return createElement(Componentized, {\n key: componentKey\n });\n};\nconst generateArrayComponents = (components, translation) => components.map((c, index) => fixComponentProps(c, index, translation));\nconst generateObjectComponents = (components, translation) => {\n const componentMap = {};\n Object.keys(components).forEach(c => {\n Object.assign(componentMap, {\n [c]: fixComponentProps(components[c], c, translation)\n });\n });\n return componentMap;\n};\nconst generateComponents = (components, translation, i18n, i18nKey) => {\n if (!components) return null;\n if (Array.isArray(components)) {\n return generateArrayComponents(components, translation);\n }\n if (isObject(components)) {\n return generateObjectComponents(components, translation);\n }\n warnOnce(i18n, 'TRANS_INVALID_COMPONENTS', `<Trans /> \"components\" prop expects an object or array`, {\n i18nKey\n });\n return null;\n};\nconst isComponentsMap = object => {\n if (!isObject(object)) return false;\n if (Array.isArray(object)) return false;\n return Object.keys(object).reduce((acc, key) => acc && Number.isNaN(Number.parseFloat(key)), true);\n};\nexport function Trans({\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n}) {\n const i18n = i18nFromProps || getI18n();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', `Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`, {\n i18nKey\n });\n return children;\n }\n const t = tFromProps || i18n.t.bind(i18n) || (k => k);\n const reactI18nextOptions = {\n ...getDefaults(),\n ...i18n.options?.react\n };\n let namespaces = ns || t.ns || i18n.options?.defaultNS;\n namespaces = isString(namespaces) ? [namespaces] : namespaces || ['translation'];\n const {\n transDefaultProps\n } = reactI18nextOptions;\n const mergedTOptions = transDefaultProps?.tOptions ? {\n ...transDefaultProps.tOptions,\n ...tOptions\n } : tOptions;\n const mergedShouldUnescape = shouldUnescape ?? transDefaultProps?.shouldUnescape;\n const mergedValues = transDefaultProps?.values ? {\n ...transDefaultProps.values,\n ...values\n } : values;\n const mergedComponents = transDefaultProps?.components ? {\n ...transDefaultProps.components,\n ...components\n } : components;\n const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);\n const defaultValue = defaults || mergedTOptions?.defaultValue || nodeAsString || reactI18nextOptions.transEmptyNodeValue || (typeof i18nKey === 'function' ? keyFromSelector(i18nKey) : i18nKey);\n const {\n hashTransKey\n } = reactI18nextOptions;\n const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);\n if (i18n.options?.interpolation?.defaultVariables) {\n values = mergedValues && Object.keys(mergedValues).length > 0 ? {\n ...mergedValues,\n ...i18n.options.interpolation.defaultVariables\n } : {\n ...i18n.options.interpolation.defaultVariables\n };\n } else {\n values = mergedValues;\n }\n const valuesFromChildren = getValuesFromChildren(children);\n if (valuesFromChildren && typeof valuesFromChildren.count === 'number' && count === undefined) {\n count = valuesFromChildren.count;\n }\n const interpolationOverride = values || count !== undefined && !i18n.options?.interpolation?.alwaysFormat || !children ? mergedTOptions.interpolation : {\n interpolation: {\n ...mergedTOptions.interpolation,\n prefix: '#$?',\n suffix: '?$#'\n }\n };\n const combinedTOpts = {\n ...mergedTOptions,\n context: context || mergedTOptions.context,\n count,\n ...values,\n ...interpolationOverride,\n defaultValue,\n ns: namespaces\n };\n let translation = key ? t(key, combinedTOpts) : defaultValue;\n if (translation === key && defaultValue) translation = defaultValue;\n const generatedComponents = generateComponents(mergedComponents, translation, i18n, i18nKey);\n let indexedChildren = generatedComponents || children;\n let componentsMap = null;\n if (isComponentsMap(generatedComponents)) {\n componentsMap = generatedComponents;\n indexedChildren = children;\n }\n const content = renderNodes(indexedChildren, componentsMap, translation, i18n, reactI18nextOptions, combinedTOpts, mergedShouldUnescape);\n const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;\n return useAsParent ? createElement(useAsParent, additionalProps, content) : content;\n}","import { useContext } from 'react';\nimport { nodesToString, Trans as TransWithoutContext } from './TransWithoutContext.js';\nimport { getI18n, I18nContext } from './context.js';\nexport { nodesToString };\nexport function Trans({\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n}) {\n const {\n i18n: i18nFromContext,\n defaultNS: defaultNSFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n const t = tFromProps || i18n?.t.bind(i18n);\n return TransWithoutContext({\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions,\n values,\n defaults,\n components,\n ns: ns || t?.ns || defaultNSFromContext || i18n?.options?.defaultNS,\n i18n,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n });\n}","import { MutationCache, QueryCache, QueryClient } from '@tanstack/react-query';\nimport { hasErrorCode, isForbidden, isNotFound, isUnauthorized } from '@/api/errors';\nimport { queryKeys } from '@/api/queryKeys';\nimport { logError, reportError } from '@/helpers/reportError';\nimport { hasUnsavedEdits, useSessionStore } from '@/stores/session';\n\ndeclare module '@tanstack/react-query' {\n interface Register {\n /**\n * `silent`: logged but no toast, because the caller shows the error itself (inline form error, state view).\n * `silentNotFound`: the same for 404 only, where callers show a \"no longer exists\" state.\n */\n queryMeta: { silent?: boolean; silentNotFound?: boolean };\n mutationMeta: { silent?: boolean };\n }\n}\n\nconst MAX_RETRIES = 2;\n\nconst AUTH_KEYS: ReadonlySet<string> = new Set(['auth', 'setup']);\n\n/**\n * The admin lost its role on this site mid-session (`SITE_FORBIDDEN`; `SITE_MISMATCH` for a credential of\n * another site), or the site is gone (`SITE_NOT_FOUND`). The Shell shows a page-level state from `me` for\n * these, so they are logged, not toasted one request at a time.\n */\nconst SITE_ACCESS_CODES = ['SITE_FORBIDDEN', 'SITE_MISMATCH', 'SITE_NOT_FOUND'] as const;\n\nexport const isSiteAccessError = (error: unknown) =>\n SITE_ACCESS_CODES.some((code) => hasErrorCode(error, code));\n\n/** 4xx answers are final; only network and 5xx failures are worth retrying. */\nconst shouldRetry = (failureCount: number, error: unknown) =>\n failureCount < MAX_RETRIES && !isUnauthorized(error) && !isForbidden(error) && !isNotFound(error);\n\nexport const createQueryClient = () => {\n /**\n * Any 401 means the session ended (expired, revoked elsewhere, signed out in another tab). Over unsaved\n * edits the page stays and asks for the password in place (`signInRequired`), keeping `me` so nothing\n * unmounts; otherwise the signed-in user is forgotten and the shell sends them to sign in. Auth requests\n * are exempt: there a 401 means wrong credentials, which the form reports. Returns whether the session is\n * being resumed in place, in which case the sign-in panel says what happened and the error isn't toasted.\n */\n const handleSessionEnded = (error: unknown, isAuthRequest: boolean) => {\n if (!isUnauthorized(error) || isAuthRequest) {\n return false;\n }\n const session = useSessionStore.getState();\n if (hasUnsavedEdits() || session.signInRequired) {\n session.requireSignIn();\n return true;\n }\n queryClient.setQueryData(queryKeys.me, null);\n return false;\n };\n /** Re-reads `me`, whose `sites` decide whether the Shell shows the no-role state. */\n const handleSiteAccessLost = (error: unknown, isMeQuery: boolean) => {\n if (isSiteAccessError(error) && !isMeQuery) {\n void queryClient.invalidateQueries({ queryKey: queryKeys.me });\n }\n };\n const queryClient: QueryClient = new QueryClient({\n queryCache: new QueryCache({\n onError: (error, query) => {\n const context = `query ${JSON.stringify(query.queryKey)}`;\n const isMeQuery = query.queryKey[0] === queryKeys.me[0];\n // `me` answers a 401 with null, except over unsaved edits, where it fails so the session resumes in place.\n const inPlace = handleSessionEnded(error, false);\n const quiet =\n query.meta?.silent ||\n (query.meta?.silentNotFound && isNotFound(error)) ||\n isSiteAccessError(error) ||\n inPlace;\n (quiet ? logError : reportError)(error, context);\n handleSiteAccessLost(error, isMeQuery);\n },\n }),\n mutationCache: new MutationCache({\n onError: (error, _variables, _context, mutation) => {\n const context = `mutation ${JSON.stringify(mutation.options.mutationKey ?? 'anonymous')}`;\n const inPlace = handleSessionEnded(error, AUTH_KEYS.has(String(mutation.options.mutationKey?.[0])));\n (mutation.meta?.silent || inPlace ? logError : reportError)(error, context);\n handleSiteAccessLost(error, false);\n },\n }),\n defaultOptions: {\n queries: { retry: shouldRetry, staleTime: 30_000, refetchOnWindowFocus: false },\n mutations: { retry: false },\n },\n });\n return queryClient;\n};\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"activity\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\",\n key: \"169zse\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Activity = createLucideIcon(__iconData);\n\nexport { __iconData, Activity as default };\n//# sourceMappingURL=activity.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"git-pull-request-arrow\",\n size: 24,\n node: [\n [\"circle\", { cx: \"5\", cy: \"6\", r: \"3\", key: \"1qnov2\" }],\n [\"path\", { d: \"M5 9v12\", key: \"ih889a\" }],\n [\"circle\", { cx: \"19\", cy: \"18\", r: \"3\", key: \"1qljk2\" }],\n [\"path\", { d: \"m15 9-3-3 3-3\", key: \"1lwv8l\" }],\n [\"path\", { d: \"M12 6h5a2 2 0 0 1 2 2v7\", key: \"1yj91y\" }]\n ]\n};\n__iconData.node;\nconst GitPullRequestArrow = createLucideIcon(__iconData);\n\nexport { __iconData, GitPullRequestArrow as default };\n//# sourceMappingURL=git-pull-request-arrow.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"log-in\",\n size: 24,\n node: [\n [\"path\", { d: \"m10 17 5-5-5-5\", key: \"1bsop3\" }],\n [\"path\", { d: \"M15 12H3\", key: \"6jk70r\" }],\n [\"path\", { d: \"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\", key: \"u53s6r\" }]\n ]\n};\n__iconData.node;\nconst LogIn = createLucideIcon(__iconData);\n\nexport { __iconData, LogIn as default };\n//# sourceMappingURL=log-in.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"log-out\",\n size: 24,\n node: [\n [\"path\", { d: \"m16 17 5-5-5-5\", key: \"1bji2h\" }],\n [\"path\", { d: \"M21 12H9\", key: \"dn1m92\" }],\n [\"path\", { d: \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\", key: \"1uf3rs\" }]\n ]\n};\n__iconData.node;\nconst LogOut = createLucideIcon(__iconData);\n\nexport { __iconData, LogOut as default };\n//# sourceMappingURL=log-out.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"mail-check\",\n size: 24,\n node: [\n [\"path\", { d: \"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8\", key: \"12jkf8\" }],\n [\"path\", { d: \"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\", key: \"1ocrg3\" }],\n [\"path\", { d: \"m16 19 2 2 4-4\", key: \"1b14m6\" }]\n ]\n};\n__iconData.node;\nconst MailCheck = createLucideIcon(__iconData);\n\nexport { __iconData, MailCheck as default };\n//# sourceMappingURL=mail-check.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"octagon-x\",\n size: 24,\n node: [\n [\"path\", { d: \"m15 9-6 6\", key: \"1uzhvr\" }],\n [\n \"path\",\n {\n d: \"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z\",\n key: \"2d38gg\"\n }\n ],\n [\"path\", { d: \"m9 9 6 6\", key: \"z0biqf\" }]\n ],\n aliases: [\"x-octagon\"]\n};\n__iconData.node;\nconst OctagonX = createLucideIcon(__iconData);\n\nexport { __iconData, OctagonX as default };\n//# sourceMappingURL=octagon-x.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"panel-left\",\n size: 24,\n node: [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M9 3v18\", key: \"fh3hqa\" }]\n ],\n aliases: [\"sidebar\"]\n};\n__iconData.node;\nconst PanelLeft = createLucideIcon(__iconData);\n\nexport { __iconData, PanelLeft as default };\n//# sourceMappingURL=panel-left.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"server\",\n size: 24,\n node: [\n [\"rect\", { width: \"20\", height: \"8\", x: \"2\", y: \"2\", rx: \"2\", ry: \"2\", key: \"ngkwjq\" }],\n [\"rect\", { width: \"20\", height: \"8\", x: \"2\", y: \"14\", rx: \"2\", ry: \"2\", key: \"iecqi9\" }],\n [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"6\", y2: \"6\", key: \"16zg32\" }],\n [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"18\", y2: \"18\", key: \"nzw8ys\" }]\n ]\n};\n__iconData.node;\nconst Server = createLucideIcon(__iconData);\n\nexport { __iconData, Server as default };\n//# sourceMappingURL=server.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"settings\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\",\n key: \"1i5ecw\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n ]\n};\n__iconData.node;\nconst Settings = createLucideIcon(__iconData);\n\nexport { __iconData, Settings as default };\n//# sourceMappingURL=settings.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"square-terminal\",\n size: 24,\n node: [\n [\"path\", { d: \"m7 11 2-2-2-2\", key: \"1lz0vl\" }],\n [\"path\", { d: \"M11 13h4\", key: \"1p7l4v\" }],\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", ry: \"2\", key: \"1m3agn\" }]\n ],\n aliases: [\"terminal-square\"]\n};\n__iconData.node;\nconst SquareTerminal = createLucideIcon(__iconData);\n\nexport { __iconData, SquareTerminal as default };\n//# sourceMappingURL=square-terminal.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"users-round\",\n size: 24,\n node: [\n [\"path\", { d: \"M18 21a8 8 0 0 0-16 0\", key: \"3ypg7q\" }],\n [\"circle\", { cx: \"10\", cy: \"8\", r: \"5\", key: \"o932ke\" }],\n [\"path\", { d: \"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3\", key: \"10s06x\" }]\n ],\n aliases: [\"users-2\"]\n};\n__iconData.node;\nconst UsersRound = createLucideIcon(__iconData);\n\nexport { __iconData, UsersRound as default };\n//# sourceMappingURL=users-round.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"zap\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z\",\n key: \"1v7up4\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Zap = createLucideIcon(__iconData);\n\nexport { __iconData, Zap as default };\n//# sourceMappingURL=zap.mjs.map\n","import * as React from 'react';\nimport { cn } from '@/helpers/cn';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn('flex flex-col gap-5 rounded-xl border bg-card py-5 text-card-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-5 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-5',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-base leading-tight font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div data-slot=\"card-description\" className={cn('text-sm text-muted-foreground', className)} {...props} />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-content\" className={cn('px-5', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-5 [.border-t]:pt-5', className)}\n {...props}\n />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n","import { useTranslation } from 'react-i18next';\nimport { DropdownMenuRadioGroup, DropdownMenuRadioItem } from '@/components/ui/dropdown-menu';\nimport { ThemeSwatches } from '../../ThemeSwatches';\nimport { useLookSelection } from '../hooks/useLookSelection';\n\n/** The looks as radio items with their colours, for any dropdown menu (the theme menu, the account menu). */\nexport const ThemeMenuThemes = () => {\n const { t } = useTranslation();\n const { looks, selectedLook, selectLook } = useLookSelection();\n return (\n <DropdownMenuRadioGroup aria-label={t('theme.label')} value={selectedLook} onValueChange={selectLook}>\n {looks.map((look) => (\n <DropdownMenuRadioItem key={look.value} value={look.value}>\n <ThemeSwatches themeKey={look.themeKey} variant={look.variant} />\n {look.name}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n );\n};\n","import { useTranslation } from 'react-i18next';\nimport { DropdownMenuLabel } from '@/components/ui/dropdown-menu';\nimport { ThemeMenuThemes } from '../Themes';\n\n/** The looks under a Theme label: the body of the theme menu and the account menu's Theme item. */\nexport const ThemeMenuContent = () => {\n const { t } = useTranslation();\n return (\n <>\n <DropdownMenuLabel>{t('theme.label')}</DropdownMenuLabel>\n <ThemeMenuThemes />\n </>\n );\n};\n","import { Palette } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '@/components/ui/button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';\nimport { ThemeMenuContent } from './Content';\n\n/** Compact theme switcher for screens without the account menu (sign-in, setup). */\nexport const ThemeMenu = () => {\n const { t } = useTranslation();\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" aria-label={t('theme.toggle')}>\n <Palette aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"min-w-52\">\n <ThemeMenuContent />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n","/**\n * The \"shapio\" letters, copied from src/assets/brand/wordmark.svg (brandAssets.test.ts keeps them equal).\n * LETTERS_VIEWBOX spans the mark's height in the original lockup, so a letters SVG as tall as the mark sits\n * at the logo's own scale and baseline.\n */\nexport const LETTERS_VIEWBOX = '616.1 188.4 737.1 391.6';\nexport const LETTER_PATHS = [\n 'M1090.58 333.275C1157.14 332.289 1174.32 424.991 1123.95 459.204C1108.87 469.445 1088.13 472.907 1071.41 464.797C1064.55 461.473 1061.37 456.784 1057.33 450.722C1056.41 462.424 1057.06 483.342 1057.1 495.852C1057.02 514.183 1048.9 525.591 1028.16 518.299C1017.28 514.477 1017.78 496.49 1017.79 486.571C1017.85 442.964 1017.33 398.942 1017.87 355.311C1018.05 336.963 1030.29 328.995 1048.26 336.47C1053.35 338.585 1055.89 347.116 1057.18 352.289C1065.37 336.584 1074.19 335.17 1090.58 333.275ZM1092.24 431.091C1108.21 428.095 1118.76 412.763 1115.85 396.776C1112.95 380.789 1097.68 370.151 1081.67 372.966C1065.54 375.803 1054.8 391.224 1057.73 407.34C1060.66 423.455 1076.14 434.111 1092.24 431.091Z',\n 'M922.446 334.008C939.628 331.531 955.543 337.211 964.406 352.727C964.869 350.705 965.362 348.663 965.99 346.687C967.332 342.464 970.326 338.329 974.338 336.297C979.136 333.866 986.204 333.852 991.234 335.555C995.206 336.901 998.676 339.872 1000.44 343.718C1001.94 346.996 1002.07 351.354 1002.26 354.938C1002.98 368.322 1003.46 449.941 1000.96 456.538C999.235 461.108 995.105 464.94 990.639 466.783C986.133 468.641 979.924 468.612 975.434 466.723C968.435 463.778 966.592 456.847 964.013 450.517C962.826 451.998 961.519 454.409 960.207 456.045C954.244 463.49 945.326 467.336 936.028 468.599C900.541 473.423 871.353 445.895 866.604 411.844C863.8 392.962 868.731 373.747 880.28 358.548C890.763 344.674 905.301 336.377 922.446 334.008ZM940.408 431.581C949.066 428.261 955.314 423.972 959.355 415.134C962.796 407.431 963.009 398.671 959.947 390.81C954.218 375.816 942.209 371.064 927.237 372.164C890.748 384.784 901.361 437.712 940.408 431.581Z',\n 'M1279.97 333.597C1317.39 330.69 1350.07 358.686 1352.95 396.11C1355.83 433.533 1327.81 466.197 1290.38 469.045C1253 471.889 1220.38 443.906 1217.5 406.524C1214.63 369.142 1242.59 336.501 1279.97 333.597ZM1286.15 431.459C1302.37 430.693 1314.91 416.938 1314.17 400.716C1313.43 384.495 1299.7 371.935 1283.48 372.646C1267.21 373.358 1254.62 387.133 1255.36 403.393C1256.1 419.653 1269.89 432.226 1286.15 431.459Z',\n 'M745.712 280.665C771.649 278.436 770.745 298.923 770.338 318.014C770.111 328.702 770.078 340.068 770.348 350.754C786.305 328.62 816.526 327.911 837.119 344.19C859.449 365.876 853.065 388.41 854.139 418.199C854.775 435.83 859.498 484.408 821.45 463.488C813.189 458.947 815.713 424.754 815.805 412.875C816.001 398.883 818.828 376.394 801.672 371.539C795.389 369.699 788.629 370.468 782.919 373.672C759.442 386.989 775.752 433.133 769.193 455.427C767.865 459.942 765.224 463.866 760.96 466.043C756.062 468.544 749.172 468.83 744.004 467.067C739.677 465.592 735.462 462.323 733.508 458.112C732.079 455.03 732.096 450.252 731.96 446.849C731.353 431.675 730.877 298.194 733.348 291.499C735.55 285.533 740.271 283.082 745.712 280.665Z',\n 'M660.099 333.26C680.586 331.864 700.006 339.184 710.734 357.654C721.091 375.484 706.761 386.653 689.026 382.376C683.14 380.957 680.282 375.044 677.765 370.073C671.556 366.764 652.682 360.92 653.447 376.224C653.858 384.432 678.054 389.014 686.587 391.943C691.392 393.543 695.973 395.75 700.221 398.509C708.033 403.655 714.749 410.97 716.391 420.381C721.421 449.209 698.738 464.343 674.162 468.785C656.55 470.863 640.237 468.779 626.299 455.765C607.025 437.768 616.967 414.291 643.818 423.21C648.552 424.783 651.03 431.197 654.674 435.163L655.16 435.687C663.141 437.562 671.768 439.003 678.101 432.48C682.092 428.37 676.277 423.068 672.842 421.215C660.527 414.57 643.648 414.391 631.887 406.609C614.592 395.165 610.953 367.819 623.894 351.806C633.551 339.783 645.424 335.187 660.099 333.26Z',\n 'M1179.04 334.725C1184.18 334.292 1188.92 333.988 1193.81 336.044C1197.19 337.462 1200.91 340.504 1202.27 343.987C1203.61 347.438 1204.12 351.843 1204.37 355.534C1205.29 369.065 1206.29 450.459 1202.88 458.094C1200.5 463.408 1195.98 465.58 1190.85 467.563C1175.74 469.989 1165.93 463.611 1165.73 447.565C1165.42 423.508 1165.71 399.287 1165.52 375.235C1165.45 365.244 1164.9 354.993 1167.11 345.33C1168.26 340.292 1175.14 336.691 1179.04 334.725Z',\n 'M1179.65 280.907C1191.7 277.75 1204.01 285.025 1207.05 297.101C1210.1 309.177 1202.71 321.419 1190.61 324.351C1178.66 327.245 1166.61 319.974 1163.61 308.056C1160.6 296.137 1167.76 284.023 1179.65 280.907Z',\n] as const;\n","import { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { cn } from '@/helpers/cn';\nimport { Logo } from '../Logo';\nimport { LETTER_PATHS, LETTERS_VIEWBOX } from './letters';\n\n/**\n * Mark and letters share one height, so the letters keep the logo's own proportions (x-height ≈ 0.35 × the\n * mark); the gap is the logo's own (about 0.15 × the mark).\n */\nconst wordmarkVariants = cva('inline-flex shrink-0 items-center [&>svg]:w-auto', {\n variants: {\n size: {\n /** Sidebar and the auth screens' compact header: 36px. */\n default: 'gap-1.5 [&>svg]:h-9',\n /** Status bar and the phone header: 24px. */\n sm: 'gap-1 [&>svg]:h-6',\n /** The auth brand panel: 52px. */\n lg: 'gap-2 [&>svg]:h-13',\n },\n variant: {\n /** The mark, letters in the theme's brand-letters colour (plum on light grounds, cream on dark). */\n default: 'text-brand-letters',\n /** For the brand panel: the panel mark, letters in the surface's text colour. */\n reverse: '',\n },\n },\n defaultVariants: { size: 'default', variant: 'default' },\n});\n\ntype WordmarkProps = {\n size?: 'default' | 'sm' | 'lg';\n variant?: 'default' | 'reverse';\n className?: string;\n};\n\n/**\n * The Shapio logo: mark + \"shapio\" letters (src/assets/brand/logo-horizontal.svg). The letters take\n * `currentColor`. Announced as \"Shapio\"; the letters carry `data-slot=\"wordmark-letters\"` so a container can\n * hide them (the collapsed sidebar shows the mark only).\n */\nexport const Wordmark = ({ size, variant, className }: WordmarkProps) => {\n const { t } = useTranslation();\n return (\n <span\n role=\"img\"\n aria-label={t('app.name')}\n className={cn(wordmarkVariants({ size, variant }), className)}\n >\n <Logo variant={variant ?? 'default'} />\n <svg\n viewBox={LETTERS_VIEWBOX}\n aria-hidden=\"true\"\n focusable=\"false\"\n data-slot=\"wordmark-letters\"\n className=\"fill-current\"\n >\n {LETTER_PATHS.map((d) => (\n <path key={d} d={d} />\n ))}\n </svg>\n </span>\n );\n};\n","import { Braces, Server, Zap } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { Wordmark } from '../../Wordmark';\n\nconst PITCHES = [\n { icon: Zap, key: 'auth.brand.pitchLive' },\n { icon: Braces, key: 'auth.brand.pitchApi' },\n { icon: Server, key: 'auth.brand.pitchSelfHosted' },\n] as const;\n\n/**\n * The brand column of the signed-out screens (lg and up), in the theme's brand-panel colours: panel logo,\n * tagline, three-line pitch.\n */\nexport const BrandPanel = () => {\n const { t } = useTranslation();\n return (\n <aside\n aria-label={t('auth.brand.label')}\n className=\"hidden bg-linear-to-br from-brand-panel-from to-brand-panel-to p-12 text-brand-panel-foreground lg:flex lg:w-5/12 lg:max-w-2xl lg:shrink-0 lg:flex-col lg:justify-between\"\n >\n <Wordmark size=\"lg\" variant=\"reverse\" className=\"self-start\" />\n <div className=\"max-w-md space-y-8\">\n <p className=\"text-5xl leading-tight font-extrabold tracking-tight\">{t('auth.brand.tagline')}</p>\n <ul className=\"space-y-4\">\n {PITCHES.map(({ icon: Icon, key }) => (\n <li key={key} className=\"flex items-start gap-3 text-base font-medium\">\n <span className=\"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-brand-panel-foreground/15\">\n <Icon aria-hidden=\"true\" className=\"size-4\" />\n </span>\n {t(key)}\n </li>\n ))}\n </ul>\n </div>\n </aside>\n );\n};\n","import type { ReactNode } from 'react';\nimport { Card, CardContent, CardDescription, CardHeader } from '@/components/ui/card';\nimport { ThemeMenu } from '../ThemeMenu';\nimport { Wordmark } from '../Wordmark';\nimport { BrandPanel } from './BrandPanel';\n\ntype AuthLayoutProps = { title: string; description?: string; children: ReactNode };\n\n/**\n * Frame for the signed-out screens (setup, sign in, invitation, password reset): the cobalt brand panel on\n * the left from lg up, the form card (420px) on the right. Below lg the panel gives way to a compact header.\n */\nexport const AuthLayout = ({ title, description, children }: AuthLayoutProps) => (\n <div className=\"flex min-h-svh bg-background\">\n <BrandPanel />\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <header className=\"flex h-16 items-center justify-end px-4 sm:px-8\">\n <Wordmark className=\"mr-auto lg:hidden\" />\n <ThemeMenu />\n </header>\n <main\n id=\"main\"\n className=\"flex flex-1 items-start justify-center px-4 pt-4 pb-16 sm:items-center sm:px-8 sm:pt-0\"\n >\n <Card className=\"w-full max-w-105\">\n <CardHeader>\n <h1 className=\"text-title\">{title}</h1>\n {description ? <CardDescription>{description}</CardDescription> : null}\n </CardHeader>\n <CardContent>{children}</CardContent>\n </Card>\n </main>\n </div>\n </div>\n);\n","import { useRouter } from '@tanstack/react-router';\nimport { useEffect, useState } from 'react';\n\nconst readFragmentToken = () => new URLSearchParams(window.location.hash.slice(1)).get('token') ?? undefined;\n\n/**\n * The single-use token from an emailed link (`…/reset-password#token=…`). It travels in the URL fragment so\n * it never reaches a server log; once read into memory it is removed from the address bar and history\n * entry, so it can't leak through bookmarks, screenshots or the back button.\n */\nexport const useFragmentToken = (): string | undefined => {\n const router = useRouter();\n const [token] = useState(readFragmentToken);\n useEffect(() => {\n if (window.location.hash) {\n router.history.replace(`${window.location.pathname}${window.location.search}`);\n }\n }, [router]);\n return token;\n};\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport { useNavigate } from '@tanstack/react-router';\nimport { useForm } from 'react-hook-form';\nimport { type z } from 'zod';\nimport { useAcceptInvitation, useInspectInvitation } from '@/api/auth';\nimport { settle } from '@/helpers/settle';\nimport { newPasswordField, requiredText, withPasswordConfirmation } from '@/helpers/validation';\nimport { useFragmentToken } from '@/hooks/useFragmentToken';\n\nconst acceptInvitationSchema = withPasswordConfirmation({\n name: requiredText(),\n password: newPasswordField(),\n});\n\nexport type AcceptInvitationValues = z.infer<typeof acceptInvitationSchema>;\n\n/** Consumes the single-use invitation token (`?token=`) and signs the new admin in. */\nexport const useAcceptInvitationForm = () => {\n const token = useFragmentToken();\n const navigate = useNavigate();\n const accept = useAcceptInvitation();\n const inspection = useInspectInvitation(token);\n const form = useForm<AcceptInvitationValues>({\n resolver: zodResolver(acceptInvitationSchema),\n defaultValues: { name: '', password: '', confirmPassword: '' },\n });\n const onSubmit = form.handleSubmit(async ({ name, password }) => {\n if (!token) {\n return;\n }\n if (!(await settle(accept.mutateAsync({ token, name, password }))).ok) {\n return;\n }\n await navigate({ to: '/', replace: true });\n });\n return { form, onSubmit, accept, inspection, hasToken: Boolean(token) };\n};\n","import { AlertCircle } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { AuthLayout } from '@/components/AuthLayout';\nimport { FormError } from '@/components/FormError';\nimport { FormTextField } from '@/components/FormTextField';\nimport { LoadingState } from '@/components/LoadingState';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { Alert, AlertDescription } from '@/components/ui/alert';\nimport { FieldGroup } from '@/components/ui/field';\nimport { useAcceptInvitationForm } from './hooks/useAcceptInvitationForm';\n\nexport const AcceptInvitation = () => {\n const { t } = useTranslation();\n const { form, onSubmit, accept, inspection, hasToken } = useAcceptInvitationForm();\n if (!hasToken) {\n return (\n <AuthLayout title={t('acceptInvitation.title')}>\n <Alert variant=\"destructive\">\n <AlertCircle aria-hidden=\"true\" />\n <AlertDescription>{t('acceptInvitation.missingToken')}</AlertDescription>\n </Alert>\n </AuthLayout>\n );\n }\n if (inspection.isPending) {\n return (\n <AuthLayout title={t('acceptInvitation.title')}>\n <LoadingState rows={3} />\n </AuthLayout>\n );\n }\n if (inspection.isError) {\n return (\n <AuthLayout title={t('acceptInvitation.title')}>\n <FormError error={inspection.error} />\n </AuthLayout>\n );\n }\n return (\n <AuthLayout\n title={t('acceptInvitation.title')}\n description={t('acceptInvitation.joiningAs', { email: inspection.data.email })}\n >\n <form noValidate onSubmit={(event) => void onSubmit(event)}>\n <FieldGroup>\n <FormTextField\n control={form.control}\n name=\"name\"\n label={t('auth.name')}\n autoComplete=\"name\"\n autoFocus\n />\n <FormTextField\n control={form.control}\n name=\"password\"\n label={t('auth.password')}\n description={t('auth.passwordHint')}\n type=\"password\"\n autoComplete=\"new-password\"\n />\n <FormTextField\n control={form.control}\n name=\"confirmPassword\"\n label={t('auth.confirmPassword')}\n type=\"password\"\n autoComplete=\"new-password\"\n />\n <FormError error={accept.error} />\n <SubmitButton\n pending={accept.isPending}\n pendingLabel={t('acceptInvitation.submitting')}\n size=\"lg\"\n className=\"w-full\"\n >\n {t('acceptInvitation.submit')}\n </SubmitButton>\n </FieldGroup>\n </form>\n </AuthLayout>\n );\n};\n","import { z } from 'zod';\n\n/** Matches the server's limit on `/api/graphql/playground?query=` (constants/graphql.ts). */\nexport const PLAYGROUND_QUERY_MAX_LENGTH = 8192;\n\n/** `/develop/graphql?query=…`: the operation GraphiQL opens on (\"Open in playground\" in the API explorer). */\nexport const graphqlSearchSchema = z.object({\n query: z.string().max(PLAYGROUND_QUERY_MAX_LENGTH).optional().catch(undefined),\n});\n\nexport type GraphqlSearch = z.infer<typeof graphqlSearchSchema>;\n","import { z } from 'zod';\n\n/** `/schema?file=schema/models/article.json`: the open file (the first one when absent or unknown). */\nexport const schemaSearchSchema = z.object({\n file: z.string().trim().min(1).max(300).optional().catch(undefined),\n});\n\nexport type SchemaSearch = z.infer<typeof schemaSearchSchema>;\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { useRequestPasswordReset } from '@/api/auth';\nimport { settle } from '@/helpers/settle';\nimport { emailField } from '@/helpers/validation';\n\nconst forgotPasswordSchema = z.object({ email: emailField() });\n\nexport type ForgotPasswordValues = z.infer<typeof forgotPasswordSchema>;\n\n/** The server answers the same way whether or not the email exists, so the UI does too. */\nexport const useForgotPasswordForm = () => {\n const requestReset = useRequestPasswordReset();\n const form = useForm<ForgotPasswordValues>({\n resolver: zodResolver(forgotPasswordSchema),\n defaultValues: { email: '' },\n });\n const onSubmit = form.handleSubmit(async (values) => {\n await settle(requestReset.mutateAsync(values));\n });\n return {\n form,\n onSubmit,\n requestReset,\n sentTo: requestReset.isSuccess ? requestReset.variables.email : undefined,\n };\n};\n","import { useTranslation } from 'react-i18next';\nimport { AuthLayout } from '@/components/AuthLayout';\nimport { FormError } from '@/components/FormError';\nimport { FormTextField } from '@/components/FormTextField';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { TextLink } from '@/components/TextLink';\nimport { FieldGroup } from '@/components/ui/field';\nimport { useForgotPasswordForm } from './hooks/useForgotPasswordForm';\n\nexport const ForgotPassword = () => {\n const { t } = useTranslation();\n const { form, onSubmit, requestReset, sentTo } = useForgotPasswordForm();\n if (sentTo !== undefined) {\n return (\n <AuthLayout title={t('forgotPassword.sentTitle')}>\n <div className=\"flex flex-col gap-6\">\n <p role=\"status\" className=\"text-sm text-muted-foreground\">\n {t('forgotPassword.sentDescription', { email: sentTo })}\n </p>\n <TextLink to=\"/login\" className=\"self-start text-sm\">\n {t('auth.backToLogin')}\n </TextLink>\n </div>\n </AuthLayout>\n );\n }\n return (\n <AuthLayout title={t('forgotPassword.title')} description={t('forgotPassword.description')}>\n <form noValidate onSubmit={(event) => void onSubmit(event)}>\n <FieldGroup>\n <FormTextField\n control={form.control}\n name=\"email\"\n label={t('auth.email')}\n type=\"email\"\n autoComplete=\"email\"\n autoFocus\n />\n <FormError error={requestReset.error} />\n <SubmitButton\n pending={requestReset.isPending}\n pendingLabel={t('forgotPassword.submitting')}\n size=\"lg\"\n className=\"w-full\"\n >\n {t('forgotPassword.submit')}\n </SubmitButton>\n <TextLink to=\"/login\" className=\"self-center text-sm\">\n {t('auth.backToLogin')}\n </TextLink>\n </FieldGroup>\n </form>\n </AuthLayout>\n );\n};\n","const PROBE_ORIGIN = 'http://shapio.invalid';\n\n// Browsers drop tabs and line breaks from URLs, so `/\\t/evil.test` would become `//evil.test`.\n// eslint-disable-next-line no-control-regex -- matching control characters is the point\nconst CONTROL_CHARACTERS = /[\\u0000-\\u001f\\u007f]/;\n\n/**\n * Only same-app paths are accepted as a post-login destination: `/settings` yes, `//evil.test`,\n * `https://evil.test` or `/\\t/evil.test` no (open redirect). The path must resolve on the current origin.\n */\nexport const safeRedirectPath = (value: unknown): string => {\n if (\n typeof value !== 'string' ||\n !value.startsWith('/') ||\n value.startsWith('//') ||\n value.includes('\\\\') ||\n CONTROL_CHARACTERS.test(value)\n ) {\n return '/';\n }\n return new URL(value, PROBE_ORIGIN).origin === PROBE_ORIGIN ? value : '/';\n};\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport { useNavigate, useSearch } from '@tanstack/react-router';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { useLogin } from '@/api/auth';\nimport { safeRedirectPath } from '@/helpers/safeRedirect';\nimport { settle } from '@/helpers/settle';\nimport { emailField } from '@/helpers/validation';\n\nconst loginSchema = z.object({ email: emailField(), password: z.string().min(1, 'validation.required') });\n\nexport type LoginValues = z.infer<typeof loginSchema>;\n\nexport const useLoginForm = () => {\n const { redirect } = useSearch({ from: '/login' });\n const navigate = useNavigate();\n const login = useLogin();\n const form = useForm<LoginValues>({\n resolver: zodResolver(loginSchema),\n defaultValues: { email: '', password: '' },\n });\n const onSubmit = form.handleSubmit(async (values) => {\n if (!(await settle(login.mutateAsync(values))).ok) {\n return;\n }\n await navigate({ href: safeRedirectPath(redirect), replace: true });\n });\n return { form, onSubmit, login };\n};\n","import { useTranslation } from 'react-i18next';\nimport { AuthLayout } from '@/components/AuthLayout';\nimport { FormError } from '@/components/FormError';\nimport { FormTextField } from '@/components/FormTextField';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { TextLink } from '@/components/TextLink';\nimport { FieldGroup } from '@/components/ui/field';\nimport { useLoginForm } from './hooks/useLoginForm';\n\nexport const Login = () => {\n const { t } = useTranslation();\n const { form, onSubmit, login } = useLoginForm();\n const { control } = form;\n return (\n <AuthLayout title={t('login.title')}>\n <form noValidate onSubmit={(event) => void onSubmit(event)}>\n <FieldGroup>\n <FormTextField\n control={control}\n name=\"email\"\n label={t('auth.email')}\n type=\"email\"\n autoComplete=\"username\"\n autoFocus\n />\n <FormTextField\n control={control}\n name=\"password\"\n label={t('auth.password')}\n type=\"password\"\n autoComplete=\"current-password\"\n />\n <FormError error={login.error} />\n <SubmitButton\n pending={login.isPending}\n pendingLabel={t('login.submitting')}\n size=\"lg\"\n className=\"w-full\"\n >\n {t('login.submit')}\n </SubmitButton>\n <TextLink to=\"/forgot-password\" className=\"self-center text-sm\">\n {t('login.forgotPassword')}\n </TextLink>\n </FieldGroup>\n </form>\n </AuthLayout>\n );\n};\n","import type { ReactNode } from 'react';\nimport { cn } from '@/helpers/cn';\nimport { Logo } from '../Logo';\n\ntype BrandMessageProps = {\n title: string;\n /** One line. */\n description: string;\n /** The way out: one primary button, optionally a secondary one before it. */\n actions: ReactNode;\n className?: string;\n};\n\n/** A whole-screen message on brand (not found, a route that failed): mark, page title, one line, actions. */\nexport const BrandMessage = ({ title, description, actions, className }: BrandMessageProps) => (\n <div className={cn('flex flex-col items-center justify-center gap-6 px-4 py-16 text-center', className)}>\n <Logo className=\"size-12\" />\n <div className=\"space-y-2\">\n <h1 className=\"text-title\">{title}</h1>\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n </div>\n <div className=\"flex flex-wrap items-center justify-center gap-3\">{actions}</div>\n </div>\n);\n","import { Link } from '@tanstack/react-router';\nimport { useTranslation } from 'react-i18next';\nimport { BrandMessage } from '@/components/BrandMessage';\nimport { Button } from '@/components/ui/button';\n\nexport const NotFound = () => {\n const { t } = useTranslation();\n return (\n <main id=\"main\" className=\"flex min-h-svh items-center justify-center bg-background\">\n <BrandMessage\n title={t('notFound.title')}\n description={t('notFound.description')}\n actions={\n <Button asChild size=\"lg\">\n <Link to=\"/\">{t('common.backHome')}</Link>\n </Button>\n }\n />\n </main>\n );\n};\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport { useForm } from 'react-hook-form';\nimport { type z } from 'zod';\nimport { useConfirmPasswordReset } from '@/api/auth';\nimport { settle } from '@/helpers/settle';\nimport { newPasswordField, withPasswordConfirmation } from '@/helpers/validation';\nimport { useFragmentToken } from '@/hooks/useFragmentToken';\n\nconst resetPasswordSchema = withPasswordConfirmation({ password: newPasswordField() });\n\nexport type ResetPasswordValues = z.infer<typeof resetPasswordSchema>;\n\n/** Consumes the single-use token from the emailed link (`?token=`). */\nexport const useResetPasswordForm = () => {\n const token = useFragmentToken();\n const confirmReset = useConfirmPasswordReset();\n const form = useForm<ResetPasswordValues>({\n resolver: zodResolver(resetPasswordSchema),\n defaultValues: { password: '', confirmPassword: '' },\n });\n const onSubmit = form.handleSubmit(async ({ password }) => {\n if (token) {\n await settle(confirmReset.mutateAsync({ token, password }));\n }\n });\n return { form, onSubmit, confirmReset, hasToken: Boolean(token) };\n};\n","import { AlertCircle } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { AuthLayout } from '@/components/AuthLayout';\nimport { FormError } from '@/components/FormError';\nimport { FormTextField } from '@/components/FormTextField';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { TextLink } from '@/components/TextLink';\nimport { Alert, AlertDescription } from '@/components/ui/alert';\nimport { FieldGroup } from '@/components/ui/field';\nimport { useResetPasswordForm } from './hooks/useResetPasswordForm';\n\nexport const ResetPassword = () => {\n const { t } = useTranslation();\n const { form, onSubmit, confirmReset, hasToken } = useResetPasswordForm();\n if (!hasToken) {\n return (\n <AuthLayout title={t('resetPassword.title')}>\n <div className=\"flex flex-col gap-6\">\n <Alert variant=\"destructive\">\n <AlertCircle aria-hidden=\"true\" />\n <AlertDescription>{t('resetPassword.missingToken')}</AlertDescription>\n </Alert>\n <TextLink to=\"/forgot-password\" className=\"self-start text-sm\">\n {t('resetPassword.requestNew')}\n </TextLink>\n </div>\n </AuthLayout>\n );\n }\n if (confirmReset.isSuccess) {\n return (\n <AuthLayout title={t('resetPassword.doneTitle')}>\n <div className=\"flex flex-col gap-6\">\n <p role=\"status\" className=\"text-sm text-muted-foreground\">\n {t('resetPassword.doneDescription')}\n </p>\n <TextLink to=\"/login\" className=\"self-start text-sm\">\n {t('auth.backToLogin')}\n </TextLink>\n </div>\n </AuthLayout>\n );\n }\n return (\n <AuthLayout title={t('resetPassword.title')} description={t('resetPassword.description')}>\n <form noValidate onSubmit={(event) => void onSubmit(event)}>\n <FieldGroup>\n <FormTextField\n control={form.control}\n name=\"password\"\n label={t('auth.newPassword')}\n description={t('auth.passwordHint')}\n type=\"password\"\n autoComplete=\"new-password\"\n autoFocus\n />\n <FormTextField\n control={form.control}\n name=\"confirmPassword\"\n label={t('auth.confirmPassword')}\n type=\"password\"\n autoComplete=\"new-password\"\n />\n <FormError error={confirmReset.error} />\n <SubmitButton\n pending={confirmReset.isPending}\n pendingLabel={t('resetPassword.submitting')}\n size=\"lg\"\n className=\"w-full\"\n >\n {t('resetPassword.submit')}\n </SubmitButton>\n </FieldGroup>\n </form>\n </AuthLayout>\n );\n};\n","import { useTranslation } from 'react-i18next';\nimport { routerBasePath } from '@/app/basePath';\nimport { BrandMessage } from '@/components/BrandMessage';\nimport { Button } from '@/components/ui/button';\n\n/**\n * The URL names a site that doesn't exist (deleted, or a mistyped key). \"Back home\" is a plain link to the\n * admin without a site, so the page loads again for a site the admin works on.\n */\nexport const SiteNotFound = () => {\n const { t } = useTranslation();\n return (\n <main id=\"main\" className=\"flex min-h-svh items-center justify-center bg-background\">\n <BrandMessage\n title={t('sites.notFound.title')}\n description={t('sites.notFound.description')}\n actions={\n <Button asChild size=\"lg\">\n <a href={`${routerBasePath().replace(/\\/$/, '')}/`}>{t('common.backHome')}</a>\n </Button>\n }\n />\n </main>\n );\n};\n","import { useRouter } from '@tanstack/react-router';\nimport { useCallback, useEffect } from 'react';\nimport { logError } from '@/helpers/reportError';\n\n/** Logs the route's error once, and returns `retry`: clear the error boundary and load the route again. */\nexport const useRetryAndLogRouteError = (error: unknown, reset: () => void) => {\n const router = useRouter();\n useEffect(() => {\n logError(error, 'loading or rendering a route');\n }, [error]);\n const retry = useCallback(() => {\n reset();\n void router.invalidate();\n }, [reset, router]);\n return { retry };\n};\n","import { Link, type ErrorComponentProps } from '@tanstack/react-router';\nimport { useTranslation } from 'react-i18next';\nimport { hasErrorCode } from '@/api/errors';\nimport { BrandMessage } from '@/components/BrandMessage';\nimport { Button } from '@/components/ui/button';\nimport { SiteNotFound } from '../SiteNotFound';\nimport { useRetryAndLogRouteError } from './hooks/useRetryAndLogRouteError';\n\n/**\n * The router's default error screen: a route that threw while loading or rendering (a failed code chunk\n * after a deploy, a bug), or a URL naming a site that doesn't exist. In-page query failures use `ErrorState`\n * instead.\n */\nexport const RouteError = ({ error, reset }: ErrorComponentProps) => {\n const { t } = useTranslation();\n const { retry } = useRetryAndLogRouteError(error, reset);\n if (hasErrorCode(error, 'SITE_NOT_FOUND')) {\n return <SiteNotFound />;\n }\n return (\n <div role=\"alert\" className=\"flex min-h-full flex-1 items-center justify-center\">\n <BrandMessage\n title={t('routeError.title')}\n description={t('routeError.description')}\n actions={\n <>\n <Button variant=\"outline\" size=\"lg\" onClick={retry}>\n {t('common.retry')}\n </Button>\n <Button asChild size=\"lg\">\n <Link to=\"/\" onClick={reset}>\n {t('common.backHome')}\n </Link>\n </Button>\n </>\n }\n />\n </div>\n );\n};\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport { useNavigate } from '@tanstack/react-router';\nimport { useMemo } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { useSetup, useSetupStatus } from '@/api/auth';\nimport { settle } from '@/helpers/settle';\nimport { emailField, newPasswordField, requiredText, withPasswordConfirmation } from '@/helpers/validation';\nimport { useFragmentToken } from '@/hooks/useFragmentToken';\n\n/** The token is asked for (and validated) only when the server requires it (SETUP_REQUIRE_TOKEN). */\nconst buildSetupSchema = (requiresToken: boolean) =>\n withPasswordConfirmation({\n token: requiresToken ? requiredText() : z.string(),\n name: requiredText(),\n email: emailField(),\n password: newPasswordField(),\n });\n\nexport type SetupValues = z.infer<ReturnType<typeof buildSetupSchema>>;\n\n/**\n * First-run owner account. By default whoever opens Setup first creates the owner; when the server says\n * `requiresToken`, the one-time setup token from the server log is needed too.\n */\nexport const useSetupFormAndTokenRequirement = () => {\n const token = useFragmentToken();\n const navigate = useNavigate();\n const setup = useSetup();\n // The route guard has loaded the status before this screen renders.\n const requiresToken = useSetupStatus().data?.requiresToken ?? false;\n const schema = useMemo(() => buildSetupSchema(requiresToken), [requiresToken]);\n const form = useForm<SetupValues>({\n resolver: zodResolver(schema),\n defaultValues: { token: token ?? '', name: '', email: '', password: '', confirmPassword: '' },\n });\n const onSubmit = form.handleSubmit(async ({ token: setupToken, name, email, password }) => {\n const input = { name, email, password, ...(requiresToken ? { token: setupToken.trim() } : {}) };\n if (!(await settle(setup.mutateAsync(input))).ok) {\n return;\n }\n await navigate({ to: '/', replace: true });\n });\n return { form, onSubmit, setup, requiresToken };\n};\n","import { useTranslation } from 'react-i18next';\nimport { AuthLayout } from '@/components/AuthLayout';\nimport { FormError } from '@/components/FormError';\nimport { FormTextField } from '@/components/FormTextField';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { FieldGroup } from '@/components/ui/field';\nimport { useSetupFormAndTokenRequirement } from './hooks/useSetupFormAndTokenRequirement';\n\nexport const Setup = () => {\n const { t } = useTranslation();\n const { form, onSubmit, setup, requiresToken } = useSetupFormAndTokenRequirement();\n const { control } = form;\n return (\n <AuthLayout title={t('setup.title')} description={t('setup.description')}>\n <form noValidate onSubmit={(event) => void onSubmit(event)}>\n <FieldGroup>\n {requiresToken && (\n <FormTextField\n control={control}\n name=\"token\"\n label={t('setup.token')}\n description={t('setup.tokenHint')}\n hint={t('setup.tokenMore')}\n autoComplete=\"off\"\n spellCheck={false}\n className=\"font-mono\"\n />\n )}\n <FormTextField control={control} name=\"name\" label={t('auth.name')} autoComplete=\"name\" />\n <FormTextField\n control={control}\n name=\"email\"\n label={t('auth.email')}\n type=\"email\"\n autoComplete=\"email\"\n />\n <FormTextField\n control={control}\n name=\"password\"\n label={t('auth.password')}\n description={t('auth.passwordHint')}\n type=\"password\"\n autoComplete=\"new-password\"\n />\n <FormTextField\n control={control}\n name=\"confirmPassword\"\n label={t('auth.confirmPassword')}\n type=\"password\"\n autoComplete=\"new-password\"\n />\n <FormError error={setup.error} />\n <SubmitButton\n pending={setup.isPending}\n pendingLabel={t('setup.submitting')}\n size=\"lg\"\n className=\"w-full\"\n >\n {t('setup.submit')}\n </SubmitButton>\n </FieldGroup>\n </form>\n </AuthLayout>\n );\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { PanelLeftIcon } from 'lucide-react';\nimport { Slot } from 'radix-ui';\nimport * as React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '@/components/ui/button';\nimport { Input } from '@/components/ui/input';\nimport { Separator } from '@/components/ui/separator';\nimport { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '@/components/ui/sheet';\nimport { Skeleton } from '@/components/ui/skeleton';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\nimport { cn } from '@/helpers/cn';\nimport { useIsMobile } from '@/hooks/use-mobile';\n\nconst SIDEBAR_WIDTH = '16rem';\nconst SIDEBAR_WIDTH_MOBILE = '18rem';\nconst SIDEBAR_WIDTH_ICON = '3rem';\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b';\n\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n\n // Shapio: no cookie; the caller persists the state (stores/ui.ts) through `open`/`onOpenChange`.\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // Shapio: a focused editor that already handled the keys (rich-text bold) keeps them.\n if (\n !event.defaultPrevented &&\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n 'group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = 'left',\n variant = 'sidebar',\n collapsible = 'offcanvas',\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n side?: 'left' | 'right';\n variant?: 'sidebar' | 'floating' | 'inset';\n collapsible?: 'offcanvas' | 'icon' | 'none';\n}) {\n const { t } = useTranslation();\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n 'flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>{t('common.sidebar')}</SheetTitle>\n <SheetDescription>{t('common.sidebarDescription')}</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground lg:block\"\n data-state={state}\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n 'relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)',\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear lg:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className,\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n const { t } = useTranslation();\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn('size-8 text-muted-foreground hover:text-foreground', className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">{t('common.toggleSidebar')}</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {\n const { t } = useTranslation();\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label={t('common.toggleSidebar')}\n tabIndex={-1}\n onClick={toggleSidebar}\n title={t('common.toggleSidebar')}\n className={cn(\n 'absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex',\n 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n 'relative flex w-full flex-1 flex-col bg-background',\n 'md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn('h-8 w-full bg-background shadow-none', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn('flex flex-col gap-2 p-2', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn('flex flex-col gap-2 p-2', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn('mx-2 w-auto bg-sidebar-border', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n 'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn('relative flex w-full min-w-0 flex-col p-2', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<'div'> & { asChild?: boolean }) {\n const Comp = asChild ? Slot.Root : 'div';\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n 'flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> & { asChild?: boolean }) {\n const Comp = asChild ? Slot.Root : 'button';\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n 'absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 md:after:hidden',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn('w-full text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn('flex w-full min-w-0 flex-col gap-1', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn('group/menu-item relative', className)}\n {...props}\n />\n );\n}\n\n// Shapio: 40px nav items with 18px icons; the active item is a pill with a 3px bar on its left (DESIGN.md).\nconst sidebarMenuButtonVariants = cva(\n 'peer/menu-button relative flex w-full items-center gap-2 overflow-hidden rounded-lg p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n {\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n /**\n * A main-navigation destination: 18px icon. Active is one signal: the `sidebar-accent` fill, with the\n * label at its normal weight and colour and only the icon in the accent (`sidebar-primary`).\n */\n nav: 'gap-3 font-medium hover:bg-sidebar-accent/70 hover:text-sidebar-foreground data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground data-[active=true]:hover:bg-sidebar-accent data-[active=true]:hover:text-sidebar-foreground [&>svg]:size-[18px] data-[active=true]:[&>svg]:text-sidebar-primary',\n outline:\n 'bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]',\n },\n size: {\n default: 'h-8 text-sm',\n /** Shapio: main navigation rows (40px). */\n nav: 'h-10 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = 'default',\n size = 'default',\n tooltip,\n className,\n ...props\n}: React.ComponentProps<'button'> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? Slot.Root : 'button';\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === 'string') {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent side=\"right\" align=\"center\" hidden={state !== 'collapsed' || isMobile} {...tooltip} />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<'button'> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : 'button';\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n 'absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 md:after:hidden',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n showOnHover &&\n 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n 'pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none',\n 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<'div'> & {\n showIcon?: boolean;\n}) {\n // Shapio: fixed width (shadcn used Math.random, which is impure during render).\n const width = '70%';\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n {...props}\n >\n {showIcon && <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" />}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n 'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn('group/menu-sub-item relative', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = 'md',\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<'a'> & {\n asChild?: boolean;\n size?: 'sm' | 'md';\n isActive?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : 'a';\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n 'flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',\n 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',\n size === 'sm' && 'text-xs',\n size === 'md' && 'text-sm',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","import { useCallback } from 'react';\nimport { usePaletteStore } from '../store';\n\n/** Opens the palette (the sidebar's search button; on phones there is no ⌘K). */\nexport const useOpenCommandPalette = () => {\n const setOpen = usePaletteStore((state) => state.setOpen);\n return useCallback(() => setOpen(true), [setOpen]);\n};\n","import { Link } from '@tanstack/react-router';\nimport { ChevronsUpDown, LogOut, Palette, UserRound } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useLogout, useMe } from '@/api/auth';\nimport { ThemeMenuContent } from '@/components/ThemeMenu/Content';\nimport { Avatar, AvatarFallback } from '@/components/ui/avatar';\nimport { Button } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';\nimport { initialsOf } from '@/helpers/initials';\nimport { useDiscardGuard } from '@/hooks/useDiscardGuard';\nimport { useSessionStore } from '@/stores/session';\n\ntype UserMenuProps = {\n /** `sidebar`: name and email in the sidebar footer. `compact`: just the avatar (the phone header). */\n variant?: 'sidebar' | 'compact';\n};\n\n/** Signed-in admin, with Profile, Theme and Sign out. */\nexport const UserMenu = ({ variant = 'sidebar' }: UserMenuProps) => {\n const { t } = useTranslation();\n const { data: me } = useMe();\n const logout = useLogout();\n // Signing out over unsaved edits (any screen's) asks first, like leaving the page does.\n const unsavedEdits = useSessionStore((state) => state.unsavedEdits > 0);\n const signOut = useDiscardGuard({\n dirty: unsavedEdits,\n registersEdits: false,\n onOpenChange: (open) => {\n if (!open) {\n logout.mutate();\n }\n },\n });\n if (!me) {\n return null;\n }\n const { user } = me;\n const displayName = user.name || user.email;\n const avatar = (\n <Avatar className=\"size-8 rounded-lg\">\n <AvatarFallback className=\"rounded-lg bg-accent text-xs font-semibold text-accent-foreground dark:bg-muted\">\n {initialsOf(displayName)}\n </AvatarFallback>\n </Avatar>\n );\n const content = (\n <DropdownMenuContent\n side={variant === 'sidebar' ? 'top' : 'bottom'}\n align={variant === 'sidebar' ? 'start' : 'end'}\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56\"\n >\n <DropdownMenuLabel className=\"font-normal\">\n <span className=\"block text-xs text-muted-foreground\">{t('userMenu.signedInAs')}</span>\n <span className=\"block truncate font-medium\">{user.email}</span>\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuItem asChild>\n <Link to=\"/settings/profile\">\n <UserRound aria-hidden=\"true\" />\n {t('userMenu.profile')}\n </Link>\n </DropdownMenuItem>\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>\n <Palette aria-hidden=\"true\" />\n {t('theme.label')}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"min-w-52\">\n <ThemeMenuContent />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n <DropdownMenuSeparator />\n <DropdownMenuItem onSelect={() => signOut.requestOpenChange(false)} disabled={logout.isPending}>\n <LogOut aria-hidden=\"true\" />\n {t('userMenu.signOut')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n );\n if (variant === 'compact') {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"rounded-lg\" aria-label={t('userMenu.label')}>\n {avatar}\n </Button>\n </DropdownMenuTrigger>\n {content}\n {signOut.discardPrompt}\n </DropdownMenu>\n );\n }\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton size=\"lg\" aria-label={t('userMenu.label')}>\n {avatar}\n <span className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-semibold\">{displayName}</span>\n <span className=\"truncate text-xs text-muted-foreground\">{user.email}</span>\n </span>\n <ChevronsUpDown className=\"ml-auto\" aria-hidden=\"true\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n {content}\n </DropdownMenu>\n {signOut.discardPrompt}\n </SidebarMenuItem>\n </SidebarMenu>\n );\n};\n","import { Link } from '@tanstack/react-router';\nimport { Search } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useOpenCommandPalette } from '@/components/CommandPalette/hooks/useOpenCommandPalette';\nimport { Button } from '@/components/ui/button';\nimport { SidebarTrigger } from '@/components/ui/sidebar';\nimport { Wordmark } from '@/components/Wordmark';\nimport { UserMenu } from '../UserMenu';\n\n/** Below lg only: the sidebar is a sheet, so this 48px row holds its trigger, the brand, search, the theme switch and the account. */\ntype MobileBarProps = {\n /** Search (the ⌘K palette); off where there is nothing to search (no role on the site). */\n searchable: boolean;\n};\n\nexport const MobileBar = ({ searchable }: MobileBarProps) => {\n const { t } = useTranslation();\n const openPalette = useOpenCommandPalette();\n return (\n <div\n data-slot=\"mobile-bar\"\n className=\"sticky top-0 z-30 flex h-12 shrink-0 items-center gap-2 border-b bg-background/95 px-2 backdrop-blur supports-[backdrop-filter]:bg-background/80 sm:px-4 lg:hidden\"\n >\n <SidebarTrigger className=\"size-9\" />\n <Link\n to=\"/\"\n aria-label={t('shell.home')}\n className=\"rounded-md outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n >\n <Wordmark size=\"sm\" />\n </Link>\n <div className=\"flex-1\" />\n {searchable ? (\n <Button variant=\"ghost\" size=\"icon\" aria-label={t('shell.search')} onClick={openPalette}>\n <Search aria-hidden=\"true\" />\n </Button>\n ) : null}\n <UserMenu variant=\"compact\" />\n </div>\n );\n};\n","import { Link } from '@tanstack/react-router';\nimport { useTranslation } from 'react-i18next';\nimport { SharedGlyph } from '@/components/SharedGlyph';\nimport { SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';\nimport { cn } from '@/helpers/cn';\nimport type { ShellNavItem } from '../hooks/useShellNavGroups';\n\ntype NavItemProps = { item: ShellNavItem; isActive: boolean };\n\n/**\n * A sidebar destination (active state from the router), with a place's entry count on the right and a\n * small globe after a place shared with all sites.\n */\nexport const NavItem = ({ item, isActive }: NavItemProps) => {\n const { t } = useTranslation();\n const Icon = item.icon;\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n asChild\n variant=\"nav\"\n size=\"nav\"\n isActive={isActive}\n tooltip={item.label}\n className={cn(item.variant === 'add' && 'text-muted-foreground', item.count !== undefined && 'pr-10')}\n >\n <Link\n {...item.link}\n aria-current={isActive ? 'page' : undefined}\n aria-description={item.shared ? t('contentTypes.sharedWithAllSites') : undefined}\n >\n <Icon aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{item.label}</span>\n {item.shared ? <SharedGlyph decorative className=\"group-data-[collapsible=icon]:hidden\" /> : null}\n </Link>\n </SidebarMenuButton>\n {item.count !== undefined ? (\n <SidebarMenuBadge className=\"top-2.5 right-2 text-muted-foreground\">\n {item.count.toLocaleString()}\n </SidebarMenuBadge>\n ) : null}\n </SidebarMenuItem>\n );\n};\n","import { Search } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useOpenCommandPalette } from '@/components/CommandPalette/hooks/useOpenCommandPalette';\nimport { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';\nimport { useShortcutLabel } from '../hooks/useShortcutLabel';\n\n/** Opens the ⌘K palette: the visible way in, and the only one on touch screens. */\nexport const SearchButton = () => {\n const { t } = useTranslation();\n const open = useOpenCommandPalette();\n const shortcut = useShortcutLabel('K');\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton\n variant=\"outline\"\n size=\"nav\"\n tooltip={t('shell.search')}\n aria-keyshortcuts=\"Meta+K Control+K\"\n onClick={open}\n className=\"gap-3 text-muted-foreground\"\n >\n <Search aria-hidden=\"true\" />\n <span className=\"flex-1\">{t('shell.search')}</span>\n <kbd className=\"rounded border bg-background px-1.5 font-sans text-2xs text-muted-foreground group-data-[collapsible=icon]:hidden\">\n {shortcut}\n </kbd>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n};\n","import { useLocation } from '@tanstack/react-router';\nimport { isNetworkPath } from '@/app/sitePaths';\n\n/** Whether the current screen is a network page (`/network/*`) rather than one of the site's. */\nexport const useIsNetworkView = () => useLocation({ select: (location) => isNetworkPath(location.pathname) });\n","import type { SiteSummary } from '@shapio/client';\nimport { useNavigate } from '@tanstack/react-router';\nimport { useCallback } from 'react';\nimport { useMe } from '@/api/auth';\nimport { goToSite } from '@/app/currentSite';\nimport { canSeeNetwork } from '@/helpers/sites';\nimport { useIsNetworkView } from './useIsNetworkView';\n\n/**\n * The site switcher's data and actions. Opening another site is a full navigation (a fresh query cache);\n * the network view and this site's own pages share the page load, so they are ordinary route changes.\n */\nexport const useSiteSwitcher = () => {\n const { data: me } = useMe();\n const navigate = useNavigate();\n const isNetworkView = useIsNetworkView();\n const site = me?.site;\n const openSite = useCallback(\n (target: SiteSummary) => {\n if (target.id === site?.id) {\n void navigate({ to: '/' });\n return;\n }\n goToSite(target.key);\n },\n [navigate, site?.id],\n );\n const openNetwork = useCallback(() => void navigate({ to: '/network' }), [navigate]);\n return {\n site,\n sites: me?.sites ?? [],\n isNetworkView,\n showNetwork: canSeeNetwork(me),\n openSite,\n openNetwork,\n };\n};\n","import { Check, ChevronsUpDown, Globe } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';\nimport { initialsOf } from '@/helpers/initials';\nimport { useSiteSwitcher } from '../hooks/useSiteSwitcher';\n\nconst TILE =\n 'flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-xs font-semibold text-foreground [&_svg]:size-4';\n\n/**\n * The sidebar header's site switcher (sites plan §H): the site this page works on, the other sites the admin\n * works on, and the network view for admins who hold a network action. Choosing another site opens it.\n */\nexport const SiteSwitcher = () => {\n const { t } = useTranslation();\n const { site, sites, isNetworkView, showNetwork, openSite, openNetwork } = useSiteSwitcher();\n if (!site) {\n return null;\n }\n const currentName = isNetworkView ? t('sites.network') : site.name;\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n {/* Not modal: the page behind isn't hidden from assistive technology while the short list is open. */}\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton size=\"lg\" aria-label={t('sites.switcher.label', { name: currentName })}>\n <span aria-hidden=\"true\" className={TILE}>\n {isNetworkView ? <Globe /> : initialsOf(site.name)}\n </span>\n <span className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-semibold\">{currentName}</span>\n <span className=\"truncate text-xs text-muted-foreground\">\n {isNetworkView ? t('sites.switcher.allSites') : site.key}\n </span>\n </span>\n <ChevronsUpDown className=\"ml-auto\" aria-hidden=\"true\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n side=\"bottom\"\n align=\"start\"\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56\"\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n {t('sites.switcher.sites')}\n </DropdownMenuLabel>\n {sites.map((item) => {\n const isCurrent = !isNetworkView && item.id === site.id;\n return (\n <DropdownMenuItem\n key={item.id}\n aria-current={isCurrent ? 'page' : undefined}\n onSelect={() => openSite(item)}\n >\n <span aria-hidden=\"true\" className={TILE}>\n {initialsOf(item.name)}\n </span>\n <span className=\"grid flex-1 leading-tight\">\n <span className=\"truncate\">{item.name}</span>\n <span className=\"truncate text-xs text-muted-foreground\">{item.key}</span>\n </span>\n {isCurrent ? <Check className=\"ml-auto\" aria-hidden=\"true\" /> : null}\n </DropdownMenuItem>\n );\n })}\n {showNetwork ? (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem aria-current={isNetworkView ? 'page' : undefined} onSelect={openNetwork}>\n <span aria-hidden=\"true\" className={TILE}>\n <Globe />\n </span>\n <span className=\"flex-1\">{t('sites.network')}</span>\n {isNetworkView ? <Check className=\"ml-auto\" aria-hidden=\"true\" /> : null}\n </DropdownMenuItem>\n </>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n};\n","import { Link } from '@tanstack/react-router';\nimport { memo, useId } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarRail,\n Sidebar as SidebarRoot,\n SidebarTrigger,\n useSidebar,\n} from '@/components/ui/sidebar';\nimport { Wordmark } from '@/components/Wordmark';\nimport type { ShellNavGroup } from '../hooks/useShellNavGroups';\nimport { NavItem } from '../NavItem';\nimport { SearchButton } from '../SearchButton';\nimport { SiteSwitcher } from '../SiteSwitcher';\nimport { UserMenu } from '../UserMenu';\n\ntype SidebarProps = {\n groups: readonly ShellNavGroup[];\n activeKey: string | undefined;\n /** Search (the ⌘K palette); off where there is nothing to search (no role on the site). */\n searchable: boolean;\n};\n\ntype GroupProps = { group: ShellNavGroup; activeKey: string | undefined };\n\n/** One labelled list of destinations (Content, Develop, Workspace) or an unlabelled one. */\nconst Group = ({ group, activeKey }: GroupProps) => {\n const labelId = useId();\n return (\n <SidebarGroup className=\"px-3 py-1\">\n {group.label ? <SidebarGroupLabel id={labelId}>{group.label}</SidebarGroupLabel> : null}\n <SidebarGroupContent>\n <SidebarMenu className=\"gap-1\" aria-labelledby={group.label ? labelId : undefined}>\n {group.items.map((item) => (\n <NavItem key={item.key} item={item} isActive={item.key === activeKey} />\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n );\n};\n\n/**\n * Wordmark, the site switcher and search, the navigation groups, and the account menu with the theme switch. Memoized: the shell re-renders on\n * every location change (search params included), the sidebar only when its groups or active item change.\n */\nexport const Sidebar = memo(function Sidebar({ groups, activeKey, searchable }: SidebarProps) {\n const { t } = useTranslation();\n const { isMobile } = useSidebar();\n return (\n <SidebarRoot collapsible=\"icon\">\n <SidebarHeader className=\"gap-3 px-3 pt-4 pb-2 group-data-[collapsible=icon]:px-2\">\n <div className=\"flex items-center justify-between gap-2 group-data-[collapsible=icon]:flex-col\">\n <Link\n to=\"/\"\n aria-label={t('shell.home')}\n className=\"rounded-md px-1 outline-none group-data-[collapsible=icon]:px-0 focus-visible:ring-[3px] focus-visible:ring-sidebar-ring/50\"\n >\n <Wordmark className=\"group-data-[collapsible=icon]:[&>[data-slot=wordmark-letters]]:hidden group-data-[collapsible=icon]:[&>svg]:h-8\" />\n </Link>\n {/* The sheet closes with Escape or a tap outside; the visible trigger is for the desktop column. */}\n {isMobile ? null : <SidebarTrigger />}\n </div>\n <SiteSwitcher />\n {searchable ? <SearchButton /> : null}\n </SidebarHeader>\n <SidebarContent>\n <nav aria-label={t('shell.mainNavigation')}>\n {groups.map((group) => (\n <Group key={group.key} group={group} activeKey={activeKey} />\n ))}\n </nav>\n </SidebarContent>\n <SidebarFooter className=\"flex-row items-center gap-1 px-3 pb-4 group-data-[collapsible=icon]:flex-col\">\n <div className=\"min-w-0 flex-1\">\n <UserMenu />\n </div>\n </SidebarFooter>\n <SidebarRail />\n </SidebarRoot>\n );\n});\n","import { useTranslation } from 'react-i18next';\nimport { useSchemaVersion } from '@/api/schema';\nimport { Wordmark } from '@/components/Wordmark';\n\ntype StatusBarProps = { section: string | undefined };\n\n/**\n * The 32px bar under every screen (md and up): where you are, and that the schema is live. Plain text, not\n * a live region: it changes with navigation and schema activations, and announcing that would be noise.\n */\nexport const StatusBar = ({ section }: StatusBarProps) => {\n const { t } = useTranslation();\n const { data: schemaVersion } = useSchemaVersion();\n return (\n <div\n data-slot=\"status-bar\"\n className=\"sticky bottom-0 z-20 hidden h-(--statusbar-h) shrink-0 items-center justify-between gap-4 border-t bg-background px-4 text-xs sm:px-8 md:flex\"\n >\n <div className=\"flex min-w-0 items-center gap-3\">\n <Wordmark size=\"sm\" className=\"opacity-80\" />\n {section ? (\n <>\n <span aria-hidden=\"true\" className=\"h-3.5 w-px bg-border\" />\n <span className=\"truncate font-semibold tracking-wide text-muted-foreground uppercase\">\n {section}\n </span>\n </>\n ) : null}\n </div>\n {schemaVersion !== undefined ? (\n <p className=\"flex items-center gap-2 truncate text-muted-foreground\">\n <span aria-hidden=\"true\" className=\"size-1.5 shrink-0 rounded-full bg-success\" />\n {t('statusBar.schema', { version: schemaVersion })}\n </p>\n ) : null}\n </div>\n );\n};\n","import type { ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';\nimport { useUiStore } from '@/stores/ui';\nimport type { ShellNavGroup } from '../hooks/useShellNavGroups';\nimport { MobileBar } from '../MobileBar';\nimport { Sidebar } from '../Sidebar';\nimport { StatusBar } from '../StatusBar';\n\ntype FrameProps = {\n groups: readonly ShellNavGroup[];\n activeKey: string | undefined;\n /** The status bar's section name. */\n section: string | undefined;\n searchable: boolean;\n children: ReactNode;\n};\n\n/** The signed-in frame: skip link, sidebar, the phone bar, the screen and the status bar. */\nexport const Frame = ({ groups, activeKey, section, searchable, children }: FrameProps) => {\n const { t } = useTranslation();\n const sidebarOpen = useUiStore((state) => state.sidebarOpen);\n const setSidebarOpen = useUiStore((state) => state.setSidebarOpen);\n return (\n <SidebarProvider open={sidebarOpen} onOpenChange={setSidebarOpen}>\n <a\n href=\"#main\"\n className=\"sr-only z-50 rounded-md bg-primary px-4 py-2 text-primary-foreground focus:not-sr-only focus:fixed focus:top-2 focus:left-2\"\n >\n {t('app.skipToContent')}\n </a>\n <Sidebar groups={groups} activeKey={activeKey} searchable={searchable} />\n <SidebarInset className=\"min-w-0\">\n <MobileBar searchable={searchable} />\n <div id=\"main\" tabIndex={-1} className=\"min-w-0 flex-1 px-4 py-7 outline-none sm:px-8\">\n {children}\n </div>\n <StatusBar section={section} />\n </SidebarInset>\n </SidebarProvider>\n );\n};\n","import { useEffect } from 'react';\nimport { usePaletteStore } from '../store';\n\n/**\n * ⌘K (Ctrl+K elsewhere) toggles the palette from anywhere, inputs and editors included: it listens in the\n * capture phase so it runs before an editor's own key handling (rich text links moved to ⌘⇧K).\n */\nexport const usePaletteShortcut = () => {\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (\n (event.metaKey || event.ctrlKey) &&\n !event.altKey &&\n !event.shiftKey &&\n event.key.toLowerCase() === 'k'\n ) {\n event.preventDefault();\n const { open, setOpen } = usePaletteStore.getState();\n setOpen(!open);\n }\n };\n window.addEventListener('keydown', onKeyDown, { capture: true });\n return () => window.removeEventListener('keydown', onKeyDown, { capture: true });\n }, []);\n};\n","import { Dialog as DialogPrimitive } from 'radix-ui';\nimport { lazy, Suspense } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { LoadingState } from '../LoadingState';\nimport { usePaletteShortcut } from './hooks/usePaletteShortcut';\nimport { usePaletteStore } from './store';\n\nconst Body = lazy(() => import('./Body').then((module) => ({ default: module.Body })));\n\n/**\n * ⌘K: go anywhere (places, entries, media, settings), create, and act on the current page. The one\n * centred overlay the admin allows (DESIGN.md): a transient launcher with nothing to lose, so it never\n * holds a form. Modal for assistive technology (focus trapped, page inert); Escape or a click outside\n * closes it and focus returns to where it was. Mounted once by the Shell.\n */\nexport const CommandPalette = () => {\n const { t } = useTranslation();\n const open = usePaletteStore((state) => state.open);\n const setOpen = usePaletteStore((state) => state.setOpen);\n usePaletteShortcut();\n return (\n <DialogPrimitive.Root open={open} onOpenChange={setOpen}>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-overlay/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\" />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n // Opened by a shortcut there is no trigger to return to: focus goes back to what had it, if it is\n // still on the page (a palette choice may have navigated away).\n onCloseAutoFocus={(event) => {\n const target = usePaletteStore.getState().returnFocus;\n if (target?.isConnected) {\n event.preventDefault();\n target.focus();\n }\n }}\n className=\"fixed top-4 left-1/2 z-50 flex w-[calc(100%-2rem)] max-w-xl -translate-x-1/2 flex-col overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-lg outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 sm:top-[12dvh]\"\n >\n <DialogPrimitive.Title className=\"sr-only\">{t('palette.title')}</DialogPrimitive.Title>\n <Suspense fallback={<LoadingState rows={3} className=\"p-4\" />}>\n <Body onClose={() => setOpen(false)} />\n </Suspense>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n","import { useMatchRoute } from '@tanstack/react-router';\nimport type { ShellNavGroup } from './useShellNavGroups';\n\n/**\n * The key of the item the current route belongs to: the most specific match, so `/settings/roles` marks\n * Roles rather than Settings, and an entry marks its place.\n */\nexport const useActiveNavKey = (groups: readonly ShellNavGroup[]): string | undefined => {\n const matchRoute = useMatchRoute();\n let best: { key: string; length: number } | undefined;\n for (const item of groups.flatMap((group) => group.items)) {\n if (!matchRoute({ ...item.link, fuzzy: !item.exact })) {\n continue;\n }\n const length = String(item.link.to ?? '').length;\n if (!best || length > best.length) {\n best = { key: item.key, length };\n }\n }\n return best?.key;\n};\n","import type { GlobalAction, NetworkAction } from '@shapio/client';\nimport type { ParseKeys } from 'i18next';\nimport {\n Activity,\n Blocks,\n Boxes,\n Braces,\n Camera,\n FileCode2,\n GitPullRequestArrow,\n Globe,\n Globe2,\n Image,\n Inbox,\n KeyRound,\n ScrollText,\n Send,\n Settings,\n ShieldCheck,\n SquareTerminal,\n Users,\n UsersRound,\n Webhook,\n type LucideIcon,\n} from 'lucide-react';\n\n/** What the admin may see, worked out once from `me` (helpers/modelPermissions). */\nexport type NavAccess = {\n globalPermissions: readonly GlobalAction[];\n /** Actions from roles on every site only (`schema.create` here means shared definitions and locales). */\n networkPermissions: readonly NetworkAction[];\n /** `schema.create`, or `schemaManage` on any model. */\n schema: boolean;\n /** Any network action, so the network view opens (helpers/sites `canSeeNetwork`). */\n network: boolean;\n};\n\nexport type NavPath =\n | '/'\n | '/media'\n | '/publishing'\n | '/publishing/webhooks'\n | '/develop/components'\n | '/changes'\n | '/snapshots'\n | '/schema'\n | '/api-explorer'\n | '/develop/graphql'\n | '/live'\n | '/settings/api-tokens'\n | '/users/app'\n | '/settings/locales'\n | '/settings'\n | '/network'\n | '/network/sites'\n | '/network/content-types'\n | '/network/users'\n | '/network/roles'\n | '/network/audit-log';\n\n/**\n * `permission` counts site and network roles; `networkPermission` only roles on every site (for actions a\n * site role can also grant for its own site, such as `schema.create`, where the screen needs every site).\n */\ntype NavRequirement = {\n permission?: GlobalAction;\n networkPermission?: NetworkAction;\n schema?: boolean;\n /** Shown only to admins who can open the network view. */\n network?: boolean;\n};\n\n/** A fixed destination; `exact` items match only their own path (the Inbox at `/`). */\nexport type NavItemDefinition = NavRequirement & {\n key: string;\n labelKey: ParseKeys;\n icon: LucideIcon;\n to: NavPath;\n exact?: boolean;\n};\n\nexport const isVisible = (item: NavRequirement, access: NavAccess) =>\n (!item.permission || access.globalPermissions.includes(item.permission)) &&\n (!item.networkPermission || access.networkPermissions.includes(item.networkPermission)) &&\n (!item.schema || access.schema) &&\n (!item.network || access.network);\n\n/** Above the places: the Inbox is home for everyone. */\nexport const INBOX_ITEM = {\n key: 'inbox',\n labelKey: 'shell.nav.inbox',\n icon: Inbox,\n to: '/',\n exact: true,\n} as const satisfies NavItemDefinition;\n\n/** Below the places. */\nexport const CONTENT_ITEMS: readonly NavItemDefinition[] = [\n { key: 'media', labelKey: 'shell.nav.media', icon: Image, to: '/media', permission: 'media.read' },\n { key: 'publishing', labelKey: 'shell.nav.publishing', icon: Send, to: '/publishing' },\n // Change sets are how editors and developers ship together, so they sit with Publishing.\n {\n key: 'changes',\n labelKey: 'shell.nav.changes',\n icon: GitPullRequestArrow,\n to: '/changes',\n permission: 'changes.manage',\n },\n];\n\n/**\n * Developer areas (plan developer-face §2): the group shows only with tokens or webhooks management or a\n * schema permission (helpers/modelPermissions `canSeeDevelop`).\n */\nexport const DEVELOP_ITEMS: readonly NavItemDefinition[] = [\n {\n key: 'snapshots',\n labelKey: 'shell.nav.snapshots',\n icon: Camera,\n to: '/snapshots',\n permission: 'changes.manage',\n },\n { key: 'schema', labelKey: 'shell.nav.schema', icon: FileCode2, to: '/schema', schema: true },\n {\n key: 'components',\n labelKey: 'shell.nav.components',\n icon: Blocks,\n to: '/develop/components',\n schema: true,\n },\n { key: 'apiExplorer', labelKey: 'shell.nav.apiExplorer', icon: SquareTerminal, to: '/api-explorer' },\n { key: 'graphql', labelKey: 'shell.nav.graphql', icon: Braces, to: '/develop/graphql' },\n { key: 'live', labelKey: 'shell.nav.live', icon: Activity, to: '/live' },\n {\n key: 'apiTokens',\n labelKey: 'shell.nav.apiTokens',\n icon: KeyRound,\n to: '/settings/api-tokens',\n permission: 'tokens.manage',\n },\n {\n key: 'webhooks',\n labelKey: 'shell.nav.webhooks',\n icon: Webhook,\n to: '/publishing/webhooks',\n permission: 'webhooks.manage',\n },\n];\n\n/**\n * Team: the admin users, who live in the network view (they are about every site). Listed in the site view\n * too, so people looking for how to add an editor find it; it needs `users.manage` from a role on every\n * site, since only those roles open the network view.\n */\nexport const TEAM_ITEM = {\n key: 'team',\n labelKey: 'shell.nav.team',\n icon: Users,\n to: '/network/users',\n networkPermission: 'users.manage',\n} as const satisfies NavItemDefinition;\n\n/**\n * The site's people (Team, then app users), the shared locales, settings, and a way into the network view\n * (also in the site switcher), each with the permission its screen needs.\n */\nexport const WORKSPACE_ITEMS: readonly NavItemDefinition[] = [\n TEAM_ITEM,\n {\n key: 'appUsers',\n labelKey: 'shell.nav.appUsers',\n icon: UsersRound,\n to: '/users/app',\n permission: 'users.manage',\n },\n {\n key: 'locales',\n labelKey: 'shell.nav.locales',\n icon: Globe,\n to: '/settings/locales',\n // Locales are shared by every site, so only a role on every site may manage them.\n networkPermission: 'schema.create',\n },\n { key: 'settings', labelKey: 'shell.nav.settings', icon: Settings, to: '/settings' },\n // The site switcher's \"Network\" target (useSiteSwitcher `openNetwork`), for admins who can open it.\n { key: 'network', labelKey: 'sites.network', icon: Globe2, to: '/network', network: true },\n];\n\n/** The network view (sites plan §H): about the whole instance rather than one site. */\nexport const NETWORK_ITEMS: readonly NavItemDefinition[] = [\n { key: 'sites', labelKey: 'shell.nav.sites', icon: Globe2, to: '/network/sites' },\n {\n key: 'contentTypes',\n labelKey: 'shell.nav.sharedContentTypes',\n icon: Boxes,\n to: '/network/content-types',\n networkPermission: 'schema.create',\n },\n {\n key: 'users',\n labelKey: 'shell.nav.users',\n icon: Users,\n to: '/network/users',\n permission: 'users.manage',\n },\n {\n key: 'roles',\n labelKey: 'shell.nav.roles',\n icon: ShieldCheck,\n to: '/network/roles',\n permission: 'roles.manage',\n },\n {\n key: 'auditLog',\n labelKey: 'shell.nav.auditLog',\n icon: ScrollText,\n to: '/network/audit-log',\n permission: 'audit.read',\n },\n];\n","import { useMemo } from 'react';\nimport { useMe } from '@/api/auth';\nimport { canSeeDevelop, hasSchemaPermission } from '@/helpers/modelPermissions';\nimport { canSeeNetwork } from '@/helpers/sites';\nimport type { NavAccess } from '../navItems';\n\n/** What the navigation may offer this admin; the server enforces every action regardless. */\nexport const useNavAccess = (): NavAccess & { develop: boolean; canCreateType: boolean } => {\n const { data: me } = useMe();\n return useMemo(\n () => ({\n globalPermissions: me?.globalPermissions ?? [],\n networkPermissions: me?.networkPermissions ?? [],\n schema: hasSchemaPermission(me),\n network: canSeeNetwork(me),\n develop: canSeeDevelop(me),\n canCreateType: me?.globalPermissions.includes('schema.create') ?? false,\n }),\n [me],\n );\n};\n","import { linkOptions, type LinkOptions } from '@tanstack/react-router';\nimport { FileStack, FileText, Plus, type LucideIcon } from 'lucide-react';\nimport { useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useSchemaScopeAccess } from '@/hooks/useSchemaScopeAccess';\nimport {\n CONTENT_ITEMS,\n DEVELOP_ITEMS,\n INBOX_ITEM,\n isVisible,\n NETWORK_ITEMS,\n WORKSPACE_ITEMS,\n type NavAccess,\n type NavItemDefinition,\n} from '../navItems';\nimport { useIsNetworkView } from './useIsNetworkView';\nimport { useNavAccess } from './useNavAccess';\nimport { usePlaces, type Place } from './usePlaces';\n\nexport type ShellNavItem = {\n key: string;\n label: string;\n icon: LucideIcon;\n link: LinkOptions;\n /** Matches only its own path, not the paths below it (the Inbox at `/`). */\n exact?: boolean;\n /** Entries in a place. */\n count?: number;\n /** The quiet \"+ New\" row at the end of the places. */\n variant?: 'add';\n /** A place shared with all sites (marked only where there is more than one site). */\n shared?: boolean;\n};\n\nexport type ShellNavGroup = {\n key: 'inbox' | 'places' | 'library' | 'develop' | 'workspace' | 'network';\n label?: string;\n items: ShellNavItem[];\n};\n\nconst PLACE_ICONS = { collection: FileStack, singleton: FileText } as const;\n\nexport const fromDefinitions = (\n definitions: readonly NavItemDefinition[],\n access: NavAccess,\n label: (item: NavItemDefinition) => string,\n): ShellNavItem[] =>\n definitions\n .filter((item) => isVisible(item, access))\n .map((item) => ({\n key: item.key,\n label: label(item),\n icon: item.icon,\n link: linkOptions({ to: item.to }),\n ...(item.exact ? { exact: true } : {}),\n }));\n\nconst placeItem = (place: Place, multiSite: boolean): ShellNavItem => ({\n key: `place:${place.id}`,\n label: place.label,\n icon: PLACE_ICONS[place.kind],\n link: linkOptions({ to: '/content/$modelKey', params: { modelKey: place.apiKey } }),\n ...(place.count === undefined ? {} : { count: place.count }),\n ...(multiSite && place.shared ? { shared: true } : {}),\n});\n\n/** The network view's one group: sites, admin users, roles and the audit log, as permitted. */\nconst useNetworkNavGroups = (enabled: boolean): ShellNavGroup[] => {\n const { t } = useTranslation();\n const access = useNavAccess();\n return useMemo(\n () =>\n enabled\n ? [\n {\n key: 'network',\n label: t('shell.groups.network'),\n items: fromDefinitions(NETWORK_ITEMS, access, (item) => t(item.labelKey)),\n },\n ]\n : [],\n [enabled, access, t],\n );\n};\n\n/**\n * The sidebar's groups for this admin: Inbox, the places (content types from the registry, with counts and\n * \"+ New\" for `schema.create`), Media and Publishing; Develop and Workspace when permitted. The word\n * \"Models\" is never shown (plan editor-experience §6). On network pages, the network group instead.\n */\nexport const useShellNavGroups = (): ShellNavGroup[] => {\n const isNetworkView = useIsNetworkView();\n const siteGroups = useSiteNavGroups(!isNetworkView);\n const networkGroups = useNetworkNavGroups(isNetworkView);\n return isNetworkView ? networkGroups : siteGroups;\n};\n\nconst useSiteNavGroups = (enabled: boolean): ShellNavGroup[] => {\n const { t } = useTranslation();\n const access = useNavAccess();\n const places = usePlaces();\n const { multiSite } = useSchemaScopeAccess();\n return useMemo(() => {\n if (!enabled) {\n return [];\n }\n const label = (item: NavItemDefinition) => t(item.labelKey);\n const placeItems = (places ?? []).map((place) => placeItem(place, multiSite));\n const addType: ShellNavItem[] = access.canCreateType\n ? [\n {\n key: 'newType',\n label: t('shell.nav.newType'),\n icon: Plus,\n link: linkOptions({ to: '/content/new' }),\n variant: 'add',\n },\n ]\n : [];\n const groups: ShellNavGroup[] = [\n { key: 'inbox', items: fromDefinitions([INBOX_ITEM], access, label) },\n { key: 'places', label: t('shell.groups.content'), items: [...placeItems, ...addType] },\n { key: 'library', items: fromDefinitions(CONTENT_ITEMS, access, label) },\n ...(access.develop\n ? [\n {\n key: 'develop' as const,\n label: t('shell.groups.develop'),\n items: fromDefinitions(DEVELOP_ITEMS, access, label),\n },\n ]\n : []),\n {\n key: 'workspace',\n label: t('shell.groups.workspace'),\n items: fromDefinitions(WORKSPACE_ITEMS, access, label),\n },\n ];\n return groups.filter((group) => group.items.length > 0);\n }, [enabled, access, places, multiSite, t]);\n};\n","import { linkOptions } from '@tanstack/react-router';\nimport { Blocks, FilePlus2, Plus } from 'lucide-react';\nimport { useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMe } from '@/api/auth';\nimport { usePaletteItems } from '@/components/CommandPalette/hooks/usePaletteItems';\nimport type { PaletteItem } from '@/components/CommandPalette/types';\nimport { SETTINGS_GROUPS } from '@/features/Settings/sections';\nimport { canSeeNetwork } from '@/helpers/sites';\nimport { isVisible, NETWORK_ITEMS } from '../navItems';\nimport { useNavAccess } from './useNavAccess';\nimport { usePlaces } from './usePlaces';\nimport type { ShellNavGroup } from './useShellNavGroups';\n\n/**\n * Every sidebar destination, then the settings pages and (for network admins, from any site) the network\n * pages the sidebar doesn't list, once each.\n */\nconst useGoToItems = (groups: readonly ShellNavGroup[]): PaletteItem[] => {\n const { t } = useTranslation();\n const access = useNavAccess();\n const { data: me } = useMe();\n return useMemo(() => {\n const items: PaletteItem[] = groups.flatMap((group) =>\n group.items.flatMap((item) =>\n item.variant !== 'add'\n ? [\n {\n id: `goto:${item.key}`,\n label: item.label,\n icon: item.icon,\n link: item.link,\n ...(group.label ? { hint: group.label } : {}),\n },\n ]\n : [],\n ),\n );\n const listed = new Set(items.map((item) => String(item.link?.to)));\n const settings = SETTINGS_GROUPS.flatMap((group) => group.sections)\n .filter((section) => isVisible(section, access) && !listed.has(section.to))\n .map((section): PaletteItem => ({\n id: `goto:settings:${section.key}`,\n label: t(`settings.${section.key}`),\n hint: t('shell.nav.settings'),\n icon: section.icon,\n link: linkOptions({ to: section.to }),\n }));\n const network = canSeeNetwork(me)\n ? NETWORK_ITEMS.filter((item) => isVisible(item, access) && !listed.has(item.to)).map(\n (item): PaletteItem => ({\n id: `goto:network:${item.key}`,\n label: t(item.labelKey),\n hint: t('shell.groups.network'),\n icon: item.icon,\n link: linkOptions({ to: item.to }),\n }),\n )\n : [];\n return [...items, ...settings, ...network];\n }, [groups, access, me, t]);\n};\n\n/** \"New Article\" for each place the admin may add to, then a new content type or component. */\nconst useCreateItems = (): PaletteItem[] => {\n const { t } = useTranslation();\n const access = useNavAccess();\n const places = usePlaces();\n return useMemo(\n () => [\n ...(places ?? [])\n .filter((place) => place.kind === 'collection' && place.canCreate)\n .map((place): PaletteItem => ({\n id: `create:${place.id}`,\n label: t('palette.newEntry', { name: place.label }),\n keywords: [place.apiKey],\n icon: FilePlus2,\n link: linkOptions({ to: '/content/$modelKey/new', params: { modelKey: place.apiKey } }),\n })),\n ...(access.canCreateType\n ? [\n {\n id: 'create:type',\n label: t('shell.nav.newType'),\n icon: Plus,\n link: linkOptions({ to: '/content/new' }),\n },\n {\n id: 'create:component',\n label: t('palette.newComponent'),\n icon: Blocks,\n link: linkOptions({ to: '/develop/components/new' }),\n },\n ]\n : []),\n ],\n [places, access.canCreateType, t],\n );\n};\n\n/** Offers the shell's destinations and create actions in the ⌘K palette while signed in. */\nexport const useShellPaletteItems = (groups: readonly ShellNavGroup[]) => {\n usePaletteItems('goto', useGoToItems(groups));\n usePaletteItems('create', useCreateItems());\n};\n","import { Outlet } from '@tanstack/react-router';\nimport { CommandPalette } from '@/components/CommandPalette';\nimport { Frame } from '../Frame';\nimport { useActiveNavKey } from '../hooks/useActiveNavKey';\nimport { useShellNavGroups } from '../hooks/useShellNavGroups';\nimport { useShellPaletteItems } from '../hooks/useShellPaletteItems';\n\n/** The frame with the navigation, the current screen and the ⌘K palette: the admin works on this site. */\nexport const Navigated = () => {\n const groups = useShellNavGroups();\n const activeKey = useActiveNavKey(groups);\n const section = groups.flatMap((group) => group.items).find((item) => item.key === activeKey)?.label;\n useShellPaletteItems(groups);\n return (\n <>\n <Frame groups={groups} activeKey={activeKey} section={section} searchable>\n <Outlet />\n </Frame>\n <CommandPalette />\n </>\n );\n};\n","import { Lock } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useMe } from '@/api/auth';\nimport { goToSite } from '@/app/currentSite';\nimport { EmptyState } from '@/components/EmptyState';\nimport { Page } from '@/components/Page';\nimport { PageHeader } from '@/components/PageHeader';\nimport { Button } from '@/components/ui/button';\n\n/**\n * The page for a site the admin holds no role on (sites plan §H): nothing of the site can be read, so it says\n * so instead of failing request by request, and offers the admin's own sites (also in the switcher).\n */\nexport const NoSiteAccess = () => {\n const { t } = useTranslation();\n const { data: me } = useMe();\n const elsewhere = me?.sites[0];\n return (\n <Page width=\"narrow\">\n <PageHeader title={me?.site.name ?? ''} meta={me?.site.key} />\n <EmptyState\n icon={Lock}\n title={t('sites.noAccess.title')}\n description={elsewhere ? t('sites.noAccess.description') : t('sites.noAccess.noSites')}\n action={\n elsewhere ? (\n <Button onClick={() => goToSite(elsewhere.key)}>\n {t('sites.openNamed', { name: elsewhere.name })}\n </Button>\n ) : undefined\n }\n />\n </Page>\n );\n};\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { useResumeSession } from '@/api/auth';\nimport { settle } from '@/helpers/settle';\n\nconst resumeSchema = z.object({ password: z.string().min(1, 'validation.required') });\n\nexport type ResumeSessionValues = z.infer<typeof resumeSchema>;\n\n/** The in-place sign-in's password form: signs `email` (the admin already on the page) in again. */\nexport const useResumeSessionForm = (email: string) => {\n const resume = useResumeSession();\n const form = useForm<ResumeSessionValues>({\n resolver: zodResolver(resumeSchema),\n defaultValues: { password: '' },\n });\n const onSubmit = form.handleSubmit(async ({ password }) => {\n if ((await settle(resume.mutateAsync({ email, password }))).ok) {\n form.reset();\n }\n });\n return { form, onSubmit, resume };\n};\n","import { useTranslation } from 'react-i18next';\nimport { FormError } from '@/components/FormError';\nimport { FormTextField } from '@/components/FormTextField';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { FieldGroup } from '@/components/ui/field';\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from '@/components/ui/sheet';\nimport { useResumeSessionForm } from './hooks/useResumeSessionForm';\n\ntype ResumeSessionProps = {\n /** The signed-in admin's email: the same account signs in again, so the page never changes hands. */\n email: string;\n};\n\n/**\n * Sign in again without leaving the page, after the session ended over unsaved edits. Non-modal and\n * without a close button: the page stays usable beside it (the edits can be read, copied or kept typing)\n * and it goes away once the password is accepted, when failed saves run again.\n */\nexport const ResumeSession = ({ email }: ResumeSessionProps) => {\n const { t } = useTranslation();\n const { form, onSubmit, resume } = useResumeSessionForm(email);\n return (\n <Sheet open modal={false}>\n <SheetContent nonModal size=\"sm\" showCloseButton={false}>\n <SheetHeader>\n <SheetTitle>{t('sessionEnded.title')}</SheetTitle>\n <SheetDescription>{t('sessionEnded.description')}</SheetDescription>\n </SheetHeader>\n <SheetBody>\n <form noValidate onSubmit={(event) => void onSubmit(event)}>\n <FieldGroup>\n <p className=\"text-sm\">{t('sessionEnded.account', { email })}</p>\n <FormTextField\n control={form.control}\n name=\"password\"\n label={t('auth.password')}\n type=\"password\"\n autoComplete=\"current-password\"\n />\n <FormError error={resume.error} />\n <SubmitButton\n pending={resume.isPending}\n pendingLabel={t('login.submitting')}\n className=\"w-full\"\n >\n {t('login.submit')}\n </SubmitButton>\n </FieldGroup>\n </form>\n </SheetBody>\n </SheetContent>\n </Sheet>\n );\n};\n","import { useRouter } from '@tanstack/react-router';\nimport { useEffect } from 'react';\nimport { useMe } from '@/api/auth';\nimport { hasSiteRole } from '@/helpers/sites';\nimport { useSessionStore } from '@/stores/session';\nimport { Frame } from './Frame';\nimport { useIsNetworkView } from './hooks/useIsNetworkView';\nimport { Navigated } from './Navigated';\nimport { NoSiteAccess } from './NoSiteAccess';\nimport { ResumeSession } from './ResumeSession';\n\n/**\n * Signed-in frame: sidebar, the current screen, the status bar and the ⌘K palette. No desktop top bar\n * (DESIGN.md): below lg a 48px row holds the sidebar trigger. Leaves for sign-in when the session ends. On a\n * site the admin holds no role on, only the site switcher and a page saying so (nothing of the site loads).\n * A session that ends over unsaved edits is resumed in place instead (`ResumeSession`), so nothing unmounts.\n */\nexport const Shell = () => {\n const { data: me } = useMe();\n const router = useRouter();\n const isNetworkView = useIsNetworkView();\n const signInRequired = useSessionStore((state) => state.signInRequired);\n // The session ended (sign-out, expiry, revoked elsewhere): re-run the route guard, which sends the\n // visitor to sign in and remembers where they were.\n useEffect(() => {\n if (me === null) {\n void router.invalidate();\n }\n }, [me, router]);\n if (!me) {\n return null;\n }\n const resume = signInRequired ? <ResumeSession email={me.user.email} /> : null;\n if (!isNetworkView && !hasSiteRole(me)) {\n return (\n <>\n <Frame groups={[]} activeKey={undefined} section={undefined} searchable={false}>\n <NoSiteAccess />\n </Frame>\n {resume}\n </>\n );\n }\n return (\n <>\n <Navigated />\n {resume}\n </>\n );\n};\n","import type { AppUserQuery, UpdateAppUserInput } from '@shapio/client';\nimport { keepPreviousData, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { adminApi } from './client';\nimport { withCsrf } from './csrf';\nimport { queryKeys } from './queryKeys';\n\nexport const useAppUsers = (query: AppUserQuery) =>\n useQuery({\n queryKey: queryKeys.appUsers.list(query),\n queryFn: () => adminApi.appUsers.list(query),\n placeholderData: keepPreviousData,\n meta: { silent: true },\n });\n\nexport const useUpdateAppUser = () => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['appUsers', 'update'],\n meta: { silent: true },\n mutationFn: ({ id, input }: { id: string; input: UpdateAppUserInput }) =>\n withCsrf(() => adminApi.appUsers.update(id, input)),\n onSettled: () => queryClient.invalidateQueries({ queryKey: queryKeys.appUsers.all }),\n });\n};\n\n/** Block or unblock from a menu: failures toast (not silent), since there is no form to show them. */\nexport const useSetAppUserBlocked = () => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['appUsers', 'setBlocked'],\n mutationFn: ({ id, blocked }: { id: string; blocked: boolean }) =>\n withCsrf(() => adminApi.appUsers.update(id, { blocked })),\n onSettled: () => queryClient.invalidateQueries({ queryKey: queryKeys.appUsers.all }),\n });\n};\n\nexport const useRemoveAppUser = () => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['appUsers', 'remove'],\n mutationFn: (id: string) => withCsrf(() => adminApi.appUsers.remove(id)),\n onSettled: () => queryClient.invalidateQueries({ queryKey: queryKeys.appUsers.all }),\n });\n};\n\nexport const useResendAppUserConfirmation = () =>\n useMutation({\n mutationKey: ['appUsers', 'resendConfirmation'],\n mutationFn: (id: string) => withCsrf(() => adminApi.appUsers.resendConfirmation(id)),\n });\n","import type { AdminAppUser } from '@shapio/client';\nimport { toast } from 'sonner';\nimport { useRemoveAppUser, useResendAppUserConfirmation, useSetAppUserBlocked } from '@/api/appUsers';\nimport { i18next } from '@/app/i18n';\n\n/** The row actions that ask first. */\nexport type ConfirmedAction = 'block' | 'unblock' | 'remove';\n\n/**\n * Row actions on app users. Block, unblock and delete resolve once done, so the inline confirmation can wait\n * for them; resending the confirmation email doesn't ask.\n */\nexport const useAppUserActions = () => {\n const setBlocked = useSetAppUserBlocked();\n const resend = useResendAppUserConfirmation();\n const remove = useRemoveAppUser();\n const run = async (action: ConfirmedAction, user: AdminAppUser) => {\n if (action === 'remove') {\n await remove.mutateAsync(user.id);\n toast.success(i18next.t('appUsers.removed'));\n return;\n }\n const blocked = action === 'block';\n await setBlocked.mutateAsync({ id: user.id, blocked });\n toast.success(i18next.t(blocked ? 'appUsers.blockedToast' : 'appUsers.unblockedToast'));\n };\n return {\n run,\n resendConfirmation: (user: AdminAppUser) =>\n resend.mutate(user.id, {\n onSuccess: () => toast.success(i18next.t('appUsers.confirmationSent', { email: user.email })),\n }),\n };\n};\n","import { useNavigate, useSearch } from '@tanstack/react-router';\nimport { useState } from 'react';\nimport type { AppUsersSearch } from '@/app/searchSchemas';\n\n/**\n * The search text and the current cursor live in the URL (bookmarkable, back-button friendly). Cursors of\n * earlier pages are kept in memory, since the API pages forward only (newest first).\n */\nexport const useAppUsersSearch = () => {\n const search = useSearch({ from: '/app/users/app' });\n const navigate = useNavigate({ from: '/users/app' });\n const [previousCursors, setPreviousCursors] = useState<(string | undefined)[]>([]);\n const go = (changes: Partial<AppUsersSearch>) =>\n void navigate({ search: (previous) => ({ ...previous, ...changes }) });\n return {\n search,\n goFirst:\n search.cursor === undefined\n ? undefined\n : () => {\n setPreviousCursors([]);\n go({ cursor: undefined });\n },\n goPrevious:\n previousCursors.length === 0\n ? undefined\n : () => {\n go({ cursor: previousCursors.at(-1) });\n setPreviousCursors((cursors) => cursors.slice(0, -1));\n },\n goNext: (nextCursor: string) => {\n setPreviousCursors((cursors) => [...cursors, search.cursor]);\n go({ cursor: nextCursor });\n },\n setQuery: (q: string | undefined) => {\n setPreviousCursors([]);\n go({ q, cursor: undefined });\n },\n };\n};\n","import { Search as SearchIcon } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { Input } from '@/components/ui/input';\nimport { useSearchInput } from '@/hooks/useSearchInput';\n\ntype SearchProps = { query: string | undefined; onQueryChange: (query: string | undefined) => void };\n\n/** Searches app users by email or name; the URL updates once typing pauses. */\nexport const Search = ({ query, onQueryChange }: SearchProps) => {\n const { t } = useTranslation();\n const { text, setText } = useSearchInput(query, onQueryChange);\n return (\n <div className=\"relative w-full sm:w-72\">\n <SearchIcon\n aria-hidden=\"true\"\n className=\"absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground\"\n />\n <Input\n type=\"search\"\n value={text}\n onChange={(event) => setText(event.target.value)}\n aria-label={t('appUsers.search')}\n placeholder={t('appUsers.searchPlaceholder')}\n inputSize=\"sm\"\n className=\"pl-8\"\n />\n </div>\n );\n};\n","import { useTranslation } from 'react-i18next';\nimport { Badge } from '@/components/ui/badge';\n\ntype RoleBadgesProps = { roleIds: readonly string[]; roleNames: ReadonlyMap<string, string> };\n\n/** A user's or invitation's roles, by name. */\nexport const RoleBadges = ({ roleIds, roleNames }: RoleBadgesProps) => {\n const { t } = useTranslation();\n return roleIds.map((roleId) => (\n <Badge key={roleId} variant=\"outline\">\n {roleNames.get(roleId) ?? t('common.unknown')}\n </Badge>\n ));\n};\n","import type { FormEventHandler, ReactElement } from 'react';\nimport type { Control } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { FormCheckboxGroup, type CheckboxOption } from '@/components/FormCheckboxGroup';\nimport { FormError } from '@/components/FormError';\nimport { FormRadioGroup, type RadioOption } from '@/components/FormRadioGroup';\nimport { SubmitButton } from '@/components/SubmitButton';\nimport { Button } from '@/components/ui/button';\nimport { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover';\nimport { useDiscardGuard } from '@/hooks/useDiscardGuard';\nimport { useReturnFocus } from '@/hooks/useReturnFocus';\n\nexport type RolesValues = { roleIds: string[] };\n\n/** One role (admin users). */\nexport type SingleRoleValues = { roleId: string };\n\n/** Several roles as a checklist (app users), or exactly one as a radio list (admin users). */\ntype RolesSelection =\n | { selection: 'multiple'; control: Control<RolesValues>; options: readonly CheckboxOption[] }\n | { selection: 'single'; control: Control<SingleRoleValues>; options: readonly RadioOption[] };\n\ntype RolesPopoverProps = RolesSelection & {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** \"Roles for Ada\": the checklist's legend and the popover's accessible name. */\n title: string;\n /** One line under the checklist. */\n description?: string;\n /** Shown instead of the checklist when there is nothing to pick. */\n emptyMessage?: string;\n dirty: boolean;\n pending: boolean;\n error: unknown;\n onSubmit: FormEventHandler<HTMLFormElement>;\n /** What the checklist points at: the row's roles. */\n children: ReactElement;\n};\n\n/**\n * A user's roles as a checklist (or a radio list, for one role) in a popover anchored to the row\n * (DESIGN.md \"Dialogs\": pick from a short list). Opened from the row's menu, so focus returns to the menu\n * button; closing over unsaved changes asks first.\n */\nexport const RolesPopover = ({\n open,\n onOpenChange,\n title,\n description,\n emptyMessage,\n dirty,\n pending,\n error,\n onSubmit,\n children,\n ...selection\n}: RolesPopoverProps) => {\n const { t } = useTranslation();\n const { requestOpenChange, discardPrompt } = useDiscardGuard({ dirty, pending, onOpenChange });\n const returnFocus = useReturnFocus();\n return (\n <>\n <Popover\n open={open}\n onOpenChange={(next) => (pending && !next ? undefined : requestOpenChange(next))}\n modal\n >\n <PopoverAnchor asChild>{children}</PopoverAnchor>\n <PopoverContent aria-label={title} align=\"start\" className=\"w-80 p-0\" {...returnFocus}>\n <form noValidate onSubmit={onSubmit}>\n <div className=\"max-h-72 space-y-3 overflow-y-auto p-4\">\n {selection.options.length > 0 || !emptyMessage ? (\n selection.selection === 'single' ? (\n <FormRadioGroup\n control={selection.control}\n name=\"roleId\"\n legend={title}\n options={selection.options}\n />\n ) : (\n <FormCheckboxGroup\n control={selection.control}\n name=\"roleIds\"\n legend={title}\n options={selection.options}\n />\n )\n ) : (\n <p className=\"text-sm text-muted-foreground\">{emptyMessage}</p>\n )}\n {description ? <p className=\"text-meta text-muted-foreground\">{description}</p> : null}\n <FormError error={error} />\n </div>\n <div className=\"flex justify-end gap-2 border-t px-4 py-3\">\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={() => requestOpenChange(false)}>\n {t('common.cancel')}\n </Button>\n <SubmitButton size=\"sm\" pending={pending} pendingLabel={t('common.saving')}>\n {t('common.saveChanges')}\n </SubmitButton>\n </div>\n </form>\n </PopoverContent>\n </Popover>\n {discardPrompt}\n </>\n );\n};\n","import { useAppRoles } from '@/api/appRoles';\nimport type { CheckboxOption } from '@/components/FormCheckboxGroup';\n\n/** Custom app roles as checkbox options (`public` and `authenticated` apply implicitly, never assigned). */\nexport const useAppRoleOptions = () => {\n const roles = useAppRoles();\n const options: CheckboxOption[] = (roles.data ?? [])\n .filter((role) => !role.isSystem)\n .map((role) => ({ value: role.id, label: role.name }));\n return { options, error: roles.error, isPending: roles.isPending };\n};\n","import { zodResolver } from '@hookform/resolvers/zod';\nimport type { AdminAppUser } from '@shapio/client';\nimport { useEffect } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { toast } from 'sonner';\nimport { z } from 'zod';\nimport { useUpdateAppUser } from '@/api/appUsers';\nimport { i18next } from '@/app/i18n';\nimport { settle } from '@/helpers/settle';\n\nconst appUserRolesSchema = z.object({ roleIds: z.array(z.string()) });\n\nexport type AppUserRolesValues = z.infer<typeof appUserRolesSchema>;\n\n/** Replaces an app user's custom roles (none is fine: `authenticated` always applies). */\nexport const useAppUserRolesForm = (open: boolean, user: AdminAppUser | undefined, onDone: () => void) => {\n const updateAppUser = useUpdateAppUser();\n const form = useForm<AppUserRolesValues>({\n resolver: zodResolver(appUserRolesSchema),\n defaultValues: { roleIds: [] },\n });\n const { reset } = form;\n useEffect(() => {\n if (open && user) {\n reset({ roleIds: user.roleIds });\n }\n }, [open, user, reset]);\n const onSubmit = form.handleSubmit(async ({ roleIds }) => {\n if (!user) {\n return;\n }\n if (!(await settle(updateAppUser.mutateAsync({ id: user.id, input: { roleIds } }))).ok) {\n return;\n }\n toast.success(i18next.t('appUsers.rolesSaved'));\n onDone();\n });\n return { form, onSubmit, updateAppUser };\n};\n","import type { AdminAppUser } from '@shapio/client';\nimport type { ReactElement } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { RolesPopover } from '../../RolesPopover';\nimport { useAppRoleOptions } from '../hooks/useAppRoleOptions';\nimport { useAppUserRolesForm } from '../hooks/useAppUserRolesForm';\n\ntype RolesEditorProps = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n user: AdminAppUser;\n /** The row's roles, which the checklist points at. */\n children: ReactElement;\n};\n\n/** Changes an app user's custom roles in a checklist anchored to their row. */\nexport const RolesEditor = ({ open, onOpenChange, user, children }: RolesEditorProps) => {\n const { t } = useTranslation();\n const { options, error: rolesError, isPending } = useAppRoleOptions();\n const { form, onSubmit, updateAppUser } = useAppUserRolesForm(open, user, () => onOpenChange(false));\n return (\n <RolesPopover\n open={open}\n onOpenChange={onOpenChange}\n title={t('appUsers.rolesTitle', { name: user.name || user.email })}\n description={t('appUsers.rolesDescription')}\n selection=\"multiple\"\n control={form.control}\n options={options}\n {...(isPending ? {} : { emptyMessage: t('appUsers.noCustomRoles') })}\n dirty={form.formState.isDirty}\n pending={updateAppUser.isPending}\n error={updateAppUser.error ?? rolesError}\n onSubmit={(event) => void onSubmit(event)}\n >\n {children}\n </RolesPopover>\n );\n};\n","import type { AdminAppUser } from '@shapio/client';\nimport { KeyRound, LogIn } from 'lucide-react';\nimport type { ComponentType, SVGProps } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Badge } from '@/components/ui/badge';\nimport { GithubIcon, GoogleIcon } from './icons';\n\ntype SignInMethodsProps = { user: AdminAppUser };\n\ntype MethodIcon = ComponentType<SVGProps<SVGSVGElement>>;\n\nconst PROVIDERS = {\n google: { labelKey: 'appUsers.providerGoogle', icon: GoogleIcon },\n github: { labelKey: 'appUsers.providerGithub', icon: GithubIcon },\n} as const satisfies Record<string, { labelKey: string; icon: MethodIcon }>;\n\nconst isKnownProvider = (provider: string): provider is keyof typeof PROVIDERS =>\n Object.hasOwn(PROVIDERS, provider);\n\n/** How an app user signs in: password and each linked provider, as icon chips. */\nexport const SignInMethods = ({ user }: SignInMethodsProps) => {\n const { t } = useTranslation();\n const methods: { key: string; label: string; icon: MethodIcon }[] = [\n ...(user.hasPassword ? [{ key: 'password', label: t('appUsers.password'), icon: KeyRound }] : []),\n ...user.providers.map((provider) =>\n isKnownProvider(provider)\n ? { key: provider, label: t(PROVIDERS[provider].labelKey), icon: PROVIDERS[provider].icon }\n : { key: provider, label: provider, icon: LogIn },\n ),\n ];\n return (\n <span className=\"flex flex-wrap gap-1\">\n {methods.map(({ key, label, icon: Icon }) => (\n <Badge key={key} variant=\"outline\">\n <Icon aria-hidden=\"true\" />\n {label}\n </Badge>\n ))}\n </span>\n );\n};\n","import type { SVGProps } from 'react';\n\ntype IconProps = SVGProps<SVGSVGElement>;\n\n/** GitHub's mark, single colour (lucide ships no brand icons). */\nexport const GithubIcon = (props: IconProps) => (\n <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" {...props}>\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z\" />\n </svg>\n);\n\n/** Google's \"G\", single colour. */\nexport const GoogleIcon = (props: IconProps) => (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" {...props}>\n <path d=\"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z\" />\n </svg>\n);\n","import { useTranslation } from 'react-i18next';\nimport type { ConfirmedAction } from '../../../hooks/useAppUserActions';\n\ntype ConfirmCopy = { title: string; description: string; confirmLabel: string; tone: 'danger' | 'default' };\n\n/** The inline confirmation's question, consequence, button and tone for each row action. */\nexport const useConfirmCopy = (action: ConfirmedAction, name: string): ConfirmCopy => {\n const { t } = useTranslation();\n switch (action) {\n case 'block':\n return {\n title: t('appUsers.blockTitle', { name }),\n description: t('appUsers.blockDescription'),\n confirmLabel: t('appUsers.block'),\n tone: 'danger',\n };\n case 'unblock':\n return {\n title: t('appUsers.unblockTitle', { name }),\n description: t('appUsers.unblockDescription'),\n confirmLabel: t('appUsers.unblock'),\n tone: 'default',\n };\n case 'remove':\n return {\n title: t('appUsers.removeTitle', { name }),\n description: t('appUsers.removeDescription'),\n confirmLabel: t('common.delete'),\n tone: 'danger',\n };\n }\n};\n","import type { AdminAppUser } from '@shapio/client';\nimport { MailCheck, MoreHorizontal, ShieldCheck, Trash2, UserCheck, UserX } from 'lucide-react';\nimport { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { InlineConfirm } from '@/components/InlineConfirm';\nimport { StatusChip } from '@/components/StatusChip';\nimport { Button } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { TableCell, TableRow } from '@/components/ui/table';\nimport { formatDateTime, formatRelativeTime } from '@/helpers/formatDate';\nimport { Person } from '../../../Person';\nimport { RoleBadges } from '../../../RoleBadges';\nimport type { ConfirmedAction } from '../../hooks/useAppUserActions';\nimport { RolesEditor } from '../../RolesEditor';\nimport { SignInMethods } from '../../SignInMethods';\nimport { useConfirmCopy } from './hooks/useConfirmCopy';\n\ntype RowProps = {\n user: AdminAppUser;\n roleNames: ReadonlyMap<string, string>;\n onResendConfirmation: (user: AdminAppUser) => void;\n /** Resolves once the action is done (the confirmation waits for it). */\n onConfirmed: (action: ConfirmedAction, user: AdminAppUser) => Promise<unknown>;\n};\n\n/**\n * One app user. Its menu hands off to a roles checklist anchored to the Roles cell, or to an inline\n * confirmation (block, unblock, delete) anchored to the menu button.\n */\nexport const Row = ({ user, roleNames, onResendConfirmation, onConfirmed }: RowProps) => {\n const { t } = useTranslation();\n // Undefined until first opened, so rows that are never edited don't each hold a form.\n const [editingRoles, setEditingRoles] = useState<boolean | undefined>(undefined);\n // The last action asked about stays while the confirmation animates out, so its text doesn't flicker.\n const [action, setAction] = useState<ConfirmedAction>('remove');\n const [confirming, setConfirming] = useState(false);\n const displayName = user.name || user.email;\n const copy = useConfirmCopy(action, displayName);\n const ask = (next: ConfirmedAction) => {\n setAction(next);\n setConfirming(true);\n };\n const roles = (\n <span className=\"flex flex-wrap gap-1\">\n {user.roleIds.length === 0 ? (\n <span className=\"text-meta text-muted-foreground\">{t('appUsers.authenticatedOnly')}</span>\n ) : (\n <RoleBadges roleIds={user.roleIds} roleNames={roleNames} />\n )}\n </span>\n );\n return (\n <TableRow>\n <TableCell>\n <Person name={displayName} email={user.email} />\n </TableCell>\n <TableCell>\n <SignInMethods user={user} />\n </TableCell>\n <TableCell>\n {editingRoles === undefined ? (\n roles\n ) : (\n <RolesEditor open={editingRoles} onOpenChange={setEditingRoles} user={user}>\n {roles}\n </RolesEditor>\n )}\n </TableCell>\n <TableCell>\n <span className=\"flex flex-wrap gap-1\">\n {user.blocked ? (\n <StatusChip tone=\"danger\" label={t('appUsers.blocked')} />\n ) : (\n <StatusChip tone=\"success\" label={t('appUsers.active')} />\n )}\n {user.confirmed ? null : <StatusChip tone=\"warning\" label={t('appUsers.unconfirmed')} />}\n </span>\n </TableCell>\n <TableCell title={formatDateTime(user.lastLoginAt) || undefined}>\n {user.lastLoginAt ? formatRelativeTime(user.lastLoginAt) : t('common.never')}\n </TableCell>\n <TableCell className=\"text-right\">\n <DropdownMenu>\n <InlineConfirm\n {...copy}\n open={confirming}\n onOpenChange={setConfirming}\n onConfirm={() => onConfirmed(action, user)}\n >\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon-sm\" aria-label={`${t('common.actions')}: ${displayName}`}>\n <MoreHorizontal aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n </InlineConfirm>\n <DropdownMenuContent\n align=\"end\"\n onCloseAutoFocus={(event) => (confirming || editingRoles) && event.preventDefault()}\n >\n <DropdownMenuItem onSelect={() => setEditingRoles(true)}>\n <ShieldCheck aria-hidden=\"true\" />\n {t('appUsers.editRoles')}\n </DropdownMenuItem>\n {user.confirmed ? null : (\n <DropdownMenuItem onSelect={() => onResendConfirmation(user)}>\n <MailCheck aria-hidden=\"true\" />\n {t('appUsers.resendConfirmation')}\n </DropdownMenuItem>\n )}\n <DropdownMenuItem onSelect={() => ask(user.blocked ? 'unblock' : 'block')}>\n {user.blocked ? <UserCheck aria-hidden=\"true\" /> : <UserX aria-hidden=\"true\" />}\n {user.blocked ? t('appUsers.unblock') : t('appUsers.block')}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant=\"destructive\" onSelect={() => ask('remove')}>\n <Trash2 aria-hidden=\"true\" />\n {t('common.delete')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </TableCell>\n </TableRow>\n );\n};\n","import type { AdminAppUser } from '@shapio/client';\nimport { useTranslation } from 'react-i18next';\nimport { Table as TableRoot, TableBody, TableHead, TableHeader, TableRow } from '@/components/ui/table';\nimport type { ConfirmedAction } from '../hooks/useAppUserActions';\nimport { Row } from './Row';\n\ntype TableProps = {\n users: AdminAppUser[];\n roleNames: ReadonlyMap<string, string>;\n onResendConfirmation: (user: AdminAppUser) => void;\n onConfirmed: (action: ConfirmedAction, user: AdminAppUser) => Promise<unknown>;\n};\n\nexport const Table = ({ users, roleNames, onResendConfirmation, onConfirmed }: TableProps) => {\n const { t } = useTranslation();\n return (\n <TableRoot>\n <TableHeader>\n <TableRow>\n <TableHead>{t('appUsers.name')}</TableHead>\n <TableHead>{t('appUsers.signIn')}</TableHead>\n <TableHead>{t('appUsers.roles')}</TableHead>\n <TableHead>{t('appUsers.status')}</TableHead>\n <TableHead>{t('appUsers.lastLogin')}</TableHead>\n <TableHead>\n <span className=\"sr-only\">{t('common.actions')}</span>\n </TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {users.map((user) => (\n <Row\n key={user.id}\n user={user}\n roleNames={roleNames}\n onResendConfirmation={onResendConfirmation}\n onConfirmed={onConfirmed}\n />\n ))}\n </TableBody>\n </TableRoot>\n );\n};\n","import { Trans } from 'react-i18next';\nimport { TextLink } from '@/components/TextLink';\nimport { useNetworkPermission } from '@/features/Network/hooks/useNetworkPermission';\n\n/**\n * Points people who came here for editors and admins to Team (admin users, in the network view). Shown only\n * to admins who can open it, the same rule as the sidebar's Team item.\n */\nexport const TeamHint = () => {\n const canManageTeam = useNetworkPermission('users.manage');\n if (!canManageTeam) {\n return null;\n }\n return (\n <p className=\"max-w-md text-sm text-muted-foreground\">\n <Trans i18nKey=\"appUsers.teamHint\" components={{ teamLink: <TextLink to=\"/network/users\" /> }} />\n </p>\n );\n};\n","import { UsersRound } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useAppRoleNames } from '@/api/appRoles';\nimport { useAppUsers } from '@/api/appUsers';\nimport { CursorPager } from '@/components/CursorPager';\nimport { EmptyState } from '@/components/EmptyState';\nimport { Page } from '@/components/Page';\nimport { PageHeader } from '@/components/PageHeader';\nimport { QueryView } from '@/components/QueryView';\nimport { TableCard } from '@/components/TableCard';\nimport { APP_USERS_PAGE_SIZE } from './constants';\nimport { useAppUserActions } from './hooks/useAppUserActions';\nimport { useAppUsersSearch } from './hooks/useAppUsersSearch';\nimport { Search } from './Search';\nimport { Table } from './Table';\nimport { TeamHint } from './TeamHint';\n\n/** App users: the end users of this site (they sign up and sign in on the site, not in this admin). */\nexport const AppUsers = () => {\n const { t } = useTranslation();\n const { search, setQuery, goFirst, goPrevious, goNext } = useAppUsersSearch();\n const users = useAppUsers({ search: search.q, cursor: search.cursor, limit: APP_USERS_PAGE_SIZE });\n const { names: roleNames } = useAppRoleNames();\n const actions = useAppUserActions();\n const nextCursor = users.data?.nextCursor;\n return (\n <Page>\n <PageHeader title={t('appUsers.title')} />\n <TableCard\n toolbar={<Search query={search.q} onQueryChange={setQuery} />}\n footer={\n <CursorPager\n onFirst={goFirst}\n onPrevious={goPrevious}\n onNext={nextCursor ? () => goNext(nextCursor) : undefined}\n />\n }\n >\n <QueryView\n query={users}\n loadingRows={8}\n isEmpty={(data) => data.items.length === 0 && search.cursor === undefined}\n empty={\n <EmptyState\n size=\"panel\"\n icon={UsersRound}\n title={search.q ? t('appUsers.noMatches') : t('appUsers.empty')}\n description={search.q ? undefined : t('appUsers.emptyDescription')}\n action={search.q ? undefined : <TeamHint />}\n />\n }\n >\n {(data) => (\n <Table\n users={data.items}\n roleNames={roleNames}\n onResendConfirmation={actions.resendConfirmation}\n onConfirmed={actions.run}\n />\n )}\n </QueryView>\n </TableCard>\n </Page>\n );\n};\n","import type { DefinitionListItem } from '@shapio/client';\nimport type { QueryClient } from '@tanstack/react-query';\nimport { redirect } from '@tanstack/react-router';\nimport { definitionsQueryOptions } from '@/api/schema';\nimport type { ModelTab } from '@/features/Models/constants';\n\n/**\n * The old `/models/*` URLs (bookmarks, links in older builds) after \"Models\" left the navigation (plan\n * editor-experience §6, §9): a model's builder is the Structure tab of its place, components live under\n * Develop, and new types are created at `/content/new`.\n */\n\n/** `/models?tab=` → the places (or Develop → Components for the components tab). */\nexport const redirectModelsIndex = (tab: ModelTab | undefined): never => {\n throw tab === 'components'\n ? redirect({ to: '/develop/components', replace: true })\n : redirect({ to: '/content', replace: true });\n};\n\n/** `/models/new?kind=` → `/content/new`, or the new-component page. */\nexport const redirectNewModel = (kind: string | undefined): never => {\n throw kind === 'component'\n ? redirect({ to: '/develop/components/new', replace: true })\n : redirect({ to: '/content/new', replace: true });\n};\n\n/** `/models/components/:id` → `/develop/components/:id` (component IDs are unchanged). */\nexport const redirectComponentBuilder = (componentId: string): never => {\n throw redirect({ to: '/develop/components/$componentId', params: { componentId }, replace: true });\n};\n\n/**\n * `/models/:modelId` → `/content/:apiKey?tab=structure`. The ID is resolved through the cached registry; a\n * model created a moment ago may not be cached yet, so a miss reads the registry once more.\n */\nexport const redirectModelBuilder = async (queryClient: QueryClient, modelId: string): Promise<never> => {\n if (modelId === 'components') {\n redirectModelsIndex('components');\n }\n const options = definitionsQueryOptions('model');\n const find = (items: readonly DefinitionListItem[]) =>\n items.find(({ definition }) => definition.id === modelId)?.definition;\n const model =\n find(await queryClient.ensureQueryData(options)) ??\n find(await queryClient.fetchQuery({ ...options, staleTime: 0 }));\n if (!model) {\n // Deleted since the link was made: the places are the closest thing left.\n throw redirect({ to: '/content', replace: true });\n }\n throw redirect({\n to: '/content/$modelKey',\n params: { modelKey: model.apiKey },\n search: { tab: 'structure' },\n replace: true,\n });\n};\n","import type { NetworkAction } from '@shapio/client';\nimport type { QueryClient } from '@tanstack/react-query';\nimport { redirect } from '@tanstack/react-router';\nimport { meQueryOptions } from '@/api/auth';\nimport { canSeeNetwork } from '@/helpers/sites';\n\n/** The network view is for admins holding a network action; anyone else goes home (the API refuses anyway). */\nexport const requireNetworkView = async (queryClient: QueryClient) => {\n const me = await queryClient.ensureQueryData(meQueryOptions);\n if (!canSeeNetwork(me)) {\n throw redirect({ to: '/', replace: true });\n }\n};\n\n/** A network page for one network action: without it, back to the network view's first page. */\nexport const requireNetworkPermission = async (queryClient: QueryClient, action: NetworkAction) => {\n const me = await queryClient.ensureQueryData(meQueryOptions);\n if (!me?.networkPermissions.includes(action)) {\n throw redirect({ to: '/network', replace: true });\n }\n};\n","import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { Toaster as Sonner, type ToasterProps } from 'sonner';\nimport { useResolvedScheme } from '@/hooks/useResolvedScheme';\n\n// Shapio: the rendered scheme comes from the admin's theme store (shadcn's default used next-themes): the\n// saved look's variant.\nconst Toaster = ({ ...props }: ToasterProps) => {\n const { t } = useTranslation();\n const theme = useResolvedScheme();\n\n return (\n <Sonner\n theme={theme}\n containerAriaLabel={t('common.notifications')}\n className=\"toaster group\"\n icons={{\n success: <CircleCheckIcon className=\"size-4 text-success\" />,\n info: <InfoIcon className=\"size-4 text-info\" />,\n warning: <TriangleAlertIcon className=\"size-4 text-warning\" />,\n error: <OctagonXIcon className=\"size-4 text-destructive\" />,\n loading: <Loader2Icon className=\"size-4 animate-spin\" />,\n }}\n toastOptions={{ closeButtonAriaLabel: t('common.close') }}\n // Shapio: clear the Shell's status bar (md and up); phones have no status bar.\n offset={{ bottom: 'calc(var(--statusbar-h) + 16px)' }}\n style={\n {\n fontFamily: 'var(--font-sans)',\n '--normal-bg': 'var(--popover)',\n '--normal-text': 'var(--popover-foreground)',\n '--normal-border': 'var(--border)',\n '--border-radius': 'calc(var(--radius) + 4px)',\n } as React.CSSProperties\n }\n {...props}\n />\n );\n};\n\nexport { Toaster };\n","import { useEffect } from 'react';\nimport { useResolvedScheme } from '@/hooks/useResolvedScheme';\nimport { useThemeStore } from '@/stores/theme';\n\n/**\n * Keeps `data-theme` and the `dark` class on <html> in step with the saved look. public/theme-init.js sets\n * the same before first paint.\n */\nexport const useApplyTheme = () => {\n const theme = useThemeStore((state) => state.theme);\n const scheme = useResolvedScheme();\n useEffect(() => {\n document.documentElement.setAttribute('data-theme', theme);\n document.documentElement.classList.toggle('dark', scheme === 'dark');\n }, [theme, scheme]);\n};\n","import { useEffect } from 'react';\nimport { DEFAULT_THEME_KEY, DEFAULT_THEME_VARIANTS } from '@/constants/themes';\nimport { resolveScheme } from '@/helpers/theme';\nimport { useThemeOptions } from '@/hooks/useThemeOptions';\nimport { useThemeStore } from '@/stores/theme';\n\n/**\n * Once the theme list is known: a saved theme that no longer exists (an extension removed) falls back to\n * Shapio, and the cached variants follow the theme's definition (read before first paint by theme-init.js),\n * keeping the saved variant when the theme still has it.\n */\nexport const useReconcileTheme = () => {\n const { themes, isComplete } = useThemeOptions();\n const theme = useThemeStore((state) => state.theme);\n const appearance = useThemeStore((state) => state.appearance);\n const variants = useThemeStore((state) => state.variants);\n const setLook = useThemeStore((state) => state.setLook);\n useEffect(() => {\n if (!isComplete) {\n return;\n }\n const current = themes.find((option) => option.key === theme);\n if (!current) {\n setLook(DEFAULT_THEME_KEY, resolveScheme(appearance, DEFAULT_THEME_VARIANTS), DEFAULT_THEME_VARIANTS);\n } else if (current.variants.join() !== variants.join()) {\n setLook(current.key, resolveScheme(appearance, current.variants), current.variants);\n }\n }, [isComplete, themes, theme, appearance, variants, setLook]);\n};\n","import { Outlet } from '@tanstack/react-router';\nimport { Toaster } from '@/components/ui/sonner';\nimport { TooltipProvider } from '@/components/ui/tooltip';\nimport { useApplyTheme } from '@/hooks/useApplyTheme';\nimport { useReconcileTheme } from '@/hooks/useReconcileTheme';\n\nexport const RootLayout = () => {\n useApplyTheme();\n useReconcileTheme();\n return (\n <TooltipProvider>\n <Outlet />\n <Toaster closeButton />\n </TooltipProvider>\n );\n};\n","import type { MeResponse } from '@shapio/client';\nimport type { QueryClient } from '@tanstack/react-query';\nimport { redirect } from '@tanstack/react-router';\nimport { meQueryOptions, setupStatusQueryOptions } from '@/api/auth';\nimport { logError } from '@/helpers/reportError';\nimport { hasSiteRole } from '@/helpers/sites';\nimport {\n currentRouterPath,\n currentSite,\n goToSite,\n rememberSite,\n settleSiteKey,\n showSiteInAddressBar,\n} from './currentSite';\nimport { needsSitePrefix } from './sitePaths';\n\n/** First run: no owner exists yet. If the status can't be read, assume setup is done (sign-in still works). */\nconst isSetupRequired = async (queryClient: QueryClient) => {\n try {\n return (await queryClient.ensureQueryData(setupStatusQueryOptions)).required;\n } catch (error) {\n logError(error, 'reading setup status');\n return false;\n }\n};\n\n/**\n * The page's site, once `me` says which site the API answered for (sites plan §H):\n * - a URL without a site lands on a site the admin works on (the remembered or primary one, else their\n * first site: a full navigation, so nothing cached for the other site survives);\n * - a site the admin works on is remembered for the next visit without a site;\n * - a site page reached without the site in its URL gets it in the address bar (the same entry, replaced:\n * the router's own location is site-free and unchanged, so this is not a navigation).\n * A URL that names a site is never redirected: without a role there, the Shell says so.\n */\nconst settleSite = (me: MeResponse): Promise<never> | undefined => {\n settleSiteKey(me.site.key);\n const hasRole = hasSiteRole(me);\n const elsewhere = me.sites[0];\n if (!hasRole && !currentSite().explicit && elsewhere) {\n goToSite(elsewhere.key);\n return new Promise<never>(() => undefined);\n }\n if (hasRole) {\n rememberSite(me.site.key);\n }\n if (needsSitePrefix(currentRouterPath())) {\n showSiteInAddressBar();\n }\n return undefined;\n};\n\n/** Signed-in screens: send visitors to setup (first run) or sign-in, remembering where they were going. */\nexport const requireSession = async (queryClient: QueryClient, currentHref: string) => {\n const me = await queryClient.ensureQueryData(meQueryOptions);\n if (me) {\n await settleSite(me);\n return me;\n }\n if (await isSetupRequired(queryClient)) {\n throw redirect({ to: '/setup' });\n }\n throw redirect({ to: '/login', search: { redirect: currentHref === '/' ? undefined : currentHref } });\n};\n\n/** Signed-out screens: someone already signed in goes straight to the app. */\nexport const redirectIfSignedIn = async (queryClient: QueryClient, destination: string) => {\n const me = await queryClient.ensureQueryData(meQueryOptions);\n if (me) {\n throw redirect({ href: destination });\n }\n};\n\nexport const requireSetupPending = async (queryClient: QueryClient) => {\n if (!(await isSetupRequired(queryClient))) {\n throw redirect({ to: '/login' });\n }\n};\n\nexport const redirectToSetupIfPending = async (queryClient: QueryClient) => {\n if (await isSetupRequired(queryClient)) {\n throw redirect({ to: '/setup' });\n }\n};\n","import type { LocationRewrite } from '@tanstack/react-router';\nimport { splitSitePath, withSitePrefix } from './sitePaths';\n\n/**\n * The router works on site-free paths (`/content/posts`); the address bar carries the site\n * (`/admin/s/blog/content/posts`). Runs inside the basepath rewrite: `url.pathname` here is already relative\n * to `{BASE_PATH}/admin`. Input drops the site prefix; output adds the current site's prefix to every site\n * page (network pages and signed-out screens keep their plain URLs).\n */\nexport const createSiteRewrite = (siteKey: () => string | undefined): LocationRewrite => ({\n input: ({ url }) => {\n url.pathname = splitSitePath(url.pathname).rest;\n return url;\n },\n output: ({ url }) => {\n url.pathname = withSitePrefix(url.pathname, siteKey());\n return url;\n },\n});\n","import type { QueryClient } from '@tanstack/react-query';\nimport { createRootRouteWithContext, createRoute, createRouter, redirect } from '@tanstack/react-router';\nimport { meQueryOptions } from '@/api/auth';\nimport { AcceptInvitation } from '@/features/AcceptInvitation';\nimport { apiExplorerSearchSchema } from '@/features/Develop/ApiExplorer/searchSchema';\nimport { changeSetSearchSchema } from '@/features/Develop/ChangeSet/searchSchema';\nimport { graphqlSearchSchema } from '@/features/Develop/Graphql/searchSchema';\nimport { schemaSearchSchema } from '@/features/Develop/Schema/searchSchema';\nimport { snapshotSearchSchema, snapshotsSearchSchema } from '@/features/Develop/Snapshots/searchSchema';\nimport { ForgotPassword } from '@/features/ForgotPassword';\nimport { Login } from '@/features/Login';\nimport { NotFound } from '@/features/NotFound';\nimport { firstPermittedSection } from '@/features/Publishing/sections';\nimport { ResetPassword } from '@/features/ResetPassword';\nimport { RouteError } from '@/features/RouteError';\nimport { Setup } from '@/features/Setup';\nimport { Shell } from '@/features/Shell';\nimport { AppUsers } from '@/features/Users/AppUsers';\nimport { safeRedirectPath } from '@/helpers/safeRedirect';\nimport { routerBasePath } from './basePath';\nimport { currentSite } from './currentSite';\nimport {\n redirectComponentBuilder,\n redirectModelBuilder,\n redirectModelsIndex,\n redirectNewModel,\n} from './modelRedirects';\nimport { requireNetworkPermission, requireNetworkView } from './networkGuards';\nimport { RootLayout } from './RootLayout';\nimport {\n redirectIfSignedIn,\n redirectToSetupIfPending,\n requireSession,\n requireSetupPending,\n} from './routeGuards';\nimport {\n appUsersSearchSchema,\n auditSearchSchema,\n contentListSearchSchema,\n cursorSearchSchema,\n entrySearchSchema,\n loginSearchSchema,\n mediaSearchSchema,\n modelsSearchSchema,\n newModelSearchSchema,\n schedulesSearchSchema,\n} from './searchSchemas';\nimport { createSiteRewrite } from './siteRewrite';\n\nexport type RouterContext = { queryClient: QueryClient };\n\nconst rootRoute = createRootRouteWithContext<RouterContext>()({\n component: RootLayout,\n notFoundComponent: NotFound,\n});\n\n// Signed-out screens\nconst setupRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'setup',\n beforeLoad: ({ context }) => requireSetupPending(context.queryClient),\n component: Setup,\n});\n\nconst loginRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'login',\n validateSearch: loginSearchSchema,\n beforeLoad: async ({ context, search }) => {\n await redirectToSetupIfPending(context.queryClient);\n await redirectIfSignedIn(context.queryClient, safeRedirectPath(search.redirect));\n },\n component: Login,\n});\n\nconst forgotPasswordRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'forgot-password',\n component: ForgotPassword,\n});\n\nconst resetPasswordRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'reset-password',\n component: ResetPassword,\n});\n\nconst acceptInvitationRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'accept-invitation',\n component: AcceptInvitation,\n});\n\n// Signed-in screens, inside the shell\nconst appRoute = createRoute({\n getParentRoute: () => rootRoute,\n id: 'app',\n beforeLoad: ({ context, location }) => requireSession(context.queryClient, location.href),\n component: Shell,\n});\n\n/** The Inbox is home for everyone (plan editor-experience §9). */\nconst homeRoute = createRoute({ getParentRoute: () => appRoute, path: '/' }).lazy(() =>\n import('./lazyRoutes/inbox').then((module) => module.inboxLazyRoute),\n);\n\n/** Admin users moved to the network view (sites plan §H); old links keep working. */\nconst usersRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'users',\n beforeLoad: () => {\n throw redirect({ to: '/network/users', replace: true });\n },\n});\n\nconst appUsersRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'users/app',\n validateSearch: appUsersSearchSchema,\n component: AppUsers,\n});\n\n// `/models/*` only redirects now: builders are the Structure tab of a place, components live under Develop.\nconst modelsRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'models',\n validateSearch: modelsSearchSchema,\n beforeLoad: ({ search }) => redirectModelsIndex(search.tab),\n});\n\nconst newModelRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'models/new',\n validateSearch: newModelSearchSchema,\n beforeLoad: ({ search }) => redirectNewModel(search.kind),\n});\n\nconst modelBuilderRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'models/$modelId',\n beforeLoad: ({ context, params }) => redirectModelBuilder(context.queryClient, params.modelId),\n});\n\nconst componentBuilderRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'models/components/$componentId',\n beforeLoad: ({ params }) => redirectComponentBuilder(params.componentId),\n});\n\n// New content types and components, and Develop → Components.\nconst contentTypesLazy = () =>\n import('./lazyRoutes/contentTypes').then((module) => module.contentTypesLazyRoutes);\n\nconst newContentTypeRoute = createRoute({ getParentRoute: () => appRoute, path: 'content/new' }).lazy(() =>\n contentTypesLazy().then((routes) => routes.newContentType),\n);\n\nconst componentsRoute = createRoute({ getParentRoute: () => appRoute, path: 'develop/components' }).lazy(() =>\n contentTypesLazy().then((routes) => routes.components),\n);\n\nconst newComponentRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'develop/components/new',\n}).lazy(() => contentTypesLazy().then((routes) => routes.newComponent));\n\nconst componentRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'develop/components/$componentId',\n}).lazy(() => contentTypesLazy().then((routes) => routes.component));\n\nconst mediaRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'media',\n validateSearch: mediaSearchSchema,\n}).lazy(() => import('./lazyRoutes/media').then((module) => module.mediaLazyRoute));\n\n// Content (package F): entry lists and forms. Models are data, so routes carry the model's API key.\nconst contentLazy = () => import('./lazyRoutes/content').then((module) => module.contentLazyRoutes);\n\nconst contentRoute = createRoute({ getParentRoute: () => appRoute, path: 'content' }).lazy(() =>\n contentLazy().then((routes) => routes.home),\n);\n\nconst modelContentRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'content/$modelKey',\n validateSearch: contentListSearchSchema,\n}).lazy(() => contentLazy().then((routes) => routes.model));\n\nconst newEntryRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'content/$modelKey/new',\n validateSearch: entrySearchSchema,\n}).lazy(() => contentLazy().then((routes) => routes.newEntry));\n\nconst entryRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'content/$modelKey/$entryId',\n validateSearch: entrySearchSchema,\n}).lazy(() => contentLazy().then((routes) => routes.entry));\n\n// Route-level code splitting: these screens (and @shapio/schema with Models and Locales) load on first visit.\nconst settingsLazy = () => import('./lazyRoutes/settings').then((module) => module.settingsLazyRoutes);\n\nconst settingsRoute = createRoute({ getParentRoute: () => appRoute, path: 'settings' }).lazy(() =>\n settingsLazy().then((routes) => routes.settings),\n);\n\nconst settingsIndexRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: '/',\n beforeLoad: () => {\n throw redirect({ to: '/settings/profile', replace: true });\n },\n});\n\ntype SettingsLazyKey = keyof Awaited<ReturnType<typeof settingsLazy>>;\n\nconst settingsChild = <TPath extends string>(path: TPath, key: SettingsLazyKey) =>\n createRoute({ getParentRoute: () => settingsRoute, path }).lazy(() =>\n settingsLazy().then((routes) => routes[key]),\n );\n\nconst profileRoute = settingsChild('profile', 'profile');\nconst sessionsRoute = settingsChild('sessions', 'sessions');\nconst appearanceRoute = settingsChild('theme', 'theme');\nconst localesRoute = settingsChild('locales', 'locales');\nconst seoRoute = settingsChild('seo', 'seo');\nconst assistRoute = settingsChild('assist', 'assist');\nconst apiTokensRoute = settingsChild('api-tokens', 'apiTokens');\n\n// Roles and the audit log moved to the network view (sites plan §H); old links keep working.\nconst rolesRedirectRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'roles',\n beforeLoad: () => {\n throw redirect({ to: '/network/roles', replace: true });\n },\n});\n\nconst appRolesRedirectRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'roles/app',\n beforeLoad: () => {\n throw redirect({ to: '/network/roles/app', replace: true });\n },\n});\n\nconst appRoleRedirectRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'roles/app/$roleId',\n beforeLoad: ({ params }) => {\n throw redirect({ to: '/network/roles/app/$roleId', params, replace: true });\n },\n});\n\nconst auditLogRedirectRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'audit-log',\n validateSearch: auditSearchSchema,\n beforeLoad: ({ search }) => {\n throw redirect({ to: '/network/audit-log', search, replace: true });\n },\n});\n\n// The network view (sites plan §H): sites, admin users, roles and the audit log, about the whole instance.\nconst networkLazy = () => import('./lazyRoutes/network').then((module) => module.networkLazyRoutes);\n\ntype NetworkLazyKey = keyof Awaited<ReturnType<typeof networkLazy>>;\n\nconst networkRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'network',\n beforeLoad: ({ context }) => requireNetworkView(context.queryClient),\n});\n\nconst networkIndexRoute = createRoute({\n getParentRoute: () => networkRoute,\n path: '/',\n beforeLoad: () => {\n throw redirect({ to: '/network/sites', replace: true });\n },\n});\n\nconst networkChild = <TPath extends string>(path: TPath, key: NetworkLazyKey) =>\n createRoute({ getParentRoute: () => networkRoute, path }).lazy(() =>\n networkLazy().then((routes) => routes[key]),\n );\n\nconst sitesRoute = networkChild('sites', 'sites');\nconst siteRoute = networkChild('sites/$siteId', 'site');\nconst networkUsersRoute = networkChild('users', 'users');\nconst networkRolesRoute = networkChild('roles', 'roles');\nconst networkRoleRoute = networkChild('roles/$roleId', 'role');\nconst networkAppRolesRoute = networkChild('roles/app', 'appRoles');\nconst networkAppRoleRoute = networkChild('roles/app/$roleId', 'appRole');\n\n// Shared content types need schema.create on every site (any other network action opens the view).\nconst networkContentTypesRoute = createRoute({\n getParentRoute: () => networkRoute,\n path: 'content-types',\n beforeLoad: ({ context }) => requireNetworkPermission(context.queryClient, 'schema.create'),\n});\nconst networkContentTypesIndexRoute = createRoute({\n getParentRoute: () => networkContentTypesRoute,\n path: '/',\n}).lazy(() => networkLazy().then((routes) => routes.contentTypes));\nconst networkNewContentTypeRoute = createRoute({\n getParentRoute: () => networkContentTypesRoute,\n path: 'new',\n}).lazy(() => networkLazy().then((routes) => routes.newContentType));\n\nconst networkAuditLogRoute = createRoute({\n getParentRoute: () => networkRoute,\n path: 'audit-log',\n validateSearch: auditSearchSchema,\n}).lazy(() => networkLazy().then((routes) => routes.auditLog));\n\n// Publishing (package H): scheduled publications, deployments and webhooks.\nconst publishingLazy = () => import('./lazyRoutes/publishing').then((module) => module.publishingLazyRoutes);\n\ntype PublishingLazyKey = keyof Awaited<ReturnType<typeof publishingLazy>>;\n\nconst publishingRoute = createRoute({ getParentRoute: () => appRoute, path: 'publishing' }).lazy(() =>\n publishingLazy().then((routes) => routes.publishing),\n);\n\n/** `/publishing` opens the first section the admin may use. */\nconst publishingIndexRoute = createRoute({\n getParentRoute: () => publishingRoute,\n path: '/',\n beforeLoad: async ({ context }) => {\n const me = await context.queryClient.ensureQueryData(meQueryOptions);\n throw redirect({ to: firstPermittedSection(me?.globalPermissions ?? []), replace: true });\n },\n});\n\nconst publishingChild = <TPath extends string>(path: TPath, key: PublishingLazyKey) =>\n createRoute({ getParentRoute: () => publishingRoute, path }).lazy(() =>\n publishingLazy().then((routes) => routes[key]),\n );\n\nconst scheduledRoute = createRoute({\n getParentRoute: () => publishingRoute,\n path: 'scheduled',\n validateSearch: schedulesSearchSchema,\n}).lazy(() => publishingLazy().then((routes) => routes.scheduled));\n\nconst deploymentsRoute = createRoute({\n getParentRoute: () => publishingRoute,\n path: 'deployments',\n validateSearch: cursorSearchSchema,\n}).lazy(() => publishingLazy().then((routes) => routes.deployments));\n\nconst connectionRoute = createRoute({\n getParentRoute: () => publishingRoute,\n path: 'deployments/$connectionId',\n validateSearch: cursorSearchSchema,\n}).lazy(() => publishingLazy().then((routes) => routes.connection));\n\nconst runRoute = publishingChild('deployments/runs/$runId', 'run');\nconst webhooksRoute = publishingChild('webhooks', 'webhooks');\n\nconst webhookRoute = createRoute({\n getParentRoute: () => publishingRoute,\n path: 'webhooks/$webhookId',\n validateSearch: cursorSearchSchema,\n}).lazy(() => publishingLazy().then((routes) => routes.webhook));\n\n// Develop (plan developer-face): change sets, snapshots, live usage, schema as code, API explorer, GraphQL.\nconst developLazy = () => import('./lazyRoutes/develop').then((module) => module.developLazyRoutes);\n\ntype DevelopLazyKey = keyof Awaited<ReturnType<typeof developLazy>>;\n\nconst developRoute = <TPath extends string>(path: TPath, key: DevelopLazyKey) =>\n createRoute({ getParentRoute: () => appRoute, path }).lazy(() =>\n developLazy().then((routes) => routes[key]),\n );\n\nconst changesRoute = developRoute('changes', 'changes');\n\nconst changeSetRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'changes/$changeSetId',\n validateSearch: changeSetSearchSchema,\n}).lazy(() => developLazy().then((routes) => routes.changeSet));\n\nconst snapshotsRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'snapshots',\n validateSearch: snapshotsSearchSchema,\n}).lazy(() => developLazy().then((routes) => routes.snapshots));\n\nconst snapshotRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'snapshots/$seq',\n validateSearch: snapshotSearchSchema,\n}).lazy(() => developLazy().then((routes) => routes.snapshot));\n\nconst liveRoute = developRoute('live', 'live');\nconst schemaRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'schema',\n validateSearch: schemaSearchSchema,\n}).lazy(() => developLazy().then((routes) => routes.schema));\n\nconst apiExplorerRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'api-explorer',\n validateSearch: apiExplorerSearchSchema,\n}).lazy(() => developLazy().then((routes) => routes.apiExplorer));\n\nconst graphqlRoute = createRoute({\n getParentRoute: () => appRoute,\n path: 'develop/graphql',\n validateSearch: graphqlSearchSchema,\n}).lazy(() => developLazy().then((routes) => routes.graphql));\n\nconst routeTree = rootRoute.addChildren([\n setupRoute,\n loginRoute,\n forgotPasswordRoute,\n resetPasswordRoute,\n acceptInvitationRoute,\n appRoute.addChildren([\n homeRoute,\n usersRoute,\n appUsersRoute,\n modelsRoute,\n newModelRoute,\n modelBuilderRoute,\n componentBuilderRoute,\n newContentTypeRoute,\n componentsRoute,\n newComponentRoute,\n componentRoute,\n mediaRoute,\n contentRoute,\n modelContentRoute,\n newEntryRoute,\n entryRoute,\n changesRoute,\n changeSetRoute,\n snapshotsRoute,\n snapshotRoute,\n liveRoute,\n schemaRoute,\n apiExplorerRoute,\n graphqlRoute,\n publishingRoute.addChildren([\n publishingIndexRoute,\n scheduledRoute,\n deploymentsRoute,\n connectionRoute,\n runRoute,\n webhooksRoute,\n webhookRoute,\n ]),\n settingsRoute.addChildren([\n settingsIndexRoute,\n profileRoute,\n sessionsRoute,\n appearanceRoute,\n localesRoute,\n seoRoute,\n assistRoute,\n rolesRedirectRoute,\n appRolesRedirectRoute,\n appRoleRedirectRoute,\n apiTokensRoute,\n auditLogRedirectRoute,\n ]),\n networkRoute.addChildren([\n networkIndexRoute,\n sitesRoute,\n siteRoute,\n networkContentTypesRoute.addChildren([networkContentTypesIndexRoute, networkNewContentTypeRoute]),\n networkUsersRoute,\n networkRolesRoute,\n networkRoleRoute,\n networkAppRolesRoute,\n networkAppRoleRoute,\n networkAuditLogRoute,\n ]),\n ]),\n]);\n\nexport const createAppRouter = (queryClient: QueryClient) =>\n createRouter({\n routeTree,\n basepath: routerBasePath(),\n // The address bar carries the site (`/admin/s/blog/...`); routes are site-free (app/siteRewrite).\n rewrite: createSiteRewrite(() => currentSite().key),\n context: { queryClient },\n defaultPreload: 'intent',\n defaultErrorComponent: RouteError,\n // Route data comes from TanStack Query; the router shouldn't cache it a second time.\n defaultPreloadStaleTime: 0,\n scrollRestoration: true,\n });\n\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: ReturnType<typeof createAppRouter>;\n }\n}\n","import { QueryClientProvider } from '@tanstack/react-query';\nimport { RouterProvider } from '@tanstack/react-router';\nimport { useState } from 'react';\nimport { createQueryClient } from '../queryClient';\nimport { createAppRouter } from '../router';\n\n/** Providers: TanStack Query (server state) and the router. Theme, i18n and toasts live in RootLayout/main. */\nexport const App = () => {\n const [queryClient] = useState(createQueryClient);\n const [router] = useState(() => createAppRouter(queryClient));\n return (\n <QueryClientProvider client={queryClient}>\n <RouterProvider router={router} />\n </QueryClientProvider>\n );\n};\n","import { StrictMode } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { App } from './app/App';\nimport { initI18n } from './app/i18n';\nimport './styles/index.css';\n\nconst container = document.getElementById('root');\nif (!container) {\n throw new Error('Missing #root element');\n}\n\nawait initI18n();\n\ncreateRoot(container).render(\n <StrictMode>\n <App />\n </StrictMode>,\n);\n"],"file":"index-DoJsnLI1.js"}