@ionic/core 8.7.19-nightly.20260304 → 8.8.0

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 (587) hide show
  1. package/components/index.d.ts +2 -0
  2. package/components/index.js +1 -114
  3. package/components/ion-accordion-group.js +1 -268
  4. package/components/ion-accordion.js +1 -456
  5. package/components/ion-action-sheet.js +1 -6
  6. package/components/ion-alert.js +1 -6
  7. package/components/ion-app.js +1 -132
  8. package/components/ion-avatar.js +1 -41
  9. package/components/ion-back-button.js +1 -130
  10. package/components/ion-backdrop.js +1 -6
  11. package/components/ion-badge.js +1 -47
  12. package/components/ion-breadcrumb.js +1 -137
  13. package/components/ion-breadcrumbs.js +1 -164
  14. package/components/ion-button.js +1 -6
  15. package/components/ion-buttons.js +1 -6
  16. package/components/ion-card-content.js +1 -45
  17. package/components/ion-card-header.js +1 -56
  18. package/components/ion-card-subtitle.js +1 -48
  19. package/components/ion-card-title.js +1 -48
  20. package/components/ion-card.js +1 -107
  21. package/components/ion-checkbox.js +1 -6
  22. package/components/ion-chip.js +1 -66
  23. package/components/ion-col.js +1 -163
  24. package/components/ion-content.js +1 -6
  25. package/components/ion-datetime-button.js +1 -383
  26. package/components/ion-datetime.js +1 -2047
  27. package/components/ion-fab-button.js +1 -151
  28. package/components/ion-fab-list.js +1 -73
  29. package/components/ion-fab.js +1 -101
  30. package/components/ion-footer.js +1 -179
  31. package/components/ion-grid.js +1 -46
  32. package/components/ion-header.js +1 -6
  33. package/components/ion-icon.js +1 -6
  34. package/components/ion-img.js +1 -133
  35. package/components/ion-infinite-scroll-content.js +1 -69
  36. package/components/ion-infinite-scroll.js +1 -236
  37. package/components/ion-input-otp.js +1 -682
  38. package/components/ion-input-password-toggle.js +1 -128
  39. package/components/ion-input.js +1 -646
  40. package/components/ion-item-divider.js +1 -59
  41. package/components/ion-item-group.js +1 -46
  42. package/components/ion-item-option.js +1 -91
  43. package/components/ion-item-options.js +1 -73
  44. package/components/ion-item-sliding.js +1 -457
  45. package/components/ion-item.js +1 -6
  46. package/components/ion-label.js +1 -6
  47. package/components/ion-list-header.js +1 -6
  48. package/components/ion-list.js +1 -6
  49. package/components/ion-loading.js +1 -343
  50. package/components/ion-menu-button.js +1 -109
  51. package/components/ion-menu-toggle.js +1 -64
  52. package/components/ion-menu.js +1 -741
  53. package/components/ion-modal.js +1 -6
  54. package/components/ion-nav-link.js +1 -64
  55. package/components/ion-nav.js +1 -951
  56. package/components/ion-note.js +1 -47
  57. package/components/ion-picker-column-option.js +1 -6
  58. package/components/ion-picker-column.js +1 -6
  59. package/components/ion-picker-legacy-column.js +1 -6
  60. package/components/ion-picker-legacy.js +1 -342
  61. package/components/ion-picker.js +1 -6
  62. package/components/ion-popover.js +1 -6
  63. package/components/ion-progress-bar.js +1 -100
  64. package/components/ion-radio-group.js +1 -6
  65. package/components/ion-radio.js +1 -6
  66. package/components/ion-range.js +1 -844
  67. package/components/ion-refresher-content.js +1 -88
  68. package/components/ion-refresher.js +1 -750
  69. package/components/ion-reorder-group.js +1 -322
  70. package/components/ion-reorder.js +1 -60
  71. package/components/ion-ripple-effect.js +1 -6
  72. package/components/ion-route-redirect.js +1 -45
  73. package/components/ion-route.js +1 -74
  74. package/components/ion-router-link.js +1 -61
  75. package/components/ion-router-outlet.js +1 -226
  76. package/components/ion-router.js +1 -840
  77. package/components/ion-row.js +1 -36
  78. package/components/ion-searchbar.js +1 -540
  79. package/components/ion-segment-button.js +1 -173
  80. package/components/ion-segment-content.js +1 -35
  81. package/components/ion-segment-view.js +1 -142
  82. package/components/ion-segment.js +1 -602
  83. package/components/ion-select-modal.js +1 -6
  84. package/components/ion-select-option.js +1 -46
  85. package/components/ion-select-popover.js +1 -6
  86. package/components/ion-select.js +1 -1035
  87. package/components/ion-skeleton-text.js +1 -64
  88. package/components/ion-spinner.js +1 -6
  89. package/components/ion-split-pane.js +1 -190
  90. package/components/ion-tab-bar.js +1 -135
  91. package/components/ion-tab-button.js +1 -127
  92. package/components/ion-tab.js +1 -82
  93. package/components/ion-tabs.js +1 -204
  94. package/components/ion-text.js +1 -42
  95. package/components/ion-textarea.js +1 -554
  96. package/components/ion-thumbnail.js +1 -36
  97. package/components/ion-title.js +1 -6
  98. package/components/ion-toast.js +1 -938
  99. package/components/ion-toggle.js +1 -360
  100. package/components/ion-toolbar.js +1 -6
  101. package/components/p-1KVKSLu5.js +4 -0
  102. package/{dist/ionic/p-DUt5fQmA.js → components/p-9VcRUwdB.js} +1 -1
  103. package/components/p-ApmKVjaE.js +4 -0
  104. package/components/p-B-hirT0v.js +1 -35
  105. package/components/p-B6FQ0cKR.js +4 -0
  106. package/components/p-B6HaBl3o.js +4 -0
  107. package/components/p-B8b1Ukl9.js +4 -0
  108. package/components/p-BFxT89Wl.js +4 -0
  109. package/components/p-BJoMtgfR.js +4 -0
  110. package/components/p-BNAG-aVv.js +4 -0
  111. package/{dist/ionic/p-D-eFFUkA.js → components/p-BR3tZJmu.js} +1 -1
  112. package/{dist/ionic/p-D0dMcSkw.js → components/p-BS1TtEiJ.js} +1 -1
  113. package/components/p-BSB38Tek.js +4 -0
  114. package/components/p-BTEOs1at.js +1 -192
  115. package/components/p-BTeL5HCK.js +4 -0
  116. package/{dist/ionic/p-DbQ5QkTP.js → components/p-BUbsoBOV.js} +1 -1
  117. package/components/p-BVnB3eEn.js +4 -0
  118. package/components/p-BYDc3hSE.js +4 -0
  119. package/components/p-BagjAGC0.js +4 -0
  120. package/components/p-BegtE7nr.js +4 -0
  121. package/components/p-BgwEQWW6.js +4 -0
  122. package/components/p-Bk2zuNWT.js +4 -0
  123. package/components/p-BmVRXR1y.js +1 -72
  124. package/components/p-Bum_LjMh.js +4 -0
  125. package/components/p-BxwWvu-b.js +4 -0
  126. package/components/p-C4jPsTQa.js +4 -0
  127. package/components/p-C53feagD.js +1 -15
  128. package/{dist/ionic/p-CwgG81ZD.js → components/p-C59ryAuS.js} +1 -1
  129. package/components/p-C7AoMl7c.js +4 -0
  130. package/components/p-CBzELu-H.js +4 -0
  131. package/components/p-CDfQnFrd.js +4 -0
  132. package/components/p-CH0NYjKq.js +4 -0
  133. package/components/p-CIGNaXM1.js +1 -10
  134. package/components/p-CO7fmmxt.js +1 -29
  135. package/components/p-CU1SSH8_.js +4 -0
  136. package/components/p-CVF7ukTk.js +4 -0
  137. package/components/p-CgfaEEem.js +4 -0
  138. package/components/p-CgqKJg96.js +4 -0
  139. package/components/p-Cl0B-RWe.js +1 -452
  140. package/components/p-CneGxKsZ.js +4 -0
  141. package/components/p-CoA-aqGF.js +4 -0
  142. package/{dist/ionic/p-DdR6rpbR.js → components/p-Cq8cQ0NL.js} +1 -1
  143. package/components/p-Csw8xuz4.js +4 -0
  144. package/components/p-CtWGkNnJ.js +1 -162
  145. package/components/p-Cwv-vmkN.js +4 -0
  146. package/{dist/ionic/p-BYEqWnSg.js → components/p-Cy5XSfIk.js} +1 -1
  147. package/components/p-Cyxa_4PV.js +4 -0
  148. package/components/p-Cz5nLPGT.js +4 -0
  149. package/components/p-D13Eaw-8.js +1 -76
  150. package/components/p-D6NJwNJN.js +4 -0
  151. package/components/p-D6Ynv7Xh.js +1 -141
  152. package/components/p-DHsZWn1l.js +4 -0
  153. package/components/p-DJMZehmW.js +4 -0
  154. package/components/p-DJztqcrH.js +1 -14
  155. package/components/p-DYdpXONG.js +4 -0
  156. package/components/p-DgbT0exM.js +4 -0
  157. package/components/p-DiVJyqlX.js +1 -40
  158. package/components/p-Dtdm8lKC.js +1 -44
  159. package/components/p-YLXPWgVj.js +4 -0
  160. package/components/p-ZjP4CjeZ.js +1 -4
  161. package/{dist/ionic/p-DCv9sLH2.js → components/p-ak_d-z48.js} +1 -1
  162. package/components/p-cyNmxje6.js +1 -155
  163. package/components/p-fpbh6w3f.js +4 -0
  164. package/components/p-hHmYLOfE.js +1 -87
  165. package/components/p-kvaDs24J.js +4 -0
  166. package/components/p-vEbVo2hO.js +4 -0
  167. package/dist/cjs/{animation-Bt3H9L1C.js → animation-Dg4yiuR2.js} +1 -1
  168. package/dist/cjs/app-globals-CLI8xCmk.js +11 -0
  169. package/dist/cjs/{button-active-CMc8cD90.js → button-active-FscMI17-.js} +1 -1
  170. package/dist/cjs/{config-C5fsO43a.js → config-BukYi_pW.js} +1 -1
  171. package/dist/cjs/{data-JwZKaIQB.js → data-BYlBjkMU.js} +1 -1
  172. package/dist/cjs/{framework-delegate-DMJRBuDi.js → framework-delegate-CRgp8o_p.js} +1 -1
  173. package/dist/cjs/{hardware-back-button-VCK4V3mG.js → hardware-back-button-C4rMJ5uI.js} +1 -1
  174. package/dist/cjs/{helpers-DrTqNghc.js → helpers-CxTYJdbT.js} +1 -1
  175. package/dist/cjs/{index-094mMFB-.js → index-C845Ti6K.js} +4 -4
  176. package/dist/cjs/{index-DrMUZJj6.js → index-CFUwM5x_.js} +5 -5
  177. package/dist/cjs/{index-D6Wc6v08.js → index-CqT-2gKy.js} +503 -382
  178. package/dist/cjs/{index-CO6eryBo.js → index-MbaBbWXk.js} +2 -2
  179. package/dist/cjs/{index-C534ULug.js → index-YcSftOMz.js} +2 -2
  180. package/dist/cjs/index.cjs.js +12 -12
  181. package/dist/cjs/{input-shims-CuMghsQ-.js → input-shims-Dl5cnc_e.js} +3 -3
  182. package/dist/cjs/{input.utils-B_QROI2g.js → input.utils-DmeJ8dmo.js} +2 -2
  183. package/dist/cjs/ion-accordion_2.cjs.entry.js +23 -15
  184. package/dist/cjs/ion-action-sheet.cjs.entry.js +21 -15
  185. package/dist/cjs/ion-alert.cjs.entry.js +25 -17
  186. package/dist/cjs/ion-app_8.cjs.entry.js +48 -43
  187. package/dist/cjs/ion-avatar_3.cjs.entry.js +12 -12
  188. package/dist/cjs/ion-back-button.cjs.entry.js +7 -7
  189. package/dist/cjs/ion-backdrop.cjs.entry.js +6 -6
  190. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +20 -14
  191. package/dist/cjs/ion-button_2.cjs.entry.js +36 -18
  192. package/dist/cjs/ion-card_5.cjs.entry.js +23 -23
  193. package/dist/cjs/ion-checkbox.cjs.entry.js +7 -7
  194. package/dist/cjs/ion-chip.cjs.entry.js +6 -6
  195. package/dist/cjs/ion-col_3.cjs.entry.js +8 -8
  196. package/dist/cjs/ion-datetime-button.cjs.entry.js +8 -8
  197. package/dist/cjs/ion-datetime_3.cjs.entry.js +75 -46
  198. package/dist/cjs/ion-fab_3.cjs.entry.js +17 -13
  199. package/dist/cjs/ion-img.cjs.entry.js +8 -6
  200. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +17 -13
  201. package/dist/cjs/ion-input-otp.cjs.entry.js +16 -10
  202. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +9 -7
  203. package/dist/cjs/ion-input.cjs.entry.js +21 -13
  204. package/dist/cjs/ion-item-option_3.cjs.entry.js +19 -17
  205. package/dist/cjs/ion-item_8.cjs.entry.js +48 -42
  206. package/dist/cjs/ion-loading.cjs.entry.js +18 -14
  207. package/dist/cjs/ion-menu_3.cjs.entry.js +30 -22
  208. package/dist/cjs/ion-modal.cjs.entry.js +237 -59
  209. package/dist/cjs/ion-nav_2.cjs.entry.js +14 -10
  210. package/dist/cjs/ion-picker-column-option.cjs.entry.js +10 -8
  211. package/dist/cjs/ion-picker-column.cjs.entry.js +11 -7
  212. package/dist/cjs/ion-picker.cjs.entry.js +6 -6
  213. package/dist/cjs/ion-popover.cjs.entry.js +21 -15
  214. package/dist/cjs/ion-progress-bar.cjs.entry.js +7 -7
  215. package/dist/cjs/ion-radio_2.cjs.entry.js +17 -13
  216. package/dist/cjs/ion-range.cjs.entry.js +205 -57
  217. package/dist/cjs/ion-refresher_2.cjs.entry.js +45 -14
  218. package/dist/cjs/ion-reorder_2.cjs.entry.js +13 -11
  219. package/dist/cjs/ion-ripple-effect.cjs.entry.js +4 -4
  220. package/dist/cjs/ion-route_4.cjs.entry.js +20 -10
  221. package/dist/cjs/ion-searchbar.cjs.entry.js +22 -12
  222. package/dist/cjs/ion-segment-content.cjs.entry.js +3 -3
  223. package/dist/cjs/ion-segment-view.cjs.entry.js +13 -8
  224. package/dist/cjs/ion-segment_2.cjs.entry.js +26 -16
  225. package/dist/cjs/ion-select-modal.cjs.entry.js +17 -13
  226. package/dist/cjs/ion-select_3.cjs.entry.js +33 -24
  227. package/dist/cjs/ion-spinner.cjs.entry.js +4 -4
  228. package/dist/cjs/ion-split-pane.cjs.entry.js +15 -9
  229. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +14 -12
  230. package/dist/cjs/ion-tab_2.cjs.entry.js +10 -8
  231. package/dist/cjs/ion-text.cjs.entry.js +4 -4
  232. package/dist/cjs/ion-textarea.cjs.entry.js +20 -14
  233. package/dist/cjs/ion-toast.cjs.entry.js +21 -15
  234. package/dist/cjs/ion-toggle.cjs.entry.js +10 -8
  235. package/dist/cjs/{ionic-global-HMVqOFGO.js → ionic-global-Bc3kJi1Z.js} +1 -1
  236. package/dist/cjs/ionic.cjs.js +5 -5
  237. package/dist/cjs/{ios.transition-BOt_uW73.js → ios.transition-trBiC95R.js} +4 -4
  238. package/dist/cjs/loader.cjs.js +4 -4
  239. package/dist/cjs/{md.transition-Dt968VXB.js → md.transition-CUQECuvD.js} +4 -4
  240. package/dist/cjs/{notch-controller-Bzqhjm4f.js → notch-controller-sD-lTpdc.js} +1 -1
  241. package/dist/cjs/{overlays-B2b-TTbl.js → overlays-C2jiBSNQ.js} +5 -5
  242. package/dist/cjs/{status-tap-g0sWWkXk.js → status-tap-CCJk5VgT.js} +3 -3
  243. package/dist/cjs/{swipe-back-BIayeNOD.js → swipe-back-BGhTQ1CU.js} +2 -2
  244. package/dist/collection/collection-manifest.json +2 -2
  245. package/dist/collection/components/accordion-group/accordion-group.js +4 -2
  246. package/dist/collection/components/action-sheet/action-sheet.js +20 -10
  247. package/dist/collection/components/alert/alert.js +24 -12
  248. package/dist/collection/components/back-button/back-button.js +4 -2
  249. package/dist/collection/components/badge/badge.js +2 -1
  250. package/dist/collection/components/breadcrumb/breadcrumb.js +8 -4
  251. package/dist/collection/components/breadcrumbs/breadcrumbs.js +4 -2
  252. package/dist/collection/components/button/button.js +6 -3
  253. package/dist/collection/components/card/card.js +6 -3
  254. package/dist/collection/components/card-header/card-header.js +2 -1
  255. package/dist/collection/components/card-subtitle/card-subtitle.js +2 -1
  256. package/dist/collection/components/card-title/card-title.js +2 -1
  257. package/dist/collection/components/checkbox/checkbox.js +4 -2
  258. package/dist/collection/components/chip/chip.js +2 -1
  259. package/dist/collection/components/content/content.js +12 -7
  260. package/dist/collection/components/datetime/datetime.js +43 -22
  261. package/dist/collection/components/datetime-button/datetime-button.js +2 -1
  262. package/dist/collection/components/fab-button/fab-button.js +6 -3
  263. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +4 -2
  264. package/dist/collection/components/input/input.js +11 -6
  265. package/dist/collection/components/input-otp/input-otp.js +8 -4
  266. package/dist/collection/components/input-password-toggle/input-password-toggle.js +4 -2
  267. package/dist/collection/components/item/item.js +10 -5
  268. package/dist/collection/components/item-divider/item-divider.js +7 -3
  269. package/dist/collection/components/item-option/item-option.js +6 -3
  270. package/dist/collection/components/item-options/item-options.js +2 -1
  271. package/dist/collection/components/item-sliding/item-sliding.js +2 -1
  272. package/dist/collection/components/label/label.js +6 -3
  273. package/dist/collection/components/list-header/list-header.js +6 -3
  274. package/dist/collection/components/loading/loading.js +22 -11
  275. package/dist/collection/components/menu/menu.js +10 -5
  276. package/dist/collection/components/menu-button/menu-button.js +2 -1
  277. package/dist/collection/components/modal/gestures/sheet.js +120 -12
  278. package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
  279. package/dist/collection/components/modal/modal.js +127 -45
  280. package/dist/collection/components/nav/nav.js +89 -45
  281. package/dist/collection/components/nav-link/nav-link.js +9 -5
  282. package/dist/collection/components/note/note.js +2 -1
  283. package/dist/collection/components/picker/picker.js +2 -1
  284. package/dist/collection/components/picker-column/picker-column.js +6 -3
  285. package/dist/collection/components/picker-column-option/picker-column-option.js +2 -1
  286. package/dist/collection/components/picker-legacy/picker.js +24 -12
  287. package/dist/collection/components/picker-legacy-column/picker-column.js +4 -2
  288. package/dist/collection/components/popover/popover.js +33 -17
  289. package/dist/collection/components/progress-bar/progress-bar.js +2 -1
  290. package/dist/collection/components/radio/radio.js +2 -1
  291. package/dist/collection/components/radio-group/radio-group.js +6 -3
  292. package/dist/collection/components/range/range.js +214 -53
  293. package/dist/collection/components/refresher/refresher.js +73 -5
  294. package/dist/collection/components/refresher-content/refresher-content.js +8 -4
  295. package/dist/collection/components/reorder-group/reorder-group.js +6 -3
  296. package/dist/collection/components/route/route.js +4 -2
  297. package/dist/collection/components/router/router.js +10 -5
  298. package/dist/collection/components/router-link/router-link.js +6 -3
  299. package/dist/collection/components/router-outlet/router-outlet.js +18 -9
  300. package/dist/collection/components/searchbar/searchbar.js +11 -6
  301. package/dist/collection/components/segment/segment.js +10 -5
  302. package/dist/collection/components/segment-button/segment-button.js +4 -2
  303. package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
  304. package/dist/collection/components/segment-view/segment-view.js +30 -4
  305. package/dist/collection/components/segment-view/segment-view.md.css +2 -1
  306. package/dist/collection/components/select/select.js +17 -8
  307. package/dist/collection/components/select-modal/select-modal.js +27 -2
  308. package/dist/collection/components/select-popover/select-popover.js +2 -1
  309. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -1
  310. package/dist/collection/components/spinner/spinner.js +4 -2
  311. package/dist/collection/components/tab/tab.js +4 -2
  312. package/dist/collection/components/tab-bar/tab-bar.js +4 -2
  313. package/dist/collection/components/tab-button/tab-button.js +4 -2
  314. package/dist/collection/components/tabs/tabs.js +4 -2
  315. package/dist/collection/components/text/text.js +2 -1
  316. package/dist/collection/components/textarea/textarea.js +10 -7
  317. package/dist/collection/components/title/title.js +4 -2
  318. package/dist/collection/components/toast/toast.js +34 -17
  319. package/dist/collection/components/toggle/toggle.js +4 -2
  320. package/dist/collection/components/toolbar/toolbar.js +2 -1
  321. package/dist/docs.d.ts +37 -0
  322. package/dist/docs.json +1186 -389
  323. package/dist/esm/{animation-Dt8bGnA-.js → animation-CnGMT4ji.js} +1 -1
  324. package/dist/esm/app-globals-DhZjtldk.js +9 -0
  325. package/dist/esm/{button-active-L570Swow.js → button-active-BBx21brx.js} +1 -1
  326. package/dist/esm/{config-mCdtaoPe.js → config-TO1rZH52.js} +1 -1
  327. package/dist/esm/{data-DCORV9FH.js → data-B9iGR5YO.js} +1 -1
  328. package/dist/esm/{framework-delegate-BYawdMXj.js → framework-delegate-CyxE1S_P.js} +1 -1
  329. package/dist/esm/{hardware-back-button-CPLxO-Ev.js → hardware-back-button-CTe4XmL7.js} +1 -1
  330. package/dist/esm/{helpers-DEn3pfjm.js → helpers-Tl8jw6S2.js} +1 -1
  331. package/dist/esm/{index-r2D9DEro.js → index-B-hkiOUh.js} +4 -4
  332. package/dist/esm/{index-CvDIirVx.js → index-B2KwgBLx.js} +5 -5
  333. package/dist/esm/{index-ceb5RaMT.js → index-BtUdxPjv.js} +2 -2
  334. package/dist/esm/{index-C8IsBmNU.js → index-IGIE5vDm.js} +503 -382
  335. package/dist/esm/{index-Bs3kT4bc.js → index-hW6eNZ3o.js} +2 -2
  336. package/dist/esm/index.js +12 -12
  337. package/dist/esm/{input-shims-D6H3ZaWt.js → input-shims-AaDhOpKN.js} +3 -3
  338. package/dist/esm/{input.utils-DrvTa8gz.js → input.utils-Bxa_DQ7-.js} +2 -2
  339. package/dist/esm/ion-accordion_2.entry.js +23 -15
  340. package/dist/esm/ion-action-sheet.entry.js +21 -15
  341. package/dist/esm/ion-alert.entry.js +25 -17
  342. package/dist/esm/ion-app_8.entry.js +48 -43
  343. package/dist/esm/ion-avatar_3.entry.js +12 -12
  344. package/dist/esm/ion-back-button.entry.js +7 -7
  345. package/dist/esm/ion-backdrop.entry.js +6 -6
  346. package/dist/esm/ion-breadcrumb_2.entry.js +20 -14
  347. package/dist/esm/ion-button_2.entry.js +36 -18
  348. package/dist/esm/ion-card_5.entry.js +23 -23
  349. package/dist/esm/ion-checkbox.entry.js +7 -7
  350. package/dist/esm/ion-chip.entry.js +6 -6
  351. package/dist/esm/ion-col_3.entry.js +8 -8
  352. package/dist/esm/ion-datetime-button.entry.js +8 -8
  353. package/dist/esm/ion-datetime_3.entry.js +75 -46
  354. package/dist/esm/ion-fab_3.entry.js +17 -13
  355. package/dist/esm/ion-img.entry.js +8 -6
  356. package/dist/esm/ion-infinite-scroll_2.entry.js +17 -13
  357. package/dist/esm/ion-input-otp.entry.js +16 -10
  358. package/dist/esm/ion-input-password-toggle.entry.js +9 -7
  359. package/dist/esm/ion-input.entry.js +21 -13
  360. package/dist/esm/ion-item-option_3.entry.js +19 -17
  361. package/dist/esm/ion-item_8.entry.js +48 -42
  362. package/dist/esm/ion-loading.entry.js +18 -14
  363. package/dist/esm/ion-menu_3.entry.js +30 -22
  364. package/dist/esm/ion-modal.entry.js +237 -59
  365. package/dist/esm/ion-nav_2.entry.js +14 -10
  366. package/dist/esm/ion-picker-column-option.entry.js +10 -8
  367. package/dist/esm/ion-picker-column.entry.js +11 -7
  368. package/dist/esm/ion-picker.entry.js +6 -6
  369. package/dist/esm/ion-popover.entry.js +21 -15
  370. package/dist/esm/ion-progress-bar.entry.js +7 -7
  371. package/dist/esm/ion-radio_2.entry.js +17 -13
  372. package/dist/esm/ion-range.entry.js +205 -57
  373. package/dist/esm/ion-refresher_2.entry.js +45 -14
  374. package/dist/esm/ion-reorder_2.entry.js +13 -11
  375. package/dist/esm/ion-ripple-effect.entry.js +4 -4
  376. package/dist/esm/ion-route_4.entry.js +20 -10
  377. package/dist/esm/ion-searchbar.entry.js +22 -12
  378. package/dist/esm/ion-segment-content.entry.js +3 -3
  379. package/dist/esm/ion-segment-view.entry.js +13 -8
  380. package/dist/esm/ion-segment_2.entry.js +26 -16
  381. package/dist/esm/ion-select-modal.entry.js +17 -13
  382. package/dist/esm/ion-select_3.entry.js +33 -24
  383. package/dist/esm/ion-spinner.entry.js +4 -4
  384. package/dist/esm/ion-split-pane.entry.js +15 -9
  385. package/dist/esm/ion-tab-bar_2.entry.js +14 -12
  386. package/dist/esm/ion-tab_2.entry.js +10 -8
  387. package/dist/esm/ion-text.entry.js +4 -4
  388. package/dist/esm/ion-textarea.entry.js +20 -14
  389. package/dist/esm/ion-toast.entry.js +21 -15
  390. package/dist/esm/ion-toggle.entry.js +10 -8
  391. package/dist/esm/{ionic-global-CDrldh-5.js → ionic-global-DfbeLwcV.js} +1 -1
  392. package/dist/esm/ionic.js +6 -6
  393. package/dist/esm/{ios.transition-BDzw0_Hm.js → ios.transition--aMF-pDH.js} +4 -4
  394. package/dist/esm/loader.js +5 -5
  395. package/dist/esm/{md.transition-BzDYi3qq.js → md.transition-BEVbfm8j.js} +4 -4
  396. package/dist/esm/{notch-controller-BwelN_JM.js → notch-controller-DAcvKU57.js} +1 -1
  397. package/dist/esm/{overlays-D5YkFThA.js → overlays-F8GHPo-e.js} +5 -5
  398. package/dist/esm/{status-tap-5DQ7Fc4V.js → status-tap-BfJqFSLF.js} +3 -3
  399. package/dist/esm/{swipe-back-BKw2CAHc.js → swipe-back-BZBFwTQV.js} +2 -2
  400. package/dist/html.html-data.json +117 -109
  401. package/dist/ionic/index.esm.js +1 -1
  402. package/dist/ionic/ionic.esm.js +1 -1
  403. package/dist/ionic/p-031b76f7.entry.js +4 -0
  404. package/dist/ionic/p-045a6a42.entry.js +4 -0
  405. package/dist/ionic/p-07506134.entry.js +4 -0
  406. package/dist/ionic/p-084c25b2.entry.js +4 -0
  407. package/dist/ionic/p-0d8b5c38.entry.js +4 -0
  408. package/dist/ionic/p-16813ce7.entry.js +4 -0
  409. package/dist/ionic/p-16b65553.entry.js +4 -0
  410. package/dist/ionic/p-1b02923f.entry.js +4 -0
  411. package/dist/ionic/{p-5c8f7253.entry.js → p-1b169fb6.entry.js} +1 -1
  412. package/dist/ionic/{p-915b3e3d.entry.js → p-23fac490.entry.js} +1 -1
  413. package/dist/ionic/{p-b8551510.entry.js → p-294f4bb5.entry.js} +1 -1
  414. package/dist/ionic/p-2a68388b.entry.js +4 -0
  415. package/dist/ionic/p-2f5a8140.entry.js +4 -0
  416. package/dist/ionic/{p-49d06882.entry.js → p-301c43f8.entry.js} +1 -1
  417. package/dist/ionic/{p-79bd78f9.entry.js → p-370a60ee.entry.js} +1 -1
  418. package/dist/ionic/p-3e143d1d.entry.js +4 -0
  419. package/dist/ionic/p-4819b469.entry.js +4 -0
  420. package/dist/ionic/p-4dd5e8e0.entry.js +4 -0
  421. package/dist/ionic/p-51c11c47.entry.js +4 -0
  422. package/dist/ionic/p-53f750a5.entry.js +4 -0
  423. package/dist/ionic/{p-7cad388a.entry.js → p-6af16209.entry.js} +1 -1
  424. package/dist/ionic/{p-7f98e710.entry.js → p-6b701daa.entry.js} +1 -1
  425. package/dist/ionic/p-6b97f2a3.entry.js +4 -0
  426. package/dist/ionic/p-71e322f7.entry.js +4 -0
  427. package/dist/ionic/p-7620be24.entry.js +4 -0
  428. package/dist/ionic/p-771b27a5.entry.js +4 -0
  429. package/dist/ionic/{p-906bb44d.entry.js → p-7ca71c83.entry.js} +1 -1
  430. package/dist/ionic/{p-11aa58d6.entry.js → p-80cac7a2.entry.js} +1 -1
  431. package/dist/ionic/p-96a2e768.entry.js +4 -0
  432. package/dist/ionic/{p-582824c5.entry.js → p-9833cf63.entry.js} +1 -1
  433. package/dist/ionic/p-9cbc6f1f.entry.js +4 -0
  434. package/dist/ionic/p-9cdbabbb.entry.js +4 -0
  435. package/dist/ionic/p-9eac4eb1.entry.js +4 -0
  436. package/dist/ionic/{p-675b1a31.entry.js → p-9fae83d8.entry.js} +1 -1
  437. package/dist/ionic/p-B8xlpH8p.js +4 -0
  438. package/dist/ionic/{p-C7hRNDhM.js → p-BAt5H1ac.js} +1 -1
  439. package/dist/ionic/p-BW_TRJm8.js +4 -0
  440. package/dist/ionic/{p-DDb5r57F.js → p-Bum7H1fw.js} +1 -1
  441. package/dist/ionic/p-BvFYtOdE.js +4 -0
  442. package/dist/ionic/{p-Dc45iWE4.js → p-BxIcPWoV.js} +1 -1
  443. package/dist/ionic/p-C0JvVFMv.js +4 -0
  444. package/dist/ionic/{p-CTfR9YZG.js → p-CGmVTdWh.js} +1 -1
  445. package/dist/ionic/{p-BOVrCkpJ.js → p-CYbRmDdy.js} +1 -1
  446. package/dist/ionic/{p-MUoJJJwd.js → p-CYvM5g3q.js} +1 -1
  447. package/dist/ionic/p-CmFz1Mjc.js +4 -0
  448. package/dist/ionic/p-CtA-yJYy.js +4 -0
  449. package/dist/ionic/p-D8HJQ1qq.js +4 -0
  450. package/dist/ionic/{p-B0q1YL7N.js → p-DB_iPQC-.js} +1 -1
  451. package/dist/ionic/{p-DNcfiJwE.js → p-DLbbmF9h.js} +1 -1
  452. package/dist/ionic/p-DTPR1Wpn.js +4 -0
  453. package/dist/ionic/p-DjriolRs.js +4 -0
  454. package/dist/ionic/p-DtVZDHlS.js +4 -0
  455. package/dist/ionic/p-IGIE5vDm.js +5 -0
  456. package/dist/ionic/{p-BFvmZNyx.js → p-NFFyoJ4Q.js} +1 -1
  457. package/dist/ionic/p-a805674e.entry.js +4 -0
  458. package/dist/ionic/{p-da7d04cc.entry.js → p-a84f2d21.entry.js} +1 -1
  459. package/dist/ionic/p-aa47f46e.entry.js +4 -0
  460. package/dist/ionic/{p-2668188b.entry.js → p-b325a113.entry.js} +1 -1
  461. package/dist/ionic/{p-d1f54e28.entry.js → p-b440381f.entry.js} +1 -1
  462. package/dist/ionic/p-b6e0ff03.entry.js +4 -0
  463. package/dist/ionic/{p-6f37536a.entry.js → p-bcaa827e.entry.js} +1 -1
  464. package/dist/ionic/{p-fb0271ae.entry.js → p-c3cce9d8.entry.js} +1 -1
  465. package/dist/ionic/{p-b0a7585c.entry.js → p-ca31010f.entry.js} +1 -1
  466. package/dist/ionic/p-d4e8b473.entry.js +4 -0
  467. package/dist/ionic/{p-9575b654.entry.js → p-e663bc5a.entry.js} +1 -1
  468. package/dist/ionic/p-e6c5f060.entry.js +4 -0
  469. package/dist/ionic/{p-652318c3.entry.js → p-e6cedcd7.entry.js} +1 -1
  470. package/dist/ionic/{p-fbb00634.entry.js → p-e863ffe8.entry.js} +1 -1
  471. package/dist/ionic/{p-0ca0fe9c.entry.js → p-f2deaceb.entry.js} +1 -1
  472. package/dist/ionic/{p-ac4eb91d.entry.js → p-f5dfb9a3.entry.js} +1 -1
  473. package/dist/ionic/{p-bce86e56.entry.js → p-f8186550.entry.js} +1 -1
  474. package/dist/ionic/p-fdbc90d4.entry.js +4 -0
  475. package/dist/ionic/p-gbVXD275.js +4 -0
  476. package/dist/ionic/p-hNN3VvaC.js +4 -0
  477. package/dist/types/components/datetime/datetime.d.ts +10 -0
  478. package/dist/types/components/header/header.utils.d.ts +2 -1
  479. package/dist/types/components/item/item.d.ts +2 -0
  480. package/dist/types/components/item-divider/item-divider.d.ts +3 -0
  481. package/dist/types/components/item-option/item-option.d.ts +2 -0
  482. package/dist/types/components/list-header/list-header.d.ts +2 -0
  483. package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
  484. package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
  485. package/dist/types/components/modal/modal-interface.d.ts +25 -0
  486. package/dist/types/components/modal/modal.d.ts +22 -1
  487. package/dist/types/components/range/range-interface.d.ts +1 -0
  488. package/dist/types/components/range/range.d.ts +44 -4
  489. package/dist/types/components/refresher/refresher-interface.d.ts +7 -0
  490. package/dist/types/components/refresher/refresher.d.ts +16 -3
  491. package/dist/types/components/segment-view/segment-view.d.ts +4 -0
  492. package/dist/types/components/select/select.d.ts +3 -0
  493. package/dist/types/components/select-modal/select-modal.d.ts +4 -0
  494. package/dist/types/components.d.ts +964 -191
  495. package/dist/types/interface.d.ts +2 -2
  496. package/dist/types/stencil-public-runtime.d.ts +126 -14
  497. package/dist/types/utils/gesture/listener.d.ts +2 -1
  498. package/hydrate/index.d.ts +12 -0
  499. package/hydrate/index.js +5632 -1421
  500. package/hydrate/index.mjs +5631 -1422
  501. package/package.json +2 -2
  502. package/components/p-B25GjpND.js +0 -71
  503. package/components/p-BANeLH_G.js +0 -290
  504. package/components/p-BBFQmhcD.js +0 -59
  505. package/components/p-BC-awmYt.js +0 -306
  506. package/components/p-BHbOsu99.js +0 -501
  507. package/components/p-BTlwXR9e.js +0 -73
  508. package/components/p-BcazQttQ.js +0 -612
  509. package/components/p-BdGshsIJ.js +0 -226
  510. package/components/p-BfS7vSpC.js +0 -147
  511. package/components/p-BhRFCLuX.js +0 -675
  512. package/components/p-Bhnhnzjz.js +0 -75
  513. package/components/p-BmcqD0EN.js +0 -153
  514. package/components/p-Boi6hecl.js +0 -115
  515. package/components/p-Bt_moUyl.js +0 -232
  516. package/components/p-Bxl5etF4.js +0 -146
  517. package/components/p-ByjmWt3s.js +0 -139
  518. package/components/p-C04oPyjT.js +0 -54
  519. package/components/p-C6dkQWq2.js +0 -1626
  520. package/components/p-CFZWrvIQ.js +0 -194
  521. package/components/p-CIJwkzL6.js +0 -195
  522. package/components/p-CL12ApCQ.js +0 -820
  523. package/components/p-CXJR56Oq.js +0 -564
  524. package/components/p-Cdm3dKWf.js +0 -108
  525. package/components/p-CslsoGzv.js +0 -192
  526. package/components/p-Cyd00tgZ.js +0 -167
  527. package/components/p-CzAJ3ArC.js +0 -380
  528. package/components/p-CzW34QBh.js +0 -12
  529. package/components/p-D0zXRwcr.js +0 -196
  530. package/components/p-D5hF6rwn.js +0 -339
  531. package/components/p-D8eD2iBA.js +0 -67
  532. package/components/p-DGOrLIyS.js +0 -481
  533. package/components/p-DK2Bn1Mc.js +0 -305
  534. package/components/p-DKRQWlK2.js +0 -598
  535. package/components/p-DNDUsygf.js +0 -128
  536. package/components/p-DTWZF6wg.js +0 -418
  537. package/components/p-DWoUQeZ3.js +0 -3012
  538. package/components/p-DX0w75a9.js +0 -420
  539. package/components/p-Dt8zaCLQ.js +0 -92
  540. package/components/p-DyFBFrV7.js +0 -264
  541. package/components/p-DyHPCMyn.js +0 -39
  542. package/components/p-LgLeKTkH.js +0 -112
  543. package/components/p-NhiRFRn9.js +0 -50
  544. package/components/p-OuiHmXO5.js +0 -646
  545. package/components/p-Wro9IPHE.js +0 -459
  546. package/components/p-aIWC4ZEV.js +0 -305
  547. package/components/p-c-XJ9XhZ.js +0 -915
  548. package/components/p-fVuFT3Wd.js +0 -78
  549. package/components/p-iyo0Toaz.js +0 -2822
  550. package/components/p-l_lso3Zl.js +0 -140
  551. package/components/p-mQp4lwQD.js +0 -1638
  552. package/dist/cjs/app-globals-Ciccnk9_.js +0 -10
  553. package/dist/esm/app-globals-BDSf8fOA.js +0 -8
  554. package/dist/ionic/p-11518b31.entry.js +0 -4
  555. package/dist/ionic/p-221a3d8c.entry.js +0 -4
  556. package/dist/ionic/p-2ac254dc.entry.js +0 -4
  557. package/dist/ionic/p-2bd1ea35.entry.js +0 -4
  558. package/dist/ionic/p-30333874.entry.js +0 -4
  559. package/dist/ionic/p-31db96da.entry.js +0 -4
  560. package/dist/ionic/p-34642fa1.entry.js +0 -4
  561. package/dist/ionic/p-35696017.entry.js +0 -4
  562. package/dist/ionic/p-363d1209.entry.js +0 -4
  563. package/dist/ionic/p-46a38cfd.entry.js +0 -4
  564. package/dist/ionic/p-4eec1a5e.entry.js +0 -4
  565. package/dist/ionic/p-530fcd71.entry.js +0 -4
  566. package/dist/ionic/p-5d6fb6e3.entry.js +0 -4
  567. package/dist/ionic/p-66fbe052.entry.js +0 -4
  568. package/dist/ionic/p-7babec72.entry.js +0 -4
  569. package/dist/ionic/p-82d5bb3d.entry.js +0 -4
  570. package/dist/ionic/p-97eb0812.entry.js +0 -4
  571. package/dist/ionic/p-9b6d46f2.entry.js +0 -4
  572. package/dist/ionic/p-BKc55Xev.js +0 -4
  573. package/dist/ionic/p-Bmgaetn_.js +0 -4
  574. package/dist/ionic/p-C8IsBmNU.js +0 -5
  575. package/dist/ionic/p-CJxh_yLS.js +0 -4
  576. package/dist/ionic/p-DZRJwG4S.js +0 -4
  577. package/dist/ionic/p-a4a9f5ae.entry.js +0 -4
  578. package/dist/ionic/p-b0ebf9f8.entry.js +0 -4
  579. package/dist/ionic/p-be263062.entry.js +0 -4
  580. package/dist/ionic/p-c175d792.entry.js +0 -4
  581. package/dist/ionic/p-cc2a9936.entry.js +0 -4
  582. package/dist/ionic/p-cc45bcbc.entry.js +0 -4
  583. package/dist/ionic/p-d0a2a1ab.entry.js +0 -4
  584. package/dist/ionic/p-e4c57008.entry.js +0 -4
  585. package/dist/ionic/p-e5d6d0f0.entry.js +0 -4
  586. package/dist/ionic/p-f1dfee25.entry.js +0 -4
  587. package/dist/ionic/p-f9f7b9db.entry.js +0 -4
@@ -1,843 +1,4 @@
1
1
  /*!
2
2
  * (C) Ionic http://ionicframework.com - MIT License
3
3
  */
4
- import { j as printIonError, p as proxyCustomElement, H, e as createEvent, f as printIonWarning } from './p-DWoUQeZ3.js';
5
- import { c as componentOnReady, p as debounce } from './p-D5hF6rwn.js';
6
-
7
- const ROUTER_INTENT_NONE = 'root';
8
- const ROUTER_INTENT_FORWARD = 'forward';
9
- const ROUTER_INTENT_BACK = 'back';
10
-
11
- /** Join the non empty segments with "/". */
12
- const generatePath = (segments) => {
13
- const path = segments.filter((s) => s.length > 0).join('/');
14
- return '/' + path;
15
- };
16
- const generateUrl = (segments, useHash, queryString) => {
17
- let url = generatePath(segments);
18
- if (useHash) {
19
- url = '#' + url;
20
- }
21
- if (queryString !== undefined) {
22
- url += '?' + queryString;
23
- }
24
- return url;
25
- };
26
- const writeSegments = (history, root, useHash, segments, direction, state, queryString) => {
27
- const url = generateUrl([...parsePath(root).segments, ...segments], useHash, queryString);
28
- if (direction === ROUTER_INTENT_FORWARD) {
29
- history.pushState(state, '', url);
30
- }
31
- else {
32
- history.replaceState(state, '', url);
33
- }
34
- };
35
- /**
36
- * Transforms a chain to a list of segments.
37
- *
38
- * Notes:
39
- * - parameter segments of the form :param are replaced with their value,
40
- * - null is returned when a value is missing for any parameter segment.
41
- */
42
- const chainToSegments = (chain) => {
43
- const segments = [];
44
- for (const route of chain) {
45
- for (const segment of route.segments) {
46
- if (segment[0] === ':') {
47
- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
48
- const param = route.params && route.params[segment.slice(1)];
49
- if (!param) {
50
- return null;
51
- }
52
- segments.push(param);
53
- }
54
- else if (segment !== '') {
55
- segments.push(segment);
56
- }
57
- }
58
- }
59
- return segments;
60
- };
61
- /**
62
- * Removes the prefix segments from the path segments.
63
- *
64
- * Return:
65
- * - null when the path segments do not start with the passed prefix,
66
- * - the path segments after the prefix otherwise.
67
- */
68
- const removePrefix = (prefix, segments) => {
69
- if (prefix.length > segments.length) {
70
- return null;
71
- }
72
- if (prefix.length <= 1 && prefix[0] === '') {
73
- return segments;
74
- }
75
- for (let i = 0; i < prefix.length; i++) {
76
- if (prefix[i] !== segments[i]) {
77
- return null;
78
- }
79
- }
80
- if (segments.length === prefix.length) {
81
- return [''];
82
- }
83
- return segments.slice(prefix.length);
84
- };
85
- const readSegments = (loc, root, useHash) => {
86
- const prefix = parsePath(root).segments;
87
- const pathname = useHash ? loc.hash.slice(1) : loc.pathname;
88
- const segments = parsePath(pathname).segments;
89
- return removePrefix(prefix, segments);
90
- };
91
- /**
92
- * Parses the path to:
93
- * - segments an array of '/' separated parts,
94
- * - queryString (undefined when no query string).
95
- */
96
- const parsePath = (path) => {
97
- let segments = [''];
98
- let queryString;
99
- if (path != null) {
100
- const qsStart = path.indexOf('?');
101
- if (qsStart > -1) {
102
- queryString = path.substring(qsStart + 1);
103
- path = path.substring(0, qsStart);
104
- }
105
- segments = path
106
- .split('/')
107
- .map((s) => s.trim())
108
- .filter((s) => s.length > 0);
109
- if (segments.length === 0) {
110
- segments = [''];
111
- }
112
- }
113
- return { segments, queryString };
114
- };
115
-
116
- const printRoutes = (routes) => {
117
- console.group(`[ion-core] ROUTES[${routes.length}]`);
118
- for (const chain of routes) {
119
- const segments = [];
120
- chain.forEach((r) => segments.push(...r.segments));
121
- const ids = chain.map((r) => r.id);
122
- console.debug(`%c ${generatePath(segments)}`, 'font-weight: bold; padding-left: 20px', '=>\t', `(${ids.join(', ')})`);
123
- }
124
- console.groupEnd();
125
- };
126
- const printRedirects = (redirects) => {
127
- console.group(`[ion-core] REDIRECTS[${redirects.length}]`);
128
- for (const redirect of redirects) {
129
- if (redirect.to) {
130
- console.debug('FROM: ', `$c ${generatePath(redirect.from)}`, 'font-weight: bold', ' TO: ', `$c ${generatePath(redirect.to.segments)}`, 'font-weight: bold');
131
- }
132
- }
133
- console.groupEnd();
134
- };
135
-
136
- /**
137
- * Activates the passed route chain.
138
- *
139
- * There must be exactly one outlet per route entry in the chain.
140
- *
141
- * The methods calls setRouteId on each of the outlet with the corresponding route entry in the chain.
142
- * setRouteId will create or select the view in the outlet.
143
- */
144
- const writeNavState = async (root, chain, direction, index, changed = false, animation) => {
145
- try {
146
- // find next navigation outlet in the DOM
147
- const outlet = searchNavNode(root);
148
- // make sure we can continue interacting the DOM, otherwise abort
149
- if (index >= chain.length || !outlet) {
150
- return changed;
151
- }
152
- await new Promise((resolve) => componentOnReady(outlet, resolve));
153
- const route = chain[index];
154
- const result = await outlet.setRouteId(route.id, route.params, direction, animation);
155
- // if the outlet changed the page, reset navigation to neutral (no direction)
156
- // this means nested outlets will not animate
157
- if (result.changed) {
158
- direction = ROUTER_INTENT_NONE;
159
- changed = true;
160
- }
161
- // recursively set nested outlets
162
- changed = await writeNavState(result.element, chain, direction, index + 1, changed, animation);
163
- // once all nested outlets are visible let's make the parent visible too,
164
- // using markVisible prevents flickering
165
- if (result.markVisible) {
166
- await result.markVisible();
167
- }
168
- return changed;
169
- }
170
- catch (e) {
171
- printIonError('[ion-router] - Exception in writeNavState:', e);
172
- return false;
173
- }
174
- };
175
- /**
176
- * Recursively walks the outlet in the DOM.
177
- *
178
- * The function returns a list of RouteID corresponding to each of the outlet and the last outlet without a RouteID.
179
- */
180
- const readNavState = async (root) => {
181
- const ids = [];
182
- let outlet;
183
- let node = root;
184
- // eslint-disable-next-line no-cond-assign
185
- while ((outlet = searchNavNode(node))) {
186
- const id = await outlet.getRouteId();
187
- if (id) {
188
- node = id.element;
189
- id.element = undefined;
190
- ids.push(id);
191
- }
192
- else {
193
- break;
194
- }
195
- }
196
- return { ids, outlet };
197
- };
198
- const waitUntilNavNode = () => {
199
- if (searchNavNode(document.body)) {
200
- return Promise.resolve();
201
- }
202
- return new Promise((resolve) => {
203
- window.addEventListener('ionNavWillLoad', () => resolve(), { once: true });
204
- });
205
- };
206
- /** Selector for all the outlets supported by the router. */
207
- const OUTLET_SELECTOR = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';
208
- const searchNavNode = (root) => {
209
- if (!root) {
210
- return undefined;
211
- }
212
- if (root.matches(OUTLET_SELECTOR)) {
213
- return root;
214
- }
215
- const outlet = root.querySelector(OUTLET_SELECTOR);
216
- return outlet !== null && outlet !== void 0 ? outlet : undefined;
217
- };
218
-
219
- /**
220
- * Returns whether the given redirect matches the given path segments.
221
- *
222
- * A redirect matches when the segments of the path and redirect.from are equal.
223
- * Note that segments are only checked until redirect.from contains a '*' which matches any path segment.
224
- * The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].
225
- */
226
- const matchesRedirect = (segments, redirect) => {
227
- const { from, to } = redirect;
228
- if (to === undefined) {
229
- return false;
230
- }
231
- if (from.length > segments.length) {
232
- return false;
233
- }
234
- for (let i = 0; i < from.length; i++) {
235
- const expected = from[i];
236
- if (expected === '*') {
237
- return true;
238
- }
239
- if (expected !== segments[i]) {
240
- return false;
241
- }
242
- }
243
- return from.length === segments.length;
244
- };
245
- /** Returns the first redirect matching the path segments or undefined when no match found. */
246
- const findRouteRedirect = (segments, redirects) => {
247
- return redirects.find((redirect) => matchesRedirect(segments, redirect));
248
- };
249
- const matchesIDs = (ids, chain) => {
250
- const len = Math.min(ids.length, chain.length);
251
- let score = 0;
252
- for (let i = 0; i < len; i++) {
253
- const routeId = ids[i];
254
- const routeChain = chain[i];
255
- // Skip results where the route id does not match the chain at the same index
256
- if (routeId.id.toLowerCase() !== routeChain.id) {
257
- break;
258
- }
259
- if (routeId.params) {
260
- const routeIdParams = Object.keys(routeId.params);
261
- // Only compare routes with the chain that have the same number of parameters.
262
- if (routeIdParams.length === routeChain.segments.length) {
263
- // Maps the route's params into a path based on the path variable names,
264
- // to compare against the route chain format.
265
- //
266
- // Before:
267
- // ```ts
268
- // {
269
- // params: {
270
- // s1: 'a',
271
- // s2: 'b'
272
- // }
273
- // }
274
- // ```
275
- //
276
- // After:
277
- // ```ts
278
- // [':s1',':s2']
279
- // ```
280
- //
281
- const pathWithParams = routeIdParams.map((key) => `:${key}`);
282
- for (let j = 0; j < pathWithParams.length; j++) {
283
- // Skip results where the path variable is not a match
284
- if (pathWithParams[j].toLowerCase() !== routeChain.segments[j]) {
285
- break;
286
- }
287
- // Weight path matches for the same index higher.
288
- score++;
289
- }
290
- }
291
- }
292
- // Weight id matches
293
- score++;
294
- }
295
- return score;
296
- };
297
- /**
298
- * Matches the segments against the chain.
299
- *
300
- * Returns:
301
- * - null when there is no match,
302
- * - a chain with the params properties updated with the parameter segments on match.
303
- */
304
- const matchesSegments = (segments, chain) => {
305
- const inputSegments = new RouterSegments(segments);
306
- let matchesDefault = false;
307
- let allparams;
308
- for (let i = 0; i < chain.length; i++) {
309
- const chainSegments = chain[i].segments;
310
- if (chainSegments[0] === '') {
311
- matchesDefault = true;
312
- }
313
- else {
314
- for (const segment of chainSegments) {
315
- const data = inputSegments.next();
316
- // data param
317
- if (segment[0] === ':') {
318
- if (data === '') {
319
- return null;
320
- }
321
- allparams = allparams || [];
322
- const params = allparams[i] || (allparams[i] = {});
323
- params[segment.slice(1)] = data;
324
- }
325
- else if (data !== segment) {
326
- return null;
327
- }
328
- }
329
- matchesDefault = false;
330
- }
331
- }
332
- const matches = matchesDefault ? matchesDefault === (inputSegments.next() === '') : true;
333
- if (!matches) {
334
- return null;
335
- }
336
- if (allparams) {
337
- return chain.map((route, i) => ({
338
- id: route.id,
339
- segments: route.segments,
340
- params: mergeParams(route.params, allparams[i]),
341
- beforeEnter: route.beforeEnter,
342
- beforeLeave: route.beforeLeave,
343
- }));
344
- }
345
- return chain;
346
- };
347
- /**
348
- * Merges the route parameter objects.
349
- * Returns undefined when both parameters are undefined.
350
- */
351
- const mergeParams = (a, b) => {
352
- return a || b ? Object.assign(Object.assign({}, a), b) : undefined;
353
- };
354
- /**
355
- * Finds the best match for the ids in the chains.
356
- *
357
- * Returns the best match or null when no match is found.
358
- * When a chain is returned the parameters are updated from the RouteIDs.
359
- * That is they contain both the componentProps of the <ion-route> and the parameter segment.
360
- */
361
- const findChainForIDs = (ids, chains) => {
362
- let match = null;
363
- let maxMatches = 0;
364
- for (const chain of chains) {
365
- const score = matchesIDs(ids, chain);
366
- if (score > maxMatches) {
367
- match = chain;
368
- maxMatches = score;
369
- }
370
- }
371
- if (match) {
372
- return match.map((route, i) => {
373
- var _a;
374
- return ({
375
- id: route.id,
376
- segments: route.segments,
377
- params: mergeParams(route.params, (_a = ids[i]) === null || _a === void 0 ? void 0 : _a.params),
378
- });
379
- });
380
- }
381
- return null;
382
- };
383
- /**
384
- * Finds the best match for the segments in the chains.
385
- *
386
- * Returns the best match or null when no match is found.
387
- * When a chain is returned the parameters are updated from the segments.
388
- * That is they contain both the componentProps of the <ion-route> and the parameter segments.
389
- */
390
- const findChainForSegments = (segments, chains) => {
391
- let match = null;
392
- let bestScore = 0;
393
- for (const chain of chains) {
394
- const matchedChain = matchesSegments(segments, chain);
395
- if (matchedChain !== null) {
396
- const score = computePriority(matchedChain);
397
- if (score > bestScore) {
398
- bestScore = score;
399
- match = matchedChain;
400
- }
401
- }
402
- }
403
- return match;
404
- };
405
- /**
406
- * Computes the priority of a chain.
407
- *
408
- * Parameter segments are given a lower priority over fixed segments.
409
- *
410
- * Considering the following 2 chains matching the path /path/to/page:
411
- * - /path/to/:where
412
- * - /path/to/page
413
- *
414
- * The second one will be given a higher priority because "page" is a fixed segment (vs ":where", a parameter segment).
415
- */
416
- const computePriority = (chain) => {
417
- let score = 1;
418
- let level = 1;
419
- for (const route of chain) {
420
- for (const segment of route.segments) {
421
- if (segment[0] === ':') {
422
- score += Math.pow(1, level);
423
- }
424
- else if (segment !== '') {
425
- score += Math.pow(2, level);
426
- }
427
- level++;
428
- }
429
- }
430
- return score;
431
- };
432
- class RouterSegments {
433
- constructor(segments) {
434
- this.segments = segments.slice();
435
- }
436
- next() {
437
- if (this.segments.length > 0) {
438
- return this.segments.shift();
439
- }
440
- return '';
441
- }
442
- }
443
-
444
- const readProp = (el, prop) => {
445
- if (prop in el) {
446
- return el[prop];
447
- }
448
- if (el.hasAttribute(prop)) {
449
- return el.getAttribute(prop);
450
- }
451
- return null;
452
- };
453
- /**
454
- * Extracts the redirects (that is <ion-route-redirect> elements inside the root).
455
- *
456
- * The redirects are returned as a list of RouteRedirect.
457
- */
458
- const readRedirects = (root) => {
459
- return Array.from(root.children)
460
- .filter((el) => el.tagName === 'ION-ROUTE-REDIRECT')
461
- .map((el) => {
462
- const to = readProp(el, 'to');
463
- return {
464
- from: parsePath(readProp(el, 'from')).segments,
465
- to: to == null ? undefined : parsePath(to),
466
- };
467
- });
468
- };
469
- /**
470
- * Extracts all the routes (that is <ion-route> elements inside the root).
471
- *
472
- * The routes are returned as a list of chains - the flattened tree.
473
- */
474
- const readRoutes = (root) => {
475
- return flattenRouterTree(readRouteNodes(root));
476
- };
477
- /**
478
- * Reads the route nodes as a tree modeled after the DOM tree of <ion-route> elements.
479
- *
480
- * Note: routes without a component are ignored together with their children.
481
- */
482
- const readRouteNodes = (node) => {
483
- return Array.from(node.children)
484
- .filter((el) => el.tagName === 'ION-ROUTE' && el.component)
485
- .map((el) => {
486
- const component = readProp(el, 'component');
487
- return {
488
- segments: parsePath(readProp(el, 'url')).segments,
489
- id: component.toLowerCase(),
490
- params: el.componentProps,
491
- beforeLeave: el.beforeLeave,
492
- beforeEnter: el.beforeEnter,
493
- children: readRouteNodes(el),
494
- };
495
- });
496
- };
497
- /**
498
- * Flattens a RouterTree in a list of chains.
499
- *
500
- * Each chain represents a path from the root node to a terminal node.
501
- */
502
- const flattenRouterTree = (nodes) => {
503
- const chains = [];
504
- for (const node of nodes) {
505
- flattenNode([], chains, node);
506
- }
507
- return chains;
508
- };
509
- /** Flattens a route node recursively and push each branch to the chains list. */
510
- const flattenNode = (chain, chains, node) => {
511
- chain = [
512
- ...chain,
513
- {
514
- id: node.id,
515
- segments: node.segments,
516
- params: node.params,
517
- beforeLeave: node.beforeLeave,
518
- beforeEnter: node.beforeEnter,
519
- },
520
- ];
521
- if (node.children.length === 0) {
522
- chains.push(chain);
523
- return;
524
- }
525
- for (const child of node.children) {
526
- flattenNode(chain, chains, child);
527
- }
528
- };
529
-
530
- const Router = /*@__PURE__*/ proxyCustomElement(class Router extends H {
531
- constructor(registerHost) {
532
- super();
533
- if (registerHost !== false) {
534
- this.__registerHost();
535
- }
536
- this.ionRouteWillChange = createEvent(this, "ionRouteWillChange", 7);
537
- this.ionRouteDidChange = createEvent(this, "ionRouteDidChange", 7);
538
- this.previousPath = null;
539
- this.busy = false;
540
- this.state = 0;
541
- this.lastState = 0;
542
- /**
543
- * The root path to use when matching URLs. By default, this is set to "/", but you can specify
544
- * an alternate prefix for all URL paths.
545
- */
546
- this.root = '/';
547
- /**
548
- * The router can work in two "modes":
549
- * - With hash: `/index.html#/path/to/page`
550
- * - Without hash: `/path/to/page`
551
- *
552
- * Using one or another might depend in the requirements of your app and/or where it's deployed.
553
- *
554
- * Usually "hash-less" navigation works better for SEO and it's more user friendly too, but it might
555
- * requires additional server-side configuration in order to properly work.
556
- *
557
- * On the other side hash-navigation is much easier to deploy, it even works over the file protocol.
558
- *
559
- * By default, this property is `true`, change to `false` to allow hash-less URLs.
560
- */
561
- this.useHash = true;
562
- }
563
- async componentWillLoad() {
564
- await waitUntilNavNode();
565
- const canProceed = await this.runGuards(this.getSegments());
566
- if (canProceed !== true) {
567
- if (typeof canProceed === 'object') {
568
- const { redirect } = canProceed;
569
- const path = parsePath(redirect);
570
- this.setSegments(path.segments, ROUTER_INTENT_NONE, path.queryString);
571
- await this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);
572
- }
573
- }
574
- else {
575
- await this.onRoutesChanged();
576
- }
577
- }
578
- componentDidLoad() {
579
- window.addEventListener('ionRouteRedirectChanged', debounce(this.onRedirectChanged.bind(this), 10));
580
- window.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));
581
- }
582
- async onPopState() {
583
- const direction = this.historyDirection();
584
- let segments = this.getSegments();
585
- const canProceed = await this.runGuards(segments);
586
- if (canProceed !== true) {
587
- if (typeof canProceed === 'object') {
588
- segments = parsePath(canProceed.redirect).segments;
589
- }
590
- else {
591
- return false;
592
- }
593
- }
594
- return this.writeNavStateRoot(segments, direction);
595
- }
596
- onBackButton(ev) {
597
- ev.detail.register(0, (processNextHandler) => {
598
- this.back();
599
- processNextHandler();
600
- });
601
- }
602
- /** @internal */
603
- async canTransition() {
604
- const canProceed = await this.runGuards();
605
- if (canProceed !== true) {
606
- if (typeof canProceed === 'object') {
607
- return canProceed.redirect;
608
- }
609
- else {
610
- return false;
611
- }
612
- }
613
- return true;
614
- }
615
- /**
616
- * Navigate to the specified path.
617
- *
618
- * @param path The path to navigate to.
619
- * @param direction The direction of the animation. Defaults to `"forward"`.
620
- * @param animation A custom animation to use for the transition.
621
- */
622
- async push(path, direction = 'forward', animation) {
623
- var _a;
624
- if (path.startsWith('.')) {
625
- const currentPath = (_a = this.previousPath) !== null && _a !== void 0 ? _a : '/';
626
- // Convert currentPath to an URL by pre-pending a protocol and a host to resolve the relative path.
627
- const url = new URL(path, `https://host/${currentPath}`);
628
- path = url.pathname + url.search;
629
- }
630
- let parsedPath = parsePath(path);
631
- const canProceed = await this.runGuards(parsedPath.segments);
632
- if (canProceed !== true) {
633
- if (typeof canProceed === 'object') {
634
- parsedPath = parsePath(canProceed.redirect);
635
- }
636
- else {
637
- return false;
638
- }
639
- }
640
- this.setSegments(parsedPath.segments, direction, parsedPath.queryString);
641
- return this.writeNavStateRoot(parsedPath.segments, direction, animation);
642
- }
643
- /** Go back to previous page in the window.history. */
644
- back() {
645
- window.history.back();
646
- return Promise.resolve(this.waitPromise);
647
- }
648
- /** @internal */
649
- async printDebug() {
650
- printRoutes(readRoutes(this.el));
651
- printRedirects(readRedirects(this.el));
652
- }
653
- /** @internal */
654
- async navChanged(direction) {
655
- if (this.busy) {
656
- printIonWarning('[ion-router] - Router is busy, navChanged was cancelled.');
657
- return false;
658
- }
659
- const { ids, outlet } = await readNavState(window.document.body);
660
- const routes = readRoutes(this.el);
661
- const chain = findChainForIDs(ids, routes);
662
- if (!chain) {
663
- printIonWarning('[ion-router] - No matching URL for', ids.map((i) => i.id));
664
- return false;
665
- }
666
- const segments = chainToSegments(chain);
667
- if (!segments) {
668
- printIonWarning('[ion-router] - Router could not match path because some required param is missing.');
669
- return false;
670
- }
671
- this.setSegments(segments, direction);
672
- await this.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, segments, null, ids.length);
673
- return true;
674
- }
675
- /** This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes. */
676
- onRedirectChanged() {
677
- const segments = this.getSegments();
678
- if (segments && findRouteRedirect(segments, readRedirects(this.el))) {
679
- this.writeNavStateRoot(segments, ROUTER_INTENT_NONE);
680
- }
681
- }
682
- /** This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes. */
683
- onRoutesChanged() {
684
- return this.writeNavStateRoot(this.getSegments(), ROUTER_INTENT_NONE);
685
- }
686
- historyDirection() {
687
- var _a;
688
- const win = window;
689
- if (win.history.state === null) {
690
- this.state++;
691
- win.history.replaceState(this.state, win.document.title, (_a = win.document.location) === null || _a === void 0 ? void 0 : _a.href);
692
- }
693
- const state = win.history.state;
694
- const lastState = this.lastState;
695
- this.lastState = state;
696
- if (state > lastState || (state >= lastState && lastState > 0)) {
697
- return ROUTER_INTENT_FORWARD;
698
- }
699
- if (state < lastState) {
700
- return ROUTER_INTENT_BACK;
701
- }
702
- return ROUTER_INTENT_NONE;
703
- }
704
- async writeNavStateRoot(segments, direction, animation) {
705
- if (!segments) {
706
- printIonError('[ion-router] - URL is not part of the routing set.');
707
- return false;
708
- }
709
- // lookup redirect rule
710
- const redirects = readRedirects(this.el);
711
- const redirect = findRouteRedirect(segments, redirects);
712
- let redirectFrom = null;
713
- if (redirect) {
714
- const { segments: toSegments, queryString } = redirect.to;
715
- this.setSegments(toSegments, direction, queryString);
716
- redirectFrom = redirect.from;
717
- segments = toSegments;
718
- }
719
- // lookup route chain
720
- const routes = readRoutes(this.el);
721
- const chain = findChainForSegments(segments, routes);
722
- if (!chain) {
723
- printIonError('[ion-router] - The path does not match any route.');
724
- return false;
725
- }
726
- // write DOM give
727
- return this.safeWriteNavState(document.body, chain, direction, segments, redirectFrom, 0, animation);
728
- }
729
- async safeWriteNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {
730
- const unlock = await this.lock();
731
- let changed = false;
732
- try {
733
- changed = await this.writeNavState(node, chain, direction, segments, redirectFrom, index, animation);
734
- }
735
- catch (e) {
736
- printIonError('[ion-router] - Exception in safeWriteNavState:', e);
737
- }
738
- unlock();
739
- return changed;
740
- }
741
- async lock() {
742
- const p = this.waitPromise;
743
- let resolve;
744
- this.waitPromise = new Promise((r) => (resolve = r));
745
- if (p !== undefined) {
746
- await p;
747
- }
748
- return resolve;
749
- }
750
- /**
751
- * Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.
752
- *
753
- * When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.
754
- * Otherwise the beforeEnterHook hook of the target route is executed.
755
- */
756
- async runGuards(to = this.getSegments(), from) {
757
- if (from === undefined) {
758
- from = parsePath(this.previousPath).segments;
759
- }
760
- if (!to || !from) {
761
- return true;
762
- }
763
- const routes = readRoutes(this.el);
764
- const fromChain = findChainForSegments(from, routes);
765
- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
766
- const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;
767
- const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;
768
- if (canLeave === false || typeof canLeave === 'object') {
769
- return canLeave;
770
- }
771
- const toChain = findChainForSegments(to, routes);
772
- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
773
- const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;
774
- return beforeEnterHook ? beforeEnterHook() : true;
775
- }
776
- async writeNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {
777
- if (this.busy) {
778
- printIonWarning('[ion-router] - Router is busy, transition was cancelled.');
779
- return false;
780
- }
781
- this.busy = true;
782
- // generate route event and emit will change
783
- const routeEvent = this.routeChangeEvent(segments, redirectFrom);
784
- if (routeEvent) {
785
- this.ionRouteWillChange.emit(routeEvent);
786
- }
787
- const changed = await writeNavState(node, chain, direction, index, false, animation);
788
- this.busy = false;
789
- // emit did change
790
- if (routeEvent) {
791
- this.ionRouteDidChange.emit(routeEvent);
792
- }
793
- return changed;
794
- }
795
- setSegments(segments, direction, queryString) {
796
- this.state++;
797
- writeSegments(window.history, this.root, this.useHash, segments, direction, this.state, queryString);
798
- }
799
- getSegments() {
800
- return readSegments(window.location, this.root, this.useHash);
801
- }
802
- routeChangeEvent(toSegments, redirectFromSegments) {
803
- const from = this.previousPath;
804
- const to = generatePath(toSegments);
805
- this.previousPath = to;
806
- if (to === from) {
807
- return null;
808
- }
809
- const redirectedFrom = redirectFromSegments ? generatePath(redirectFromSegments) : null;
810
- return {
811
- from,
812
- redirectedFrom,
813
- to,
814
- };
815
- }
816
- get el() { return this; }
817
- }, [0, "ion-router", {
818
- "root": [1],
819
- "useHash": [4, "use-hash"],
820
- "canTransition": [64],
821
- "push": [64],
822
- "back": [64],
823
- "printDebug": [64],
824
- "navChanged": [64]
825
- }, [[8, "popstate", "onPopState"], [4, "ionBackButton", "onBackButton"]]]);
826
- function defineCustomElement$1() {
827
- if (typeof customElements === "undefined") {
828
- return;
829
- }
830
- const components = ["ion-router"];
831
- components.forEach(tagName => { switch (tagName) {
832
- case "ion-router":
833
- if (!customElements.get(tagName)) {
834
- customElements.define(tagName, Router);
835
- }
836
- break;
837
- } });
838
- }
839
-
840
- const IonRouter = Router;
841
- const defineCustomElement = defineCustomElement$1;
842
-
843
- export { IonRouter, defineCustomElement };
4
+ import{j as t,p as n,H as o,e,f as r,t as s}from"./p-BJoMtgfR.js";import{c as i,p as a}from"./p-DgbT0exM.js";const c="root",u="forward",h=t=>"/"+t.filter((t=>t.length>0)).join("/"),l=t=>{let n,o=[""];if(null!=t){const e=t.indexOf("?");e>-1&&(n=t.substring(e+1),t=t.substring(0,e)),o=t.split("/").map((t=>t.trim())).filter((t=>t.length>0)),0===o.length&&(o=[""])}return{segments:o,queryString:n}},f=async(n,o,e,r,s=!1,a)=>{try{const t=w(n);if(r>=o.length||!t)return s;await new Promise((n=>i(t,n)));const u=o[r],h=await t.setRouteId(u.id,u.params,e,a);return h.changed&&(e=c,s=!0),s=await f(h.element,o,e,r+1,s,a),h.markVisible&&await h.markVisible(),s}catch(n){return t("[ion-router] - Exception in writeNavState:",n),!1}},d=":not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet",w=t=>{if(!t)return;if(t.matches(d))return t;const n=t.querySelector(d);return null!=n?n:void 0},m=(t,n)=>n.find((n=>((t,n)=>{const{from:o,to:e}=n;if(void 0===e)return!1;if(o.length>t.length)return!1;for(let n=0;n<o.length;n++){const e=o[n];if("*"===e)return!0;if(e!==t[n])return!1}return o.length===t.length})(t,n))),p=(t,n)=>{const o=Math.min(t.length,n.length);let e=0;for(let r=0;r<o;r++){const o=t[r],s=n[r];if(o.id.toLowerCase()!==s.id)break;if(o.params){const t=Object.keys(o.params);if(t.length===s.segments.length){const n=t.map((t=>":"+t));for(let t=0;t<n.length&&n[t].toLowerCase()===s.segments[t];t++)e++}}e++}return e},g=(t,n)=>{const o=new R(t);let e,r=!1;for(let t=0;t<n.length;t++){const s=n[t].segments;if(""===s[0])r=!0;else{for(const n of s){const r=o.next();if(":"===n[0]){if(""===r)return null;e=e||[],(e[t]||(e[t]={}))[n.slice(1)]=r}else if(r!==n)return null}r=!1}}return r&&r!==(""===o.next())?null:e?n.map(((t,n)=>({id:t.id,segments:t.segments,params:v(t.params,e[n]),beforeEnter:t.beforeEnter,beforeLeave:t.beforeLeave}))):n},v=(t,n)=>t||n?Object.assign(Object.assign({},t),n):void 0,b=(t,n)=>{let o=null,e=0;for(const r of n){const n=g(t,r);if(null!==n){const t=y(n);t>e&&(e=t,o=n)}}return o},y=t=>{let n=1,o=1;for(const e of t)for(const t of e.segments)":"===t[0]?n+=Math.pow(1,o):""!==t&&(n+=Math.pow(2,o)),o++;return n};class R{constructor(t){this.segments=t.slice()}next(){return this.segments.length>0?this.segments.shift():""}}const E=(t,n)=>n in t?t[n]:t.hasAttribute(n)?t.getAttribute(n):null,S=t=>Array.from(t.children).filter((t=>"ION-ROUTE-REDIRECT"===t.tagName)).map((t=>{const n=E(t,"to");return{from:l(E(t,"from")).segments,to:null==n?void 0:l(n)}})),C=t=>O(j(t)),j=t=>Array.from(t.children).filter((t=>"ION-ROUTE"===t.tagName&&t.component)).map((t=>{const n=E(t,"component");return{segments:l(E(t,"url")).segments,id:n.toLowerCase(),params:t.componentProps,beforeLeave:t.beforeLeave,beforeEnter:t.beforeEnter,children:j(t)}})),O=t=>{const n=[];for(const o of t)T([],n,o);return n},T=(t,n,o)=>{if(t=[...t,{id:o.id,segments:o.segments,params:o.params,beforeLeave:o.beforeLeave,beforeEnter:o.beforeEnter}],0!==o.children.length)for(const e of o.children)T(t,n,e);else n.push(t)},k=n(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.ionRouteWillChange=e(this,"ionRouteWillChange",7),this.ionRouteDidChange=e(this,"ionRouteDidChange",7),this.previousPath=null,this.busy=!1,this.state=0,this.lastState=0,this.root="/",this.useHash=!0}async componentWillLoad(){await(w(document.body)?Promise.resolve():new Promise((t=>{window.addEventListener("ionNavWillLoad",(()=>t()),{once:!0})})));const t=await this.runGuards(this.getSegments());if(!0!==t){if("object"==typeof t){const{redirect:n}=t,o=l(n);this.setSegments(o.segments,c,o.queryString),await this.writeNavStateRoot(o.segments,c)}}else await this.onRoutesChanged()}componentDidLoad(){window.addEventListener("ionRouteRedirectChanged",a(this.onRedirectChanged.bind(this),10)),window.addEventListener("ionRouteDataChanged",a(this.onRoutesChanged.bind(this),100))}async onPopState(){const t=this.historyDirection();let n=this.getSegments();const o=await this.runGuards(n);if(!0!==o){if("object"!=typeof o)return!1;n=l(o.redirect).segments}return this.writeNavStateRoot(n,t)}onBackButton(t){t.detail.register(0,(t=>{this.back(),t()}))}async canTransition(){const t=await this.runGuards();return!0===t||"object"==typeof t&&t.redirect}async push(t,n="forward",o){var e;if(t.startsWith(".")){const n=null!==(e=this.previousPath)&&void 0!==e?e:"/",o=new URL(t,"https://host/"+n);t=o.pathname+o.search}let r=l(t);const s=await this.runGuards(r.segments);if(!0!==s){if("object"!=typeof s)return!1;r=l(s.redirect)}return this.setSegments(r.segments,n,r.queryString),this.writeNavStateRoot(r.segments,n,o)}back(){return window.history.back(),Promise.resolve(this.waitPromise)}async printDebug(){(t=>{console.group(`[ion-core] ROUTES[${t.length}]`);for(const n of t){const t=[];n.forEach((n=>t.push(...n.segments)));const o=n.map((t=>t.id));console.debug("%c "+h(t),"font-weight: bold; padding-left: 20px","=>\t",`(${o.join(", ")})`)}console.groupEnd()})(C(this.el)),(t=>{console.group(`[ion-core] REDIRECTS[${t.length}]`);for(const n of t)n.to&&console.debug("FROM: ","$c "+h(n.from),"font-weight: bold"," TO: ","$c "+h(n.to.segments),"font-weight: bold");console.groupEnd()})(S(this.el))}async navChanged(t){if(this.busy)return r("[ion-router] - Router is busy, navChanged was cancelled."),!1;const{ids:n,outlet:o}=await(async()=>{const t=[];let n,o=window.document.body;for(;n=w(o);){const e=await n.getRouteId();if(!e)break;o=e.element,e.element=void 0,t.push(e)}return{ids:t,outlet:n}})(),e=((t,n)=>{let o=null,e=0;for(const r of n){const n=p(t,r);n>e&&(o=r,e=n)}return o?o.map(((n,o)=>{var e;return{id:n.id,segments:n.segments,params:v(n.params,null===(e=t[o])||void 0===e?void 0:e.params)}})):null})(n,C(this.el));if(!e)return r("[ion-router] - No matching URL for",n.map((t=>t.id))),!1;const s=(t=>{const n=[];for(const o of t)for(const t of o.segments)if(":"===t[0]){const e=o.params&&o.params[t.slice(1)];if(!e)return null;n.push(e)}else""!==t&&n.push(t);return n})(e);return s?(this.setSegments(s,t),await this.safeWriteNavState(o,e,c,s,null,n.length),!0):(r("[ion-router] - Router could not match path because some required param is missing."),!1)}onRedirectChanged(){const t=this.getSegments();t&&m(t,S(this.el))&&this.writeNavStateRoot(t,c)}onRoutesChanged(){return this.writeNavStateRoot(this.getSegments(),c)}historyDirection(){var t;const n=window;null===n.history.state&&(this.state++,n.history.replaceState(this.state,n.document.title,null===(t=n.document.location)||void 0===t?void 0:t.href));const o=n.history.state,e=this.lastState;return this.lastState=o,o>e||o>=e&&e>0?u:o<e?"back":c}async writeNavStateRoot(n,o,e){if(!n)return t("[ion-router] - URL is not part of the routing set."),!1;const r=S(this.el),s=m(n,r);let i=null;if(s){const{segments:t,queryString:e}=s.to;this.setSegments(t,o,e),i=s.from,n=t}const a=C(this.el),c=b(n,a);return c?this.safeWriteNavState(document.body,c,o,n,i,0,e):(t("[ion-router] - The path does not match any route."),!1)}async safeWriteNavState(n,o,e,r,s,i=0,a){const c=await this.lock();let u=!1;try{u=await this.writeNavState(n,o,e,r,s,i,a)}catch(n){t("[ion-router] - Exception in safeWriteNavState:",n)}return c(),u}async lock(){const t=this.waitPromise;let n;return this.waitPromise=new Promise((t=>n=t)),void 0!==t&&await t,n}async runGuards(t=this.getSegments(),n){if(void 0===n&&(n=l(this.previousPath).segments),!t||!n)return!0;const o=C(this.el),e=b(n,o),r=e&&e[e.length-1].beforeLeave,s=!r||await r();if(!1===s||"object"==typeof s)return s;const i=b(t,o),a=i&&i[i.length-1].beforeEnter;return!a||a()}async writeNavState(t,n,o,e,s,i=0,a){if(this.busy)return r("[ion-router] - Router is busy, transition was cancelled."),!1;this.busy=!0;const c=this.routeChangeEvent(e,s);c&&this.ionRouteWillChange.emit(c);const u=await f(t,n,o,i,!1,a);return this.busy=!1,c&&this.ionRouteDidChange.emit(c),u}setSegments(t,n,o){this.state++,((t,n,o,e,r,s,i)=>{const a=((t,n,o)=>{let e=h(t);return n&&(e="#"+e),void 0!==o&&(e+="?"+o),e})([...l(n).segments,...e],o,i);r===u?t.pushState(s,"",a):t.replaceState(s,"",a)})(window.history,this.root,this.useHash,t,n,this.state,o)}getSegments(){return((t,n,o)=>{const e=l(this.root).segments,r=o?t.hash.slice(1):t.pathname;return((t,n)=>{if(t.length>n.length)return null;if(t.length<=1&&""===t[0])return n;for(let o=0;o<t.length;o++)if(t[o]!==n[o])return null;return n.length===t.length?[""]:n.slice(t.length)})(e,l(r).segments)})(window.location,0,this.useHash)}routeChangeEvent(t,n){const o=this.previousPath,e=h(t);return this.previousPath=e,e===o?null:{from:o,redirectedFrom:n?h(n):null,to:e}}get el(){return this}},[0,"ion-router",{root:[1],useHash:[4,"use-hash"],canTransition:[64],push:[64],back:[64],printDebug:[64],navChanged:[64]},[[8,"popstate","onPopState"],[4,"ionBackButton","onBackButton"]]]),D=k,L=function(){"undefined"!=typeof customElements&&["ion-router"].forEach((t=>{"ion-router"===t&&(customElements.get(s(t))||customElements.define(s(t),k))}))};export{D as IonRouter,L as defineCustomElement}