@wildo-ai/application-creation-workbench 1.1.14 → 1.1.15

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 (179) hide show
  1. package/dist/.vite/manifest.json +552 -552
  2. package/dist/assets/{ChartEmptyState-DOlrd3QL.js → ChartEmptyState-ZXRcbrLV.js} +1 -1
  3. package/dist/assets/ChartLoadingSkeleton-BRWWLwJE.js +1 -0
  4. package/dist/assets/{ChartView-nQvehKAl.js → ChartView-B6f1J6Er.js} +2 -2
  5. package/dist/assets/ChartWidget-29BcqLsQ.js +5 -0
  6. package/dist/assets/{abnfDiagram-VCTEODGH-BOSMF_iF.js → abnfDiagram-VCTEODGH-BuQmdgCH.js} +1 -1
  7. package/dist/assets/{af-1WnNPqq-.js → af-CBNa7AYn.js} +1 -1
  8. package/dist/assets/{ar-I_OTuA6g.js → ar-RghUrw-U.js} +1 -1
  9. package/dist/assets/{architectureDiagram-5GKGNRK7-F_DICN7K.js → architectureDiagram-5GKGNRK7-BVyAQs-b.js} +1 -1
  10. package/dist/assets/badge-tone-Ci8vno_R.js +5 -0
  11. package/dist/assets/{bg-BNynXrJg.js → bg-D_WdYZi3.js} +1 -1
  12. package/dist/assets/{blockDiagram-I7D4REHJ-vdakidUW.js → blockDiagram-I7D4REHJ-R2VdOZ1H.js} +1 -1
  13. package/dist/assets/{bn-IoUqFxhs.js → bn-Do7unCCm.js} +1 -1
  14. package/dist/assets/{c4Diagram-7LVT6UL2-cnHP-5K7.js → c4Diagram-7LVT6UL2-Bslw228e.js} +1 -1
  15. package/dist/assets/{ca-CWN_9uem.js → ca-CRZTbRqC.js} +1 -1
  16. package/dist/assets/channel-DxaB-rRG.js +1 -0
  17. package/dist/assets/{chunk-4HAMMTFA-C6G-f7n3.js → chunk-4HAMMTFA-DUDg3eHK.js} +1 -1
  18. package/dist/assets/{chunk-75Z2AOVW-DiyJkf0q.js → chunk-75Z2AOVW-DaeXzHyk.js} +1 -1
  19. package/dist/assets/{chunk-DU6HZSFF-Dy7jxNH_.js → chunk-DU6HZSFF-B3UMRfg8.js} +2 -2
  20. package/dist/assets/{chunk-F27PBJKO-CkvHG7F6.js → chunk-F27PBJKO-BEX6D1-n.js} +1 -1
  21. package/dist/assets/{chunk-GMAD6QVW-DsY6Jtz4.js → chunk-GMAD6QVW-ZsbK8Hyz.js} +1 -1
  22. package/dist/assets/{chunk-GVQU2GXP-BE5D92zU.js → chunk-GVQU2GXP-CFgk1428.js} +1 -1
  23. package/dist/assets/{chunk-IMKFNOWR-CAwOIW4R.js → chunk-IMKFNOWR-Bl09s7a_.js} +1 -1
  24. package/dist/assets/{chunk-L3NEJ4N5-B1mDlHi1.js → chunk-L3NEJ4N5-zKVzE7OW.js} +1 -1
  25. package/dist/assets/{chunk-OSK3NFVY-iylVXGs0.js → chunk-OSK3NFVY-BmuNqHzQ.js} +1 -1
  26. package/dist/assets/{chunk-P2QGCYS3-CvcRZ6j9.js → chunk-P2QGCYS3-C2tydC-M.js} +1 -1
  27. package/dist/assets/{chunk-POPQ4Y6H-CNbcNXVN.js → chunk-POPQ4Y6H-DNak0l6w.js} +1 -1
  28. package/dist/assets/{chunk-PWAF6VOD-BorA01Hz.js → chunk-PWAF6VOD-D95y-mRG.js} +1 -1
  29. package/dist/assets/{chunk-SHT3W25Y-DNWg7N7_.js → chunk-SHT3W25Y-BK0XKr9M.js} +1 -1
  30. package/dist/assets/{chunk-SVP7TREG-C_gZGZzY.js → chunk-SVP7TREG-CD0633UP.js} +1 -1
  31. package/dist/assets/{chunk-TICWLB2K-CG8L7csD.js → chunk-TICWLB2K-C_TN_qXz.js} +1 -1
  32. package/dist/assets/classDiagram-ZZMXUADV-Cb5NNOFP.js +1 -0
  33. package/dist/assets/classDiagram-v2-VYDZK3BY-Cb5NNOFP.js +1 -0
  34. package/dist/assets/{cm6-editor-BrI954sl.js → cm6-editor-CsI0AZDl.js} +3 -3
  35. package/dist/assets/{code-block-IT6T5CEO-P8OONT1n.js → code-block-IT6T5CEO-rh8d07_F.js} +1 -1
  36. package/dist/assets/{context-BNM55Snb.js → context-9KbckYZi.js} +1 -1
  37. package/dist/assets/{cs-CmgNpjMj.js → cs-LJwt8LR2.js} +1 -1
  38. package/dist/assets/{cy-zQX_QEXD.js → cy-BlvpCYgb.js} +1 -1
  39. package/dist/assets/{cynefinDiagram-5FMLGOSQ-Drk0vtFB.js → cynefinDiagram-5FMLGOSQ-DxRmh9t5.js} +1 -1
  40. package/dist/assets/{da-CjOdj32R.js → da-BUvDMABw.js} +1 -1
  41. package/dist/assets/{dagre-GXQ25YYZ-CLrGf0om.js → dagre-GXQ25YYZ-w2hLzSss.js} +1 -1
  42. package/dist/assets/{de-AT-BLeHD7-g.js → de-AT-CMYX-FSX.js} +1 -1
  43. package/dist/assets/{de-CwLcXmDQ.js → de-Cg_5asH4.js} +1 -1
  44. package/dist/assets/{diagram-S7CK7UJ4-B-ZdgPTX.js → diagram-S7CK7UJ4-CNrSaCrT.js} +1 -1
  45. package/dist/assets/{diagram-UQ7AKVKN-BkKvmg4L.js → diagram-UQ7AKVKN-BEoR36FG.js} +1 -1
  46. package/dist/assets/{diagram-VSXAHHWV-HiaAFHhk.js → diagram-VSXAHHWV-Dy8S8rIp.js} +1 -1
  47. package/dist/assets/{diagram-VX7I27RA-DwkAZ58D.js → diagram-VX7I27RA-BC8Xf9f0.js} +1 -1
  48. package/dist/assets/{diagram-Z3DM3KII-D-cMFf4d.js → diagram-Z3DM3KII-CKiC1nrY.js} +1 -1
  49. package/dist/assets/{dist-BgSqI6_g.js → dist-1-HCT6qM.js} +1 -1
  50. package/dist/assets/{dist-DJ3oXpIs.js → dist-BQ8k61qr.js} +1 -1
  51. package/dist/assets/{dist-CPuGLmxI.js → dist-BYbvqYeK.js} +1 -1
  52. package/dist/assets/{dist-kKXf1Bjx.js → dist-Bi-7RiEi.js} +1 -1
  53. package/dist/assets/{dist-BHvGeTYl.js → dist-Ble3IUnd.js} +1 -1
  54. package/dist/assets/{dist-tfb1xShq.js → dist-BuE0_QYF.js} +1 -1
  55. package/dist/assets/{dist-CJxRNwMR.js → dist-C2PLdFfo.js} +1 -1
  56. package/dist/assets/{dist-Dy2TKEdf.js → dist-CSrdLN_Y.js} +1 -1
  57. package/dist/assets/{dist-7Nz9yNhS.js → dist-CY9MvaM1.js} +1 -1
  58. package/dist/assets/{dist-CE3k7Kha.js → dist-CgVofDKX.js} +1 -1
  59. package/dist/assets/{dist-CRpxTWEh.js → dist-Ciqde0Ol.js} +1 -1
  60. package/dist/assets/{dist-BCRkZyjz.js → dist-Cj_xL7Es.js} +1 -1
  61. package/dist/assets/{dist-DlNJgHFc.js → dist-D7MnPcGE.js} +1 -1
  62. package/dist/assets/{dist-5fOMJ27f.js → dist-DBEagOph.js} +1 -1
  63. package/dist/assets/{dist-BxwAVf7j.js → dist-DCP6b5Yp.js} +1 -1
  64. package/dist/assets/{dist-Cuhv1Fm_.js → dist-DChuQCpL.js} +1 -1
  65. package/dist/assets/{dist-KJ6-32V3.js → dist-DOFuKjhK.js} +1 -1
  66. package/dist/assets/{dist-OpJd06F1.js → dist-DXUYhDMM.js} +1 -1
  67. package/dist/assets/{dist-DgFx0nHw.js → dist-Dek2gQIT.js} +1 -1
  68. package/dist/assets/{dist-CstXuejQ.js → dist-ddtYIZHC.js} +1 -1
  69. package/dist/assets/{dist-CPhv_Fl3.js → dist-jCSCdtJ7.js} +1 -1
  70. package/dist/assets/{dist-CFrG-Mt_.js → dist-ngz3bapC.js} +1 -1
  71. package/dist/assets/{dist-ByMsVuIk.js → dist-ssfnxGX1.js} +1 -1
  72. package/dist/assets/{dropbox-picker-C9r5F3kM.js → dropbox-picker-YaUvIgU1.js} +1 -1
  73. package/dist/assets/{ebnfDiagram-PWID7BFC-DrvpEZ_f.js → ebnfDiagram-PWID7BFC-CBnxtxcg.js} +1 -1
  74. package/dist/assets/{el-CWW60iH9.js → el-5l_HfQh-.js} +1 -1
  75. package/dist/assets/{en-AU-BossA0Rn.js → en-AU-DIy7kJ-6.js} +1 -1
  76. package/dist/assets/{en-CA-DATw2cVB.js → en-CA-BY8gTlj5.js} +1 -1
  77. package/dist/assets/{en-GB-CUli1ZoP.js → en-GB-BGqFfEzK.js} +1 -1
  78. package/dist/assets/{erDiagram-RLTQ6QDP-aafi4jCY.js → erDiagram-RLTQ6QDP-ZW5EDEeK.js} +1 -1
  79. package/dist/assets/{es-qp1wsCMr.js → es-Bb0Mmwm4.js} +1 -1
  80. package/dist/assets/{esm-B3AZ9HP5.js → esm-CfFZhCCl.js} +1 -1
  81. package/dist/assets/esm-DDY4jF6a.js +46 -0
  82. package/dist/assets/{et-CuSdGi0t.js → et-BSa6lvqX.js} +1 -1
  83. package/dist/assets/{eu-xCnVjdHU.js → eu-9Yfh6o5v.js} +1 -1
  84. package/dist/assets/{fa-IR-DZ3ibPOw.js → fa-IR-BlqDoYrh.js} +1 -1
  85. package/dist/assets/{fi-g4XjAI_I.js → fi-Cj9cD91h.js} +1 -1
  86. package/dist/assets/flowDiagram-HODETNUW-Br3H18HF.js +1 -0
  87. package/dist/assets/{flows-actors-graph-runtime-DeTt1QCB.js → flows-actors-graph-runtime-YwzVDPst.js} +1 -1
  88. package/dist/assets/{fr-BhOuGXkV.js → fr-B0qYMnPX.js} +1 -1
  89. package/dist/assets/{fr-CA-BYF9Kaol.js → fr-CA-C2acOTEv.js} +1 -1
  90. package/dist/assets/{ganttDiagram-EL5Y4UJY-CRmnjbyh.js → ganttDiagram-EL5Y4UJY-D0NWXhSy.js} +1 -1
  91. package/dist/assets/{gitGraphDiagram-WWUBYQGX-C4ebHhmy.js → gitGraphDiagram-WWUBYQGX-C16HvgtP.js} +1 -1
  92. package/dist/assets/{gl-BLfeYzoG.js → gl-Ce_1v5yA.js} +1 -1
  93. package/dist/assets/{google-drive-picker-3-SZkSfN.js → google-drive-picker-DL6kxOGz.js} +1 -1
  94. package/dist/assets/{graph-runtime-BbbtydnB.js → graph-runtime-BDCDECWS.js} +1 -1
  95. package/dist/assets/{he-BXMp0P82.js → he-fssXNSLh.js} +1 -1
  96. package/dist/assets/{hi-BmH5--Ew.js → hi-wjit_WaO.js} +1 -1
  97. package/dist/assets/{hr-CsQDZ0KK.js → hr-CZcH_ib_.js} +1 -1
  98. package/dist/assets/{hu-DiL5YUSE.js → hu-DmApBwDg.js} +1 -1
  99. package/dist/assets/{id-1Vn21CD0.js → id-CaQxvUk5.js} +1 -1
  100. package/dist/assets/index-CZ5sv4PP.css +2 -0
  101. package/dist/assets/index-Da7nRw0z.js +202 -0
  102. package/dist/assets/{infoDiagram-27XIBGKW-CplMaWp5.js → infoDiagram-27XIBGKW-BB9zejj7.js} +1 -1
  103. package/dist/assets/{is-CByKTwFK.js → is-C7YkCQSO.js} +1 -1
  104. package/dist/assets/isSameWeek-B-QyK2gA.js +1 -0
  105. package/dist/assets/{ishikawaDiagram-5VMMS53U-BREas_JM.js → ishikawaDiagram-5VMMS53U-D0VdeBWj.js} +1 -1
  106. package/dist/assets/{it-CPNWwvi0.js → it--OaDSi8G.js} +1 -1
  107. package/dist/assets/{ja-D9Jm250G.js → ja-BZII__KN.js} +1 -1
  108. package/dist/assets/{journeyDiagram-3NMN7TZE-DWHGp6os.js → journeyDiagram-3NMN7TZE-BAlcsabK.js} +1 -1
  109. package/dist/assets/{kanban-definition-UXKFOSKX-CP-1mPST.js → kanban-definition-UXKFOSKX-DpR1bfHx.js} +1 -1
  110. package/dist/assets/katex-CHQwrTZL.js +1 -0
  111. package/dist/assets/{ko-CpsoMmES.js → ko-RpFeRS3z.js} +1 -1
  112. package/dist/assets/{line-C_Dg3XTF.js → line-sQ28MnTc.js} +1 -1
  113. package/dist/assets/{linear-DMyAYyr-.js → linear-B5bg3HtL.js} +1 -1
  114. package/dist/assets/{lt-Ckx9bY2o.js → lt-Mb4LqnAa.js} +1 -1
  115. package/dist/assets/{lv-DZt3HT5G.js → lv-D333_Qfx.js} +1 -1
  116. package/dist/assets/{markdown-stream-runtime-CMB_Qu0K.js → markdown-stream-runtime-kB8TMEpF.js} +4 -4
  117. package/dist/assets/{match-_OgMbUjy.js → match-BwzNbvxk.js} +1 -1
  118. package/dist/assets/{match-CLYNQBt4.js → match-DQpkdx9H.js} +1 -1
  119. package/dist/assets/mermaid-VLURNSYL-DUd6jtzD.js +1 -0
  120. package/dist/assets/{mermaid.core-D_DICvzX.js → mermaid.core-DY7EfcRK.js} +4 -4
  121. package/dist/assets/{mindmap-definition-YA3MSWOX-C20ANuWc.js → mindmap-definition-YA3MSWOX-DAHZInIk.js} +1 -1
  122. package/dist/assets/{ms-C7UJy830.js → ms-CLbOeyRX.js} +1 -1
  123. package/dist/assets/{mt-8KsNOVwG.js → mt-PLOofk2t.js} +1 -1
  124. package/dist/assets/{nb-C7YQIAOB.js → nb-DxwrcYvh.js} +1 -1
  125. package/dist/assets/{nl-UadnkhJV.js → nl-CzRLOR7M.js} +1 -1
  126. package/dist/assets/node-YCCWYXNI.js +2 -0
  127. package/dist/assets/{onedrive-picker-C_4mWMyM.js → onedrive-picker-B79jNUe8.js} +1 -1
  128. package/dist/assets/{pdf-viewer-By7fQHYQ.js → pdf-viewer-CslUZhU5.js} +1 -1
  129. package/dist/assets/{pegDiagram-XKGWAZYB-DVbFO1Fa.js → pegDiagram-XKGWAZYB-Dq7UThjR.js} +1 -1
  130. package/dist/assets/{pieDiagram-E7YTZNPT-DWtaagpj.js → pieDiagram-E7YTZNPT-Dl3n9rSp.js} +1 -1
  131. package/dist/assets/{pl-DaJL5jLd.js → pl-gbLhckq3.js} +1 -1
  132. package/dist/assets/{pt-BR-zn9BrDVb.js → pt-BR-R1rW_1OL.js} +1 -1
  133. package/dist/assets/{pt-BHQDKf9o.js → pt-BwcWNQjq.js} +1 -1
  134. package/dist/assets/{public-runtime-f4VjjFok.js → public-runtime-8slf2C-u.js} +1 -1
  135. package/dist/assets/{quadrantDiagram-AXDQQJYC-CJvBFA_c.js → quadrantDiagram-AXDQQJYC-_GKiRjuD.js} +1 -1
  136. package/dist/assets/{railroadDiagram-O6MQD6OU-Dygrn5Zv.js → railroadDiagram-O6MQD6OU-6CUNSmGg.js} +1 -1
  137. package/dist/assets/{requirementDiagram-BXWQKSXE-BpnohlUt.js → requirementDiagram-BXWQKSXE-BPl-usp2.js} +1 -1
  138. package/dist/assets/{ro-BdQOzb6t.js → ro-DdDjuWNa.js} +1 -1
  139. package/dist/assets/{ru-BmbP3F22.js → ru-BawxQnYH.js} +1 -1
  140. package/dist/assets/{sankeyDiagram-P5KCCOFB-Cyy3VaYL.js → sankeyDiagram-P5KCCOFB-DZKA85RO.js} +1 -1
  141. package/dist/assets/{sequenceDiagram-WJ2MYXX4-GaYcTb-c.js → sequenceDiagram-WJ2MYXX4-BJQcyiuO.js} +1 -1
  142. package/dist/assets/{sk-Deobe1dz.js → sk-MRZEZ2K_.js} +1 -1
  143. package/dist/assets/{sl-DDWo-_WQ.js → sl-BBub_-u1.js} +1 -1
  144. package/dist/assets/{stateDiagram-D77RDMKH-DGiRCD9r.js → stateDiagram-D77RDMKH-B-0Pxnb4.js} +1 -1
  145. package/dist/assets/stateDiagram-v2-MP3YSRHH-Ctzs0iNL.js +1 -0
  146. package/dist/assets/{sv-DQUMehtC.js → sv-C4z9pgWx.js} +1 -1
  147. package/dist/assets/{swimlanes-42K2YHIH-D7xJP0pw.js → swimlanes-42K2YHIH-oICSfvZv.js} +1 -1
  148. package/dist/assets/swimlanesDiagram-VR7AAH4N-Bhf7f3Wn.js +8 -0
  149. package/dist/assets/{ta-CzkRFNns.js → ta-1G1MUVAA.js} +1 -1
  150. package/dist/assets/{th-DR6hfS-t.js → th-CbVjLGeK.js} +1 -1
  151. package/dist/assets/{timeline-definition-24CTP7MA-DTJnlCQe.js → timeline-definition-24CTP7MA-DmKkaTSI.js} +1 -1
  152. package/dist/assets/{tr-ECW9jg6T.js → tr-CL1-pTfR.js} +1 -1
  153. package/dist/assets/useI18n-DcSZnYEx.js +171 -0
  154. package/dist/assets/{vennDiagram-4TSXK5OY-CFat-M74.js → vennDiagram-4TSXK5OY-CnK77vBm.js} +1 -1
  155. package/dist/assets/{vi-D2nRiUXf.js → vi-1ZMJLve8.js} +1 -1
  156. package/dist/assets/{wardleyDiagram-VM6X3IG4-h29SCI73.js → wardleyDiagram-VM6X3IG4-DkkVnAra.js} +1 -1
  157. package/dist/assets/{xychartDiagram-S5SC5T6Z-B8S8taDj.js → xychartDiagram-S5SC5T6Z-DXVlr43t.js} +1 -1
  158. package/dist/assets/{zh-CN-Cn0aI883.js → zh-CN-uOTSXSf7.js} +1 -1
  159. package/dist/assets/{zh-HK-DxBG0PaI.js → zh-HK-CNYirMD2.js} +1 -1
  160. package/dist/assets/{zh-TW-DHK1J7Rs.js → zh-TW-DB-dAf15.js} +1 -1
  161. package/dist/index.html +10 -10
  162. package/package.json +9 -9
  163. package/dist/assets/ChartLoadingSkeleton-BlVB40sh.js +0 -1
  164. package/dist/assets/ChartWidget-CZ5NXj5y.js +0 -5
  165. package/dist/assets/badge-tone-B1Pd5hFs.js +0 -5
  166. package/dist/assets/channel-Dn5Kml0R.js +0 -1
  167. package/dist/assets/classDiagram-ZZMXUADV-DZBHmNh2.js +0 -1
  168. package/dist/assets/classDiagram-v2-VYDZK3BY-DZBHmNh2.js +0 -1
  169. package/dist/assets/esm-GB9ACU6Q.js +0 -46
  170. package/dist/assets/flowDiagram-HODETNUW-RzRAndm9.js +0 -1
  171. package/dist/assets/index-Bcdys-EF.css +0 -2
  172. package/dist/assets/index-TNOEipJX.js +0 -202
  173. package/dist/assets/isSameWeek-Bf15BL-p.js +0 -1
  174. package/dist/assets/katex-Dp9rtsw4.js +0 -1
  175. package/dist/assets/mermaid-VLURNSYL-DXNPK6wv.js +0 -1
  176. package/dist/assets/node-nqfXDpgr.js +0 -2
  177. package/dist/assets/stateDiagram-v2-MP3YSRHH-CZRVHb2L.js +0 -1
  178. package/dist/assets/swimlanesDiagram-VR7AAH4N-C2KDCowk.js +0 -8
  179. package/dist/assets/useI18n-CrrUk_L3.js +0 -171
@@ -1,5 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChartView-nQvehKAl.js","assets/rolldown-runtime-BWaJ3C7D.js","assets/jsx-runtime-lTuChwRC.js","assets/react-9WV3M1gM.js","assets/useI18n-CrrUk_L3.js","assets/public-runtime-f4VjjFok.js","assets/bundle-mjs-H9shJLym.js","assets/badge-tone-B1Pd5hFs.js","assets/ChartEmptyState-DOlrd3QL.js","assets/ChartLoadingSkeleton-BlVB40sh.js"])))=>i.map(i=>d[i]);
2
- import{a as e,r as t}from"./rolldown-runtime-BWaJ3C7D.js";import{t as n}from"./jsx-runtime-lTuChwRC.js";import{t as r}from"./react-9WV3M1gM.js";import{$t as i,Bn as a,D as o,E as s,Et as c,In as l,Kt as u,N as d,P as f,Pn as p,Qt as m,Tt as h,Wt as g,Zt as _,c as v,d as y,er as b,et as x,f as S,ft as C,n as w,nt as T,p as E,rt as D,s as O,t as k,tt as A,zn as j}from"./ChartLoadingSkeleton-BlVB40sh.js";import{ot as M}from"./public-runtime-f4VjjFok.js";import{$b as N,Ar as P,Ba as F,Co as I,DD as L,Da as R,Eb as z,Ef as ee,Fr as te,Ft as B,Gb as V,Gr as H,Hr as U,Ii as ne,Il as re,Ir as ie,It as W,Ja as ae,Jb as oe,Jo as se,Jr as ce,Ka as le,Kb as ue,Kp as de,Kr as G,Lr as fe,Mf as pe,Mp as me,Ob as K,QE as he,Qb as ge,Qr as _e,Rn as q,Sb as ve,Tt as ye,Ur as be,Vb as xe,Wo as Se,Wp as Ce,Xo as we,Yb as Te,Yr as Ee,Yt as De,Yy as Oe,Zr as ke,_c as Ae,an as je,ax as J,bt as Me,c as Ne,cc as Pe,d as Fe,db as Ie,df as Le,dm as Re,ei as ze,eo as Be,ex as Ve,fb as He,fh as Ue,fm as We,fn as Ge,gc as Ke,gh as qe,go as Je,hd as Ye,ho as Xe,ib as Ze,ix as Qe,jb as $e,jp as et,k as tt,kr as Y,lb as nt,lc as rt,lx as it,mc as at,mo as ot,n as st,ni as ct,nt as lt,o as ut,od as dt,ox as ft,pd as pt,pm as mt,pn as ht,qT as gt,qb as X,qm as _t,qo as vt,ra as yt,ry as bt,sb as xt,sc as St,sn as Ct,t as wt,ti as Tt,tt as Et,ua as Dt,ub as Ot,uc as kt,v as At,vb as jt,vc as Mt,vo as Nt,w as Pt,wb as Ft,wo as It,yD as Lt,yb as Rt,zr as Z}from"./useI18n-CrrUk_L3.js";import{t as zt}from"./react-dom-DQGBdIds.js";import{t as Bt}from"./preload-helper-7y9sWmk5.js";var Q=e(r(),1),Vt=e(zt(),1);function Ht(e){let t=e.registry.resourceConfigurations[e.resourceType]?.frontendConfiguration;return[...(t?.compositeViews??[]).map(e=>({viewRef:e.ref,family:`composite`,scope:e.scope})),...(t?.chartViews??[]).map(e=>({viewRef:e.ref,family:`chart`,scope:e.scope})),...(t?.executionViews??[]).map(e=>({viewRef:e.ref,family:`execution`,scope:e.scope}))]}function Ut(e){return Ht({resourceType:e.resourceType,registry:e.registry}).filter(t=>t.viewRef===e.viewRef)}function Wt(e){let t=Ut(e);return t.length===1?{family:t[0].family,scope:t[0].scope}:null}var Gt=n(),Kt=.25;function qt(e){let{contentAreaWidth:t,paneMinWidthPx:n}=e;if(!t||t<=0)return!0;let r=t*Kt,i=n??r,a=e.occupiedByOtherPanesPx??0;return r+i+a<=t}function Jt(e){return e.viewport===gt.MOBILE||e.viewport===gt.VERT_TABLET||!qt({contentAreaWidth:e.contentAreaWidth,paneMinWidthPx:e.zoneConfig?.minWidth})}function Yt(e){return e.zone===X.PRIMARY||!Jt({zoneConfig:e.layout?.zones?.[e.zone],viewport:e.viewport,contentAreaWidth:e.contentAreaWidth})}var Xt={[gt.MOBILE]:[gt.MOBILE,gt.VERT_TABLET,gt.DESKTOP],[gt.VERT_TABLET]:[gt.VERT_TABLET,gt.DESKTOP],[gt.DESKTOP]:[gt.DESKTOP]};function Zt(e){if(!Jt(e))return;let t=e.zoneConfig?.responsiveCollapse;return t?Qt(t,e.viewport)??Te.PUSH:Te.PUSH}function Qt(e,t){if(e==null)return;if(typeof e!=`object`||!$t(e))return e;let n=e,r=Xt[t]??[t];for(let e of r)if(e in n)return n[e]}function $t(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e),n=new Set(Object.values(gt));return t.length>0&&t.some(e=>n.has(e))}var en=V.PUSH,tn=new class{resolve(e,t){let n=this.resolveTransition(e,t),r=n.config,i=ge(r),a=N(r),o=Ve(r),s=[],c=this.deriveTargetZone(i,e,t,o),l=c.zone;c.adjustment&&s.push(c.adjustment);let u=c.adjustment===U.SPLIT_ESCALATED_NO_ADJACENT_ZONE||c.adjustment===U.PERSISTENT_SPLIT_ESCALATED_NO_COMPANION?V.OVERLAY:i;if(e.operationSurface===Ft.EMBEDDED&&l!==G.OVERLAY&&(u!==V.SPLIT||e.zoneOccupancy?.[l]===!0)&&u!==V.INPLACE)return s.push(U.EMBEDDED_COERCED_TO_OVERLAY),{targetZone:G.OVERLAY,transition:V.OVERLAY,appearance:this.deriveAppearance(V.OVERLAY,e,t),collapsed:!1,ephemeral:a||void 0,provenance:{transitionSource:n.source,authoredTransition:i,adjustments:s}};let d=this.resolveCollapseMode(l,e,t),f=d===Te.OVERLAY?G.OVERLAY:d===Te.PUSH?X.PRIMARY:l,p=d===Te.OVERLAY?V.OVERLAY:d===Te.PUSH?V.PUSH:u;d===Te.OVERLAY?s.push(U.RESPONSIVE_COLLAPSE_OVERLAY):d===Te.PUSH&&s.push(U.RESPONSIVE_COLLAPSE_PUSH);let m=e.relationshipMaxDepth??t.maxDepth,h=f===G.OVERLAY?void 0:e.zoneDepth[f],g=m!==void 0&&h!==void 0&&p===V.PUSH&&h>=m,_=g?G.OVERLAY:f,v=g?V.OVERLAY:p;g&&s.push(U.DEPTH_CEILING_ESCALATED_TO_OVERLAY);let y=this.deriveAppearance(v,e,t),b=d!==void 0;return{targetZone:_,transition:v,appearance:y,overlayBehavior:v===V.OVERLAY?this.resolveOverlayBehavior(e):void 0,collapsed:b,collapsedFromZone:b?l:void 0,ephemeral:a||void 0,persistent:o&&_!==G.OVERLAY?!0:void 0,provenance:{transitionSource:n.source,authoredTransition:i,adjustments:s}}}degradeInPlaceToOverlay(e,t,n){return{targetZone:G.OVERLAY,transition:V.OVERLAY,appearance:this.deriveAppearance(V.OVERLAY,e,t),overlayBehavior:this.resolveOverlayBehavior(e),collapsed:!1,ephemeral:n.ephemeral,provenance:{transitionSource:n.provenance.transitionSource,authoredTransition:n.provenance.authoredTransition,adjustments:[...n.provenance.adjustments,U.INPLACE_DEGRADED_TO_OVERLAY]}}}resolveTransition(e,t){let n=this.checkOperationOverrides(e);if(n)return{config:n,source:H.OPERATION_OVERRIDE};if(e.actionPresentationIsAuthored===!0&&e.actionPresentationTransition!==void 0)return{config:e.actionPresentationTransition,source:H.AUTHORED_ACTION_PRESENTATION};if(e.relationshipTransition!==void 0)return{config:e.relationshipTransition,source:H.RELATIONSHIP};let r=this.checkViewportOverride(e,t);if(r)return{config:r,source:H.VIEWPORT_OVERRIDE};let i=this.getSourceTransitions(e,t);if(i.transitions){let t=this.getTransitionBySemanticKey(i.transitions,e);if(t)return{config:t,source:i.borrowedFromPrimary?H.OVERLAY_FALLBACK_TO_PRIMARY:H.SOURCE_TRANSITIONS}}return e.actionPresentationTransition===void 0?{config:en,source:H.FRAMEWORK_DEFAULT}:{config:e.actionPresentationTransition,source:H.DERIVED_ACTION_PRESENTATION}}checkOperationOverrides(e){if(e.operationOverrides?.length){for(let t of e.operationOverrides)if(this.overrideMatches(t,e))return t.transition}}overrideMatches(e,t){return!(e.fromZone!==void 0&&e.fromZone!==t.sourceZone||e.viewport!==void 0&&e.viewport!==t.viewport)}checkViewportOverride(e,t){if(e.viewport===gt.DESKTOP)return;let n=t[e.viewport];if(n?.transitions)return this.getTransitionBySemanticKey(n.transitions,e)}getTransitionBySemanticKey(e,t){let n=t.effectiveOperation??(Object.values(J).includes(t.operation)?t.operation:void 0);if(n)return e[n]}getSourceTransitions(e,t){if(e.sourceZone===`appLevel`)return{transitions:t.appLevel?.transitions,borrowedFromPrimary:!1};if(e.sourceZone===`overlay`){let n=t.fromOverlay?.transitions;return(n&&this.getTransitionBySemanticKey(n,e))===void 0?{transitions:t.zones.primary?.transitions,borrowedFromPrimary:!0}:{transitions:n,borrowedFromPrimary:!1}}return{transitions:t.zones[e.sourceZone]?.transitions,borrowedFromPrimary:!1}}deriveTargetZone(e,t,n,r){switch(e){case V.PUSH:case V.REPLACE:case V.INPLACE:return{zone:this.getStructuralSourceZone(t)};case V.SPLIT:return this.resolveSplitTarget(t,n,r);case V.OVERLAY:return{zone:G.OVERLAY};case V.PROMOTE:return{zone:X.PRIMARY};default:return{zone:X.PRIMARY}}}getStructuralSourceZone(e){return e.sourceZone===`appLevel`||e.sourceZone===`overlay`?X.PRIMARY:e.sourceZone}resolveSplitTarget(e,t,n){return n?t.zones.companion?{zone:X.COMPANION,adjustment:this.splitOutcomeFor(e,X.COMPANION)}:{zone:G.OVERLAY,adjustment:U.PERSISTENT_SPLIT_ESCALATED_NO_COMPANION}:t.zones.secondary?e.zoneOccupancy?.[X.SECONDARY]?t.zones.companion&&!e.zoneOccupancy?.[X.COMPANION]?{zone:X.COMPANION,adjustment:U.SPLIT_OPENED_FREE_PANE}:{zone:X.SECONDARY,adjustment:U.SPLIT_REPLACED_OCCUPIED_PANE}:{zone:X.SECONDARY,adjustment:U.SPLIT_OPENED_FREE_PANE}:t.zones.companion?{zone:X.COMPANION,adjustment:this.splitOutcomeFor(e,X.COMPANION)}:{zone:G.OVERLAY,adjustment:U.SPLIT_ESCALATED_NO_ADJACENT_ZONE}}splitOutcomeFor(e,t){return e.zoneOccupancy?.[t]===!0?U.SPLIT_REPLACED_OCCUPIED_PANE:U.SPLIT_OPENED_FREE_PANE}deriveAppearance(e,t,n){if(e!==V.OVERLAY)return;if(t.operationOverrides?.length){for(let e of t.operationOverrides)if(this.overrideMatches(e,t)&&e.appearance!==void 0)return Qt(e.appearance,t.viewport)}let r=this.getSourceAppearance(t,n);if(e===V.OVERLAY)return Qt(r?.overlay,t.viewport)??oe.DIALOG}resolveOverlayBehavior(e){if(e.operationOverrides?.length){for(let t of e.operationOverrides)if(this.overrideMatches(t,e)&&t.overlayBehavior!==void 0)return t.overlayBehavior}}getSourceAppearance(e,t){return e.sourceZone===`appLevel`?t.appLevel?.appearance:e.sourceZone===`overlay`?t.zones.primary?.appearance:t.zones[e.sourceZone]?.appearance}resolveCollapseMode(e,t,n){if(e!==G.OVERLAY&&e!==X.PRIMARY)return Zt({zoneConfig:n.zones[e],viewport:t.viewport,contentAreaWidth:t.contentAreaWidth})}},nn;(function(e){e.CHILD_ID=`child-id`,e.PARENT_CONTEXT_SINGLETON=`parent-context-singleton`,e.ASSOCIATION_COMPLETE_CONTEXT=`association-complete-context`})(nn||={});function rn(e,t,n){let r=n.resourceFieldIdentifier;return(e.initiatorInfos??[]).some(e=>(e.parameters??[]).some(e=>e.fieldIdentifier===r||e.relationshipField===r||e.resourceType===t))}function an(e,t){return bt.ensureCompiledRelationshipBuckets.call(bt,e,t.allResourceFieldIdentifiers)}function on(e){if(e.operation.isBulkOperation===!0)return!1;let t=ht(e.operation);return t===J.READ||t===J.UPDATE||t===J.DELETE||t===void 0&&rn(e.operation,e.resourceType,e.resourceConfig)}function sn(e){if(typeof e==`string`&&e.length>0)return e;if(e&&typeof e==`object`){let t=e.resourceId;if(typeof t==`string`&&t.length>0)return t}}function cn(e){let t=e.contextResourceIdentifiers??{};if(sn(t[e.parentResourceType])||sn(t[e.foreignKeyField])||e.parentResourceFieldIdentifier&&sn(t[e.parentResourceFieldIdentifier]))return!0;let n=e.contextualParameters??{},r=n[e.foreignKeyField];if(r!==void 0&&String(r).length>0)return!0;let i=e.parentResourceFieldIdentifier?n[e.parentResourceFieldIdentifier]:void 0;return i!==void 0&&String(i).length>0}function ln(e){if(sn((e.contextResourceIdentifiers??{})[e.foreignKeyField]))return!0;let t=e.contextualParameters?.[e.foreignKeyField];return t!==void 0&&String(t).length>0}function un(e,t){let n=e.initiatorInfos??[];return n.length!==0&&n.some(e=>e.parameters?.some(e=>e.fieldIdentifier===t))}function dn(e){let t=e.operation.initiatorInfos??[];return t.length!==0&&t.some(t=>{let n=t.parameters??[];return n.some(t=>t.fieldIdentifier===e.resourceFieldIdentifier)?n.every(t=>{let n=[t.fieldIdentifier,t.relationshipField,t.resourceType].filter(e=>typeof e==`string`&&e.length>0);return n.length!==0&&n.some(t=>{if(t===e.resourceFieldIdentifier&&e.hasResourceId===!0||sn(e.contextResourceIdentifiers?.[t]))return!0;let n=e.contextualParameters?.[t];return n!==void 0&&String(n).length>0})}):!1})}function fn(e){return(e.operation.initiatorInfos??[]).some(t=>{let n=t.parameters??[];return!n.some(t=>t.fieldIdentifier===e.resourceFieldIdentifier)&&n.some(t=>t.resourceType===e.parentResourceType||t.fieldIdentifier===e.foreignKeyField||t.fieldIdentifier===e.parentResourceFieldIdentifier||t.relationshipField===e.foreignKeyField)})}function pn(e){let t=e.operation.initiatorInfos??[],n=new Set(e.parents.map(e=>e.parentResourceType).filter((e,t,n)=>n.filter(t=>t===e).length>1));return t.some(t=>{let r=t.parameters??[];return!r.some(t=>t.fieldIdentifier===e.resourceFieldIdentifier)&&e.parents.every(e=>r.some(t=>{let r=t.fieldIdentifier===e.foreignKeyField||t.relationshipField===e.foreignKeyField;return n.has(e.parentResourceType)?r:r||t.fieldIdentifier===e.parentResourceFieldIdentifier||t.resourceType===e.parentResourceType}))})}function mn(e,t){return t.filter(t=>t.parentResourceType===e.parentResourceType).length>1}function hn(e){return mn(e.parent,e.parents)?ln({foreignKeyField:e.parent.foreignKeyField,contextResourceIdentifiers:e.contextResourceIdentifiers,contextualParameters:e.contextualParameters}):cn({parentResourceType:e.parent.parentResourceType,parentResourceFieldIdentifier:e.parent.parentResourceFieldIdentifier,foreignKeyField:e.parent.foreignKeyField,contextResourceIdentifiers:e.contextResourceIdentifiers,contextualParameters:e.contextualParameters})}function gn(e){let t=ht(e.operation);if(t!==J.READ&&t!==J.UPDATE&&t!==J.DELETE||e.operation.isBulkOperation===!0||!e.operation.resourceRelationships)return;let n=an(e.operation.resourceRelationships,e.registry),r=vt(n).filter(t=>{let n=e.registry.resourceConfigurations[t.parentResourceType]?.resourceFieldIdentifier;return fn({operation:e.operation,resourceFieldIdentifier:e.resourceConfig.resourceFieldIdentifier,parentResourceType:t.parentResourceType,parentResourceFieldIdentifier:n,foreignKeyField:t.foreignKeyField})});if(r.length!==1)return;let i=r[0],a=i.relationship;return{mode:nn.PARENT_CONTEXT_SINGLETON,relationship:a,parentResourceType:i.parentResourceType,parentResourceFieldIdentifier:e.registry.resourceConfigurations[i.parentResourceType]?.resourceFieldIdentifier,foreignKeyField:i.foreignKeyField,isSatisfiedByCurrentContext:!1}}function _n(e){let t=ht(e.operation);if(t!==J.READ&&t!==J.UPDATE&&t!==J.DELETE||e.operation.isBulkOperation===!0||!e.operation.resourceRelationships)return;let n=e.operation.resourceIdentifier??e.resourceConfig.resourceIdentifier;if(!n)return;let r=(an(e.operation.resourceRelationships,e.registry).parentRelationships??[]).filter(e=>e.nature===ve.ASSOCIATION&&e.jointResourceType===n&&e.resourceType2===n&&e.cardinality1===$e.ONE&&e.cardinality2===$e.MANY).map(t=>{let n=e.registry.resourceConfigurations[t.resourceType1]?.resourceFieldIdentifier,r=bt.tryResolveRelationshipForeignKeyIdentity(t,e.registry.allResourceFieldIdentifiers)?.fieldIdentifier;if(!r)return;let i={relationship:t,parentResourceType:t.resourceType1,foreignKeyField:r};return n&&(i.parentResourceFieldIdentifier=n),i}).filter(e=>e!==void 0);if(r.length===2&&new Set(r.map(e=>e.foreignKeyField)).size===r.length&&pn({operation:e.operation,resourceFieldIdentifier:e.resourceConfig.resourceFieldIdentifier,parents:r}))return{mode:nn.ASSOCIATION_COMPLETE_CONTEXT,parents:r,isSatisfiedByCurrentContext:!1}}function vn(e){let t=gn(e),n=_n(e),r=t?{...t,isSatisfiedByCurrentContext:cn({parentResourceType:t.parentResourceType,parentResourceFieldIdentifier:t.parentResourceFieldIdentifier,foreignKeyField:t.foreignKeyField,contextResourceIdentifiers:e.contextResourceIdentifiers,contextualParameters:e.contextualParameters})}:void 0,i=n?{...n,isSatisfiedByCurrentContext:n.parents.every(t=>hn({parent:t,parents:n.parents,contextResourceIdentifiers:e.contextResourceIdentifiers,contextualParameters:e.contextualParameters}))}:void 0;return{operation:e.operation,supportsChildId:un(e.operation,e.resourceConfig.resourceFieldIdentifier),singletonParentContext:r,associationCompleteContext:i}}function yn(e){let t=vn(e);return e.hasResourceId===!0&&dn({operation:e.operation,resourceFieldIdentifier:e.resourceConfig.resourceFieldIdentifier,hasResourceId:e.hasResourceId,contextResourceIdentifiers:e.contextResourceIdentifiers,contextualParameters:e.contextualParameters})||t.singletonParentContext?.isSatisfiedByCurrentContext===!0||t.associationCompleteContext?.isSatisfiedByCurrentContext===!0}function bn(e){if(!e.resourceConfig)return;let t=De(e.operations,e.coreOperation,{allowBulk:e.allowBulk}).filter(t=>e.requireFrontendAddressable!==!0||ne(t.operationFrontendConfig)).filter(t=>e.requireLiteralCoreOperation!==!0||t.operationIdentifier===e.coreOperation).filter(t=>yn({resourceConfig:e.resourceConfig,operation:t,registry:e.registry,hasResourceId:e.hasResourceId,contextResourceIdentifiers:e.contextResourceIdentifiers,contextualParameters:e.contextualParameters}));if(t.length===0)return;let n=e.preferredVariantKey?t.filter(t=>t.variantKey===e.preferredVariantKey):[];return Ct(n.length>0?n:t,e.coreOperation,{allowBulk:e.allowBulk})}function xn(e,t,n){if(e===ft.ORGANIZATIONS&&t)return t;let r=n?.[ft.ORGANIZATIONS],i=typeof r==`string`?r:r?.resourceId;return typeof i==`string`&&i.length>0?i:void 0}function Sn(e){let{viewer:t,...n}=e,r=String(e.resourceConfig?.resourceIdentifier??``),i=n.operations.filter(n=>jn({resourceType:r,roles:n.roles,operationIdentifier:n.operationIdentifier,resourceOperationLike:n.resourceOperationLike,admitsCrossTenantPlatformAdministration:n.admitsCrossTenantPlatformAdministration,resourcePrimaryScope:e.resourceConfig?.resourcePrimaryScope},t));return bn({...n,operations:i,coreOperation:J.UPDATE,allowBulk:!1,requireLiteralCoreOperation:!0})}var Cn=Be.getLogger(),wn=Cn.debugByType(`NavigationUtils`);Cn.setDebugTypeLogging(`NavigationUtils`,!1);var Tn=class e{static resolveContextIdentifierValue(e,t){let n=e.contextResourceIdentifiers?.[t];if(typeof n==`string`)return n;if(n&&typeof n==`object`){let e=n.resourceId;return typeof e==`string`?e:void 0}}static _transactionActive=!1;static _transactionSource=null;static _transactionAutoCommitTimer=null;static _transactionEpoch=0;static _transactionListeners=new Set;static subscribeToTransactionState(t){return e._transactionListeners.add(t),()=>{e._transactionListeners.delete(t)}}static getTransactionEpoch(){return e._transactionEpoch}static endTransactionAndNotify(){e.disarmTransactionTimers(),e._transactionActive=!1,e._transactionDepth=0,e._transactionSource=null,e._transactionEpoch+=1;for(let t of[...e._transactionListeners])t()}static resetTransactions(){e._transactionActive?(e._transactionDepth=1,e.commitTransaction()):e.disarmTransactionTimers()}static disarmTransactionTimers(){e._transactionAutoCommitTimer&&=(clearTimeout(e._transactionAutoCommitTimer),null),e._transactionSafetyTimer&&=(clearTimeout(e._transactionSafetyTimer),null)}static _transactionSafetyTimer=null;static _transactionDepth=0;static beginTransaction(t){e._transactionActive?(e._transactionDepth+=1,wn(`beginTransaction: NESTED (already active)`,{outerSource:e._transactionSource,nestedSource:t,depth:e._transactionDepth})):(e._transactionDepth=1,e._transactionActive=!0,e._transactionSource=t,wn(`beginTransaction: STARTED`,{source:t}),e._transactionAutoCommitTimer=setTimeout(()=>{e._transactionActive&&(wn(`beginTransaction: AUTO-COMMIT (setTimeout(0))`,{source:e._transactionSource}),e.endTransactionAndNotify()),e._transactionAutoCommitTimer=null},0),e._transactionSafetyTimer=setTimeout(()=>{e._transactionActive&&(Cn.warn(`Navigation transaction safety timeout — force committing after 5s`,{source:e._transactionSource}),e.endTransactionAndNotify()),e._transactionSafetyTimer=null},5e3))}static commitTransaction(){e._transactionActive&&(e._transactionDepth>1?(--e._transactionDepth,wn(`commitTransaction: nested level closed`,{depth:e._transactionDepth})):(wn(`commitTransaction: COMMITTED`,{source:e._transactionSource}),e.endTransactionAndNotify()))}static isInTransaction(){return e._transactionActive}static getTransactionSource(){return e._transactionSource}static buildBrowserUrl(e,t=``){return t?`${e}${t}`:e}static normalizeComparableUrl(e){if(!e)return;let[t]=e.split(`#`);return t||void 0}static isAddressQueryParam(e,t){return t===`pane`||e.startsWith(`/chart/`)?!0:t.startsWith(`composite_ctx_`)||t.startsWith(`chart_ctx_`)||t.startsWith(`execution_ctx_`)}static splitUrlPath(e){let[t=``]=e.split(`#`),n=t.indexOf(`?`);return n<0?{pathname:t,params:new URLSearchParams}:{pathname:t.slice(0,n),params:new URLSearchParams(t.slice(n+1))}}static joinUrlPath(e,t){let n=t.toString();return n.length>0?`${e}?${n}`:e}static getUrlDestinationKey(t){if(!t)return;let{pathname:n,params:r}=e.splitUrlPath(t),i=[...r.entries()].filter(([t])=>e.isAddressQueryParam(n,t)).sort(([e],[t])=>e<t?-1:+(e>t));return e.joinUrlPath(n,new URLSearchParams(i))}static urlsAddressSameDestination(t,n){let r=e.getUrlDestinationKey(t);return r!==void 0&&r===e.getUrlDestinationKey(n)}static primaryContentIsUrlDerivable(e){return e===void 0||e.contentType===Z.RESOURCE_OPERATION}static isHeldHostedPane(e){return e?.collapsedFromZone===X.SECONDARY&&e.hostedPane===!0}static decomposeHostedPaneBrowserUrl(t){let{pathname:n,params:r}=e.splitUrlPath(t),a=r.get(`pane`)??void 0;r.delete(i);let o=e.joinUrlPath(n,r);return a&&a.length>0?{hostUrl:o,paneUrl:a}:{hostUrl:o}}static composeHostedPaneBrowserUrl(t,n){let{pathname:r,params:a}=e.splitUrlPath(t);return a.delete(i),a.set(i,n),e.joinUrlPath(r,a)}static hostedPaneApplies(t){let{paneContent:n,primaryTop:r}=t;return n!==void 0&&e.isResourceOperationContent(n)&&r?.urlPath!==void 0&&!e.primaryContentIsUrlDerivable(r.content)}static resolveBrowserUrlForZoneEntry(t){let{zone:n,entryUrlPath:r,paneContent:i,currentBrowserUrl:a,getZoneState:o}=t;if(n===X.COMPANION){let t=e.getTopEntry(o(X.SECONDARY));return t?.hostedPane&&t.urlPath?e.resolveBrowserUrlForZoneEntry({zone:X.SECONDARY,entryUrlPath:t.urlPath,paneContent:t.content,currentBrowserUrl:a,getZoneState:o}):r}let s=e.getTopEntry(o(X.PRIMARY));if(!(n===X.SECONDARY&&e.hostedPaneApplies({paneContent:i,primaryTop:s})))return r;let{hostUrl:c}=e.decomposeHostedPaneBrowserUrl(a),l=e.urlsAddressSameDestination(c,s.urlPath)?c:s.urlPath;return r?e.composeHostedPaneBrowserUrl(l,r):l}static resolveGoBackTarget(t){let{currentBrowserUrl:n,getZoneState:r}=t,i=t.zone??e.findStructuralRouteOwner(n,r)?.zone??X.PRIMARY,a=r(i);if(a.stack.length>1){let t=a.stack[a.stack.length-2],o=a.stack[a.stack.length-1];if(i===X.PRIMARY&&e.isHeldHostedPane(o)){let{hostUrl:r,paneUrl:a}=e.decomposeHostedPaneBrowserUrl(n);if(a!==void 0)return{zone:i,browserUrl:e.isHeldHostedPane(t)&&t?.urlPath?e.composeHostedPaneBrowserUrl(r,t.urlPath):r}}return{zone:i,browserUrl:t?.urlPath?e.resolveBrowserUrlForZoneEntry({zone:i,entryUrlPath:t.urlPath,paneContent:t.content,currentBrowserUrl:n,getZoneState:r}):void 0}}return i===X.PRIMARY?null:{zone:i,browserUrl:e.resolveZoneDismissUrl({zone:i,currentBrowserUrl:n,getZoneState:r})}}static resolveZoneDismissUrl(t){let{zone:n,currentBrowserUrl:r,getZoneState:i}=t,{hostUrl:a,paneUrl:o}=e.decomposeHostedPaneBrowserUrl(r);if(n===X.SECONDARY&&o!==void 0)return a;let s=e.getTopEntry(i(X.PRIMARY))?.urlPath;if(n===X.COMPANION){let t=e.getTopEntry(i(X.SECONDARY));return(t?.urlPath?e.resolveBrowserUrlForZoneEntry({zone:X.SECONDARY,entryUrlPath:t.urlPath,paneContent:t.content,currentBrowserUrl:r,getZoneState:i}):s)||void 0}return s||void 0}static zoneOwnsBrowserUrl(t,n,r){let{hostUrl:i,paneUrl:a}=e.decomposeHostedPaneBrowserUrl(n),o=e.getTopEntry(r(t));return o?t===X.SECONDARY&&o.hostedPane?a!==void 0&&e.urlsAddressSameDestination(o.urlPath,a):t===X.PRIMARY?e.urlsAddressSameDestination(o.urlPath,i):a===void 0&&e.urlsAddressSameDestination(o.urlPath,n):!1}static findStructuralRouteOwner(t,n){let r=e.normalizeComparableUrl(t);if(!r)return null;let{hostUrl:i,paneUrl:a}=e.decomposeHostedPaneBrowserUrl(r);if(a!==void 0){let t=e.getTopEntry(n(X.SECONDARY)),r=e.getTopEntry(n(X.PRIMARY));return t?.hostedPane&&e.urlsAddressSameDestination(t.urlPath,a)&&e.urlsAddressSameDestination(r?.urlPath,i)?{zone:X.SECONDARY,entry:t,searchDiffers:t.urlPath!==a||r?.urlPath!==i}:null}let o=[X.COMPANION,X.SECONDARY,X.PRIMARY];for(let t of o){let i=e.getTopEntry(n(t));if(i&&!i.hostedPane&&e.urlsAddressSameDestination(i.urlPath,r))return{zone:t,entry:i,searchDiffers:e.normalizeComparableUrl(i.urlPath)!==r}}return null}static findStructuralStackEntryOwningUrl(t,n){let r=e.normalizeComparableUrl(t);if(!r)return null;let{hostUrl:i,paneUrl:a}=e.decomposeHostedPaneBrowserUrl(r);if(a!==void 0){let t=e.getTopEntry(n(X.PRIMARY));if(!e.urlsAddressSameDestination(t?.urlPath,i))return null;let r=n(X.SECONDARY).stack;for(let n=r.length-1;n>=0;n--){let o=r[n];if(o?.hostedPane&&e.urlsAddressSameDestination(o.urlPath,a))return{zone:X.SECONDARY,entry:o,isTop:n===r.length-1,searchDiffers:o.urlPath!==a||t?.urlPath!==i}}return null}let o=[X.COMPANION,X.SECONDARY,X.PRIMARY];for(let t of o){let i=n(t).stack;for(let n=i.length-1;n>=0;n--){let a=i[n];if(a&&!a.hostedPane&&e.urlsAddressSameDestination(a.urlPath,r))return{zone:t,entry:a,isTop:n===i.length-1,searchDiffers:e.normalizeComparableUrl(a.urlPath)!==r}}}return null}static extractUrlPatternParams(e,t){let n=`___PARAM___`,r=[],i=e.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(e,t)=>(r.push(t),n)).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(RegExp(n,`g`),`([^/]+)`),a=RegExp(`^${i}$`).exec(t);if(!a)return;let o={};return r.forEach((e,t)=>{o[e]=decodeURIComponent(a[t+1]??``)}),o}static resolveResourceRouteForUrl(t,n){let{pathname:r}=e.splitUrlPath(t),i;for(let t of Object.values(n.resourceConfigurations??{})){let a=Array.isArray(t.operations)?t.operations:[];for(let o of a){if(!ne(o.operationFrontendConfig))continue;let a;try{a=se.buildOperationFrontendRoutePaths(t,o,n.allResourceFieldIdentifiers)}catch{continue}for(let n of a??[]){let a=e.extractUrlPatternParams(n.url,r);if(!a)continue;let s=e.routeSpecificityScore(n.url);(!i||s>i.score)&&(i={score:s,resourceType:t.resourceIdentifier,operation:o,routePathParameters:n.parameters??[],urlParameters:a})}}}if(!i)return;let{score:a,...o}=i;return o}static matchUrlPattern(t,n){return e.extractUrlPatternParams(t,n)!==void 0}static isActiveRoute(t,n){let r=t.split(`?`)[0]?.split(`#`)[0]??t,i=n.split(`?`)[0]?.split(`#`)[0]??n;if(e.matchUrlPattern(r,i))return!0;let a=r.split(`/`).filter(Boolean),o=i.split(`/`).filter(Boolean);if(a.length>o.length)return!1;for(let e=0;e<a.length;e++){let t=a[e],n=o[e];if(t.startsWith(`:`)){if(!n)return!1}else if(t!==n)return!1}return!0}static routeSpecificityScore(e){let t=(e.split(`?`)[0]?.split(`#`)[0]??e).split(`/`).filter(Boolean),n=t.filter(e=>!e.startsWith(`:`)).length;return t.length*100+n}static getMostSpecificActiveRoute(t,n){let r,i=-1;for(let a of t){if(!a||!n(a))continue;let t=e.routeSpecificityScore(a);t>i&&(i=t,r=a)}return r}static convertToFieldIdentifierKeys(e,t){let n={};for(let[r,i]of Object.entries(e))if(i){let e=t[r];if(e)n[e]=i;else{let e=it[r];e?n[e]=i:n[r]=i}}return n}static resolveUrlPath(e,t){if(!e)return;let n=e;for(let[e,r]of Object.entries(t))if(r!=null&&r!==``){let t=encodeURIComponent(String(r)),i=RegExp(`(^|/):${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}(?=\\W|$)`,`g`);n=n.replace(i,(e,n)=>`${n}${t}`);let a=RegExp(`\\{${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}\\}`,`g`);n=n.replace(a,t)}return n}static hasUnresolvedPlaceholders(e){let[t]=e.split(/[?#]/);return t.split(`/`).some(e=>/^:[a-zA-Z_]\w*$/.test(e)||/^:[a-zA-Z_]\w*\W/.test(e))||/\{[a-zA-Z_]\w*\}/.test(e)}static createAppLevelInitiator(e){return{sourceZone:ie,launcher:e}}static dispatchNavigationForItem(t,n,r){ce(n)?t({content:{contentType:Z.CUSTOM_COMPONENT,componentRef:n.componentRef,contextResourceIdentifiers:n.contextResourceIdentifiers},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):Ee(n)?t({content:{contentType:Z.ENGINE_PAGE,pageRef:n.pageRef},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):ke(n)?t({content:{contentType:Z.SETTINGS_HUB,sectionRef:n.sectionRef},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):_e(n)?t({content:e.buildNavigationContentForViewItem(n),initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):t({content:{contentType:Z.RESOURCE_OPERATION,resourceContext:n.resourceContext},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath})}static dispatchNavigationForResolvedTarget(t,n,r){n.resourceContext?t({content:{contentType:Z.RESOURCE_OPERATION,resourceContext:n.resourceContext},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):n.viewRef&&n.contentType?t({content:e.buildNavigationContentForResolvedView(n.viewRef,n.contentType,n.fullCustomComponentRef,n.flowsActorsSystemRef,n.contextResourceIdentifiers,n.urlParamValues,n.requiredFeatures),initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):n.contentType===Z.ENGINE_PAGE&&n.pageRef?t({content:{contentType:Z.ENGINE_PAGE,pageRef:n.pageRef},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):n.contentType===Z.SETTINGS_HUB?t({content:{contentType:Z.SETTINGS_HUB,sectionRef:n.sectionRef},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):n.componentRef?t({content:{contentType:Z.CUSTOM_COMPONENT,componentRef:n.componentRef,contextResourceIdentifiers:n.contextResourceIdentifiers},initiator:e.createAppLevelInitiator(r),urlPath:n.urlPath}):wn(`Cannot dispatch navigation for resolved target — no resolved resource/view/page payload`,{target:n})}static buildNavigationContentForResolvedView(e,t,n,r,i,a,o){switch(t){case Z.COMPOSITE_VIEW:return{contentType:Z.COMPOSITE_VIEW,viewRef:e,contextResourceIdentifiers:i};case Z.CHART_VIEW:return{contentType:Z.CHART_VIEW,viewRef:e,contextResourceIdentifiers:i,urlParamValues:a,requiredFeatures:o};case Z.EXECUTION_VIEW:return{contentType:Z.EXECUTION_VIEW,viewRef:e,contextResourceIdentifiers:i};case Z.FULL_CUSTOM_VIEW:return{contentType:Z.FULL_CUSTOM_VIEW,viewRef:e,fullCustomComponentRef:n??``,contextResourceIdentifiers:i};case Z.FLOWS_ACTORS_VIEW:return{contentType:Z.FLOWS_ACTORS_VIEW,viewRef:e,flowsActorsSystemRef:r??``,contextResourceIdentifiers:i};default:throw Error(`Unknown view content type: ${t}`)}}static createOperationInitiator(e,t){let n=typeof t==`string`?Ge(t):t?ht(t):void 0;return{sourceZone:e??G.PRIMARY,...n?{sourceOperation:n}:{}}}static createEmptyZoneState(e){return{zone:e,stack:[],isVisible:e===X.PRIMARY}}static createInitialNavigationState(){return{zones:{[X.PRIMARY]:e.createEmptyZoneState(X.PRIMARY),[X.SECONDARY]:e.createEmptyZoneState(X.SECONDARY),[X.COMPANION]:e.createEmptyZoneState(X.COMPANION)},overlay:[]}}static getZoneDepth(e){return e?.stack.length??0}static getTopEntry(e){return e.stack[e.stack.length-1]}static calculateResourceRelationshipDepth(e){return e?e.filter(e=>e?.isPrimaryScope!==!0).length:0}static layoutSplitsOperationFromPrimary(e,t,n){if(t.isBulkOperation===!0)return!1;let r=ht(t);if(!r)return!1;let i=t.operationFrontendConfig?.navigationOverrides;if(Array.isArray(i))for(let e of i){let t=e;if(t.fromZone!==void 0&&t.fromZone!==X.PRIMARY||t.viewport!==void 0&&t.viewport!==n)continue;let r=Qt(t.transition,n);if(r!==void 0)return r===V.SPLIT}let a=e?.zones?.primary?.transitions?.[r];return(typeof a==`string`?a:a?.transition)===V.SPLIT}static resolveResourceTargetZone(e,t){let n=!!t?.hasSecondary,r=!!t?.hasCompanion,i=e>=2?X.COMPANION:e===1||t?.prefersAdjacentZoneForDetail?X.SECONDARY:X.PRIMARY;return!r&&i===X.COMPANION?i=n?X.SECONDARY:X.PRIMARY:!n&&i===X.SECONDARY&&(i=X.PRIMARY),i}static generateStackEntryId(){return`nav-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}static isResourceOperationContent(e){return e.contentType===Z.RESOURCE_OPERATION}static resolveResourceUrl(t,n,r,i,a,o){try{wn(`resolveResourceUrl()`,{resourceIdentifier:t.resourceIdentifier,operationIdentifier:n.operationIdentifier,candidateKeys:Object.keys(r)});let s=se.buildOperationFrontendRoutePaths(t,n,i);if(!s||s.length===0)return;let c=W.selectMatchingRoutePath(s,r,t.resourceIdentifier,t.resourceFieldIdentifier,a,i,o),l=c.url,u=c.parameters??[],d=e.convertToFieldIdentifierKeys(r,i);for(let e of u){let t=r[e.fieldIdentifier]??r[e.resourceType];t&&(d[e.fieldIdentifier]=t)}let f=e.resolveUrlPath(l,d);return f&&e.hasUnresolvedPlaceholders(f)?(wn(`resolveResourceUrl() WARNING: unresolved placeholders in URL`,{templateUrl:l,resolvedUrl:f}),f=void 0):wn(`resolveResourceUrl() resolved`,{templateUrl:l,resolvedUrl:f}),{resolvedUrl:f,templateUrl:l,routePathParameters:u}}catch(e){wn(`resolveResourceUrl() failed`,{error:String(e)});return}}static resolveOperationRef(e,t,n){let r=e.split(`.`);if(r.length<2){Cn.warn("resolveOperationRef() failed: invalid ref format — expected `<resourceType>.<operationIdentifier>[.<variant>]`, so this navigation does nothing",{operationRef:e});return}let[i,a,o]=r,s=n.resourceConfigurations[i];if(!s){wn(`resolveOperationRef() failed: resource not found`,{resourceType:i});return}let c=s.operations.filter(e=>String(e.operationIdentifier)===a),l=c.filter(e=>e.isOperationDefault&&e.isBulkOperation!==!0);if((o==="default"||o===void 0)&&l.length>1){wn(`resolveOperationRef() failed: ambiguous default operation variants`,{resourceType:i,operationId:a,operationVariantRef:o,candidateVariants:l.map(e=>({variantType:e.variantType,variantKey:e.variantKey}))});return}let u=o==="default"?l.length===1?l[0]:void 0:o?c.find(e=>e.variantKey===o):l.length===1?l[0]:c.length===1?c[0]:void 0;if(!u){wn(`resolveOperationRef() failed: operation not found`,{resourceType:i,operationId:a,operationVariantRef:o});return}wn(`resolveOperationRef() resolved`,{operationRef:e,resourceType:i,operationId:a,operationVariantRef:o});let d=t?W.buildParentResourcesRequirements(i,t,n):[];return{contentType:Z.RESOURCE_OPERATION,resourceContext:W.createFrontendResourceOperationContextFromOperation({resourceType:i,operation:u,contextResourceIdentifiers:t??{},parentResourcesRequirements:d})}}static buildNavigationContentForViewItem(e){let t=e.contentType;switch(t){case Z.COMPOSITE_VIEW:return{contentType:Z.COMPOSITE_VIEW,viewRef:e.viewRef,contextResourceIdentifiers:e.contextResourceIdentifiers};case Z.CHART_VIEW:return{contentType:Z.CHART_VIEW,viewRef:e.viewRef,contextResourceIdentifiers:e.contextResourceIdentifiers,urlParamValues:e.urlParamValues,requiredFeatures:e.requiredFeatures};case Z.EXECUTION_VIEW:return{contentType:Z.EXECUTION_VIEW,viewRef:e.viewRef,contextResourceIdentifiers:e.contextResourceIdentifiers};case Z.FULL_CUSTOM_VIEW:return{contentType:Z.FULL_CUSTOM_VIEW,viewRef:e.viewRef,fullCustomComponentRef:e.fullCustomComponentRef??``,contextResourceIdentifiers:e.contextResourceIdentifiers};case Z.FLOWS_ACTORS_VIEW:return{contentType:Z.FLOWS_ACTORS_VIEW,viewRef:e.viewRef,flowsActorsSystemRef:e.flowsActorsSystemRef??``,contextResourceIdentifiers:e.contextResourceIdentifiers};default:throw Error(`Unknown view content type: ${t}`)}}static findRelationshipBetween(e,t,n,r){return n.resourceRelationships.find(i=>i.resourceType1===e&&i.resourceType2===t&&!i.isDisabled&&(r===void 0||bt.tryResolveRelationshipForeignKeyIdentity(i,n.allResourceFieldIdentifiers)?.fieldIdentifier===r))}static deriveDefaultAncestorOperation(e){return e.resourceType1===e.resourceType2?e.display?.inParentNavigation?.direction===Qe.BACKWARD?J.READ:J.LIST:J.READ}static resolveAncestorOperation(t,n){let r=e.resolveAncestorOperationConfig(t,n);return r?ht(r)??null:null}static resolveAncestorOperationConfig(t,n,r){let i=n.operations??[],a=!n.operations&&n.operationsConfiguration?Object.entries(n.operationsConfiguration).map(([e,t])=>({...t,operationIdentifier:e})):[],o=i.length>0?i:a;if(o.length===0)return null;let s=e=>{let t=e===J.READ||e===J.UPDATE||e===J.DELETE;return r&&t?bn({resourceConfig:n,operations:o,coreOperation:e,registry:r.registry,hasResourceId:W.getResourceId(r.contextResourceIdentifiers[n.resourceIdentifier]).length>0,requireFrontendAddressable:!0,contextResourceIdentifiers:r.contextResourceIdentifiers,contextualParameters:r.contextualParameters}):Ct(o,e,{requireAddressable:!0})};if(t){let e=t.display?.inParentNavigation?.ancestorOperation;if(e){let t=s(e);if(t)return t}}let c=t?e.deriveDefaultAncestorOperation(t):J.READ;return s(c)||s(c===J.LIST?J.READ:J.LIST)||null}static isCollectionOperationContext(e){let t=e.operation;if(!t)return!1;let n=ht(t);return n===J.LIST||n===J.SEARCH}static isScopeAddressedOperationContext(e){let t=e.operation;return!!t&&!je(t)}static isSameResourceTarget(t,n){if(t.resourceType!==n.resourceType)return!1;let r=e.isScopeAddressedOperationContext(t);return r===e.isScopeAddressedOperationContext(n)?r?B.buildContextResourceIdentifiersKey(t.contextResourceIdentifiers)===B.buildContextResourceIdentifiersKey(n.contextResourceIdentifiers):W.getPrimaryResourceIdentifier(t)===W.getPrimaryResourceIdentifier(n):!1}static isContentRelevantToParent(t,n){if(t.contentType!==Z.RESOURCE_OPERATION||n.contentType!==Z.RESOURCE_OPERATION)return!1;let r=n.resourceContext.resourceType,i=e.isScopeAddressedOperationContext(n.resourceContext)?null:W.getPrimaryResourceIdentifier(n.resourceContext),a=t.resourceContext.resourceType,o=t.resourceContext.contextResourceIdentifiers??{},s=(t,n)=>(n.foreignKeyField?e.resolveContextIdentifierValue(t,n.foreignKeyField):void 0)??(n.resourceType!==void 0&&n.resourceType!==a?e.resolveContextIdentifierValue(t,n.resourceType):void 0),c=t.resourceContext.parentResourcesRequirements??[],l=Object.entries(o).filter(([e,t])=>e!==a&&W.getFieldIdentifier(t)===e&&!c.some(t=>t.foreignKeyField===e)).map(([e])=>({foreignKeyField:e}));if(n.resourceContext.resourceType===a&&e.isScopeAddressedOperationContext(n.resourceContext)&&[...c,...l].every(e=>{let r=s(n.resourceContext,e),i=s(t.resourceContext,e);return!r||!i||r===i}))return!0;let u=t.resourceContext.parentResourcesRequirements;return!u||u.length===0?!1:u.some(n=>{if(n.resourceType!==r||!i)return!1;let a=n.foreignKeyField??n.resourceType,o=e.resolveContextIdentifierValue(t.resourceContext,a)??e.resolveContextIdentifierValue(t.resourceContext,n.resourceType);return o?o===i:!1})}static shouldShowParentReference(e,t,n,r){if(e||t===G.OVERLAY||n?.sourceRelationship?.inChildView?.parentDisplay===xe.NONE)return!1;let i=n?.sourceZone;if(i&&i!==t&&r){let e=r(i),t=e?.stack?.[e.stack.length-1];if(t?.content&&`resourceContext`in t.content){let e=t.content.resourceContext,r=e?.resourceType,i=e?W.getAddressedRecordId(e):void 0,a=n?.sourceRelationship;if(r===a?.parentResourceType&&(!a.parentResourceId||a.parentResourceId===i))return!1}}return!0}static resolveDefaultShowParentLink(e,t){try{let n=e?._def?.shape?.();if(!n||!n[t])return!0;let r=n[t];return r?._def?.typeName!==`ZodOptional`&&r?.isOptional?.()!==!0}catch{return!0}}},En=Be.getLogger().debugByType(`sidebar-resource-browser`);function Dn(e,t,n){let r=e.operations.filter(e=>e.operationIdentifier===t&&(n===void 0||e.variantKey===n));if(r.length===1)return r[0];let i=r.filter(e=>e.isOperationDefault===!0&&e.isBulkOperation!==!0);if(n===void 0&&i.length===1)return i[0];En(`Unable to resolve sidebar resource operation unambiguously`,{resourceType:e.resourceIdentifier,operationIdentifier:t,variantKey:n,candidates:r.map(e=>({variantType:e.variantType,variantKey:e.variantKey,isOperationDefault:e.isOperationDefault,isBulkOperation:e.isBulkOperation}))})}var On=Be.getLogger(),kn=On.debugByType(`launcher-resolution`);On.setDebugTypeLogging(`launcher-resolution`,!1);function An(e,t){return!e?.length||Nt({requiredRoles:e,userAppRoles:t.applicationRoles,userOrgRoles:t.organizationRoles,appRolesConfig:t.roleTables.appRolesConfig,orgRolesConfig:t.roleTables.orgRolesConfig,unresolvableRoles:t.roleTables.unresolvableRoles})}function jn(e,t){if(In(e,t)||Nn(t)&&e.admitsCrossTenantPlatformAdministration!==!0&&String(e.operationIdentifier)!==Le.REQUEST_ACCESS)return!1;if(An(e.roles,t))return!0;if(!t.accessProfile||!t.organizationId)return!1;let n=t.roleTables,r=It({resourceType:e.resourceType,requiredRoles:e.roles??[],initiatorRoles:t.accessProfile.roleEntries,organizationId:t.organizationId,narrowingRegistry:t.accessProfile.organizationUnitNarrowing,ownRowsRegistry:t.accessProfile.organizationOwnRows,relationshipOrganizationWideAccess:t.accessProfile.relationshipOrganizationWideAccess,operationIsReadOnly:Se(e),roleHierarchyResolver:(e,t)=>Xe(e,t===K.APPLICATION?n.appRolesConfig:n.orgRolesConfig)});return r.kind===I.UNIT_NARROWED||r.kind===I.RELATIONSHIP_ORGANIZATION_WIDE}function Mn(e){return e.organizationId?e.organizationRoles.length>0||(e.accessProfile?.roleEntries??[]).some(t=>String(t.relatedPrimaryScope)===K.ORGANIZATIONS&&String(t.relatedResourceId)===e.organizationId):!1}function Nn(e){return!e.organizationId||Mn(e)?!1:e.applicationRoles.length>0||e.accessProfile!==null}function Pn(e,t,n){return e.resourcePrimaryScope!==K.USER_SELF||t.subjectUserId&&t.viewerUserId&&t.subjectUserId===t.viewerUserId?!0:e.admitsCrossSubjectUserAdministration===!0&&An(e.roles,n)}var Fn=new Set([J.CREATE,J.LIST,J.SEARCH,J.COUNT,J.CREATE_MANY,J.UPDATE_MANY,J.DELETE_MANY]);function In(e,t){if(e.admitsCrossTenantPlatformAdministration!==!0||String(e.resourcePrimaryScope??``)!==K.ORGANIZATIONS||String(e.operationIdentifier)===Le.REQUEST_ACCESS||!t.organizationId||t.organizationRoles.length===0)return!1;let n=String(e.resourceOperationLike??e.operationIdentifier);return Fn.has(n)?!An(e.roles,{...t,applicationRoles:[]}):!1}function Ln(e,t){switch(e.kind){case Dt.RESOURCE_OPERATION:return Rn(e,t);case Dt.VIEW:return Bn(e,t);case Dt.RESOURCE_VIEW:return Vn(e,t);case Dt.ENGINE_PAGE:return Wn(e,t);case Dt.CUSTOM_COMPONENT:return Xn(e,t);case Dt.SETTINGS_SECTION:return Yn(e,t);default:return kn(`Unknown LauncherItemRef kind`,{item:e}),null}}function Rn(e,t){let n=t.registry.resourceConfigurations[e.resourceType];if(!n)return kn(`Resource type not found in registry`,{resourceType:e.resourceType}),null;let r=(Array.isArray(n.operations)?n.operations:[]).filter(t=>String(t.operationIdentifier)===e.operation),i=r.filter(e=>e.isOperationDefault===!0),a=e.operationVariant?r.find(t=>t.variantKey===e.operationVariant):i.length===1?i[0]:r.length===1?r[0]:void 0;if(!a)return kn(`Operation not found for resource`,{resourceType:e.resourceType,operation:e.operation,operationVariant:e.operationVariant}),null;if(t.viewerRoles&&!jn({...a,resourceType:e.resourceType},t.viewerRoles))return kn(`Launcher resource operation withheld: the viewer may not perform it (no role, no reaching unit grant)`,{resourceType:e.resourceType,operation:e.operation}),null;let o=t.contextResourceIdentifiers??{},s=Tn.resolveResourceUrl(n,a,o,t.registry.allResourceFieldIdentifiers)?.resolvedUrl;if(!s)return kn(`No scope-satisfiable route for launcher resource operation (requires non-ambient context)`,{resourceType:e.resourceType,operation:e.operation,scopeKeys:Object.keys(o)}),null;let c=String(a.operationIdentifier),l=W.createFrontendResourceOperationContextFromOperation({resourceType:e.resourceType,operation:a,contextResourceIdentifiers:o});return{targetKind:Dt.RESOURCE_OPERATION,id:`resolved-${e.resourceType}-${c}-${a.variantKey??`default`}`,ref:`resource:${e.resourceType}:${c}:${a.variantKey??`default`}`,label:t.tResourceOperation(e.resourceType,c,`title`),urlPath:s,iconReference:{category:F.RESOURCES,resourceType:e.resourceType},resourceType:e.resourceType,operationIdentifier:c,operation:a,resourceContext:l,contextResourceIdentifiers:o}}function zn(e,t){return t===`application`?e===b.APPLICATION:e===b.RESOURCE}function Bn(e,t){let n=Hn(e.viewRef,t);return n?{targetKind:Dt.VIEW,id:`resolved-view-${e.viewRef}`,ref:`view:${n.contentType}:${e.viewRef}`,label:t.tViewTitle(n.viewRef,n.contentType),...n}:(kn(`Application-scoped VIEW ref not found in any compatible view collection`,{viewRef:e.viewRef}),null)}function Vn(e,t){let n=Un(e,t);return n?{targetKind:Dt.RESOURCE_VIEW,id:`resolved-resource-view-${e.resourceType}-${e.viewRef}`,ref:`view:${n.contentType}:${e.resourceType}:${e.viewRef}`,label:t.tViewTitle(n.viewRef,n.contentType),...n}:(kn(`Resource-scoped RESOURCE_VIEW ref not found on the target resource`,{resourceType:e.resourceType,viewRef:e.viewRef}),null)}function Hn(e,t){let{compositeViews:n,fullCustomViews:r,flowsActorsViews:i}=t.views,a=n?.find(t=>t.ref===e&&zn(t.scope,`application`));if(a)return{urlPath:j(a)?p(e):``,iconReference:{category:F.COMPOSITE_VIEW,viewReference:e},viewRef:e,contentType:Z.COMPOSITE_VIEW,requiredFeatures:a.requiredFeatures,contextResourceIdentifiers:void 0};let o=r?.find(t=>t.ref===e&&zn(t.scope,`application`));if(o)return{urlPath:`/custom/${e}`,iconReference:{category:F.CUSTOM,customReference:`view-custom-${e}`},viewRef:e,contentType:Z.FULL_CUSTOM_VIEW,fullCustomComponentRef:o.componentRef,requiredFeatures:o.requiredFeatures,contextResourceIdentifiers:void 0};let s=i?.find(t=>t.ref===e&&zn(t.scope,`application`));return s?{urlPath:`/flows-actors/${e}`,iconReference:{category:F.CUSTOM,customReference:`view-flows-${e}`},viewRef:e,contentType:Z.FLOWS_ACTORS_VIEW,flowsActorsSystemRef:s.systemRef,requiredFeatures:s.requiredFeatures,contextResourceIdentifiers:void 0}:null}function Un(e,t){let n=t.registry.resourceConfigurations[e.resourceType]?.frontendConfiguration,r=Ut({resourceType:e.resourceType,viewRef:e.viewRef,registry:t.registry}),i=t.contextResourceIdentifiers&&Object.keys(t.contextResourceIdentifiers).length>0?t.contextResourceIdentifiers:void 0;if(r.length!==1)return null;let o=n?.compositeViews?.find(t=>t.ref===e.viewRef);if(o){if(o.scope!==b.RESOURCE)return null;let t=l(e.resourceType,o);return{urlPath:a(o)?p(t.insertedViewRef,i):``,iconReference:{category:F.COMPOSITE_VIEW,viewReference:e.viewRef},viewRef:t.insertedViewRef,contentType:Z.COMPOSITE_VIEW,requiredFeatures:o.requiredFeatures,contextResourceIdentifiers:i}}let s=n?.chartViews?.find(t=>t.ref===e.viewRef);if(s){let t=u(e.resourceType,s);return{urlPath:_(s)?g(t.insertedViewRef,i):``,iconReference:{category:F.CUSTOM,customReference:`view-chart-${e.viewRef}`},viewRef:t.insertedViewRef,contentType:Z.CHART_VIEW,requiredFeatures:s.chartDefinition.requiredFeatures,contextResourceIdentifiers:i}}let d=n?.executionViews?.find(t=>t.ref===e.viewRef);if(d){if(d.scope!==b.RESOURCE)return null;let t=c(e.resourceType,d);return{urlPath:d.isAddressable?h(t.insertedViewRef,i):``,iconReference:{category:F.CUSTOM,customReference:`view-execution-${e.viewRef}`},viewRef:t.insertedViewRef,contentType:Z.EXECUTION_VIEW,requiredFeatures:d.requiredFeatures,contextResourceIdentifiers:i}}return null}function Wn(e,t){let n=yt[e.pageRef],r=t.t(`${n.i18nKey}.title`);return{targetKind:Dt.ENGINE_PAGE,id:`resolved-engine-${e.pageRef}`,ref:`engine:${e.pageRef}`,label:r,urlPath:n.route,iconReference:n.icon,pageRef:e.pageRef,contentType:Z.ENGINE_PAGE}}var Gn=`${he.COMPONENTS}.${L.APP_LAYOUTS_SETTINGS_HUB}.title`;function Kn(e){return`${he.SETTINGS_HUB}.sections.${e}.label`}function qn(e,t){let n=new Set(e),r=new Set(t);return e=>!n.has(e)||r.has(e)}function Jn(e,t){let n=Kn(e),r=t.t(n);return r===n?t.settingsSectionLabel(e)??n:r}function Yn(e,t){if(e.sectionRef&&t.settingsSectionVisible&&!t.settingsSectionVisible(e.sectionRef))return kn(`Launcher settings section withheld: the Settings Hub does not show it to this viewer`,{sectionRef:e.sectionRef}),null;let n=e.sectionRef?ae.settingsSection.replace(`:sectionRef`,e.sectionRef):ae.settings;return{targetKind:Dt.SETTINGS_SECTION,id:`resolved-settings-${e.sectionRef??`default`}`,ref:`settings:${e.sectionRef??`default`}`,label:e.sectionRef?Jn(e.sectionRef,t):t.t(Gn),urlPath:n,iconReference:e.sectionRef&&t.settingsSectionIcon(e.sectionRef)||le.SETTINGS,contentType:Z.SETTINGS_HUB,sectionRef:e.sectionRef}}function Xn(e,t){return{targetKind:Dt.CUSTOM_COMPONENT,id:`resolved-custom-${e.componentRef}`,ref:`custom:${e.componentRef}`,label:e.componentRef,urlPath:``,componentRef:e.componentRef,contextResourceIdentifiers:t.contextResourceIdentifiers&&Object.keys(t.contextResourceIdentifiers).length>0?t.contextResourceIdentifiers:void 0}}function Zn(e,t){let n=Ln(e,t);if(!n)return null;let r;return e.children&&e.children.length>0&&(r=e.children.map(e=>Zn(e,t)).filter(e=>e!==null)),{...n,displayPolicy:e.displayPolicy,notificationBadgeRef:e.notificationBadgeRef,children:r}}function Qn(e,t){return e.flatMap(e=>{switch(e.contentKind){case R.NAVIGATION_LIST:return[er(e,t)];case R.RESOURCE_BROWSER:return $n(e,t)?[tr(e)]:[];case R.GUIDANCE_WIDGET:return[nr(e)];case R.CUSTOM_COMPONENT:return[rr(e)]}})}function $n(e,t){if(!t.viewerRoles)return!0;let n=t.registry.resourceConfigurations[e.resourceType];if(!n)return!0;let r=Dn(n,e.operation??J.LIST,e.operationVariant);return r===void 0||jn({...r,resourceType:e.resourceType},t.viewerRoles)}function er(e,t){let n=e.children.map(e=>Zn(e,t)).filter(e=>e!==null);return{contentKind:R.NAVIGATION_LIST,ref:e.ref,label:e.label,icon:e.icon,showLabel:e.showLabel,collapsible:e.collapsible,defaultCollapsed:e.defaultCollapsed,isPrimary:e.isPrimary,visibleInModes:e.visibleInModes,items:n,behavior:e.behavior,inlineCreate:e.inlineCreate,inlineCreateResourceType:e.inlineCreateResourceType,nested:e.nested,maxNestingDepth:e.maxNestingDepth}}function tr(e){return{contentKind:R.RESOURCE_BROWSER,ref:e.ref,label:e.label,icon:e.icon,showLabel:e.showLabel,collapsible:e.collapsible,defaultCollapsed:e.defaultCollapsed,visibleInModes:e.visibleInModes,resourceType:e.resourceType,operation:e.operation,operationVariant:e.operationVariant,navigateOperation:e.navigateOperation,navigateOperationVariant:e.navigateOperationVariant,instanceFilter:e.instanceFilter,onInstanceClick:e.onInstanceClick}}function nr(e){return{contentKind:R.GUIDANCE_WIDGET,ref:e.ref,label:e.label,icon:e.icon,showLabel:e.showLabel,collapsible:e.collapsible,defaultCollapsed:e.defaultCollapsed,visibleInModes:e.visibleInModes,guidanceRef:e.guidanceRef}}function rr(e){return{contentKind:R.CUSTOM_COMPONENT,ref:e.ref,label:e.label,icon:e.icon,showLabel:e.showLabel,collapsible:e.collapsible,defaultCollapsed:e.defaultCollapsed,visibleInModes:e.visibleInModes,componentRef:e.componentRef}}function ir(e,t){let n=[];for(let r of e){let e=Ln(r,t);e&&n.push({...e,category:r.category,shortcut:r.shortcut,searchKeywords:r.searchKeywords,displayPolicy:r.displayPolicy})}return n}function ar(e,t){let n=[];for(let r of e){let e=Ln(r,t);if(!e)continue;let i=r.description??(r.kind===Dt.RESOURCE_OPERATION?t.tResourceOperation(r.resourceType,r.operation,`title`):e.label);n.push({...e,shortcut:r.shortcut,scope:r.scope,description:i})}return n}function or(e,t){let n=[];for(let r of e){let e=Ln(r,t);e&&n.push({...e,displayPolicy:r.displayPolicy})}return n}function sr(e,t){let n=[];for(let r of e){let e=Ln(r,t);e&&n.push({...e,section:r.section})}return n}function cr(e,t){let n=[];for(let r of e){let e=Ln(r,t);e&&n.push({...e,group:r.group,iconOnly:r.iconOnly})}return n}function lr(e,t,n){let r=[];if(t)for(let e of t){let t=Ln(e,n);t&&r.push({...t,group:e.group,...e.notificationBadgeRef?{notificationBadgeRef:e.notificationBadgeRef}:{}})}return{hostedComponents:e??[],items:r}}function ur(e){let t=W.scopeHostContextToReferencedRecord(e);if(W.isReferencedTargetTheHostRecord(e))return t;let n={identifiers:mr(t.identifiers,e=>fr.has(e)||pr.has(e)),contextualParameters:mr(t.contextualParameters,e=>pr.has(e)),parentRequirements:t.parentRequirements.filter(e=>fr.has(e.resourceType))};if(Object.keys(n.identifiers).length===Object.keys(t.identifiers).length&&Object.keys(n.contextualParameters).length===Object.keys(t.contextualParameters).length&&n.parentRequirements.length===t.parentRequirements.length)return t;let r=e.registry.resourceConfigurations[e.targetResourceType];if(!r)return t;let i=e.registry.allResourceFieldIdentifiers?.[e.targetResourceType],a={};for(let[e,t]of Object.entries(n.contextualParameters))(typeof t==`string`||typeof t==`number`)&&(a[e]=t);return bn({resourceConfig:r,operations:r.operations??[],coreOperation:J.READ,registry:e.registry,hasResourceId:!0,requireFrontendAddressable:!1,contextResourceIdentifiers:{...n.identifiers,[e.targetResourceType]:e.targetId},contextualParameters:{...a,...i?{[i]:e.targetId}:{}}})?n:t}var dr=[K.ORGANIZATIONS,K.APPLICATION],fr=new Set(dr.map(e=>jt[e])),pr=new Set(dr.map(e=>Rt[e]));function mr(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>t(e)))}var hr=e=>{throw TypeError(e)},gr=(e,t,n)=>t.has(e)||hr(`Cannot `+n),_r=(e,t,n)=>(gr(e,t,`read from private field`),n?n.call(e):t.get(e)),vr=(e,t,n)=>t.has(e)?hr(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),yr=(e,t,n,r)=>(gr(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),br=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,xr=/^[\\/]{2}/;function Sr(e,t){return t+e.replace(/\\/g,`/`)}var Cr=`popstate`;function wr(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Tr(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return kr(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Ar(t)}return Mr(t,n,null,e)}function $(e,t){if(e===!1||e==null)throw Error(t)}function Er(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Dr(){return Math.random().toString(36).substring(2,10)}function Or(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function kr(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?jr(t):t,state:n,key:t&&t.key||r||Dr(),mask:i}}function Ar({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function jr(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Mr(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=wr(e)?e:kr(h.location,e,t);n&&n(r,e),l=u()+1;let d=Or(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=wr(e)?e:kr(h.location,e,t);n&&n(r,e),l=u();let i=Or(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Nr(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Cr,d),c=e,()=>{i.removeEventListener(Cr,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Nr(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),$(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ar(t);return i=i.replace(/ $/,`%20`),!n&&xr.test(i)&&(i=r+i),new URL(i,r)}function Pr(e){return{defaultValue:e}}var Fr,Ir=class{constructor(e){if(vr(this,Fr,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(_r(this,Fr).has(e))return _r(this,Fr).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){_r(this,Fr).set(e,t)}};Fr=new WeakMap;var Lr=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function Rr(e){return Lr.has(e)}var zr=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Br(e){return zr.has(e)}function Vr(e){return e.index===!0}function Hr(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if($(e.index!==!0||!e.children,`Cannot specify children on an index route`),$(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Vr(e)){let n={...e,id:s};return r[s]=Ur(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Ur(n,t(n)),e.children&&(n.children=Hr(e.children,t,o,r,i)),n}})}function Ur(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Wr(e,t,n=`/`){return Gr(e,t,n,!1)}function Gr(e,t,n,r,i){let a=di((typeof t==`string`?jr(t):t).pathname||`/`,n);if(a==null)return null;let o=i??qr(e),s=null,c=ui(a);for(let e=0;s==null&&e<o.length;++e)s=oi(o[e],c,r);return s}function Kr(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function qr(e){let t=Jr(e);return Xr(t),t}function Jr(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;$(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=xi([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&($(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Jr(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ii(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=li(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Yr(e.path))a(e,t,!0,n)}),t}function Yr(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Yr(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Xr(e){e.sort((e,t)=>e.score===t.score?ai(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Zr=/^:[\w-]+$/,Qr=3,$r=2,ei=1,ti=10,ni=-2,ri=e=>e===`*`;function ii(e,t){let n=e.split(`/`),r=n.length;return n.some(ri)&&(r+=ni),t&&(r+=$r),n.filter(e=>!ri(e)).reduce((e,t)=>e+(Zr.test(t)?Qr:t===``?ei:ti),r)}function ai(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function oi(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ci(u,l,s.matcher,s.compiledParams):si(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=si({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:xi([a,d.pathname]),pathnameBase:Ci(xi([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=xi([a,d.pathnameBase]))}return o}function si(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=li(e.path,e.caseSensitive,e.end);return ci(e,t,n,r)}function ci(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Si(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Si(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function li(e,t=!1,n=!0){Er(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ui(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Er(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function di(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function fi({basename:e,pathname:t}){return t===`/`?e:xi([e,t])}var pi=e=>br.test(e);function mi(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?jr(e):e,a;return n?(n=bi(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?hi(n.substring(1),`/`):hi(n,t)):a=t,{pathname:a,search:wi(r),hash:Ti(i)}}function hi(e,t){let n=Si(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function gi(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _i(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function vi(e){let t=_i(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function yi(e,t,n,r=!1){let i;typeof e==`string`?i=jr(e):(i={...e},$(!i.pathname||!i.pathname.includes(`?`),gi(`?`,`pathname`,`search`,i)),$(!i.pathname||!i.pathname.includes(`#`),gi(`#`,`pathname`,`hash`,i)),$(!i.search||!i.search.includes(`#`),gi(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=mi(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var bi=e=>e.replace(/[\\/]{2,}/g,`/`),xi=e=>bi(e.join(`/`));function Si(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ci=e=>Si(e).replace(/^\/*/,`/`),wi=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ti=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ei=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Di=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Oi(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ki(e){return xi(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ai=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ji(e,t){let n=e;if(typeof n!=`string`||!br.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ai)try{let e=new URL(window.location.href),r=xr.test(n)?new URL(Sr(n,e.protocol)):new URL(n),a=di(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Er(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Mi=Symbol(`Uninstrumented`);function Ni(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Fi(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Fi(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Mi]??i,a=Fi(n[e],t,(...e)=>Li(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Mi]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Mi]??e,r=Fi(n.middleware,t,(...e)=>Li(e[0]));return r?(r[Mi]=t,r):e})),r}function Pi(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Mi]??e.navigate,r=Fi(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?Ar(n):`.`,...Ri(e,r??{})}});r&&(r[Mi]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Mi]??e.fetch,r=Fi(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Ri(e,i??{})}});r&&(r[Mi]=t,e.fetch=r)}return e}function Fi(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ii(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ii(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ii(e,t,n,r-1),a=await o,$(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function Li(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:zi(t),params:{...r},pattern:i,context:Bi(n)}}function Ri(e,t){return{currentUrl:Ar(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function zi(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Bi(e){if(Hi(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Vi=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Hi(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Vi}var Ui=new URL(`http://localhost`);function Wi(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ui)}catch{return Ui}}function Gi(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ki(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qi(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Gi(i,n),s=!Gi(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ki(e,i)||!Gi(i,a)))throw Error(`External navigation is not allowed`)}var Ji=[`POST`,`PUT`,`PATCH`,`DELETE`],Yi=new Set(Ji),Xi=[`GET`,...Ji],Zi=new Set(Xi),Qi=new Set([301,302,303,307,308]),$i=new Set([307,308]),ea={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ta={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},na={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},ra=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ia=`remix-router-transitions`,aa=Symbol(`ResetLoaderData`),oa,sa,ca,la,ua=class{constructor(e){vr(this,oa),vr(this,sa),vr(this,ca),vr(this,la),yr(this,oa,e),yr(this,sa,qr(e))}get stableRoutes(){return _r(this,oa)}get activeRoutes(){return _r(this,ca)??_r(this,oa)}get branches(){return _r(this,la)??_r(this,sa)}get hasHMRRoutes(){return _r(this,ca)!=null}setRoutes(e){yr(this,oa,e),yr(this,sa,qr(e))}setHmrRoutes(e){yr(this,ca,e),yr(this,la,qr(e))}commitHmrRoutes(){_r(this,ca)&&(yr(this,oa,_r(this,ca)),yr(this,sa,_r(this,la)),yr(this,ca,void 0),yr(this,la,void 0))}};oa=new WeakMap,sa=new WeakMap,ca=new WeakMap,la=new WeakMap;function da(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;$(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||ra,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Ni(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new ua(Hr(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Oa,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Gr(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=$a(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Qa(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Fe(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Fe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>ga(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=_a(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:ea,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,N=!1,P=new Set,F=new Map,I=0,L=-1,R=new Map,z=new Set,ee=new Map,te=new Map,B=new Set,V=new Map,H,U=null;function ne(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(H){H(),H=void 0;return}Er(V.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ae({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{H=e});e.history.go(r*-1),ke(i,{state:`blocked`,location:n,proceed(){ke(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,na),W({blockers:e})}}),E?.resolve(),E=null}else return ce(t,n)}),n){wo(t,A);let e=()=>To(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ce(`POP`,w.location,{initialHydration:!0}),C}function re(){d&&d(),j&&j(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>xe(w.fetchers,t)),w.blockers.forEach((e,t)=>Oe(t))}function ie(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function W(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(B.has(t)?n.push(t):r.push(t))}),B.forEach(e=>{!w.fetchers.has(e)&&!F.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>xe(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function ae(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&ho(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Ya(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,na)));let l=!M&&Pe(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&ho(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`&&!M&&t!==w.location){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}W({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:ea,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,N=!1,E?.resolve(),E=null,U?.resolve(),U=null}async function oe(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Eo();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=ma(!1,pa(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?jr(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},xr.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),qi(typeof n.mask==`string`?n.mask:Ar(n.mask),Ar(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=kr(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},qi(t==null?e.history.createHref(w.location):typeof t==`string`?t:Ar(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&ho(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ae({currentLocation:s,nextLocation:l,historyAction:d});m?ke(m,{state:`blocked`,location:l,proceed(){ke(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),oe(t,n)},reset(){let e=new Map(w.blockers);e.set(m,na),W({blockers:e})}}):await ce(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function se(){U||=Eo(),_e(),W({revalidation:`loading`});let e=U.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ce(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ce(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function ce(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,Ne(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:Gr(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!N&&no(w.location,n)&&!(r&&r.submission&&ho(r.submission.formMethod))){ae(n,{matches:a},{flushSync:o});return}let l=Fe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=je(n.pathname);ae(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=Ua(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new Ir,p;if(r&&r.pendingError)p=[Za(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&ho(r.submission.formMethod)){let i=await le(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(so(t)&&Oi(t.error)&&t.error.status===404){O=null,ae(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=yo(n,a,t,r.submission),o=!1,l.active=!1,d=Ua(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await ue(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(O=null,ae(n,{matches:h||a,...Xa(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function le(t,n,i,l,u,d,f,p,m={}){if(_e(),W({navigation:bo(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Ie(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Qa(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Za(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=je(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=_o(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:$a(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await he(t,n,Pa(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(co(h)){let n;return n=m&&m.replace!=null?m.replace:Ha(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await K(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(so(h)){let e=Za(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function ue(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||yo(n,i,l,p),x=p||m||vo(b),S=!M&&!g;if(d){if(S){let e=de(v);W({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ie(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Qa(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Za(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=je(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=ha(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,N,P,B,ee,z,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(L=++I,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=Te(e);return ae(n,{matches:i,loaderData:{},errors:v&&so(v[1])?{[v[0]]:v[1].error}:null,...Xa(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=de(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=G(E)),W(e,{flushSync:_})}E.forEach(e=>{Ce(e.key),e.controller&&F.set(e.key,e.controller)});let D=()=>E.forEach(e=>Ce(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await ge(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>F.delete(e.key));let j=eo(k);if(j)return await K(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=eo(A),j)return z.add(j.key),await K(t,j.result,!0,{replace:h}),{shortCircuited:!0};let R=new Map(w.fetchers),{loaderData:te,errors:V}=Ja(w,i,k,v,E,A,R);g&&w.errors&&(V={...w.errors,...V});let H=Te(R),U=Ee(L,R),ne=H||U||E.length>0;return{matches:i,loaderData:te,errors:V,...ne?{workingFetchers:R}:{}}}function de(e){if(e&&!so(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function G(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=xo(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function fe(t,n,r,i){Ce(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=pa(w.location,w.matches,c,r,n,i?.relative),u=Gr(o,l,c,!1,s.branches),d=Fe(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){ve(t,n,$a(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=ma(!0,l,i);if(m){ve(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Ir,g=(i&&i.preventScrollReset)===!0;p&&ho(p.formMethod)?await pe(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate):(ee.set(t,{routeId:n,path:f}),await me(t,n,f,u,h,d.active,a,g,p))}async function pe(t,n,i,l,u,d,f,p,m,h){_e(),ee.delete(t),q(t,So(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Ua(e.history,i,g.signal,m);if(d){let e=await Ie(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ve(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{ve(t,n,$a(404,{pathname:i}),{flushSync:f});return}}let v=_o(l,i);if(!v.route.action&&!v.route.lazy){ve(t,n,$a(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}F.set(t,g);let y=I,b=Pa(a,o,_,i,l,v,r,u),x=await he(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){F.get(t)===g&&F.delete(t);return}if(B.has(t)){if(co(S)||so(S)){q(t,Co(void 0));return}}else{if(co(S)){if(F.delete(t),L>y){q(t,Co(void 0));return}return z.add(t),q(t,xo(m)),K(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(so(S)){ve(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Ua(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:Gr(D,w.navigation.location,c,!1,s.branches);$(k,`Didn't find any matches after fetcher action`);let A=++I;R.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=ha(E,u,a,o,e.history,w,k,m,C,r,!1,N,P,B,ee,z,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),te=xo(m,S.data),V=new Map(w.fetchers);V.set(t,te),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=V.get(t),r=xo(void 0,n?n.data:void 0);V.set(t,r),Ce(t),e.controller&&F.set(t,e.controller)}),W({fetchers:V});let H=()=>M.forEach(e=>Ce(e.key));g.signal.addEventListener(`abort`,H);let{loaderResults:U,fetcherResults:ne}=await ge(j,M,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,H),R.delete(t),F.delete(t),M.forEach(e=>F.delete(e.key));let re=w.fetchers.has(t),ie=e=>{if(!re)return e;let n=new Map(e.fetchers);return n.set(t,Co(S.data)),{...e,fetchers:n}},oe=eo(U);if(oe)return w=ie(w),K(E,oe.result,!1,{preventScrollReset:p});if(oe=eo(ne),oe)return z.add(oe.key),w=ie(w),K(E,oe.result,!1,{preventScrollReset:p});let se=new Map(w.fetchers);re&&se.set(t,Co(S.data));let{loaderData:ce,errors:le}=Ja(w,k,U,void 0,M,ne,se);Ee(A,se),w.navigation.state===`loading`&&A>L?($(T,`Expected pending action`),O&&O.abort(),ae(w.navigation.location,{matches:k,loaderData:ce,errors:le,fetchers:se})):(W({errors:le,loaderData:Ya(w.loaderData,ce,k,le),fetchers:se}),N=!1)}async function me(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);q(t,xo(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ua(e.history,i,m.signal);if(l){let e=await Ie(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ve(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{ve(t,n,$a(404,{pathname:i}),{flushSync:u});return}}let g=_o(s,i);F.set(t,m);let _=I,v=await he(h,i,Pa(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(B.has(t))q(t,Co(void 0));else if(co(y)){if(L>_){q(t,Co(void 0));return}z.add(t),await K(h,y,!1,{preventScrollReset:d})}else so(y)?ve(t,n,y.error):q(t,Co(y.data))}}async function K(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(N=!0);let d=i.response.headers.get(`Location`);$(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Ha(d,p,c,e.history),qi(f,d,p,`allow-explicit`);let m=kr(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(pi(d)){let n=Nr(t,d,!0);e=n.origin!==t.location.origin||di(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=vo(w.navigation));let y=o||s;$i.has(i.response.status)&&y&&ho(y.formMethod)?await ce(h,m,{submission:{...y,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await ce(h,m,{overrideNavigation:yo(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function he(e,t,n,r,i){let a,o={};try{a=await Fa(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!ho(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;a.hasOwnProperty(e.route.id)||w.loaderData.hasOwnProperty(e.route.id)||w.errors&&w.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(oo(r)){let i=r.result;o[t]={type:`redirect`,response:za(i,e,t,n,c)}}else o[t]=await Ra(r);return o}async function ge(e,t,n,r,i){let a=he(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await he(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:$a(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function _e(){N=!0,ee.forEach((e,t)=>{F.has(t)&&P.add(t),Ce(t)})}function q(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),W({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function ve(e,t,n,r={}){let i=Za(w.matches,t),a=new Map(w.fetchers);xe(a,e),W({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function ye(e){return te.set(e,(te.get(e)||0)+1),B.has(e)&&B.delete(e),w.fetchers.get(e)||ta}function be(e,t){Ce(e,t?.reason),q(e,Co(null))}function xe(e,t){let n=w.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&R.has(t))&&Ce(t),ee.delete(t),R.delete(t),z.delete(t),B.delete(t),P.delete(t),e.delete(t)}function Se(e){let t=(te.get(e)||0)-1;t<=0?(te.delete(e),B.add(e)):te.set(e,t),W({fetchers:new Map(w.fetchers)})}function Ce(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function we(e,t){for(let n of e){let e=t.get(n);$(e,`Expected fetcher: ${n}`);let r=Co(e.data);t.set(n,r)}}function Te(e){let t=[],n=!1;for(let r of z){let i=e.get(r);$(i,`Expected fetcher: ${r}`),i.state===`loading`&&(z.delete(r),t.push(r),n=!0)}return we(t,e),n}function Ee(e,t){let n=[];for(let[r,i]of R)if(i<e){let e=t.get(r);$(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ce(r),R.delete(r),n.push(r))}return we(n,t),n.length>0}function De(e,t){let n=w.blockers.get(e)||na;return V.get(e)!==t&&V.set(e,t),n}function Oe(e){w.blockers.delete(e),V.delete(e)}function ke(e,t){let n=w.blockers.get(e)||na;$(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),W({blockers:r})}function Ae({currentLocation:e,nextLocation:t,historyAction:n}){if(V.size===0)return;V.size>1&&Er(!1,`A router only supports one blocker at a time`);let r=Array.from(V.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function je(e){let t=$a(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Qa(n);return{notFoundMatches:r,route:i,error:t}}function J(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===ea){_=!0;let e=Pe(w.location,w.matches);e!=null&&W({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Me(e,t){return h&&h(e,t.map(e=>Kr(e,w.loaderData)))||e.key}function Ne(e,t){if(m&&g){let n=Me(e,t);m[n]=g()}}function Pe(e,t){if(m){let n=Me(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Fe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Gr(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Gr(n,r,c,!0,e)}}return{active:!1,matches:null}}async function Ie(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||xa(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=Gr(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Gr(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Le(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Gr(s.activeRoutes,n,c,!0,u),!f||Le(l,f))return{type:`success`,matches:null};l=f}}function Le(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Re(e){o={},s.setHmrRoutes(Hr(e,a,void 0,o))}function ze(e,t,n=!1){xa(e,t,s,o,a,n),s.hasHMRRoutes||W({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ne,subscribe:ie,enableScrollRestoration:J,navigate:oe,fetch:fe,revalidate:se,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ye,resetFetcher:be,deleteFetcher:Se,dispose:re,getBlocker:De,deleteBlocker:Oe,patchRoutes:ze,_internalFetchControllers:F,_internalSetRoutes:Re,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){W(e)}},e.instrumentations&&(C=Pi(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function fa(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function pa(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=yi(r||`.`,vi(o),di(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=go(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=fi({basename:n,pathname:c.pathname})),Ar(c)}function ma(e,t,n){if(!n||!fa(n))return{path:t};if(n.formMethod&&!mo(n.formMethod))return{path:t,error:$a(405,{method:n.formMethod})};let r=()=>({path:t,error:$a(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=to(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!ho(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
3
- `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!ho(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}$(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ga(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ga(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Ka(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Ka(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(ho(c.formMethod))return{path:t,submission:c};let l=jr(t);return e&&l.search&&go(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ar(l),submission:c}}function ha(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?so(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&so(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=ki(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ga(s))f=!1;else if(u){let{shouldLoad:e}=_a(s,a.loaderData,a.errors);f=e}else va(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Na(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?ya(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=ba(i,m);return Na(n,r,e,c,k,i,l,t,h,m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=Gr(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=_o(b,e.path),C=new AbortController,w=Ua(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Pa(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Pa(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};ba(S,a)&&(T=Pa(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function ga(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function _a(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ga(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function va(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function ya(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ba(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function xa(e,t,n,r,i,a){let o;if(e){let t=r[e];$(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Sa(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Hr(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Hr([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Sa(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Sa(e,t)))??!1}var Ca=new WeakMap,wa=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if($(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Ca.get(i);o||(o={},Ca.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Rr(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)Er(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)Er(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Ta=new WeakMap;function Ea(e,t,n,r,i){let a=n[e.id];if($(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Ta.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{$(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Br(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?Er(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?Er(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Ta.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=wa({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Da(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Oa(e){return e.matches.some(e=>e.route.middleware)?ka(e,()=>Da(e)):Da(e)}function ka(e,t){return Aa(e,t,e=>{if(po(e))throw e;return e},io,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Za(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Aa(e,t,n,r,i){let{matches:a,...o}=e;return await ja(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function ja(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await ja(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Ma(e,t,n,r,i){let a=wa({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Ea(r.route,ho(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Na(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Ma(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ba(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ba(a,{...l,defaultShouldRevalidate:e}):ba(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!ho(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(ho(n.method)||!p)?Ia({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Pa(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Na(e,t,n,r,ki(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Ma(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Fa(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Wa(t,n),pattern:ki(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return ka(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Ia({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=ho(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Wa(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw $a(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw $a(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function La(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Ra(e){let{result:t,type:n}=e;if(uo(t)){let e;try{e=await La(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Di(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?lo(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:ro(t),statusCode:Oi(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Oi(t)?t.status:void 0}:lo(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function za(e,t,n,r,i){let a=e.headers.get(`Location`);if($(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!pi(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=pa(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Ba=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Va(e){try{return Ba.includes(new URL(e).protocol)}catch{return!1}}function Ha(e,t,n,r){if(pi(e)){let r=e,i=xr.test(r)?new URL(Sr(r,t.protocol)):new URL(r);if(Va(i.toString()))throw Error(`Invalid redirect location`);let a=di(i.pathname,n)!=null;if(i.origin===t.origin&&a)return bi(i.pathname)+i.search+i.hash}try{if(Va(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ua(e,t,n,r){let i=e.createURL(to(t)).toString(),a={signal:n};if(r&&ho(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Ga(r.formData):r.formData}return new Request(i,a)}function Wa(e,t){let n=new URL(e.url),r=typeof t==`string`?jr(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Ga(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Ka(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function qa(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&so(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if($(!co(f),`Cannot handle redirect results in processLoaderData`),so(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Za(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=aa),c||(c=!0,s=Oi(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Ja(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=qa(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if($(s,`Did not find corresponding fetcher result`),so(s)){let t=Za(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(co(s))$(!1,`Unhandled fetcher revalidation redirect`);else{let e=Co(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Ya(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==aa).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Xa(e){return e?so(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Za(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Qa(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function $a(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Di(e||500,o,Error(s),!0)}function eo(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(co(r))return{key:n,result:r}}}function to(e){return Ar({...typeof e==`string`?jr(e):e,hash:``})}function no(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function ro(e){return new Di(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function io(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&ao(t))}function ao(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function oo(e){return uo(e.result)&&Qi.has(e.result.status)}function so(e){return e.type===`error`}function co(e){return(e&&e.type)===`redirect`}function lo(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function uo(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function fo(e){return Qi.has(e)}function po(e){return uo(e)&&fo(e.status)&&e.headers.has(`Location`)}function mo(e){return Zi.has(e.toUpperCase())}function ho(e){return Yi.has(e.toUpperCase())}function go(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function _o(e,t){let n=typeof t==`string`?jr(t).search:t.search;if(e[e.length-1].route.index&&go(n||``))return e[e.length-1];let r=_i(e);return r[r.length-1]}function vo(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function yo(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bo(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function xo(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function So(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Co(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function wo(e,t){try{let n=e.sessionStorage.getItem(ia);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function To(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(ia,JSON.stringify(n))}catch(e){Er(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Eo(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Do=Q.createContext(null);Do.displayName=`DataRouter`;var Oo=Q.createContext(null);Oo.displayName=`DataRouterState`;var ko=Q.createContext(!1);function Ao(){return Q.useContext(ko)}var jo=Q.createContext({isTransitioning:!1});jo.displayName=`ViewTransition`;var Mo=Q.createContext(new Map);Mo.displayName=`Fetchers`;var No=Q.createContext(null);No.displayName=`Await`;var Po=Q.createContext(null);Po.displayName=`Navigation`;var Fo=Q.createContext(null);Fo.displayName=`Location`;var Io=Q.createContext({outlet:null,matches:[],isDataRoute:!1});Io.displayName=`Route`;var Lo=Q.createContext(null);Lo.displayName=`RouteError`;var Ro=`REACT_ROUTER_ERROR`,zo=`REDIRECT`,Bo=`ROUTE_ERROR_RESPONSE`;function Vo(e){if(e.startsWith(`${Ro}:${zo}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ho(e){if(e.startsWith(`${Ro}:${Bo}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Di(t.status,t.statusText,t.data)}catch{}}function Uo(e,{relative:t}={}){$(Wo(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=Q.useContext(Po),{hash:i,pathname:a,search:o}=$o(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:xi([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Wo(){return Q.useContext(Fo)!=null}function Go(){return $(Wo(),`useLocation() may be used only in the context of a <Router> component.`),Q.useContext(Fo).location}var Ko=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qo(e){Q.useContext(Po).static||Q.useLayoutEffect(e)}function Jo(){let{isDataRoute:e}=Q.useContext(Io);return e?gs():Yo()}function Yo(){$(Wo(),`useNavigate() may be used only in the context of a <Router> component.`);let e=Q.useContext(Do),{basename:t,navigator:n}=Q.useContext(Po),{matches:r}=Q.useContext(Io),{pathname:i}=Go(),a=JSON.stringify(vi(r)),o=Q.useRef(!1);return qo(()=>{o.current=!0}),Q.useCallback((r,s={})=>{if(Er(o.current,Ko),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=yi(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:xi([t,c.pathname])),qi(typeof r==`string`?r:Ar(r),n.createHref(c),Wi(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Xo=Q.createContext(null);function Zo(e){let t=Q.useContext(Io).outlet;return Q.useMemo(()=>t&&Q.createElement(Xo.Provider,{value:e},t),[t,e])}function Qo(){let{matches:e}=Q.useContext(Io);return e[e.length-1]?.params??{}}function $o(e,{relative:t}={}){let{matches:n}=Q.useContext(Io),{pathname:r}=Go(),i=JSON.stringify(vi(n));return Q.useMemo(()=>yi(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function es(e,t){return ts(e,t)}function ts(e,t,n){$(Wo(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=Q.useContext(Po),{matches:i}=Q.useContext(Io),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;vs(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
4
-
5
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Go(),d;if(t){let e=typeof t==`string`?jr(t):t;$(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Wr(e,{pathname:p});Er(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Er(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=cs(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:xi([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:xi([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?Q.createElement(Fo.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ns(){let e=hs(),t=Oi(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=Q.createElement(Q.Fragment,null,Q.createElement(`p`,null,`💿 Hey developer 👋`),Q.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,Q.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,Q.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),Q.createElement(Q.Fragment,null,Q.createElement(`h2`,null,`Unexpected Application Error!`),Q.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?Q.createElement(`pre`,{style:i},n):null,o)}var rs=Q.createElement(ns,null),is=class extends Q.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ho(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:Q.createElement(Io.Provider,{value:this.props.routeContext},Q.createElement(Lo.Provider,{value:e,children:this.props.component}));return this.context?Q.createElement(os,{error:e},t):t}};is.contextType=ko;var as=new WeakMap;function os({children:e,error:t}){let{basename:n,navigator:r}=Q.useContext(Po);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Vo(t.digest);if(e){let i=as.get(t);if(i)throw i;let a=ji(e.location,n),o=a.absoluteURL||a.to;if(qi(e.location,o,Wi(r),`allow-explicit`),Va(o))throw Error(`Invalid redirect location`);if(Ai&&!as.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw as.set(t,n),n}}return Q.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function ss({routeContext:e,match:t,children:n}){let r=Q.useContext(Do);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Q.createElement(Io.Provider,{value:e},n)}function cs(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);$(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ki(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||rs,o&&(s<0&&c===0?(vs(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?Q.createElement(n.route.Component,null):n.route.element?n.route.element:e,Q.createElement(ss,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?Q.createElement(is,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function ls(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function us(e){let t=Q.useContext(Do);return $(t,ls(e)),t}function ds(e){let t=Q.useContext(Oo);return $(t,ls(e)),t}function fs(e){let t=Q.useContext(Io);return $(t,ls(e)),t}function ps(e){let t=fs(e),n=t.matches[t.matches.length-1];return $(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ms(){return ps(`useRouteId`)}function hs(){let e=Q.useContext(Lo),t=ds(`useRouteError`),n=ps(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gs(){let{router:e}=us(`useNavigate`),t=ps(`useNavigate`),n=Q.useRef(!1);return qo(()=>{n.current=!0}),Q.useCallback(async(r,i={})=>{Er(n.current,Ko),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _s={};function vs(e,t,n){!t&&!_s[e]&&(_s[e]=!0,Er(!1,n))}var ys={};function bs(e,t){!e&&!ys[t]&&(ys[t]=!0,console.warn(t))}var xs=Q.useOptimistic,Ss=()=>void 0;function Cs(e){return xs?xs(e):[e,Ss]}function ws(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Er(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:Q.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Er(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:Q.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Er(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:Q.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ts=[`HydrateFallback`,`hydrateFallbackElement`],Es=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ds({router:e,flushSync:t,onError:n,useTransitions:r}){r=Ao()||r;let[i,a]=Q.useState(e.state),[o,s]=Cs(i),[c,l]=Q.useState(),[u,d]=Q.useState({isTransitioning:!1}),[f,p]=Q.useState(),[m,h]=Q.useState(),[g,_]=Q.useState(),v=Q.useRef(new Map),y=Q.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:ki(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),bs(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(bs(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y)t&&u?t(()=>a(i)):r===!1?a(i):Q.startTransition(()=>{r===!0&&s(e=>Os(e,i)),a(i)});else if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n))}else m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);Q.useLayoutEffect(()=>e.subscribe(y),[e,y]),Q.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Es)},[u]),Q.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):Q.startTransition(()=>{r===!0&&s(e=>Os(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),Q.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),Q.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=Q.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,S=Q.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return Q.createElement(Q.Fragment,null,Q.createElement(Do.Provider,{value:S},Q.createElement(Oo.Provider,{value:o},Q.createElement(Mo.Provider,{value:v.current},Q.createElement(jo.Provider,{value:u},Q.createElement(Ps,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},Q.createElement(ks,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Os(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var ks=Q.memo(As);function As({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ts(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function js({to:e,replace:t,state:n,relative:r}){$(Wo(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=Q.useContext(Po);Er(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=Q.useContext(Io),{pathname:s}=Go(),c=Jo(),l=yi(e,vi(o),s,r===`path`);qi(typeof e==`string`?e:Ar(e),a.createHref(l),Wi(a),`reject`);let u=JSON.stringify(l);return Q.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Ms(e){return Zo(e.context)}function Ns(e){$(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ps({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){$(!Wo(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=Q.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=jr(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=Q.useMemo(()=>{let e=di(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Er(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:Q.createElement(Po.Provider,{value:c},Q.createElement(Fo.Provider,{children:t,value:h}))}function Fs({children:e,location:t}){return es(Is(e),t)}Q.Component;function Is(e,t=[]){let n=[];return Q.Children.forEach(e,(e,r)=>{if(!Q.isValidElement(e))return;let i=[...t,r];if(e.type===Q.Fragment){n.push.apply(n,Is(e.props.children,i));return}$(e.type===Ns,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Is(e.props.children,i)),n.push(a)}),n}var Ls=`get`,Rs=`application/x-www-form-urlencoded`;function zs(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Bs(e){return zs(e)&&e.tagName.toLowerCase()===`button`}function Vs(e){return zs(e)&&e.tagName.toLowerCase()===`form`}function Hs(e){return zs(e)&&e.tagName.toLowerCase()===`input`}function Us(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ws(e,t){return e.button===0&&(!t||t===`_self`)&&!Us(e)}function Gs(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Ks(e,t){let n=Gs(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var qs=null;function Js(){if(qs===null)try{new FormData(document.createElement(`form`),0),qs=!1}catch{qs=!0}return qs}var Ys=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Xs(e){return e!=null&&!Ys.has(e)?(Er(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rs}"`),null):e}function Zs(e,t){let n,r,i,a,o;if(Vs(e)){let o=e.getAttribute(`action`);r=o?di(o,t):null,n=e.getAttribute(`method`)||Ls,i=Xs(e.getAttribute(`enctype`))||Rs,a=new FormData(e)}else if(Bs(e)||Hs(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?di(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Ls,i=Xs(e.getAttribute(`formenctype`))||Xs(o.getAttribute(`enctype`))||Rs,a=new FormData(o,e),!Js()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(zs(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Ls,r=null,i=Rs,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Qs(e,t){if(e===!1||e==null)throw Error(t)}function $s(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&di(i.pathname,t)===`/`?`${Si(t)}/_root.${r}`:`${Si(i.pathname)}.${r}`,i}async function ec(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tc(e){return e!=null&&typeof e.page==`string`}function nc(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function rc(e,t,n){return cc((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ec(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(nc).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ic(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ac(e,t,{includeHydrateFallback:n}={}){return oc(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function oc(e){return[...new Set(e)]}function sc(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function cc(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!tc(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(sc(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function lc(){let e=Q.useContext(Do);return Qs(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function uc(){let e=Q.useContext(Oo);return Qs(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var dc=Q.createContext(void 0);dc.displayName=`FrameworkContext`;function fc(){let e=Q.useContext(dc);return Qs(e,`You must render this element inside a <HydratedRouter> element`),e}function pc(e,t){let n=Q.useContext(dc),[r,i]=Q.useState(!1),[a,o]=Q.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=Q.useRef(null);Q.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),Q.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:mc(s,p),onBlur:mc(c,m),onMouseEnter:mc(l,p),onMouseLeave:mc(u,m),onTouchStart:mc(d,p)}]:[a,f,{}]:[!1,f,{}]}function mc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function hc({page:e,...t}){let n=Ao(),{nonce:r}=fc(),{router:i}=lc(),a=Q.useMemo(()=>Wr(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?Q.createElement(_c,{page:e,matches:a,...t}):Q.createElement(vc,{page:e,matches:a,...t})):null}function gc(e){let{manifest:t,routeModules:n}=fc(),[r,i]=Q.useState([]);return Q.useEffect(()=>{let r=!1;return rc(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function _c({page:e,matches:t,...n}){let r=Go(),{future:i}=fc(),{basename:a}=lc(),o=Q.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=$s(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return Q.createElement(Q.Fragment,null,o.map(e=>Q.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function vc({page:e,matches:t,...n}){let r=Go(),{future:i,manifest:a,routeModules:o}=fc(),{basename:s}=lc(),{loaderData:c,matches:l}=uc(),u=Q.useMemo(()=>ic(e,t,l,a,r,`data`),[e,t,l,a,r]),d=Q.useMemo(()=>ic(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=Q.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=$s(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=Q.useMemo(()=>ac(d,a),[d,a]),m=gc(d);return Q.createElement(Q.Fragment,null,f.map(e=>Q.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>Q.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>Q.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function yc(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}Q.Component;var bc=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{bc&&(window.__reactRouterVersion=`7.18.5`)}catch{}function xc(e,t){return da({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:Tr({window:t?.window}),hydrationData:t?.hydrationData||Sc(),routes:e,mapRouteProperties:ws,hydrationRouteProperties:Ts,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Sc(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Cc(e.errors)}),e}function Cc(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Di(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ei.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var wc=Q.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=Q.useContext(Po),v=typeof l==`string`&&br.test(l),y=ji(l,h);l=y.to;let b=Uo(l,{relative:r}),x=Go(),S=null;if(o){let e=yi(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:xi([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=pc(n,p),E=kc(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=Q.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:yc(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?Q.createElement(Q.Fragment,null,k,Q.createElement(hc,{page:b})):k});wc.displayName=`Link`;var Tc=Q.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=$o(a,{relative:c.relative}),d=Go(),f=Q.useContext(Oo),{navigator:p,basename:m}=Q.useContext(Po),h=f!=null&&Fc(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=di(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return Q.createElement(wc,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Tc.displayName=`NavLink`;var Ec=Q.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Ls,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=Q.useContext(Po),g=Nc(),_=Pc(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&br.test(s);return Q.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?Q.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ec.displayName=`Form`;function Dc(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Oc(e){let t=Q.useContext(Do);return $(t,Dc(e)),t}function kc(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Jo(),d=Go(),f=$o(e,{relative:o});return Q.useCallback(p=>{if(Ws(p,t)){p.preventDefault();let t=n===void 0?Ar(d)===Ar(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?Q.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Ac(e){Er(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=Q.useRef(Gs(e)),n=Q.useRef(!1),r=Go(),i=Q.useMemo(()=>Ks(r.search,n.current?null:t.current),[r.search]),a=Jo();return[i,Q.useCallback((e,t)=>{let r=Gs(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var jc=0,Mc=()=>`__${String(++jc)}__`;function Nc(){let{router:e}=Oc(`useSubmit`),{basename:t}=Q.useContext(Po),n=ms(),r=e.fetch,i=e.navigate;return Q.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Zs(e,t);if(a.navigate===!1){let e=a.fetcherKey||Mc();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Pc(e,{relative:t}={}){let{basename:n}=Q.useContext(Po),r=Q.useContext(Io);$(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...$o(e||`.`,{relative:t})},o=Go();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:xi([n,a.pathname])),Ar(a)}function Fc(e,{relative:t}={}){let n=Q.useContext(jo);$(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Oc(`useViewTransitionState`),i=$o(e,{relative:t});if(!n.isTransitioning)return!1;let a=di(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=di(n.nextLocation.pathname,r)||n.nextLocation.pathname;return si(i.pathname,o)!=null||si(i.pathname,a)!=null}function Ic(e,t){Tn.beginTransaction(t),e(Y.NAVIGATION_CLOSE,{zone:G.OVERLAY})}function Lc(e,t){Tn.beginTransaction(t),e(Y.NAVIGATION_CLEAR_ZONE,{zone:X.SECONDARY,preservePersistent:!0}),e(Y.NAVIGATION_CLEAR_ZONE,{zone:X.COMPANION,preservePersistent:!0}),e(Y.NAVIGATION_CLOSE,{zone:G.OVERLAY})}function Rc(e){let{emit:t,routerNavigate:n,homePath:r=`/`}=e;zc({emit:t,routerNavigate:n,path:r,source:`home_navigation`})}function zc(e){let{emit:t,routerNavigate:n,path:r,source:i=`path_navigation`}=e;Tn.beginTransaction(i),t(Y.NAVIGATION_CLEAR_ZONE,{zone:X.PRIMARY}),Lc(t,`app_level_navigation`),n(r,{replace:!0})}var Bc=null,Vc=null;function Hc(e){return Bc=e,()=>{Bc===e&&(Bc=null)}}function Uc(){Vc?.()}function Wc(e,t){Uc();let n=Bc;if(!n){e();return}let r=!1,i,a=()=>{r||(r=!0,Vc===a&&(Vc=null),clearTimeout(i),e())};try{n(a,t)}catch(e){throw a(),e}r||(Vc=a,i=setTimeout(a,400))}function Gc(e,t,n){if(e.length===0)return-1;let r=e.length-1;if(t===void 0)return r;switch(t){case ue.SINGLE:return r;case ue.TABBED:break;default:throw Error(`[navigation] Zone content model '${String(t)}' reaches no renderer. Add a case to resolveVisibleEntryIndex, and the rendering that case implies.`)}let i=e.findIndex(e=>e.id===n);return i>=0?i:r}function Kc(e,t){if(e.length===0)return-1;let n=t===void 0?-1:e.findIndex(e=>e.id===t);return n>=0?n:e.length-1}function qc(e,t,n,r){let i=e.zones[t];if(!i||i.stack.length===0)return e;let a=Gc(i.stack,r,i.activeTabId),o=r===ue.TABBED?[...i.stack.filter((e,t)=>t!==a),i.stack[a]]:i.stack,s=n===Te.OVERLAY?G.OVERLAY:X.PRIMARY,c=o.map(e=>({...e,zone:s,collapsedFromZone:t})),l={...i,stack:[],activeTabId:void 0,isVisible:!1};if(n===Te.OVERLAY)return{...e,overlay:[...e.overlay,...c],zones:{...e.zones,[t]:l}};let u=e.zones[X.PRIMARY];return{...e,zones:{...e.zones,[t]:l,[X.PRIMARY]:{...u,stack:[...u.stack,...c],isVisible:!0}}}}function Jc(e,t){let n=e.length;for(;n>0&&e[n-1].collapsedFromZone!==void 0;)--n;return e.slice(n).filter(e=>e.collapsedFromZone===t)}function Yc(e,t,n){let r=e.zones[X.PRIMARY],i=Jc(r.stack,t),a=Jc(e.overlay,t);if(i.length===0&&a.length===0)return e;let o=new Set([...i,...a].map(e=>e.id)),s=[...i,...a].map(e=>{let{collapsedFromZone:n,...r}=e;return{...r,zone:t}}),c=e.zones[t],l=[...c.stack,...s];return{...e,overlay:a.length>0?e.overlay.filter(e=>!o.has(e.id)):e.overlay,zones:{...e.zones,[X.PRIMARY]:i.length>0?{...r,stack:r.stack.filter(e=>!o.has(e.id)),isVisible:!0}:r,[t]:{...c,stack:l,isVisible:!0,activeTabId:n===ue.TABBED?l[l.length-1].id:c.activeTabId}}}}function Xc(e,t){return t.reduce((e,{zone:t,mode:n,contentModel:r})=>n===void 0?Yc(e,t,r):qc(e,t,n,r),e)}function Zc(e){let t;switch(e.contentType){case Z.RESOURCE_OPERATION:case Z.INLINE_CREATE:t=e.resourceContext.contextResourceIdentifiers;break;case Z.COMPOSITE_VIEW:case Z.CHART_VIEW:case Z.FULL_CUSTOM_VIEW:case Z.FLOWS_ACTORS_VIEW:case Z.EXECUTION_VIEW:case Z.CUSTOM_COMPONENT:t=e.contextResourceIdentifiers;break;case Z.ENGINE_PAGE:case Z.SETTINGS_HUB:case Z.ERROR_MODAL:return null;default:return e}let n=t?.[ft.ORGANIZATIONS];if(n==null)return null;let r=W.getResourceId(n);return r.length>0?r:null}function Qc(e,t){return!e.urlPath||e.hostedPane||!fe.includes(e.zone)?!1:e.zone!==X.COMPANION||!Tn.getTopEntry(t(X.SECONDARY))?.hostedPane}function $c(e){let t=e.initiatorInfos??[];if(t.length===0)return;let n=e.registry.resourceConfigurations?.[e.targetResourceType]?.resourceFieldIdentifier??``;if(!n)return;let r=B.selectOperationUrlInitiatorInfo({initiatorInfos:[...t],contextualParameters:e.ownContextualParameters,targetResourceType:e.targetResourceType,targetDefaultFieldIdentifier:n,parentResourcesRequirements:e.parentResourcesRequirements});if(r&&r.parameters.some(t=>t.resourceType===e.targetResourceType&&t.fieldIdentifier===n))return W.buildParentResourcesRequirementsFromRouteParams(r.parameters,e.targetResourceType,e.registry)}function el(e){let t=Object.fromEntries(Object.entries(e.tenancyIdentifiers).filter(([e])=>fr.has(e)));return $c({initiatorInfos:e.initiatorInfos,targetResourceType:e.targetResourceType,registry:e.registry,ownContextualParameters:B.buildContextualParameters({...t,...e.ownIdentifiers},e.registry),parentResourcesRequirements:e.parentResourcesRequirements})}var tl=Be.getLogger(),nl=tl.debugByType(`NavigationContext`);tl.setDebugTypeLogging(`NavigationContext`,!1);var rl=(0,Q.createContext)(void 0);function il({children:e}){let[t,n]=(0,Q.useState)(Tn.createInitialNavigationState()),[r,i]=(0,Q.useState)(X.PRIMARY),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(void 0),{on:l,emit:u}=Me(),d=Go(),f=Jo(),{registry:p}=T(),m=v(),h=(0,Q.useRef)(t);(0,Q.useEffect)(()=>{h.current=t},[t]);let g=(0,Q.useCallback)((e,t)=>{nl(`pushEntry`,{zone:e,entryId:t.id,contentType:t.content.contentType,urlPath:t.urlPath,source:t.navigationSource}),n(n=>({...n,zones:{...n.zones,[e]:{...n.zones[e],stack:[...n.zones[e].stack,t],isVisible:!0,activeTabId:n.zones[e].activeTabId===void 0?void 0:t.id}}}))},[]),_=(0,Q.useCallback)((e,t)=>{nl(`replaceEntry`,{zone:e,entryId:t.id,contentType:t.content.contentType,urlPath:t.urlPath,source:t.navigationSource}),n(n=>{let r=n.zones[e];if(nl(`replaceEntry: previous stack depth`,{zone:e,previousStackDepth:r.stack.length}),r.stack.length===0)return{...n,zones:{...n.zones,[e]:{...r,stack:[t],isVisible:!0}}};let i=Kc(r.stack,r.activeTabId),a=r.activeTabId!==void 0&&r.stack[i]?.id===r.activeTabId,o=r.stack.map((e,n)=>n===i?t:e);return{...n,zones:{...n.zones,[e]:{...r,stack:o,isVisible:!0,activeTabId:a?t.id:r.activeTabId}}}})},[]),y=(0,Q.useCallback)((e,t)=>{n(n=>{let r=n.zones[e];if(r.stack.length===0)return n;let i,a=r.activeTabId;if(t){let e=r.stack.findIndex(e=>e.id===t);i=e>=0?r.stack.slice(0,e+1):r.stack.slice(0,-1),a=r.activeTabId===void 0?r.activeTabId:i[i.length-1]?.id}else if(r.activeTabId!==void 0){let e=Kc(r.stack,r.activeTabId);r.stack[e]?.id===r.activeTabId?(i=r.stack.filter((t,n)=>n!==e),a=i[Math.max(0,e-1)]?.id):i=r.stack.slice(0,-1)}else i=r.stack.slice(0,-1);return{...n,zones:{...n.zones,[e]:{...r,stack:i,activeTabId:i.length>0?a:void 0,isVisible:i.length>0||e===X.PRIMARY}}}})},[]),b=(0,Q.useCallback)((e,t=!1)=>{nl(`clearZoneEntries called`,{zone:e}),n(n=>{nl(`clearZoneEntries: previous stack depth`,{zone:e,previousStackDepth:n.zones[e].stack.length});let r=n.zones[e].stack[n.zones[e].stack.length-1];return t&&r?.persistent?(nl(`clearZoneEntries: PERSISTENT top kept across the fresh start`,{zone:e}),n.zones[e].stack.length===1?n:{...n,zones:{...n.zones,[e]:{...n.zones[e],stack:[r]}}}):{...n,zones:{...n.zones,[e]:{...n.zones[e],stack:[],isVisible:e===X.PRIMARY}}}})},[]),x=(0,Q.useCallback)(e=>{let t=t=>{let n=Zc(t.content);return n!==null&&n!==e};n(n=>{let r=!1,i={...n.zones};for(let a of fe){let o=n.zones[a],s=o.stack.filter(e=>!t(e));if(s.length===o.stack.length)continue;r=!0,nl(`dropEntriesAddressingAnotherOrganization`,{zone:a,dropped:o.stack.length-s.length,organizationId:e});let c=o.activeTabId===void 0||s.some(e=>e.id===o.activeTabId);i[a]={...o,stack:s,activeTabId:s.length===0?void 0:c?o.activeTabId:s[s.length-1].id,isVisible:s.length>0||a===X.PRIMARY}}let a=n.overlay.filter(e=>!t(e));return a.length!==n.overlay.length&&(r=!0),r?{...n,zones:i,overlay:a}:n})},[]),C=(0,Q.useCallback)(e=>{nl(`pushOverlay`,{entryId:e.id,contentType:e.content.contentType,appearance:e.appearance}),n(t=>({...t,overlay:[...t.overlay,e]}))},[]),w=(0,Q.useCallback)(e=>{n(t=>t.overlay.length===0?t:e?{...t,overlay:t.overlay.filter(t=>t.id!==e)}:{...t,overlay:t.overlay.slice(0,-1)})},[]),E=(0,Q.useCallback)(()=>{nl(`clearOverlay called`),n(e=>e.overlay.length===0?e:{...e,overlay:[]})},[]),D=(0,Q.useCallback)((e,t)=>l(e,e=>{Uc(),t(e)}),[l]);(0,Q.useEffect)(()=>D(Y.NAVIGATION_PUSH,e=>{nl(`NAVIGATION_PUSH received`,{zone:e.zone,contentType:e.content.contentType,urlPath:e.urlPath,transition:e.transition});let t={id:e.stackEntryId,content:e.content,urlPath:e.urlPath,timestamp:Date.now(),zone:e.zone,initiator:e.initiator,navigationSource:e.navigationSource,transition:e.transition,appearance:e.appearance,overlayBehavior:e.overlayBehavior,ephemeral:e.ephemeral,hostedPane:e.hostedPane,collapsedFromZone:e.collapsedFromZone,persistent:e.persistent};e.zone===G.OVERLAY?C(t):g(e.zone,t)}),[D,g,C]),(0,Q.useEffect)(()=>D(Y.NAVIGATION_REPLACE,e=>{nl(`NAVIGATION_REPLACE received`,{zone:e.zone,contentType:e.content.contentType,urlPath:e.urlPath,transition:e.transition});let t={id:e.stackEntryId,content:e.content,urlPath:e.urlPath,timestamp:Date.now(),zone:e.zone,initiator:e.initiator,navigationSource:e.navigationSource,transition:e.transition,appearance:e.appearance,overlayBehavior:e.overlayBehavior,ephemeral:e.ephemeral,hostedPane:e.hostedPane,collapsedFromZone:e.collapsedFromZone,persistent:e.persistent};e.zone===G.OVERLAY?n(e=>e.overlay.length===0?{...e,overlay:[t]}:{...e,overlay:[...e.overlay.slice(0,-1),t]}):_(e.zone,t)}),[D,_]),(0,Q.useEffect)(()=>D(Y.NAVIGATION_POP,e=>{nl(`NAVIGATION_POP received`,{zone:e.zone,toStackEntryId:e.toStackEntryId}),e.zone===G.OVERLAY?w(e.toStackEntryId):y(e.zone,e.toStackEntryId)}),[D,y,w]),(0,Q.useEffect)(()=>D(Y.NAVIGATION_CLOSE,e=>{nl(`NAVIGATION_CLOSE received`,{zone:e.zone,stackEntryId:e.stackEntryId}),e.zone===G.OVERLAY&&(e.stackEntryId?w(e.stackEntryId):E())}),[D,w,E]),(0,Q.useEffect)(()=>D(Y.NAVIGATION_CLEAR_ZONE,e=>{nl(`NAVIGATION_CLEAR_ZONE received`,{zone:e.zone,preservePersistent:e.preservePersistent}),b(e.zone,e.preservePersistent===!0)}),[D,b]),(0,Q.useEffect)(()=>D(Y.NAVIGATION_URL_PATH_UPDATED,e=>{nl(`NAVIGATION_URL_PATH_UPDATED received`,{zone:e.zone,stackEntryId:e.stackEntryId,urlPath:e.urlPath}),n(t=>{let n=t.zones[e.zone];if(!n)return t;let r=n.stack.findIndex(t=>t.id===e.stackEntryId);if(r<0||n.stack[r].urlPath===e.urlPath)return t;let i=n.stack.slice();return i[r]={...i[r],urlPath:e.urlPath},{...t,zones:{...t.zones,[e.zone]:{...n,stack:i}}}})}),[D]);let O=(0,Q.useRef)(t);(0,Q.useEffect)(()=>{let e=O.current;O.current=t;for(let n of fe){let r=e.zones[n],i=t.zones[n];if(r.stack!==i.stack){let e=i.stack[i.stack.length-1];nl(`Emitting NAVIGATION_ZONE_CHANGED`,{zone:n,stackDepth:i.stack.length,previousStackDepth:r.stack.length}),u(Y.NAVIGATION_ZONE_CHANGED,{zone:n,currentContent:e?.content,stackDepth:i.stack.length,previousStackDepth:r.stack.length})}}},[t,u]);let k=(0,Q.useRef)(t.zones[X.PRIMARY]);(0,Q.useEffect)(()=>{let e=k.current;k.current=t.zones[X.PRIMARY];let n=t.zones[X.PRIMARY];if(e.stack===n.stack)return;let r=n.stack[n.stack.length-1],i=e.stack[e.stack.length-1];if(!r||i&&i.id===r.id||i?.collapsedFromZone!==void 0&&!n.stack.some(e=>e.id===i.id)||i&&r.content.contentType===Z.RESOURCE_OPERATION&&i.content.contentType===Z.RESOURCE_OPERATION&&Tn.isSameResourceTarget(r.content.resourceContext,i.content.resourceContext))return;let a=t.zones[X.SECONDARY],o=!1,s=!1;if(a.stack.length>0){let e=a.stack[a.stack.length-1];if(e){let n=e.hostedPane===!0&&r.content.contentType!==Z.RESOURCE_OPERATION||Tn.isContentRelevantToParent(e.content,r.content);if(!n&&e.persistent)nl(`Zone dependency cleanup: SECONDARY is PERSISTENT — kept across the primary change`,{paneResourceType:e.content.contentType===Z.RESOURCE_OPERATION?e.content.resourceContext.resourceType:e.content.contentType});else if(!n){nl(`Zone dependency cleanup: SECONDARY stale, clearing`,{primaryResourceType:r.content.contentType===Z.RESOURCE_OPERATION?r.content.resourceContext.resourceType:r.content.contentType}),b(X.SECONDARY),s=!0;let e=t.zones[X.COMPANION].stack,n=e[e.length-1];e.length>0&&!n?.persistent&&(o=!0,b(X.COMPANION))}}}let c=t.zones[X.COMPANION];if(!o&&c.stack.length>0){let e=c.stack[c.stack.length-1];if(e){let t=s?void 0:a.stack[a.stack.length-1],n=Tn.isContentRelevantToParent(e.content,r.content)||!!t&&t.content.contentType===Z.RESOURCE_OPERATION&&Tn.isContentRelevantToParent(e.content,t.content);!n&&e.persistent?nl(`Zone dependency cleanup: COMPANION is PERSISTENT — kept across the primary change`,{paneResourceType:e.content.contentType===Z.RESOURCE_OPERATION?e.content.resourceContext.resourceType:e.content.contentType}):n||(nl(`Zone dependency cleanup: COMPANION stale, clearing`,{primaryResourceType:r.content.contentType===Z.RESOURCE_OPERATION?r.content.resourceContext.resourceType:r.content.contentType}),b(X.COMPANION))}}},[t,b]);let A=(0,Q.useRef)(new Map),j=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(!m)return;let e=e=>{let t=`${d.pathname}${d.search}`,n=Tn.findStructuralRouteOwner(t,e=>h.current.zones[e]);if(!n)return!1;if(n.entry.hostedPane)return!0;let r=n.zone,i=n.entry,a=i.content;if(!a||a.contentType!==Z.RESOURCE_OPERATION)return!0;let o=a.resourceContext?.resourceType,s=a.resourceContext?.operation;if(!o||!s)return!0;let c=p.resourceConfigurations?.[o];if(!c)return!0;let l=S.primaryScopeToContextIdentifiers(S.buildInitiatorIds({userId:m.currentUserId,organizationId:m.currentOrganizationId,applicationId:m.currentApplicationId,anonymousUserId:m.currentAnonymousUserId}),c.resourcePrimaryScope),g={...m.buildContextResourceIdentifiers()},_=Array.isArray(e.newValue)?e.newValue[0]:e.newValue,v=typeof _==`string`&&_.length>0?_:void 0,y=[e.resourceType,e.fieldIdentifier].filter(Boolean);for(let e of y)v?g[e]=v:delete g[e];let b=a.resourceContext?.contextResourceIdentifiers??{},x={};for(let[e,t]of Object.entries(b)){let n=W.getResourceId(t);if(n){x[e]=n;let r=W.getFieldIdentifier(t);r&&(x[r]=n)}}let C=(m.customScopeFields??[]).flatMap(e=>[e.resourceType,e.fieldIdentifier].filter(Boolean)),w=new Set([...Object.keys(l),...Object.keys(g),...C]),T=Object.fromEntries(Object.entries(x).filter(([e])=>!w.has(e))),E={...l,...g,...T},D=el({initiatorInfos:s.initiatorInfos,targetResourceType:o,registry:p,ownIdentifiers:T,tenancyIdentifiers:l}),O=Tn.resolveResourceUrl(c,s,E,p.allResourceFieldIdentifiers,D,D!==void 0);if(!O?.resolvedUrl)return!0;let k=O.resolvedUrl,A=new URLSearchParams(d.search);for(let e of Array.from(A.keys()))e.startsWith(`scope_`)&&A.delete(e);let j=A.toString().length>0?`${k}?${A.toString()}`:k;if(j===t)return!0;let M={};for(let e of O.routePathParameters){let t=E[e.fieldIdentifier]??E[e.resourceType];t&&(M[e.fieldIdentifier]=t)}let N=W.extractResourceIdentifiersFromUrlParams(M,p,O.routePathParameters),P=S.buildResourceOperationContextIdentifiers({currentUserId:m.currentUserId,currentOrganizationId:m.currentOrganizationId,currentApplicationId:m.currentApplicationId,currentAnonymousUserId:m.currentAnonymousUserId,primaryScope:c.resourcePrimaryScope,liveAppScopeContextResourceIdentifiers:g,explicitContextResourceIdentifiers:N}),F=W.buildParentResourcesRequirementsFromRouteParams(O.routePathParameters,o,p),I={...a,resourceContext:W.createFrontendResourceOperationContextFromOperation({resourceType:o,operation:s,contextResourceIdentifiers:P,parentResourcesRequirements:F})};return u(Y.NAVIGATION_REPLACE,{zone:r,content:I,urlPath:j,stackEntryId:i.id,initiator:i.initiator,navigationSource:be.CONTROLLER,transition:V.REPLACE}),f(j,{replace:!0}),!0};return j.current=e,l(Y.APP_SCOPE_CHANGED,t=>{let n=t.fieldIdentifier||t.resourceType;t.initiator===te.ROUTER||t.initiator===te.SURFACE_FILTER||e(t)?A.current.delete(n):A.current.set(n,t)})},[m,u,d.pathname,d.search,l,p,f]),(0,Q.useEffect)(()=>{let e=A.current,t=j.current;if(e.size!==0&&t)for(let[n,r]of Array.from(e.entries())){if(!t(r))return;e.delete(n)}},[t.zones,d.pathname,d.search]),(0,Q.useEffect)(()=>l(Y.PRIMARY_SCOPE_CHANGED,e=>{e.scopeLevel===K.ORGANIZATIONS&&e.newValue!==e.previousValue&&e.previousValue&&e.initiator!==te.ROUTER&&(Tn.beginTransaction(`org_switch`),b(X.PRIMARY),b(X.SECONDARY),b(X.COMPANION),E(),f(`/`,{replace:!0}))}),[l,b,E,f]),(0,Q.useEffect)(()=>D(Y.NAVIGATION_ORGANIZATION_FOLLOWED,e=>{nl(`NAVIGATION_ORGANIZATION_FOLLOWED received`,{organizationId:e.organizationId}),x(e.organizationId)}),[D,x]),(0,Q.useEffect)(()=>l(Y.NAVIGATION_ZONE_CHANGED,e=>{let t=e.zone;if(!fe.includes(t))return;let r=h.current.overlay;if(r.length===0)return;let i=r.filter(e=>e.ephemeral===!0&&e.initiator?.sourceZone===t);if(i.length===0)return;for(let e of i)nl(`Ephemeral auto-close: closing overlay entry`,{entryId:e.id,changedZone:t});let a=new Set(i.map(e=>e.id));n(e=>({...e,overlay:e.overlay.filter(e=>!a.has(e.id))}))}),[l]);let M=(0,Q.useCallback)(e=>e===G.OVERLAY?{zone:G.OVERLAY,stack:t.overlay,isVisible:t.overlay.length>0}:t.zones[e]??Tn.createEmptyZoneState(e),[t]),N=(0,Q.useCallback)(e=>e===G.OVERLAY?t.overlay.length:Tn.getZoneDepth(M(e)),[M,t.overlay.length]),P=(0,Q.useCallback)(e=>e===G.OVERLAY?t.overlay[t.overlay.length-1]?.content:Tn.getTopEntry(M(e))?.content,[M,t.overlay]),F=(0,Q.useCallback)(e=>e===G.OVERLAY?t.overlay[t.overlay.length-1]:Tn.getTopEntry(M(e)),[M,t.overlay]),I=(0,Q.useCallback)(e=>e===G.OVERLAY?t.overlay.length>0:M(e).isVisible,[M,t.overlay.length]),L=(0,Q.useMemo)(()=>{let e=Tn.getTopEntry(t.zones[X.PRIMARY])?.content;return e&&Tn.isResourceOperationContent(e)?Tn.calculateResourceRelationshipDepth(e.resourceContext.parentResourcesRequirements):0},[t]),R=(0,Q.useCallback)(e=>Tn.isActiveRoute(e,d.pathname),[d.pathname]),z=(0,Q.useCallback)((e,t)=>{n(n=>{let r=n.zones[e];return!r||!r.stack.some(e=>e.id===t)||r.activeTabId===t?n:{...n,zones:{...n.zones,[e]:{...r,activeTabId:t}}}})},[]),ee=(0,Q.useCallback)(e=>{n(t=>Xc(t,e))},[]),B=(0,Q.useMemo)(()=>({state:t,getZoneState:M,getZoneDepth:N,getTopContent:P,getTopEntry:F,isZoneVisible:I,resourceRelationshipDepth:L,isNavigationItemActive:R,focusedZone:r,setFocusedZone:i,setActiveTab:z,emphasizedZone:a,setEmphasizedZone:o,contentAreaWidth:s,setContentAreaWidth:c,reconcileCollapsedZones:ee}),[t,M,N,P,F,I,L,R,z,r,a,s,ee]);return(0,Gt.jsx)(rl.Provider,{value:B,children:e})}function al(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var ol=e=>{switch(e){case`success`:return ll;case`info`:return dl;case`warning`:return ul;case`error`:return fl;default:return null}},sl=Array(12).fill(0),cl=({visible:e,className:t})=>Q.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},Q.createElement(`div`,{className:`sonner-spinner`},sl.map((e,t)=>Q.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),ll=Q.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},Q.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),ul=Q.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},Q.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),dl=Q.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},Q.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),fl=Q.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},Q.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),pl=Q.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},Q.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),Q.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ml=()=>{let[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},hl=1,gl=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:hl++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],Q.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(vl(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!Q.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Q.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Q.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Q.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||hl++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_l=(e,t)=>{let n=t?.id||hl++;return gl.addToast({title:e,...t,id:n}),n},vl=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,yl=Object.assign(_l,{success:gl.success,info:gl.info,warning:gl.warning,error:gl.error,custom:gl.custom,message:gl.message,promise:gl.promise,dismiss:gl.dismiss,loading:gl.loading},{getHistory:()=>gl.toasts,getToasts:()=>gl.getActiveToasts()});al(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function bl(e){return e.label!==void 0}var xl=3,Sl=`24px`,Cl=`16px`,wl=4e3,Tl=356,El=14,Dl=45,Ol=200;function kl(...e){return e.filter(Boolean).join(` `)}function Al(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var jl=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=Q.useState(null),[O,k]=Q.useState(null),[A,j]=Q.useState(!1),[M,N]=Q.useState(!1),[P,F]=Q.useState(!1),[I,L]=Q.useState(!1),[R,z]=Q.useState(!1),[ee,te]=Q.useState(0),[B,V]=Q.useState(0),H=Q.useRef(n.duration||y||wl),U=Q.useRef(null),ne=Q.useRef(null),re=c===0,ie=c+1<=o,W=n.type,ae=n.dismissible!==!1,oe=n.className||``,se=n.descriptionClassName||``,ce=Q.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),le=Q.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ue=Q.useMemo(()=>n.duration||y||wl,[n.duration,y]),de=Q.useRef(0),G=Q.useRef(0),fe=Q.useRef(0),pe=Q.useRef(null),[me,K]=b.split(`-`),he=Q.useMemo(()=>s.reduce((e,t,n)=>n>=ce?e:e+t.height,0),[s,ce]),ge=ml(),_e=n.invert||t,q=W===`loading`;G.current=Q.useMemo(()=>ce*x+he,[ce,he]),Q.useEffect(()=>{H.current=ue},[ue]),Q.useEffect(()=>{j(!0)},[]),Q.useEffect(()=>{let e=ne.current;if(e){let t=e.getBoundingClientRect().height;return V(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),Q.useLayoutEffect(()=>{if(!A)return;let e=ne.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,V(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ve=Q.useCallback(()=>{N(!0),te(G.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Ol)},[n,d,a,G]);Q.useEffect(()=>{if(n.promise&&W===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||ge?(()=>{if(fe.current<de.current){let e=new Date().getTime()-de.current;H.current-=e}fe.current=new Date().getTime()})():H.current!==1/0&&(de.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ve()},H.current)),()=>clearTimeout(e)},[u,i,n,W,ge,ve]),Q.useEffect(()=>{n.delete&&(ve(),n.onDismiss==null||n.onDismiss.call(n,n))},[ve,n.delete]);function ye(){return w?.loading?Q.createElement(`div`,{className:kl(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":W===`loading`},w.loading):Q.createElement(cl,{className:kl(C?.loader,n?.classNames?.loader),visible:W===`loading`})}let be=n.icon||w?.[W]||ol(W);return Q.createElement(`li`,{tabIndex:0,ref:ne,className:kl(_,oe,C?.toast,n?.classNames?.toast,C?.default,C?.[W],n?.classNames?.[W]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":ie,"data-y-position":me,"data-x-position":K,"data-index":c,"data-front":re,"data-swiping":P,"data-dismissible":ae,"data-type":W,"data-invert":_e,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?ee:G.current}px`,"--initial-height":S?`auto`:`${B}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),pe.current=null},onPointerDown:e=>{e.button!==2&&!q&&ae&&(U.current=new Date,te(G.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),pe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!ae)return;pe.current=null;let e=Number(ne.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ne.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-U.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Dl||a>.11)te(G.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ve(),L(!0);else{var o,s;(o=ne.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ne.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),F(!1),D(null)}},onPointerMove:t=>{var n,r;if(!pe.current||!ae||window.getSelection()?.toString().length>0)return;let i=t.clientY-pe.current.y,a=t.clientX-pe.current.x,o=e.swipeDirections??Al(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`)){if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`))){if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&z(!0),(n=ne.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ne.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},le&&!n.jsx&&W!==`loading`?Q.createElement(`button`,{"aria-label":T,"data-disabled":q,"data-close-button":!0,onClick:q||!ae?()=>{}:()=>{ve(),n.onDismiss==null||n.onDismiss.call(n,n)},className:kl(C?.closeButton,n?.classNames?.closeButton)},w?.close??pl):null,(W||n.icon||n.promise)&&n.icon!==null&&(w?.[W]!==null||n.icon)?Q.createElement(`div`,{"data-icon":``,className:kl(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||ye():null,n.type===`loading`?null:be):null,Q.createElement(`div`,{"data-content":``,className:kl(C?.content,n?.classNames?.content)},Q.createElement(`div`,{"data-title":``,className:kl(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?Q.createElement(`div`,{"data-description":``,className:kl(v,se,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),Q.isValidElement(n.cancel)?n.cancel:n.cancel&&bl(n.cancel)?Q.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{bl(n.cancel)&&ae&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ve())},className:kl(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,Q.isValidElement(n.action)?n.action:n.action&&bl(n.action)?Q.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{bl(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),e.defaultPrevented||ve())},className:kl(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Ml(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Nl(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Cl:Sl;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Pl=Q.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=xl,toastOptions:g,dir:_=Ml(),gap:v=El,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=Q.useState([]),C=Q.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=Q.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=Q.useState([]),[D,O]=Q.useState(!1),[k,A]=Q.useState(!1),[j,M]=Q.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),N=Q.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),F=Q.useRef(null),I=Q.useRef(!1),L=Q.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||gl.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return Q.useEffect(()=>gl.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Vt.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),Q.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),Q.useEffect(()=>{x.length<=1&&O(!1)},[x]),Q.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=N.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===N.current||N.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),Q.useEffect(()=>{if(N.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[N.current]),Q.createElement(`section`,{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?Q.createElement(`ol`,{key:t,dir:_===`auto`?Ml():_,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Tl}px`,"--gap":`${v}px`,...m,...Nl(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>Q.createElement(jl,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:L,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Fl=Be.getLogger();Fl.debugByType(`NotificationDisplayPolicy`),Fl.setDebugTypeLogging(`NotificationDisplayPolicy`,!1);var Il={success:{showToast:!0,addToCenter:!1,toastDuration:3e3},info:{showToast:!0,addToCenter:!1,toastDuration:4e3},warning:{showToast:!0,addToCenter:!0,toastDuration:5e3},error:{showToast:!0,addToCenter:!0,toastDuration:6e3}},Ll={resource:{success:{addToCenter:!1},info:{addToCenter:!1},warning:{addToCenter:!0},error:{addToCenter:!0}},custom:{},backend:{success:{addToCenter:!0,toastDuration:4e3},info:{addToCenter:!0,toastDuration:5e3},warning:{addToCenter:!0,toastDuration:6e3},error:{addToCenter:!0,toastDuration:8e3}}};function Rl(e,t,n){let r=Il[e],i=Ll[t]?.[e];return{...r,...i,...n}}var zl=Be.getLogger(),Bl=zl.debugByType(`NotificationContext`);zl.setDebugTypeLogging(`NotificationContext`,!1);var Vl={notifications:[]};function Hl(e,t){switch(t.type){case`ADD_NOTIFICATION`:return{...e,notifications:[t.notification,...e.notifications].slice(0,100)};case`REMOVE_NOTIFICATION`:return{...e,notifications:e.notifications.filter(e=>e.id!==t.id)};case`CLEAR_ALL`:return{...e,notifications:[]};default:return e}}function Ul(e,t){return e===``||e.startsWith(`${t}.`)?null:e}function Wl(e){let t=e?.i18nParams;if(!t||typeof t!=`object`||Array.isArray(t))return;let n=Object.entries(t).filter(e=>typeof e[1]==`string`||typeof e[1]==`number`);return n.length>0?Object.fromEntries(n):void 0}function Gl(e){let t=de.safeParse(e?.destination);return t.success?t.data:void 0}function Kl(e,t,n){switch(e){case`success`:yl.success(t,n);break;case`error`:yl.error(t,n);break;case`warning`:yl.warning(t,n);break;default:yl.info(t,n)}}function ql(e,t){let n=e?.milestoneRef;return typeof n!=`string`||n.length===0?null:t(n)}var Jl=(0,Q.createContext)(void 0);function Yl(){return`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}var Xl=5e3,Zl=12e4;function Ql({children:e}){let[t,n]=(0,Q.useReducer)(Hl,Vl),{on:r,emit:i}=Me(),[a,o]=(0,Q.useState)({isActive:!1}),s=(0,Q.useRef)(null),{tNotificationCustom:c,tResourceOperation:l,tComponent:u,tErrorMessage:p,tErrorGuidance:m,tMilestone:h,tMilestoneReward:g,t:_,isReady:v}=wt({component:L.APPLICATION_LEVEL_NOTIFICATION_CENTER,keys:[`notifications_custom`,he.MILESTONES]}),[y,b]=(0,Q.useState)(null),x=(0,Q.useRef)(c),S=(0,Q.useRef)(l),C=(0,Q.useRef)(u),w=(0,Q.useRef)(p),T=(0,Q.useRef)(m),E=(0,Q.useRef)(h),D=(0,Q.useRef)(g),O=(0,Q.useRef)(_),k=(0,Q.useRef)(v),A=(0,Q.useRef)([]);(0,Q.useEffect)(()=>{x.current=c,S.current=l,C.current=u,w.current=p,T.current=m,E.current=h,D.current=g,O.current=_},[c,l,u,p,m,h,g,_]);let j=(0,Q.useCallback)((e,t,n)=>{Kl(e,t,n?{duration:n}:void 0),Bl(`Toast displayed`,{type:e,message:t,duration:n})},[]),M=(0,Q.useCallback)((e,t,n)=>{let r={id:e,duration:1/0};switch(t){case`loading`:yl.loading(n,r);break;case`success`:yl.success(n,r);break;case`error`:yl.error(n,r);break;case`warning`:yl.warning(n,r);break;default:yl.info(n,r)}Bl(`Persistent toast shown`,{id:e,type:t})},[]),N=(0,Q.useCallback)(e=>{yl.dismiss(e),Bl(`Persistent toast dismissed`,{id:e})},[]),P=(0,Q.useCallback)(()=>{s.current&&=(clearTimeout(s.current),null),o({isActive:!1}),Bl(`Celebration dismissed`)},[]),F=(0,Q.useCallback)((e,t)=>{s.current&&clearTimeout(s.current),o({isActive:!0,mode:e,notificationIdentifier:t.notificationIdentifier,message:t.message,heading:t.heading,nextStep:t.nextStep}),s.current=setTimeout(()=>{o({isActive:!1}),s.current=null,Bl(t.nextStep?`Celebration reached its maximum lifetime`:`Celebration auto-dismissed`)},t.nextStep?Zl:Xl),Bl(`Celebration shown`,{mode:e.mode,identifier:t.notificationIdentifier,hasNextStep:!!t.nextStep})},[]);(0,Q.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]);let I=(0,Q.useCallback)((e,t,n)=>{if(n.message)return n.message;let r=n.data,i=r?.errorCustomMessageReference??r?.customMessageReference,a=typeof r?.errorGuidanceKey==`string`?r.errorGuidanceKey:void 0,o=(e===`error`||e===`warning`)&&(typeof i==`string`||typeof r?.errorRefusalCode==`string`||a!==void 0);if(o){if(a){let e=r?.errorGuidanceParams&&typeof r.errorGuidanceParams==`object`?r.errorGuidanceParams:void 0,t=T.current(a,`explanation`,e);if(t)return t}let e=f({tErrorMessage:w.current,t:O.current},typeof r?.errorRefusalCode==`string`?r.errorRefusalCode:void 0);if(e)return e;let t=d({tErrorMessage:w.current,tResourceOperation:S.current,resourceType:n.resourceContext?.resourceType,operationIdentifier:n.resourceContext?.operationIdentifier===void 0?void 0:String(n.resourceContext.operationIdentifier),customMessageReference:i});if(t)return t}if(n.identifier&&!o){let e=Ul(x.current(n.identifier,`msg`,n.i18nParams),`notifications_custom`);if(e!==null)return e}let s=ql(n.data,e=>D.current(e,`message`));if(s!==null)return s;if(e!==`success`&&e!==`error`&&!o&&t===`resource`&&n.resourceContext){let{resourceType:e,operationIdentifier:t}=n.resourceContext;if(e&&t){let n=Ul(S.current(e,String(t),`title`),`resources`);if(n!==null)return n}}return C.current(L.APPLICATION_LEVEL_NOTIFICATION_CENTER,{success:`defaultSuccess`,info:`defaultInfo`,warning:`defaultWarning`,error:`defaultError`}[e])},[]),R=(0,Q.useCallback)((e,t,n)=>{let r=I(e,t,n),i=n.data?.affectedCount;return e!==`success`||t!==`resource`||typeof i!=`number`||i<=1?r:r===C.current(L.APPLICATION_LEVEL_NOTIFICATION_CENTER,`defaultSuccess`)?C.current(L.APPLICATION_LEVEL_NOTIFICATION_CENTER,`bulkSucceeded`,{count:i}):C.current(L.APPLICATION_LEVEL_NOTIFICATION_CENTER,`bulkSucceededWithMessage`,{message:r,count:i})},[I]),z=(0,Q.useCallback)((e,t,r)=>{if(!k.current){A.current.push(()=>ee.current(e,t,r));return}let a=r.serverNotification!==void 0&&!r.serverNotification.alwaysDeliver&&Ze(r.serverNotification.target),o=a?r.resourceContext?.resourceType:void 0;if((t===`backend`||a)&&!pt(y,o,dt.IN_APP)){Bl(`Suppressing personal server notification: recipient switched in-app notifications off`,{type:e,identifier:r.identifier,resourceType:o});return}let s=Rl(e,t,r.overridePolicy),c=R(e,t,r),l,u=r.frontendDisplayHints?.nextStep;if(u){let e=``;if(r.identifier&&(e=Ul(x.current(r.identifier,`nextStepLabel`),`notifications_custom`)??``),!e&&u.operationRef){let t=u.operationRef.split(`.`);if(t.length>=2){let[n,r]=t;e=Ul(S.current(n,r,`title`),`resources`)??``}}e||=u.operationRef,l={label:e,onClick:()=>{if(u.type===`url`)window.open(u.operationRef,`_blank`,`noopener,noreferrer`);else{let e=r.resourceContext?B.flattenContextIdentifiers(r.resourceContext.contextResourceIdentifiers):void 0;i(Y.NAVIGATION_REQUEST,{operationRef:u.operationRef,operationRefContextIdentifiers:e,initiator:{sourceZone:ie}})}}}}else if(r.destination){let e=r.destination;l={label:r.identifier?x.current(r.identifier,`nextStepLabel`):e,onClick:()=>{i(Y.NAVIGATION_REQUEST,{urlPath:e,initiator:{sourceZone:ie}})}}}Bl(`Processing notification`,{type:e,source:t,message:c,displayBehavior:s,hasCelebration:!!r.frontendDisplayHints?.celebration,hasNextStep:!!u});let d=r.frontendDisplayHints?.celebration;if(d){F(d,{message:c,heading:ql(r.data,e=>E.current(e,`title`))??void 0,notificationIdentifier:r.identifier,nextStep:l});let i={id:Yl(),type:e,source:t,message:c,timestamp:Date.now(),identifier:r.identifier,resourceContext:r.resourceContext,data:r.data,wasCelebration:!0,nextStep:l};n({type:`ADD_NOTIFICATION`,notification:i})}else if(s.showToast&&(l?Kl(e,c,{duration:s.toastDuration,action:{label:l.label,onClick:l.onClick}}):j(e,c,s.toastDuration)),s.addToCenter){let i={id:Yl(),type:e,source:t,message:c,timestamp:Date.now(),identifier:r.identifier,resourceContext:r.resourceContext,data:r.data,nextStep:l};n({type:`ADD_NOTIFICATION`,notification:i})}},[R,j,F,y]),ee=(0,Q.useRef)(z);(0,Q.useEffect)(()=>{ee.current=z},[z]),(0,Q.useEffect)(()=>{if(k.current=v,!v)return;let e=A.current;if(e.length!==0){A.current=[];for(let t of e)t()}},[v]),(0,Q.useEffect)(()=>{let e=(e,t)=>{let n=t,r=n.additionalContext||{};z(e,`resource`,{resourceContext:n,serverNotification:t.serverNotification,identifier:r.notificationIdentifier,data:r,frontendDisplayHints:r.frontendDisplayHints})},t=r(Y.NOTIFY_RESOURCE_INFO,t=>e(`info`,t)),n=r(Y.NOTIFY_RESOURCE_SUCCESS,t=>e(`success`,t)),i=r(Y.NOTIFY_RESOURCE_WARNING,t=>e(`warning`,t)),a=r(Y.NOTIFY_RESOURCE_ERROR,t=>e(`error`,t));return()=>{t(),n(),i(),a()}},[r,z]),(0,Q.useEffect)(()=>{let e=(e,t)=>{let n=t.data,r=n?._backendNotification===!0,i=r?`backend`:`custom`,a;if(r&&n?.displayTarget){let e=n.displayTarget;e===`toast`?a={showToast:!0,addToCenter:!1}:e===`center`&&(a={showToast:!1,addToCenter:!0})}let o=r?n?.message:void 0,s=n?.frontendDisplayHints;z(e,i,{identifier:t.identifier,message:o,data:n,...r?{i18nParams:Wl(n),destination:Gl(n)}:{},overridePolicy:a,frontendDisplayHints:s})},t=r(Y.NOTIFY_CUSTOM_INFO,t=>e(`info`,t)),n=r(Y.NOTIFY_CUSTOM_SUCCESS,t=>e(`success`,t)),i=r(Y.NOTIFY_CUSTOM_WARNING,t=>e(`warning`,t)),a=r(Y.NOTIFY_CUSTOM_ERROR,t=>e(`error`,t));return()=>{t(),n(),i(),a()}},[r,z]),(0,Q.useEffect)(()=>r(Y.USER_PREFERENCES_CHANGED,e=>{e.notificationsPreferences&&(b(e.notificationsPreferences),Bl(`Notification preferences updated from UserOrgsContext event`,{email:e.notificationsPreferences.email,inApp:e.notificationsPreferences.inApp}))}),[r]);let te=(0,Q.useCallback)(()=>y,[y]),V=(0,Q.useCallback)((e,t={})=>{z(`success`,`custom`,{message:t.message??e,identifier:t.identifier,data:t.data,i18nParams:t.i18nParams,overridePolicy:t.overridePolicy})},[z]),H=(0,Q.useCallback)((e,t={})=>{z(`error`,`custom`,{message:t.message??e,identifier:t.identifier,data:t.data,i18nParams:t.i18nParams,overridePolicy:t.overridePolicy})},[z]),U=(0,Q.useCallback)((e,t={})=>{z(`warning`,`custom`,{message:t.message??e,identifier:t.identifier,data:t.data,i18nParams:t.i18nParams,overridePolicy:t.overridePolicy})},[z]),ne=(0,Q.useCallback)((e,t={})=>{z(`info`,`custom`,{message:t.message??e,identifier:t.identifier,data:t.data,i18nParams:t.i18nParams,overridePolicy:t.overridePolicy})},[z]),re=(0,Q.useCallback)(e=>{n({type:`REMOVE_NOTIFICATION`,id:e})},[]),W=(0,Q.useCallback)(()=>{n({type:`CLEAR_ALL`})},[]),ae=(0,Q.useMemo)(()=>({notifications:t.notifications,removeNotification:re,clearAll:W,notifySuccess:V,notifyError:H,notifyWarning:U,notifyInfo:ne,showToast:j,showPersistentToast:M,dismissPersistentToast:N,celebration:a,dismissCelebration:P,notificationsPreferences:y,getNotificationsPreferences:te}),[t.notifications,re,W,V,H,U,ne,j,M,N,a,P,y,te]);return(0,Gt.jsx)(Jl.Provider,{value:ae,children:e})}function $l(){let e=(0,Q.useContext)(Jl);if(e===void 0)throw Error(`useNotification must be used within a NotificationProvider`);return e}function eu(e){return e.customIdentifier?`custom:${e.customIdentifier}`:[e.resourceType,e.operation,e.discriminator].filter(Boolean).join(`:`)}function tu(e){return{resourceType:e.resourceType,operation:String(e.operation),discriminator:e.discriminator}}function nu(e){return{customIdentifier:e}}function ru(e){return{customIdentifier:e}}var iu=Be.getLogger(),au=iu.debugByType(`LoadingContext`);iu.setDebugTypeLogging(`LoadingContext`,!1);var ou;(function(e){e.APP_LOADING_START=`APP_LOADING_START`,e.APP_LOADING_END=`APP_LOADING_END`,e.COMPONENT_LOADING_START=`COMPONENT_LOADING_START`,e.COMPONENT_LOADING_END=`COMPONENT_LOADING_END`})(ou||={});var su={appLoadingSources:new Map,componentLoadingMap:new Map};function cu(e,t){switch(t.type){case ou.APP_LOADING_START:{let n=new Map(e.appLoadingSources);return n.set(t.identifier,t.source),{...e,appLoadingSources:n}}case ou.APP_LOADING_END:{let n=new Map(e.appLoadingSources);return n.delete(t.identifier),{...e,appLoadingSources:n}}case ou.COMPONENT_LOADING_START:{let n=new Map(e.componentLoadingMap),r=n.get(t.scopeKey),i=(r?.activeCount??0)+1;return n.set(t.scopeKey,{hasLoadedOnce:r?.hasLoadedOnce??!1,isLoading:!0,phase:t.phase,activeCount:i}),{...e,componentLoadingMap:n}}case ou.COMPONENT_LOADING_END:{let n=new Map(e.componentLoadingMap),r=n.get(t.scopeKey);if(!r)return e;let i=Math.max(0,r.activeCount-1);return n.set(t.scopeKey,{hasLoadedOnce:!0,isLoading:i>0,phase:r.phase,activeCount:i}),{...e,componentLoadingMap:n}}default:return e}}var lu=class{cache=new Map;maxEntries=200;has(e,t=3e5){let n=this.cache.get(e);return n?Date.now()-n.lastRenderedAt<t:!1}set(e){if(this.cache.delete(e),this.cache.set(e,{lastRenderedAt:Date.now()}),this.cache.size>this.maxEntries){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}}clear(){this.cache.clear()}},uu=(0,Q.createContext)(void 0),du=({children:e})=>{let[t,n]=(0,Q.useReducer)(cu,su),r=(0,Q.useRef)(new lu);(0,Q.useEffect)(()=>{let e=Array.from(t.appLoadingSources.keys());au(`App loading state: ${t.appLoadingSources.size>0?`loading`:`ready`} [${e.join(`, `)||`none`}]`)},[t.appLoadingSources]),(0,Q.useEffect)(()=>{let e=[];return e.push(q.on(Y.LOADING_RESOURCE_START,e=>{let t=eu({resourceType:e.resourceType,operation:e.operationIdentifier,discriminator:e.optionalDiscriminator}),r=e.tier??ct.COMPONENT,i=e.phase??Tt.INITIAL;r===ct.APPLICATION?(au(`APP_LOADING_START resource:${t}`),n({type:ou.APP_LOADING_START,identifier:t,source:{identifier:t,tier:r,startedAt:Date.now()}})):n({type:ou.COMPONENT_LOADING_START,scopeKey:t,phase:i})})),e.push(q.on(Y.LOADING_RESOURCE_END,e=>{let t=eu({resourceType:e.resourceType,operation:e.operationIdentifier,discriminator:e.optionalDiscriminator});(e.tier??ct.COMPONENT)===ct.APPLICATION?(au(`APP_LOADING_END resource:${t}`),n({type:ou.APP_LOADING_END,identifier:t})):n({type:ou.COMPONENT_LOADING_END,scopeKey:t})})),e.push(q.on(Y.LOADING_CUSTOM_START,e=>{let t=e.tier??ct.COMPONENT,r=e.phase??Tt.INITIAL;t===ct.APPLICATION?(au(`APP_LOADING_START custom:${e.identifier}`),n({type:ou.APP_LOADING_START,identifier:e.identifier,source:{identifier:e.identifier,tier:t,startedAt:Date.now()}})):n({type:ou.COMPONENT_LOADING_START,scopeKey:`custom:${e.identifier}`,phase:r})})),e.push(q.on(Y.LOADING_CUSTOM_END,e=>{(e.tier??ct.COMPONENT)===ct.APPLICATION?(au(`APP_LOADING_END custom:${e.identifier}`),n({type:ou.APP_LOADING_END,identifier:e.identifier})):n({type:ou.COMPONENT_LOADING_END,scopeKey:`custom:${e.identifier}`})})),()=>e.forEach(e=>e())},[]),(0,Q.useEffect)(()=>{let e=[];return e.push(q.on(Y.PRIMARY_SCOPE_CHANGED,e=>{e.scopeLevel===K.ORGANIZATIONS&&r.current.clear()})),e.push(q.on(Y.USER_LOGOUT,()=>{r.current.clear()})),e.push(q.on(Y.WHOLE_APP_REFRESH,()=>{r.current.clear()})),()=>e.forEach(e=>e())},[]);let i=(0,Q.useCallback)(e=>t.componentLoadingMap.get(e),[t.componentLoadingMap]),a=(0,Q.useCallback)((e,t)=>r.current.has(e,t),[]),o=(0,Q.useCallback)(e=>r.current.set(e),[]),s=(0,Q.useCallback)((e,t)=>{e.customIdentifier?q.emit(Y.LOADING_CUSTOM_START,{identifier:e.customIdentifier,data:void 0,tier:t?.tier,phase:t?.phase}):q.emit(Y.LOADING_RESOURCE_START,{resourceType:e.resourceType??``,operationIdentifier:e.operation??``,optionalDiscriminator:e.discriminator,contextResourceIdentifiers:{},tier:t?.tier,phase:t?.phase})},[]),c=(0,Q.useCallback)((e,t)=>{e.customIdentifier?q.emit(Y.LOADING_CUSTOM_END,{identifier:e.customIdentifier,data:void 0,tier:t?.tier}):q.emit(Y.LOADING_RESOURCE_END,{resourceType:e.resourceType??``,operationIdentifier:e.operation??``,optionalDiscriminator:e.discriminator,contextResourceIdentifiers:{},tier:t?.tier})},[]),l=(0,Q.useMemo)(()=>({isAppLoading:t.appLoadingSources.size>0,appLoadingSources:Array.from(t.appLoadingSources.values()),getComponentLoadingState:i,hasLoadedOnce:a,markRendered:o,fireLoading:s,endLoading:c}),[t.appLoadingSources,i,a,o,s,c]);return(0,Gt.jsx)(uu.Provider,{value:l,children:e})};function fu(e){let t=(0,Q.useContext)(uu),n=t?.fireLoading,r=t?.endLoading,i=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{if(!n||!r)return;let t=ru(e.identifier),a=ct.COMPONENT;e.isLoading&&!i.current?(n(t,{tier:a,phase:e.hasLoadedOnce?Tt.REFRESH:Tt.INITIAL}),i.current=!0):!e.isLoading&&i.current&&(r(t,{tier:a}),i.current=!1)},[e.identifier,e.isLoading,e.hasLoadedOnce,n,r]),(0,Q.useEffect)(()=>()=>{if(i.current&&r){let t=ru(e.identifier);r(t,{tier:ct.COMPONENT}),i.current=!1}},[e.identifier,r])}var pu=[xt.AUTHENTICATION,xt.JWT_TOKEN_EXPIRED,xt.JWT_TOKEN_INVALID,xt.JWT_TOKEN_NOT_FOUND,xt.JWT_TOKEN_NOT_VERIFIED,xt.AUTHENTICATION_INVALID_TOKEN,xt.AUTHENTICATION_JWT_TOKEN_FAILED,xt.AUTHENTICATION_SESSION_INVALID,xt.AUTHENTICATION_SESSION_EXPIRED,xt.AUTHENTICATION_USER_NOT_AUTHORIZED,xt.AUTHENTICATION_API_KEY_INVALID,xt.AUTHENTICATION_API_KEY_FAILED,xt.AUTHENTICATION_NO_AUTHENTICATION_PROVIDED],mu=class e{constructor(){}static isAuthenticationError(t){if(e.isAuthorizationError(t))return!1;let n=t?.wildoError;if(n&&(n.type===Oe.AUTHENTICATION||n.customMessageReference&&pu.includes(n.customMessageReference))||t?.response?.status&&t.response.status===me.UNAUTHORIZED)return!0;if(t?.response?.data?.error){let e=t.response.data.error;if(e.type===Oe.AUTHENTICATION||e.code&&pu.includes(e.code))return!0}return!1}static isAuthorizationError(e){return e?.wildoError?.type===Oe.AUTHORIZATION||e?.response?.status===me.FORBIDDEN||e?.response?.data?.error?.type===Oe.AUTHORIZATION}static evaluateAccountCompleteness(e,t,n,r){if(!e)return{isComplete:!0,missingMethods:[],enrolledMethods:n,requiresEnrollment:!1};let i=r.length>0?t.filter(e=>r.includes(e)):t,a=new Set([...n,...ee.getAlwaysAvailableSecondFactorMethods()]),o=i.some(e=>a.has(e));return{isComplete:o,missingMethods:i.filter(e=>!a.has(e)),enrolledMethods:n,requiresEnrollment:!o}}};function hu(e){let t=[...new Set(e.roleEntries.filter(e=>e.relatedPrimaryScope===K.APPLICATION).flatMap(e=>e.roles))],n=new Set(e.roleEntries.filter(e=>e.relatedPrimaryScope===K.ORGANIZATIONS&&e.relatedResourceId).map(e=>String(e.relatedResourceId))),r={};for(let t of n){let n=He(e.roleEntries,t).filter(e=>e.relatedPrimaryScope===K.ORGANIZATIONS);r[t]=[...new Set(Ie(n))]}return{appLevel:t,organizations:r}}function gu(e,t){return!e||!t?!1:e.roleEntries.some(e=>e.relatedPrimaryScope===K.ORGANIZATIONS&&String(e.relatedResourceId??``)===t)}function _u(e){if(!e)return[];let t=new Set;for(let n of e.roleEntries){if(n.relatedPrimaryScope!==K.ORGANIZATIONS||!Ot(n))continue;let e=String(n.relatedResourceId??``);e&&t.add(e)}return[...t]}var vu;(function(e){e.NOT_ADDRESSED=`NOT_ADDRESSED`,e.UNDECIDABLE=`UNDECIDABLE`,e.ACTIVE_MEMBERSHIP=`ACTIVE_MEMBERSHIP`,e.VERIFYING=`VERIFYING`,e.ADMITTED=`ADMITTED`,e.REFUSED=`REFUSED`,e.INCONCLUSIVE=`INCONCLUSIVE`})(vu||={});function yu(e,t){return(e??[]).some(e=>e.organizationId===t&&e.status===Ye.ACTIVE&&!_t(e))}function bu(e){return e?.operations?.find(e=>e.operationIdentifier===J.READ&&e.isOperationDefault===!0&&e.isBulkOperation!==!0&&e.variantType===z.API_CALL)}var xu;(function(e){e.NOT_ADDRESSED=`NOT_ADDRESSED`,e.IN_STEP=`IN_STEP`,e.FOLLOWING=`FOLLOWING`,e.NOT_FOLLOWED=`NOT_FOLLOWED`})(xu||={});function Su(e){return e.routeOrganizationId?e.currentOrganizationId===e.routeOrganizationId?xu.IN_STEP:!(e.access===vu.ACTIVE_MEMBERSHIP||e.access===vu.ADMITTED&&(e.routeOrganizationLoaded||e.routeOrganizationConferred))||e.arrivalSettled?xu.NOT_FOLLOWED:xu.FOLLOWING:xu.NOT_ADDRESSED}function Cu(e){let{entryOrganizationId:t,routeDecision:n}=e;return!t||!e.entryOwnsBrowserUrl||!n?!1:t===n.routeOrganizationId?n.routeContentHeld:t!==e.currentOrganizationId}var wu=Be.getLogger(),Tu=wu.debugByType(`UserOrgsContext`);wu.setDebugTypeLogging(`UserOrgsContext`,!1);var Eu=1e3,Du=3e4,Ou=(0,Q.createContext)(void 0),ku=({children:e})=>{let{doOperation:t,registry:n}=T(),{emit:r,on:i}=Me(),{auth:a,tokenStorage:o,identifyByEmail:s,authenticateWithPassword:c,authenticate:l,getSessionState:u,isAuthenticated:d,logout:f,endSession:p,getSessionEstablishment:m,getSessionEndReason:h,initiateOAuth2Login:g,handleAuthCodeExchange:_,markSessionRestored:v,setSessionRestoring:b,connectWebSocket:x}=E(),w=O(),{commitOrganizationScopeValue:D}=y(),k=w.currentOrganizationId,A=(0,Q.useRef)(k);A.current=k;let j=(0,Q.useRef)(!1),N=(0,Q.useRef)(null),F=(0,Q.useRef)(!1),I=(0,Q.useRef)(null),[L,R]=(0,Q.useState)(null),ee=(0,Q.useRef)(null);ee.current=L?._id??null;let[B,V]=(0,Q.useState)([]),[H,U]=(0,Q.useState)(null),[ne,ie]=(0,Q.useState)(null),W=(0,Q.useRef)(0),ae=e=>e===void 0?{}:e===null?{organizationLanguagePreferences:null,organizationRegionalPreferences:null}:{organizationLanguagePreferences:e.languagePreferences??null,organizationRegionalPreferences:{timezone:e.timezone,locale:e.locale,dateFormat:e.dateFormat,timeFormat:e.timeFormat}},oe=(0,Q.useCallback)((e,t)=>{e===null?r(Y.USER_PREFERENCES_CHANGED,{languagePreferences:null,organizationLanguagePreferences:null,regionalPreferences:null,organizationRegionalPreferences:null,notificationsPreferences:null,uiPreferences:null,privacy:null}):r(Y.USER_PREFERENCES_CHANGED,{...e?.languagePreferences===void 0?{}:{languagePreferences:e.languagePreferences},...ae(t),...e?.regional===void 0?{}:{regionalPreferences:e.regional},...e?.notifications===void 0?{}:{notificationsPreferences:e.notifications},...e?.ui===void 0?{}:{uiPreferences:e.ui},...e?.privacy===void 0?{}:{privacy:e.privacy}})},[r]),se=(0,Q.useRef)(null),ce=(0,Q.useCallback)(e=>{let t=se.current;t!==null&&(se.current=null,r(Y.USER_LOGOUT,{userId:t,reason:e}))},[r]),le=L?._id??null;(0,Q.useEffect)(()=>{let e=se.current;e!==le&&(e!==null&&le!==null?(ce(P.REPLACED),ie(null),oe(null)):e!==null&&ce(h()),le!==null&&(se.current=le,r(Y.USER_LOGIN,{userId:le,establishment:m()})))},[le,r,ce,oe,h,m]);let ue=(0,Q.useMemo)(()=>S.buildInitiatorIds({userId:w.currentUserId,organizationId:w.currentOrganizationId,applicationId:w.currentApplicationId,anonymousUserId:w.currentAnonymousUserId}),[w.currentApplicationId,w.currentAnonymousUserId,w.currentOrganizationId,w.currentUserId]),de=(0,Q.useCallback)((e,t)=>{e.privacy&&ie(e.privacy);let n=t===void 0?k?B.find(e=>e._id===k)?.preferences:void 0:t;oe(e,n)},[k,oe,B]),G=async()=>{let e=n.resourceConfigurations[ft.USER_SELF]?.operations.find(e=>e.operationIdentifier===re.ACCESS_PROFILE&&e.variantType===z.API_CALL&&e.isBulkOperation!==!0);if(!e)return null;try{let n=we.buildOperationPathKeyFromOperation(e);return await t(n,{contextualParameters:{}})??null}catch(e){return wu.warn(`Access profile could not be loaded; entries reached only through an organization-unit grant stay hidden`,{error:e}),null}},fe=(e,t)=>{let n=e.appRoles||[],r={},i=e.organizationMembers||[];for(let e of i)r[e.organizationId]=e.roles||[];return{appLevel:n,organizations:r,accessProfile:null}},pe=(0,Q.useCallback)(async e=>{let r=n.resourceConfigurations[ft.ORGANIZATIONS];if(!r)return wu.warn(`ORGANIZATIONS resource not available`),null;let i=bu(r);if(!i)return wu.warn(`ORGANIZATIONS READ operation not found`),null;let a=we.buildOperationPathKeyFromOperation(i),o=bu(n.resourceConfigurations[ft.ORGANIZATION_PREFERENCES]),s=async()=>{if(o)try{return await t(we.buildOperationPathKeyFromOperation(o),{contextualParameters:{organizationId:e}})??void 0}catch(t){wu.warn(`Failed to fetch organization preferences`,{organizationId:e,error:t});return}};try{let[n,r]=await Promise.all([t(a,{contextualParameters:{organizationId:e}}),s()]);return n?r?{...n,preferences:r}:n:null}catch(t){return wu.warn(`Failed to fetch organization`,{organizationId:e,error:t}),null}},[t,n]),me=(0,Q.useCallback)(e=>{let t=ee.current;pe(e).then(e=>{e&&ee.current===t&&V(t=>t.some(t=>t._id===e._id)?t:[...t,e])})},[pe]),K=(0,Q.useCallback)(async e=>{let t=G(),r=e.organizationMembers||[],i=a.sessionType===nt.ONE_OFF?o.getOrganizationId():null,s=i?r.filter(e=>e.organizationId===i):r;Tu(`Loading organizations`,{userId:e._id,membershipCount:s.length,isOneOff:a.sessionType===nt.ONE_OFF}),bu(n.resourceConfigurations[ft.ORGANIZATION_PREFERENCES])||wu.warn(`ORGANIZATION_PREFERENCES READ operation not found — tenant regional defaults will not be applied`);let c=[],l=await Promise.all(s.map(e=>pe(String(e.organizationId))));c.push(...l.filter(e=>e!==null));let u=A.current,d=o.getOrganizationId(),f=e=>!!e&&c.some(t=>t._id===e),p=await t,m=u??d;if(m&&!f(m)&&(!i||m===i)&&gu(p,m)){let e=await pe(m);e&&c.push(e)}let h=f(u)?u:f(d)?d:c[0]?._id||null,g=fe(e,c),_=g?{...g,...p?hu(p):{},accessProfile:p}:null;return V(c),D(h),U(_),Tu(`Organizations loaded`,{organizationCount:c.length,currentOrganizationId:h}),{organizationsList:c,selectedOrgId:h}},[D,pe,n,o,a.sessionType]),he=(0,Q.useCallback)(async e=>{if(Tu(`Restoring user session`),!Object.keys(n.resourceConfigurations).includes(ft.USER_SELF))return wu.warn(`USER_SELF resource not available for session restoration`),!1;let r=n.resourceConfigurations[ft.USER_SELF],i=bu(r);if(!i)return wu.warn(`USER_SELF READ operation not found`),!1;let a=r.operations.find(e=>e.operationIdentifier===J.READ&&e.isBulkOperation!==!0&&e.variantType===z.API_CALL&&e.variantKey===qe.CONTEXT);if(!a)return wu.warn(`USER_SELF context variant not found`),!1;let o=(i.initiatorInfos?.[0])?.parameters?.some(e=>e.fieldIdentifier===`userId`),s={};if(o&&e)try{let t=C(e);t.userId&&(s.userId=t.userId)}catch(e){Tu(`Failed to decode JWT for userId extraction`,{error:e})}let c=we.buildOperationPathKeyFromOperation(a),l=await t(c,{contextualParameters:s});if(!l)return wu.warn(`Failed to fetch user context during session restoration`),!1;let u=(l.organizationMembers||[]).length;Tu(`User context restored`,{userId:l._id,organizationCount:u}),R(l);let{organizationsList:d,selectedOrgId:f}=await K(l),p=l.userSelfPreferences;if(p){let e=f?d.find(e=>e._id===f):null;de(p,e?.preferences)}return wu.info(`Session restored successfully`,{userId:l._id,organizationCount:u}),!0},[t,n,K,de]);(0,Q.useEffect)(()=>(F.current=!1,()=>{F.current=!0,I.current&&=(clearTimeout(I.current),null)}),[]);let ge=(0,Q.useCallback)(async()=>{if(Tu(`Restoring session from stored token`),a.sessionRestored&&a.accessToken&&L)return Tu(`Session already restored, skipping restoration`),!0;let e=a.accessToken;if(!e)return Tu(`No access token available`),!1;b(!0);let t=0;for(;;)try{let t=await he(e);if(t){if(v(),a.sessionType!==nt.ONE_OFF){let t=o.getAccessToken()??e;x(t,o.getOrganizationId())}}else wu.warn(`Session restoration could not build a valid authenticated context; logging out to avoid a half-restored state`),p(P.SESSION_ENDED);return t}catch(e){if(mu.isAuthorizationError(e)){let t=e?.message||`Session restoration blocked by authorization`;return wu.warn(`Session restoration encountered authorization/scope error`,{error:t,errorType:e?.wildoError?.type||e?.response?.data?.error?.type,status:e?.response?.status}),b(!1),v(),!1}if(Et(e)){t+=1;let n=Math.min(Eu*2**(t-1),Du);if(wu.warn(`Session restoration hit a transient backend failure; preserving session and retrying`,{attempt:t,retryInMs:n,status:e?.response?.status,code:e?.code}),await new Promise(e=>{I.current=setTimeout(e,n)}),F.current||!o.getAccessToken())return b(!1),!1;continue}if(mu.isAuthenticationError(e))return Tu(`Session restoration failed due to authentication error`,{errorType:e?.wildoError?.type||e?.response?.data?.error?.type,status:e?.response?.status}),p(lt(e)),!1;let n=e?.message||`Session restoration failed`;return wu.warn(`Session restoration encountered a non-transient error; logging out`,{error:n,errorType:e?.wildoError?.type}),p(P.SESSION_ENDED),!1}},[he,a.sessionRestored,a.sessionType,a.accessToken,L,p,v,b,x,o]),[_e,q]=(0,Q.useState)(null),ve=(0,Q.useCallback)(async()=>{try{return await ge()}finally{let e=o.getAccessToken();e&&q(e)}},[ge,o]),ye=(0,Q.useCallback)(async()=>{let e=L?.organizationMembers||[];e.length===0?Tu(`No organizations membership to refresh`):(Tu(`Refreshing organizations`,{membershipCount:e.length}),await K(L))},[L,K]);(0,Q.useEffect)(()=>{if(!L?.userSelfPreferences)return;let e=k?B.find(e=>e._id===k):null;oe(L.userSelfPreferences,e?.preferences)},[k,oe,B,L]);let be=(0,Q.useContext)(Fe),xe=At({isRestoringSession:a.isRestoringSession,hasUser:L!==null,hasAccessToken:!!a.accessToken,restoreConcludedForAccessToken:!!a.accessToken&&_e===a.accessToken});(0,Q.useEffect)(()=>{be?.(xe)},[be,xe]);let Ce=(0,Q.useCallback)(e=>{let t=B.find(t=>t._id===e),n=!t&&a.sessionType!==nt.ONE_OFF&&gu(H?.accessProfile,e);if(!t&&!n){wu.warn(`Attempted to set invalid organization`,{organizationId:e,availableOrganizations:B.map(e=>e._id)});return}n&&me(e);let r=k;r!==e&&(Tu(`Setting current organization`,{organizationId:e,organizationName:t?.name,previousOrganizationId:r,loadedOnDemand:n}),D(e,te.USER_SELECTION))},[a.sessionType,B,H,k,D,me]),Te=(0,Q.useCallback)(e=>{if(a.sessionType===nt.ONE_OFF)return!1;let t=B.some(t=>t._id===e),n=gu(H?.accessProfile,e);return yu(L?.organizationMembers,e)||t||n?(t||me(e),k!==e&&(Tu(`Following the route organization`,{organizationId:e,previousOrganizationId:k}),D(e,te.ROUTER)),!0):(wu.warn(`Refused to follow a route organization this session cannot be in`,{organizationId:e}),!1)},[a.sessionType,L,B,H,k,D,me]),Ee=(0,Q.useCallback)(()=>k&&B.find(e=>e._id===k)||null,[k,B]),De=(0,Q.useCallback)(()=>ne,[ne]),Oe=w.buildContextualParameters,ke=(0,Q.useCallback)(async e=>{let r=++W.current,i=n.resourceConfigurations[ft.USER_SELF_PREFERENCES]?.operations.find(e=>e.operationIdentifier===J.UPDATE&&e.isOperationDefault===!0&&e.isBulkOperation!==!0&&e.variantType===z.API_CALL);if(!i)throw Error(`Cannot record a consent decision: this application mounts no user self-preferences UPDATE operation`);let a=(await t(we.buildOperationPathKeyFromOperation(i),{contextualParameters:Oe(),requestData:{privacy:{consentedPurposes:M(e),consentDecidedAt:new Date}}}))?.privacy;if(!a)throw Error(`Consent decision was written but the response carried no privacy block`);return r===W.current&&(ie(a),R(e=>e&&{...e,userSelfPreferences:{...e.userSelfPreferences??{},privacy:a}})),B.length===0&&await ye().catch(e=>{wu.warn(`Organizations could not be re-loaded after a consent decision`,{error:e})}),a},[Oe,t,n,B.length,ye]),Ae=(0,Q.useCallback)(async()=>{let e=bu(n.resourceConfigurations[ft.USER_SELF_PREFERENCES]);if(!e)return;let r=++W.current,i=await t(we.buildOperationPathKeyFromOperation(e),{contextualParameters:Oe()});if(!i||r!==W.current)return;let a=i.privacy??{consentedPurposes:[]};ie(a),R(e=>e&&{...e,userSelfPreferences:{...e.userSelfPreferences??{},...i,privacy:a}})},[Oe,t,n]);(0,Q.useEffect)(()=>i(Y.RESOURCE_OPERATION_EXECUTED,()=>{Ae().catch(e=>{wu.warn(`The preferences could not be read again after they were written`,{error:e})})},e=>e.resourceType===ft.USER_SELF_PREFERENCES&&!Se(e.operation??{operationIdentifier:e.operationIdentifier})),[i,Ae]);let je=(0,Q.useCallback)(()=>{Tu(`Logging out user`,{userId:L?._id,organizationId:k}),ce(P.SIGNED_OUT),R(null),V([]),D(null),U(null),ie(null),oe(null),j.current=!1,N.current=null,f()},[L?._id,k,f,ce,D,oe]);(0,Q.useEffect)(()=>{let e=a.accessToken;e&&e!==N.current&&(a.sessionRestored&&L?N.current=e:j.current&&a.isRestoringSession||(Tu(`Token changed, initiating session restoration`,{hasToken:!!e,previousToken:!!N.current}),N.current=e,j.current=!0,ve().catch(e=>{wu.error(`Session restoration failed`,{error:e})})))},[a.accessToken,a.sessionRestored,a.isRestoringSession,L,ve]),(0,Q.useEffect)(()=>{!a.accessToken&&N.current&&(Tu(`Token removed, clearing user/org data`),ce(h()),R(null),V([]),D(null),U(null),ie(null),oe(null),N.current=null,j.current=!1)},[a.accessToken,ce,D,oe,h]);let Ne=(0,Q.useMemo)(()=>({auth:a,identifyByEmail:s,authenticateWithPassword:c,authenticate:l,getSessionState:u,isAuthenticated:d,logout:je,restoreSession:ve,initiateOAuth2Login:g,handleAuthCodeExchange:_,user:L,organizations:B,currentOrganizationId:k,permissions:H,primaryScopeInitiatorIds:ue,privacy:ne,setCurrentOrganization:Ce,followRouteOrganization:Te,getCurrentOrganization:Ee,refreshOrganizations:ye,getPrivacy:De,recordConsentDecision:ke}),[a,s,c,l,u,d,je,ve,g,_,L,B,k,H,ue,ne,Ce,Te,Ee,ye,De,ke]);return(0,Gt.jsx)(Ou.Provider,{value:Ne,children:e})},Au=()=>{let e=(0,Q.useContext)(Ou);if(!e)throw Error(`useUserOrgs must be used within a UserOrgsProvider`);return e},ju={...Je(void 0),unresolvableRoles:ot.ASSUME_POSSIBLE},Mu=(0,Q.createContext)(ju);function Nu({customRoles:e,children:t}){let n=(0,Q.useMemo)(()=>({...Je(e),unresolvableRoles:ot.INERT}),[e]);return(0,Gt.jsx)(Mu.Provider,{value:n,children:t})}function Pu(){return(0,Q.useContext)(Mu)}var Fu=Be.getLogger(),Iu=Fu.debugByType(`FeaturesContext`);Fu.setDebugTypeLogging(`FeaturesContext`,!1);var Lu=`${pe}/features/resolved`,Ru=[Ce.BILLING_STATUS_CHANGED,Ce.BILLING_SUBSCRIPTION_UPDATED,Ce.BILLING_ACCOUNT_CHANGED,Ce.BILLING_FEATURES_UPDATED],zu={features:[],limits:{},currentUsage:{}},Bu=(0,Q.createContext)(void 0);function Vu({featureConfiguration:e,children:t}){let[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(null),[o,c]=(0,Q.useState)(!0),[l,u]=(0,Q.useState)(null),d=(0,Q.useRef)(0),f=(0,Q.useRef)(!0),p=(0,Q.useRef)(null),{isAuthenticated:m}=E(),h=A(ft.USER_FEATURES),g=m()&&h,_=v()?.currentOrganizationId??null,{on:y}=s(),b=(0,Q.useContext)(ye),x=(0,Q.useRef)(null),S=(0,Q.useMemo)(()=>{let t=new Map;for(let n of e.definitions)t.set(n.identifier,n);return Iu(`Feature definitions map built`,{count:t.size}),t},[e.definitions]),C=(0,Q.useMemo)(()=>e.unavailabilityPolicy,[e.unavailabilityPolicy]),w=(0,Q.useMemo)(()=>n?{features:n.features,limits:n.limits,currentUsage:n.currentUsage}:zu,[n]),T=(0,Q.useCallback)(()=>{d.current+=1,r(null),a(null),u(null),c(!1)},[]),D=(0,Q.useCallback)(async()=>{let e=++d.current,t=()=>f.current&&e===d.current;try{Iu(`Fetching resolved features from backend`,{organizationId:_});let e=await tt().get(Lu,_?{params:{organizationId:_}}:void 0);t()&&(r(e),a(_??null),u(null),Iu(`Resolved features fetched`,{featureCount:e.features.length,limitCount:Object.keys(e.limits).length,usageCount:Object.keys(e.currentUsage).length}))}catch(e){t()&&(u(e instanceof Error?e:Error(e?.message??`Failed to fetch features`)),Iu(`Failed to fetch resolved features`,{error:e?.message}))}finally{t()&&c(!1)}},[_]);(0,Q.useEffect)(()=>(f.current=!0,g?(c(!0),D()):T(),()=>{f.current=!1}),[g,_,D,T]),(0,Q.useEffect)(()=>{x.current=l},[l]),(0,Q.useEffect)(()=>{if(g)return b.on(Y.USER_PREFERENCES_CHANGED,()=>{x.current&&D()})},[g,b,D]),(0,Q.useEffect)(()=>{if(!g)return;let e=[],t=()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null,D()},300)};for(let n of Ru){let r=y(n,()=>{Iu(`WebSocket invalidation event received, scheduling refetch`,{event:n}),t()});e.push(r)}return()=>{p.current&&clearTimeout(p.current);for(let t of e)t()}},[g,y,D]);let O=(0,Q.useMemo)(()=>new Set(w.features),[w.features]),k=(0,Q.useCallback)(e=>O.has(e),[O]),j=(0,Q.useCallback)(e=>O.has(e)?!0:!!n?.upgradeOptions?.[e],[O,n]),M=(0,Q.useCallback)(e=>w.limits[e],[w.limits]),N=(0,Q.useCallback)(e=>w.currentUsage[e],[w.currentUsage]),P=(0,Q.useCallback)(e=>{let t=w.limits[e];if(t===void 0||t===-1)return;let n=w.currentUsage[e]??0;return Math.max(0,t-n)},[w.limits,w.currentUsage]),F=(0,Q.useMemo)(()=>({resolvedFeatures:w,resolvedFeaturesResponse:n,resolvedForOrganizationId:i,featureDefinitions:S,unavailabilityPolicy:C,isFeatureEnabled:k,isFeatureOffered:j,getLimit:M,getCurrentUsage:N,getRemainingCapacity:P,isLoading:o,error:l,refetch:D}),[w,n,i,S,C,k,j,M,N,P,o,l,D]);return(0,Gt.jsx)(Bu.Provider,{value:F,children:t})}function Hu(e,t){return Ue.restoreResponseValues(t,e)}var Uu=Be.getLogger(),Wu=Uu.debugByType(`BillingContext`);Uu.setDebugTypeLogging(`BillingContext`,!1);var Gu=pe,Ku=[Ce.BILLING_STATUS_CHANGED,Ce.BILLING_SUBSCRIPTION_UPDATED,Ce.BILLING_ACCOUNT_CHANGED,Ce.BILLING_USAGE_UPDATED,Ce.BILLING_CREDIT_POOL_UPDATED,Ce.BILLING_FEATURES_UPDATED],qu={[K.ORGANIZATIONS]:ft.ORGANIZATION_BILLING_ACCOUNTS,[K.USER_SELF]:ft.USER_BILLING_ACCOUNTS},Ju={[K.ORGANIZATIONS]:e=>`${Gu}/organizations/${e}/organization-billing-accounts/get-state/count`,[K.USER_SELF]:e=>`${Gu}/users/${e}/user-billing-accounts/get-state/count`},Yu={[K.ORGANIZATIONS]:(e,t)=>`${Gu}/organizations/${e}/organization-billing-accounts/${t}/open-checkout`,[K.USER_SELF]:(e,t)=>`${Gu}/users/${e}/user-billing-accounts/${t}/open-checkout`},Xu={[K.ORGANIZATIONS]:(e,t)=>`${Gu}/organizations/${e}/organization-billing-accounts/${t}/open-portal`,[K.USER_SELF]:(e,t)=>`${Gu}/users/${e}/user-billing-accounts/${t}/open-portal`},Zu={byProduct:{}},Qu=(0,Q.createContext)(void 0);function $u({children:e,productDefinitions:t}){let n=Au(),r=v(),{appConfig:i}=Pt(),a=D(),o=i.billing,c=o?.enabled??!1,l=c?o?.providerRef??null:null,u=o?.enabledScopes??[K.ORGANIZATIONS],{scopeType:d,scopeEntityId:f}=(0,Q.useMemo)(()=>u.includes(K.ORGANIZATIONS)&&r?.currentOrganizationId?{scopeType:K.ORGANIZATIONS,scopeEntityId:r.currentOrganizationId}:u.includes(K.USER_SELF)&&n.user?._id?{scopeType:K.USER_SELF,scopeEntityId:n.user._id}:{scopeType:null,scopeEntityId:null},[u,r?.currentOrganizationId,n.user?._id]),p=d?qu[d]:null,m=c&&p!==null&&x(a,p),h=n.permissions,g=r?.currentOrganizationId??null,_=Pu(),y=(0,Q.useMemo)(()=>{if(!m||!p)return!1;let e=a?.registry.resourceConfigurations[p]?.operations.find(e=>String(e.operationIdentifier)===at.GET_STATE&&e.isOperationDefault===!0);return!e||Nt({requiredRoles:e.roles,userAppRoles:h?.appLevel??[],userOrgRoles:g?h?.organizations?.[g]??[]:[],appRolesConfig:_.appRolesConfig,orgRolesConfig:_.orgRolesConfig,unresolvableRoles:_.unresolvableRoles})},[m,p,a,h,g,_]),[b,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(y&&!!f),[T,E]=(0,Q.useState)(null);fu({identifier:ze.BILLING_STATE,isLoading:C,hasLoadedOnce:b!==null});let O=(0,Q.useRef)(!1),k=(0,Q.useRef)(!0),A=(0,Q.useRef)(null),j=(0,Q.useRef)(!1),{on:M}=s(),N=(0,Q.useMemo)(()=>typeof window<`u`?window.location.origin:``,[]),P=b?.billingAccount?._id??null;(0,Q.useEffect)(()=>{S(null),E(null),w(y&&!!f)},[d,f,y]);let F=(0,Q.useCallback)(async()=>{if(y&&d&&f&&!O.current){O.current=!0;try{Wu(`Fetching billing state`,{scopeType:d,scopeEntityId:f});let e=tt(),t=Ju[d];if(!t)return;let n=t(f),r=Hu(Ae,await e.get(n));k.current&&(S(r),E(null),Wu(`Billing state fetched`,{hasAccount:!!r.billingAccount,hasSubscription:!!r.subscription,productCount:r.products?.length??0,priceCount:r.prices?.length??0,billingAccountId:r.billingAccount?._id}))}catch(e){if(k.current){let t=e instanceof Error?e.message:`Failed to fetch billing state`;S(null),E(e instanceof Error?e:Error(t)),Wu(`Failed to fetch billing state`,{error:t})}}finally{k.current&&w(!1),O.current=!1}}},[y,d,f]);(0,Q.useEffect)(()=>(k.current=!0,y&&d&&f?F():w(!1),()=>{k.current=!1}),[F,y,d,f]),(0,Q.useEffect)(()=>{if(!y)return;let e=[],t=()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null,F()},300)};for(let n of Ku){let r=M(n,e=>{!d||!f?Wu(`Ignoring billing invalidation without active scope`,{event:n,payload:e}):e.scopeType!==d||e.scopeEntityId!==f?Wu(`Ignoring billing invalidation for another scope`,{event:n,payload:e,currentScopeType:d,currentScopeEntityId:f}):P&&e.billingAccountId!==P?Wu(`Ignoring billing invalidation for another billing account`,{event:n,payload:e,currentBillingAccountId:P}):(Wu(`WebSocket invalidation event received, scheduling refetch`,{event:n,payload:e}),t())});e.push(r)}return()=>{A.current&&clearTimeout(A.current);for(let t of e)t()}},[M,F,y,d,f,P]);let I=b?.availability??null,L=(0,Q.useCallback)(e=>I?.[e]===Ke.AVAILABLE,[I]),R=b?.billingAccount??null,ee=b?.subscription??null,te=b?.products??[],B=b?.prices??[],V=b?.invoices??[],H=b?.usage??Zu,U=b?.creditPools??{},ne=b?.activePromotions??[],re=b?.acquirableProductKeys,ie=d??null,W=(0,Q.useMemo)(()=>{let e=new Map;for(let t of te)e.set(t.key,t);return e},[te]),ae=(0,Q.useMemo)(()=>{let e=new Map;for(let t of B){let n=e.get(t.productId)??[];n.push(t),e.set(t.productId,n)}return e},[B]),oe=(0,Q.useCallback)(e=>ae.get(e)??[],[ae]),se=(0,Q.useCallback)(e=>W.get(e),[W]),ce=(0,Q.useMemo)(()=>new Set(re??[]),[re]),le=(0,Q.useCallback)(e=>ce.has(e),[ce]),{currentPlanKey:ue,currentPlanProduct:de}=(0,Q.useMemo)(()=>{if(!ee||!ee.items?.length)return{currentPlanKey:null,currentPlanProduct:null};for(let e of ee.items){let t=te.find(t=>t._id===e.productId);if(t&&t.type===`plan`)return{currentPlanKey:t.key,currentPlanProduct:t}}return{currentPlanKey:null,currentPlanProduct:null}},[ee,te]),G=(0,Q.useMemo)(()=>t??[],[t]),fe=(0,Q.useCallback)(async(e,t,n)=>{if(!P||!p||!d||!f)throw Error(`No billing account available. Cannot open checkout.`);let r=Yu[d]?.(f,P);if(!r)throw Error(`No OPEN_CHECKOUT URL builder for scope ${d}.`);if(j.current)Wu(`Checkout already in progress, ignoring duplicate request`);else{j.current=!0;try{Wu(`Opening checkout session`,{productKey:e,priceId:t,...n});let i=await tt().put(r,{productKey:e,priceId:t,successUrl:`${N}/billing/success?session_id={CHECKOUT_SESSION_ID}`,cancelUrl:`${N}/billing/cancel`,quantity:n?.quantity,promotionCode:n?.promotionCode});i.url&&(window.location.href=i.url)}finally{j.current=!1}}},[P,p,d,f,N]),pe=(0,Q.useCallback)(async()=>{if(!P||!p||!d||!f)throw Error(`No billing account available. Cannot open customer portal.`);let e=Xu[d]?.(f,P);if(!e)throw Error(`No OPEN_PORTAL URL builder for scope ${d}.`);Wu(`Opening customer portal session`);let t=tt(),n=encodeURIComponent(`${N}/billing`),r=await t.get(`${e}?returnUrl=${n}`);r.url&&(window.location.href=r.url)},[P,p,d,f,N]),me=(0,Q.useCallback)(async(e,t,n)=>{if(!a||!ee?._id||!P||!p||!d||!f||![Mt.BILLING_ACCOUNT,Mt.SUBSCRIPTION,Mt.PRODUCTS,Mt.PRICES].every(L))throw Error(`Billing plan change context is unavailable.`);let r=d===K.ORGANIZATIONS?ft.ORGANIZATION_SUBSCRIPTIONS:ft.USER_SUBSCRIPTIONS,i=a.registry.resourceConfigurations[r],o=i?.operations.find(t=>t.operationIdentifier===e&&t.variantType===z.API_CALL&&t.isOperationDefault);if(!o||o.variantType!==z.API_CALL)throw Error(`Billing plan change operation is unavailable.`);let s=a.registry.allResourceFieldIdentifiers,c=d===K.ORGANIZATIONS?ft.ORGANIZATIONS:ft.USERS,l=s[p],u=s[c];if(!i.resourceFieldIdentifier||!l||!u)throw Error(`Billing plan change route context is unavailable.`);return a.doOperation(we.createOperationPathKeyFromOperation(o),{contextualParameters:{[i.resourceFieldIdentifier]:ee._id,[l]:P,[u]:f},...o.httpVerb===et.GET?{queryParameters:t}:{requestData:t}},{signal:n,silent:!0})},[a,ee?._id,P,p,d,f,L]),he=(0,Q.useCallback)(async(e,t)=>{let n=kt.parse(e),r=await me(Pe.PREVIEW_PLAN_CHANGE,n,t?.signal);return rt.parse(r)},[me]),ge=(0,Q.useCallback)(async e=>{let t=St.parse(e);await me(Pe.CHANGE_PLAN,t),await F()},[me,F]),_e=(0,Q.useCallback)(async()=>{await me(Pe.CANCEL_PLAN_CHANGE,{}),await F()},[me,F]),q=(0,Q.useMemo)(()=>({isEnabled:m,billingConfiguration:o,billingProviderRef:l,billingAccount:R,subscription:ee,currentPlanKey:ue,currentPlanProduct:de,currentScope:ie,products:te,prices:B,invoices:V,productDefinitions:G,getPricesForProduct:oe,getProductByKey:se,isProductAcquirable:le,activePromotions:ne,usage:H,creditPools:U,openCheckout:fe,openCustomerPortal:pe,previewPlanChange:he,confirmPlanChange:ge,cancelPendingPlanChange:_e,isLoading:C,availability:I,isSliceAvailable:L,error:T,refetch:F}),[m,o,l,R,ee,ue,de,ie,te,B,V,G,oe,se,le,ne,H,U,fe,pe,he,ge,_e,C,I,L,T,F]);return(0,Gt.jsx)(Qu.Provider,{value:q,children:e})}var ed=()=>{let e=(0,Q.useContext)(Qu);if(!e)throw Error(`useBilling must be used within a BillingProvider`);return e},td=()=>(0,Q.useContext)(Qu),nd=()=>{let e=(0,Q.useContext)(Bu);if(!e)throw Error(`useFeatures must be used within a FeaturesProvider`);return e},rd=new Set([Re.UPGRADE_PROMPT,Re.LIMIT_UPGRADE_PROMPT,Re.ADDON_PROMPT]);function id(e,t){let n=[];return e?.appLevel?.length&&n.push(...e.appLevel),t&&e?.organizations?.[t]?.length&&n.push(...e.organizations[t]),[...new Set(n)]}function ad(e,t,n,r){return t||!rd.has(e)?e:(r.push(`[billing-disabled] Replacing ${e} with ${n.whenBillingDisabled}`),n.whenBillingDisabled)}function od(e){let{billingEnabled:t,featureDef:n,policy:r,reason:i,userRoles:a}=e,o=[];if(n?.unavailability?.behavior)return o.push(`[1] Per-feature override: ${n.unavailability.behavior}`),{behavior:ad(n.unavailability.behavior,t,r,o),suggestedProductRef:n.unavailability.suggestedProductRef,customComponentRef:n?.unavailability?.customComponentRef,debugTrace:o};if(n?.unavailability?.byRole){for(let e of a){let i=n.unavailability.byRole[e];if(i)return o.push(`[2] Per-feature role override (${e}): ${i}`),{behavior:ad(i,t,r,o),suggestedProductRef:n.unavailability.suggestedProductRef,customComponentRef:n?.unavailability?.customComponentRef,debugTrace:o}}o.push(`[2] Per-feature role override: no match`)}for(let e of a){let i=r.roleDefaults[e];if(i)return o.push(`[3] Global role default (${e}): ${i}`),{behavior:ad(i,t,r,o),customComponentRef:n?.unavailability?.customComponentRef,debugTrace:o}}o.push(`[3] Global role default: no match`);let s=r.reasonDefaults[i];return s?(o.push(`[4] Global reason default (${i}): ${s}`),{behavior:ad(s,t,r,o),customComponentRef:n?.unavailability?.customComponentRef,debugTrace:o}):(o.push(`[4] Global reason default (${i}): no match`),o.push(`[5] Global default: ${r.defaultBehavior}`),{behavior:ad(r.defaultBehavior,t,r,o),customComponentRef:n?.unavailability?.customComponentRef,debugTrace:o})}function sd(e,t){if(!e)return;let n=e.requiredFeatures;if(!n)return;let r=Array.isArray(n)?{features:n,mode:`OR`}:n;if(r.appliesWhen)return;let{resolvedFeatures:i,resolvedFeaturesResponse:a,featureDefinitions:o,unavailabilityPolicy:s,userRoles:c,billingEnabled:l}=t,u=new Set(i.features);if(r.features&&r.features.length>0){if((r.mode??`OR`)===`OR`){let e=r.features.filter(e=>{let t=o.get(e);return!t||t.valueType===mt.BOOLEAN}),t=e.some(e=>u.has(e));if(e.length>0&&!t){let t=e.filter(e=>!u.has(e)),n=o.get(t[0]),r=We.FEATURE_NOT_ENABLED,{behavior:i}=od({reason:r,featureDef:n,policy:s,userRoles:c,billingEnabled:l});return{isAvailable:!1,reason:r,behavior:i,missingFeatures:t,upgradeOptions:a?.upgradeOptions?.[t[0]]?.availableVia,suggestedProductRef:n?.unavailability?.suggestedProductRef}}}else for(let e of r.features){let t=o.get(e);if(!(t&&t.valueType!==mt.BOOLEAN)&&!u.has(e)){let n=We.FEATURE_NOT_ENABLED,{behavior:r}=od({reason:n,featureDef:t,policy:s,userRoles:c,billingEnabled:l}),i=a?.upgradeOptions?.[e]?.availableVia;return{isAvailable:!1,reason:n,behavior:r,missingFeatures:[e],upgradeOptions:i,suggestedProductRef:t?.unavailability?.suggestedProductRef}}}}if(r.limitChecks&&r.limitChecks.length>0){let t=e.operationIdentifier;for(let e of r.limitChecks){let n=i.limits[e.featureId];if(n===void 0||n===-1)continue;let r=i.currentUsage[e.featureId]??0,u;if(u=e.increment===void 0?t===J.CREATE?1:+(t===J.CREATE_MANY):e.increment,u!==0&&r+u>n){let t=We.LIMIT_EXCEEDED,i=o.get(e.featureId),{behavior:u}=od({reason:t,featureDef:i,policy:s,userRoles:c,billingEnabled:l}),d=a?.upgradeOptions?.[e.featureId]?.availableVia;return{isAvailable:!1,reason:t,behavior:u,limitInfo:{featureId:e.featureId,current:r,limit:n},upgradeOptions:d,suggestedProductRef:i?.unavailability?.suggestedProductRef}}}}return{isAvailable:!0,behavior:Re.DISABLE}}function cd(e){let{resolvedFeatures:t,resolvedFeaturesResponse:n,featureDefinitions:r,unavailabilityPolicy:i,isLoading:a}=nd(),{permissions:o}=Au(),s=td(),c=v();return(0,Q.useMemo)(()=>{if(a)return e?.requiredFeatures?{isAvailable:!0,behavior:Re.DISABLE}:void 0;let l=id(o,c?.currentOrganizationId??null);return sd(e,{resolvedFeatures:t,resolvedFeaturesResponse:n,featureDefinitions:r,unavailabilityPolicy:i,userRoles:l,billingEnabled:s?.isEnabled??!1})},[e,a,t,n,r,i,o,c?.currentOrganizationId,s?.isEnabled])}function ld({preset:e=Lt.DEFAULT,...t}){if(t.behavior===Re.CUSTOM&&t.customComponentRef){let e=Ne.resolve(t.customComponentRef,Lt.DEFAULT);if(!e)return(0,Gt.jsx)(ut,{componentType:t.customComponentRef,componentName:t.customComponentRef});let{customComponentRef:n,...r}=t;return(0,Gt.jsx)(e,{...r})}let n=st(L.LOW_LEVEL_FEATURE_UNAVAILABLE_PROMPT,`FeatureUnavailablePrompt`)(e);return(0,Gt.jsx)(n,{...t})}function ud(){let{notifyError:e}=$l(),t=o();return(0,Q.useCallback)(n=>{n().catch(n=>{e(t(n))})},[e,t])}function dd(){let e=td(),t=ud();return(0,Q.useCallback)(n=>{if(!e||!e.isEnabled||!e.isSliceAvailable(Mt.BILLING_ACCOUNT))return;let{behavior:r,suggestedProductRef:i,upgradeOptions:a}=n,o,s;if(i&&e.isSliceAvailable(Mt.PRODUCTS)&&e.isSliceAvailable(Mt.PRICES)){let t=e.getProductByKey(i);if(t){o=t.key;let n=e.getPricesForProduct(t._id);s=(n.find(e=>e.isDefault)??n[0])?._id}}if(!o&&a&&a.length>0){let e=a[0];e&&(o=e.productKey,s=e.priceId)}switch(r){case Re.UPGRADE_PROMPT:case Re.LIMIT_UPGRADE_PROMPT:case Re.ADDON_PROMPT:o&&s&&[Mt.SUBSCRIPTION,Mt.PRODUCTS,Mt.PRICES].every(e.isSliceAvailable)?t(()=>e.openCheckout(o,s)):t(()=>e.openCustomerPortal());break;case Re.CONTACT_ADMIN:case Re.DISABLE:case Re.HIDE:case Re.CUSTOM:}},[e,t])}var fd=({operation:e,requiredFeatures:t,children:n})=>{let r=Jo(),i=dd(),{emit:a}=Me(),o=Q.useContext(rl),s=cd(Q.useMemo(()=>e||(t?{requiredFeatures:t,operationIdentifier:`VIEW_ACCESS`}:null),[e,t])),c=Q.useCallback(()=>{Rc({emit:a,routerNavigate:r})},[a,r]),l=Q.useCallback(()=>{if(o){let e=Tn.resolveGoBackTarget({currentBrowserUrl:Tn.buildBrowserUrl(window.location.pathname,window.location.search),getZoneState:o.getZoneState});if(e?.browserUrl){a(Y.NAVIGATION_POP,{zone:e.zone}),r(e.browserUrl,{replace:!0});return}}c()},[a,r,c,o]),u=s!==void 0&&!s.isAvailable&&s.behavior===Re.HIDE;return Q.useEffect(()=>{u&&c()},[c,u]),!s||s.isAvailable?(0,Gt.jsx)(Gt.Fragment,{children:n}):u?null:(0,Gt.jsx)(ld,{behavior:s.behavior,missingFeatures:s.missingFeatures,limitInfo:s.limitInfo,upgradeOptionsCount:s.upgradeOptions?.length,customComponentRef:s.customComponentRef,onDismiss:l,onAction:()=>i(s)})},pd=t({ChartWidget:()=>_d,default:()=>_d}),md=Q.lazy(()=>Bt(()=>import(`./ChartView-nQvehKAl.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),hd=({onRetry:e})=>{let{tComponent:t,isReady:n}=wt({component:L.HIGH_LEVEL_VIEWS_CHART_WIDGET});return n?(0,Gt.jsx)(w,{variant:`compact`,iconRef:le.ERROR_APPLICATION,title:t(L.HIGH_LEVEL_VIEWS_CHART_WIDGET,`chartFailed`),primaryActionLabel:t(L.HIGH_LEVEL_VIEWS_CHART_WIDGET,`retry`),onPrimaryAction:e,respectSurfaceEmptyDisplay:!1,className:`h-full min-h-[120px] border-0`}):null},gd=class extends Q.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ChartWidget error (ref: ${this.props.chartRef}):`,e,t)}render(){return this.state.hasError?(0,Gt.jsx)(hd,{onRetry:()=>this.setState({hasError:!1,error:void 0})}):this.props.children}},_d=({chartRef:e,width:t=`100%`,height:n=`100%`,className:r})=>{let{registry:i}=T(),a=m({viewRef:e,registry:i})?.chartView.chartDefinition.requiredFeatures;return(0,Gt.jsx)(gd,{chartRef:e,children:(0,Gt.jsx)(fd,{requiredFeatures:a,children:(0,Gt.jsx)(Q.Suspense,{fallback:(0,Gt.jsx)(k,{height:n}),children:(0,Gt.jsx)(md,{viewRef:e,width:t,height:n,className:r})})})})};export{$c as $,on as $t,gu as A,sr as At,$l as B,An as Bt,ku as C,Qo as Ct,Cu as D,ur as Dt,Su as E,pr as Et,du as F,Qn as Ft,ql as G,Tn as Gt,Ql as H,jn as Ht,nu as I,cr as It,Rl as J,rn as Jt,Il as K,nn as Kt,ru as L,Kn as Lt,mu as M,Ln as Mt,fu as N,lr as Nt,bu as O,Gn as Ot,uu as P,or as Pt,il as Q,xn as Qt,eu as R,qn as Rt,Ou as S,Jo as St,xu as T,Ac as Tt,Gl as U,Pn as Ut,Jl as V,Nn as Vt,Wl as W,Dn as Wt,yl as X,bn as Xt,Pl as Y,Sn as Yt,rl as Z,vn as Zt,Bu as _,Fs as _t,ud as a,Ut as an,Hc as at,Nu as b,Oi as bt,cd as c,Ic as ct,nd as d,Do as dt,tn as en,el as et,ed as f,wc as ft,Hu as g,Ds as gt,$u as h,Ns as ht,dd as i,Jt as in,Kc as it,_u as j,ar as jt,yu as k,ir as kt,id as l,Rc as lt,Qu as m,Ms as mt,pd as n,Zt as nn,Qc as nt,ld as o,Ht as on,Wc as ot,td as p,js as pt,Ll as q,yn as qt,fd as r,Yt as rn,Gc as rt,sd as s,Wt as sn,Lc as st,_d as t,Qt as tn,Zc as tt,od as u,zc as ut,Vu as v,xc as vt,vu as w,hs as wt,Au as x,Go as xt,Pu as y,Pr as yt,tu as z,Mn as zt};