smoothly 1.0.0-alpha.21 → 1.0.0-alpha.211

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 (549) hide show
  1. package/dist/cjs/{Listenable-63ea2d90.js → Data-ae713814.js} +523 -6
  2. package/dist/cjs/Data-ae713814.js.map +1 -0
  3. package/dist/cjs/Observers-6450f075.js +25 -0
  4. package/dist/cjs/Observers-6450f075.js.map +1 -0
  5. package/dist/cjs/TimeZone-016ac7b0.js +6181 -0
  6. package/dist/cjs/TimeZone-016ac7b0.js.map +1 -0
  7. package/dist/cjs/getLanguage-49a534df.js +6118 -0
  8. package/dist/cjs/getLanguage-49a534df.js.map +1 -0
  9. package/dist/cjs/{index-8adc5c1b.js → index-43af753b.js} +55 -2
  10. package/dist/cjs/index-43af753b.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +22 -17
  12. package/dist/cjs/index.cjs.js.map +1 -1
  13. package/dist/cjs/loader.cjs.js +4 -3
  14. package/dist/cjs/loader.cjs.js.map +1 -1
  15. package/dist/cjs/{Notice-88ba4c70.js → redirect-2e5d4524.js} +11 -2
  16. package/dist/cjs/redirect-2e5d4524.js.map +1 -0
  17. package/dist/cjs/smoothly-accordion-item.cjs.entry.js +61 -0
  18. package/dist/cjs/smoothly-accordion-item.cjs.entry.js.map +1 -0
  19. package/dist/cjs/smoothly-accordion.cjs.entry.js +58 -0
  20. package/dist/cjs/smoothly-accordion.cjs.entry.js.map +1 -0
  21. package/dist/cjs/smoothly-address-display.cjs.entry.js +1 -1
  22. package/dist/cjs/smoothly-address.cjs.entry.js +1 -1
  23. package/dist/cjs/smoothly-addresses.cjs.entry.js +1 -1
  24. package/dist/cjs/smoothly-app_80.cjs.entry.js +10897 -0
  25. package/dist/cjs/smoothly-app_80.cjs.entry.js.map +1 -0
  26. package/dist/cjs/smoothly-checkbox.cjs.entry.js +102 -0
  27. package/dist/cjs/smoothly-checkbox.cjs.entry.js.map +1 -0
  28. package/dist/cjs/smoothly-color.cjs.entry.js +1 -1
  29. package/dist/cjs/smoothly-country.cjs.entry.js +56 -55
  30. package/dist/cjs/smoothly-country.cjs.entry.js.map +1 -1
  31. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +26 -0
  32. package/dist/cjs/smoothly-display-date-time.cjs.entry.js.map +1 -0
  33. package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
  34. package/dist/cjs/smoothly-reorder.cjs.entry.js +1 -1
  35. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +4 -4
  36. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js.map +1 -1
  37. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +6 -6
  38. package/dist/cjs/smoothly-trigger-source.cjs.entry.js.map +1 -1
  39. package/dist/cjs/smoothly.cjs.js +4 -3
  40. package/dist/cjs/smoothly.cjs.js.map +1 -1
  41. package/dist/collection/collection-manifest.json +37 -15
  42. package/dist/collection/components/Button.js +16 -2
  43. package/dist/collection/components/Button.js.map +1 -1
  44. package/dist/collection/components/accordion/index.js +32 -12
  45. package/dist/collection/components/accordion/index.js.map +1 -1
  46. package/dist/collection/components/accordion-item/index.js +18 -25
  47. package/dist/collection/components/accordion-item/index.js.map +1 -1
  48. package/dist/collection/components/app/index.js +99 -29
  49. package/dist/collection/components/app/index.js.map +1 -1
  50. package/dist/collection/components/app/room/index.js +134 -25
  51. package/dist/collection/components/app/room/index.js.map +1 -1
  52. package/dist/collection/components/app/room/style.css +39 -10
  53. package/dist/collection/components/app/style.css +104 -39
  54. package/dist/collection/components/app-demo/index.js +1 -1
  55. package/dist/collection/components/app-demo/index.js.map +1 -1
  56. package/dist/collection/components/backtotop/index.js +3 -3
  57. package/dist/collection/components/backtotop/index.js.map +1 -1
  58. package/dist/collection/components/burger/index.js +60 -14
  59. package/dist/collection/components/burger/index.js.map +1 -1
  60. package/dist/collection/components/burger/style.css +2 -2
  61. package/dist/collection/components/button/index.js +10 -23
  62. package/dist/collection/components/button/index.js.map +1 -1
  63. package/dist/collection/components/button/style.css +33 -35
  64. package/dist/collection/components/button-demo/index.js +4 -2
  65. package/dist/collection/components/button-demo/index.js.map +1 -1
  66. package/dist/collection/components/button-demo/style.css +1 -0
  67. package/dist/collection/components/calendar/generate.js +1 -1
  68. package/dist/collection/components/calendar/generate.js.map +1 -1
  69. package/dist/collection/components/calendar/index.js +16 -16
  70. package/dist/collection/components/calendar/index.js.map +1 -1
  71. package/dist/collection/components/checkbox/index.js +82 -29
  72. package/dist/collection/components/checkbox/index.js.map +1 -1
  73. package/dist/collection/components/checkbox/style.css +39 -42
  74. package/dist/collection/components/confirm/index.js +261 -0
  75. package/dist/collection/components/confirm/index.js.map +1 -0
  76. package/dist/collection/components/confirm/style.css +15 -0
  77. package/dist/collection/components/country/index.js +1 -1
  78. package/dist/collection/components/display/index.js +6 -3
  79. package/dist/collection/components/display/index.js.map +1 -1
  80. package/dist/collection/components/display-amount/index.js +1 -1
  81. package/dist/collection/components/display-demo/index.js +16 -1
  82. package/dist/collection/components/display-demo/index.js.map +1 -1
  83. package/dist/collection/components/filter/Filter.js +17 -0
  84. package/dist/collection/components/filter/Filter.js.map +1 -0
  85. package/dist/collection/components/filter/field/index.js +105 -0
  86. package/dist/collection/components/filter/field/index.js.map +1 -0
  87. package/dist/collection/components/filter/field/style.css +4 -0
  88. package/dist/collection/components/filter/index.js +55 -132
  89. package/dist/collection/components/filter/index.js.map +1 -1
  90. package/dist/collection/components/filter/input/index.js +64 -302
  91. package/dist/collection/components/filter/input/index.js.map +1 -1
  92. package/dist/collection/components/filter/picker/index.js +209 -0
  93. package/dist/collection/components/filter/picker/index.js.map +1 -0
  94. package/dist/collection/components/filter/picker/style.css +8 -0
  95. package/dist/collection/components/filter/style.css +56 -71
  96. package/dist/collection/components/filter/toggle/index.js +248 -0
  97. package/dist/collection/components/filter/toggle/index.js.map +1 -0
  98. package/dist/collection/components/filter/toggle/style.css +8 -0
  99. package/dist/collection/components/form/index.js +302 -35
  100. package/dist/collection/components/form/index.js.map +1 -1
  101. package/dist/collection/components/form/style.css +11 -17
  102. package/dist/collection/components/icon/index.js +29 -38
  103. package/dist/collection/components/icon/index.js.map +1 -1
  104. package/dist/collection/components/icon-demo/index.js +1 -1
  105. package/dist/collection/components/icon-demo/index.js.map +1 -1
  106. package/dist/collection/components/icon-demo/style.css +5 -6
  107. package/dist/collection/components/input/Clearable.js.map +1 -0
  108. package/dist/collection/components/input/Editable.js +18 -0
  109. package/dist/collection/components/input/Editable.js.map +1 -0
  110. package/dist/collection/components/input/Input.js +23 -0
  111. package/dist/collection/components/input/Input.js.map +1 -0
  112. package/dist/collection/components/input/Looks.js +8 -0
  113. package/dist/collection/components/input/Looks.js.map +1 -0
  114. package/dist/collection/components/input/Submittable.js +8 -0
  115. package/dist/collection/components/input/Submittable.js.map +1 -0
  116. package/dist/collection/components/input/checkbox/index.js +235 -0
  117. package/dist/collection/components/input/checkbox/index.js.map +1 -0
  118. package/dist/collection/components/input/checkbox/style.css +31 -0
  119. package/dist/collection/components/input/clear/index.js +242 -0
  120. package/dist/collection/components/input/clear/index.js.map +1 -0
  121. package/dist/collection/components/input/clear/style.css +256 -0
  122. package/dist/collection/components/input/color/index.js +226 -0
  123. package/dist/collection/components/input/color/index.js.map +1 -0
  124. package/dist/collection/components/input/color/style.css +15 -0
  125. package/dist/collection/components/{input-date-range → input/date}/index.js +153 -99
  126. package/dist/collection/components/input/date/index.js.map +1 -0
  127. package/dist/collection/components/input/date/range/index.js +443 -0
  128. package/dist/collection/components/input/date/range/index.js.map +1 -0
  129. package/dist/collection/components/input/date/range/style.css +94 -0
  130. package/dist/collection/components/input/date/style.css +83 -0
  131. package/dist/collection/components/input/demo/index.js +47 -0
  132. package/dist/collection/components/input/demo/index.js.map +1 -0
  133. package/dist/collection/components/input/demo/style.css +15 -0
  134. package/dist/collection/components/input/edit/index.js +231 -0
  135. package/dist/collection/components/input/edit/index.js.map +1 -0
  136. package/dist/collection/components/input/edit/style.css +239 -0
  137. package/dist/collection/components/input/file/index.js +305 -0
  138. package/dist/collection/components/input/file/index.js.map +1 -0
  139. package/dist/collection/components/input/file/style.css +107 -0
  140. package/dist/collection/components/input/index.js +329 -104
  141. package/dist/collection/components/input/index.js.map +1 -1
  142. package/dist/collection/components/{input-month → input/month}/index.js +8 -8
  143. package/dist/collection/components/input/month/index.js.map +1 -0
  144. package/dist/collection/components/input/radio/Selected.js +11 -0
  145. package/dist/collection/components/input/radio/Selected.js.map +1 -0
  146. package/dist/collection/components/input/radio/index.js +404 -0
  147. package/dist/collection/components/input/radio/index.js.map +1 -0
  148. package/dist/collection/components/input/radio/item/index.js +150 -0
  149. package/dist/collection/components/input/radio/item/index.js.map +1 -0
  150. package/dist/collection/components/input/radio/item/style.css +28 -0
  151. package/dist/collection/components/input/radio/style.css +66 -0
  152. package/dist/collection/components/input/range/index.js +305 -0
  153. package/dist/collection/components/input/range/index.js.map +1 -0
  154. package/dist/collection/components/input/range/style.css +154 -0
  155. package/dist/collection/components/input/reset/index.js +241 -0
  156. package/dist/collection/components/input/reset/index.js.map +1 -0
  157. package/dist/collection/components/input/reset/style.css +259 -0
  158. package/dist/collection/components/input/select/index.js +452 -0
  159. package/dist/collection/components/input/select/index.js.map +1 -0
  160. package/dist/collection/components/input/select/style.css +104 -0
  161. package/dist/collection/components/input/style.css +47 -10
  162. package/dist/collection/components/input/submit/index.js +232 -0
  163. package/dist/collection/components/input/submit/index.js.map +1 -0
  164. package/dist/collection/components/input/submit/style.css +236 -0
  165. package/dist/collection/components/item/index.js +5 -5
  166. package/dist/collection/components/item/index.js.map +1 -1
  167. package/dist/collection/components/label/index.js +81 -0
  168. package/dist/collection/components/label/index.js.map +1 -0
  169. package/dist/collection/components/label/style.css +15 -0
  170. package/dist/collection/components/lazy/index.js +73 -0
  171. package/dist/collection/components/lazy/index.js.map +1 -0
  172. package/dist/collection/components/{radio → load-more}/index.js +35 -46
  173. package/dist/collection/components/load-more/index.js.map +1 -0
  174. package/dist/collection/components/load-more/style.css +5 -0
  175. package/dist/collection/components/notification/index.js +45 -8
  176. package/dist/collection/components/notification/index.js.map +1 -1
  177. package/dist/collection/components/notification/style.css +25 -1
  178. package/dist/collection/components/notifier/style.css +1 -3
  179. package/dist/collection/components/picker/demo/index.js +91 -0
  180. package/dist/collection/components/picker/demo/index.js.map +1 -0
  181. package/dist/collection/components/picker/demo/style.css +30 -0
  182. package/dist/collection/components/picker/index.js +197 -396
  183. package/dist/collection/components/picker/index.js.map +1 -1
  184. package/dist/collection/components/picker/menu/index.js +429 -0
  185. package/dist/collection/components/picker/menu/index.js.map +1 -0
  186. package/dist/collection/components/picker/menu/style.css +44 -0
  187. package/dist/collection/components/picker/option/index.js +298 -0
  188. package/dist/collection/components/picker/option/index.js.map +1 -0
  189. package/dist/collection/components/picker/option/style.css +30 -0
  190. package/dist/collection/components/picker/slot-elements/index.js +109 -0
  191. package/dist/collection/components/picker/slot-elements/index.js.map +1 -0
  192. package/dist/collection/components/picker/slot-elements/style.css +3 -0
  193. package/dist/collection/components/picker/slotted-elements/index.js +84 -0
  194. package/dist/collection/components/picker/slotted-elements/index.js.map +1 -0
  195. package/dist/collection/components/picker/slotted-elements/style.css +3 -0
  196. package/dist/collection/components/picker/style.css +76 -136
  197. package/dist/collection/components/popup/index.js +5 -5
  198. package/dist/collection/components/popup/index.js.map +1 -1
  199. package/dist/collection/components/popup/style.css +4 -4
  200. package/dist/collection/components/select-demo/index.js +0 -87
  201. package/dist/collection/components/select-demo/index.js.map +1 -1
  202. package/dist/collection/components/spinner/style.css +1 -0
  203. package/dist/collection/components/submit/index.js +64 -5
  204. package/dist/collection/components/submit/index.js.map +1 -1
  205. package/dist/collection/components/submit/style.css +226 -0
  206. package/dist/collection/components/summary/index.js +46 -4
  207. package/dist/collection/components/summary/index.js.map +1 -1
  208. package/dist/collection/components/summary/style.css +25 -16
  209. package/dist/collection/components/svg/style.css +2 -2
  210. package/dist/collection/components/table/cell/index.js +1 -1
  211. package/dist/collection/components/table/cell/index.js.map +1 -1
  212. package/dist/collection/components/table/cell/style.css +18 -11
  213. package/dist/collection/components/table/demo/filtered/Root.js.map +1 -1
  214. package/dist/collection/components/table/demo/filtered/index.js +25 -18
  215. package/dist/collection/components/table/demo/filtered/index.js.map +1 -1
  216. package/dist/collection/components/table/demo/filtered/style.css +9 -0
  217. package/dist/collection/components/table/demo/index.js +2 -9
  218. package/dist/collection/components/table/demo/index.js.map +1 -1
  219. package/dist/collection/components/table/demo/style.css +7 -0
  220. package/dist/collection/components/table/demo/testing/data.js +28 -0
  221. package/dist/collection/components/table/demo/testing/data.js.map +1 -0
  222. package/dist/collection/components/table/demo/testing/index.js +28 -0
  223. package/dist/collection/components/table/demo/testing/index.js.map +1 -0
  224. package/dist/collection/components/table/demo/testing/style.css +32 -0
  225. package/dist/collection/components/table/expandable/cell/index.js +14 -33
  226. package/dist/collection/components/table/expandable/cell/index.js.map +1 -1
  227. package/dist/collection/components/table/expandable/cell/style.css +32 -25
  228. package/dist/collection/components/table/expandable/row/index.js +9 -51
  229. package/dist/collection/components/table/expandable/row/index.js.map +1 -1
  230. package/dist/collection/components/table/expandable/row/style.css +32 -29
  231. package/dist/collection/components/table/footer/index.js +19 -0
  232. package/dist/collection/components/table/footer/index.js.map +1 -0
  233. package/dist/collection/components/table/footer/style.css +10 -0
  234. package/dist/collection/components/table/header/style.css +2 -3
  235. package/dist/collection/components/table/index.js +55 -12
  236. package/dist/collection/components/table/index.js.map +1 -1
  237. package/dist/collection/components/table/row/index.js +37 -5
  238. package/dist/collection/components/table/row/index.js.map +1 -1
  239. package/dist/collection/components/table/row/style.css +4 -1
  240. package/dist/collection/components/table/style.css +0 -2
  241. package/dist/collection/components/theme/color/index.js +48 -0
  242. package/dist/collection/components/theme/color/index.js.map +1 -0
  243. package/dist/collection/components/theme/color/style.css +8 -0
  244. package/dist/collection/components/theme/color/variant/index.js +66 -0
  245. package/dist/collection/components/theme/color/variant/index.js.map +1 -0
  246. package/dist/collection/components/theme/color/variant/style.css +18 -0
  247. package/dist/collection/components/theme/colors/index.js +30 -0
  248. package/dist/collection/components/theme/colors/index.js.map +1 -0
  249. package/dist/collection/components/theme/colors/style.css +7 -0
  250. package/dist/collection/components/theme/picker/index.js +48 -0
  251. package/dist/collection/components/theme/picker/index.js.map +1 -0
  252. package/dist/collection/components/theme/picker/style.css +0 -0
  253. package/dist/collection/components/toggle-switch/index.js +69 -17
  254. package/dist/collection/components/toggle-switch/index.js.map +1 -1
  255. package/dist/collection/components/toggle-switch/style.css +19 -12
  256. package/dist/collection/components/trigger-source/index.js +3 -3
  257. package/dist/collection/components/trigger-source/index.js.map +1 -1
  258. package/dist/collection/global/Observers.js +22 -0
  259. package/dist/collection/global/Observers.js.map +1 -0
  260. package/dist/collection/global/index.js +5 -0
  261. package/dist/collection/global/index.js.map +1 -0
  262. package/dist/collection/index.js +2 -2
  263. package/dist/collection/index.js.map +1 -1
  264. package/dist/collection/model/Color.js +18 -1
  265. package/dist/collection/model/Color.js.map +1 -1
  266. package/dist/collection/{components/form → model}/Data.js +8 -1
  267. package/dist/collection/model/Data.js.map +1 -0
  268. package/dist/collection/model/Icon.js +23 -0
  269. package/dist/collection/model/Icon.js.map +1 -0
  270. package/dist/collection/model/Listenable.js +17 -4
  271. package/dist/collection/model/Listenable.js.map +1 -1
  272. package/dist/collection/model/Notice.js +1 -1
  273. package/dist/collection/model/Notice.js.map +1 -1
  274. package/dist/collection/model/Option.js.map +1 -1
  275. package/dist/collection/model/index.js +4 -0
  276. package/dist/collection/model/index.js.map +1 -1
  277. package/dist/collection/model/redirect.js +8 -0
  278. package/dist/collection/model/redirect.js.map +1 -0
  279. package/dist/collection/smoothly.js +3 -0
  280. package/dist/collection/smoothly.js.map +1 -0
  281. package/dist/custom-elements/index.d.ts +176 -50
  282. package/dist/custom-elements/index.js +13394 -29834
  283. package/dist/custom-elements/index.js.map +1 -1
  284. package/dist/esm/{Listenable-fb6f4723.js → Data-0390d600.js} +518 -7
  285. package/dist/esm/Data-0390d600.js.map +1 -0
  286. package/dist/esm/Observers-5f08e828.js +25 -0
  287. package/dist/esm/Observers-5f08e828.js.map +1 -0
  288. package/dist/esm/TimeZone-c8df4905.js +6181 -0
  289. package/dist/esm/TimeZone-c8df4905.js.map +1 -0
  290. package/dist/esm/getLanguage-1e9ec036.js +6116 -0
  291. package/dist/esm/getLanguage-1e9ec036.js.map +1 -0
  292. package/dist/esm/{index-6ac4212d.js → index-258984d3.js} +55 -2
  293. package/dist/esm/index-258984d3.js.map +1 -0
  294. package/dist/esm/index.js +20 -5
  295. package/dist/esm/index.js.map +1 -1
  296. package/dist/esm/loader.js +5 -4
  297. package/dist/esm/loader.js.map +1 -1
  298. package/dist/esm/{Notice-1fa17794.js → redirect-b0f87e88.js} +11 -3
  299. package/dist/esm/redirect-b0f87e88.js.map +1 -0
  300. package/dist/esm/smoothly-accordion-item.entry.js +57 -0
  301. package/dist/esm/smoothly-accordion-item.entry.js.map +1 -0
  302. package/dist/esm/smoothly-accordion.entry.js +54 -0
  303. package/dist/esm/smoothly-accordion.entry.js.map +1 -0
  304. package/dist/esm/smoothly-address-display.entry.js +1 -1
  305. package/dist/esm/smoothly-address.entry.js +1 -1
  306. package/dist/esm/smoothly-addresses.entry.js +1 -1
  307. package/dist/esm/smoothly-app_80.entry.js +10814 -0
  308. package/dist/esm/smoothly-app_80.entry.js.map +1 -0
  309. package/dist/esm/smoothly-checkbox.entry.js +98 -0
  310. package/dist/esm/smoothly-checkbox.entry.js.map +1 -0
  311. package/dist/esm/smoothly-color.entry.js +1 -1
  312. package/dist/esm/smoothly-country.entry.js +10 -9
  313. package/dist/esm/smoothly-country.entry.js.map +1 -1
  314. package/dist/esm/smoothly-display-date-time.entry.js +22 -0
  315. package/dist/esm/smoothly-display-date-time.entry.js.map +1 -0
  316. package/dist/esm/smoothly-google-font.entry.js +1 -1
  317. package/dist/esm/smoothly-reorder.entry.js +1 -1
  318. package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
  319. package/dist/esm/smoothly-trigger-source.entry.js +4 -4
  320. package/dist/esm/smoothly-trigger-source.entry.js.map +1 -1
  321. package/dist/esm/smoothly.js +5 -4
  322. package/dist/esm/smoothly.js.map +1 -1
  323. package/dist/smoothly/index.esm.js +1 -1
  324. package/dist/smoothly/index.esm.js.map +1 -1
  325. package/dist/smoothly/{p-04fb45e1.entry.js → p-12182a73.entry.js} +2 -2
  326. package/dist/smoothly/{p-5629e452.entry.js → p-127dcc56.entry.js} +2 -2
  327. package/dist/smoothly/p-21905b32.entry.js +2 -0
  328. package/dist/smoothly/p-21905b32.entry.js.map +1 -0
  329. package/dist/smoothly/p-312ef066.js +2 -0
  330. package/dist/smoothly/p-312ef066.js.map +1 -0
  331. package/dist/smoothly/p-47151a53.entry.js +2 -0
  332. package/dist/smoothly/p-5e387578.js +3 -0
  333. package/dist/smoothly/p-5e387578.js.map +1 -0
  334. package/dist/smoothly/{p-0fec28cc.entry.js → p-6aebb818.entry.js} +2 -2
  335. package/dist/smoothly/p-6e9aca2e.entry.js +2 -0
  336. package/dist/smoothly/p-6e9aca2e.entry.js.map +1 -0
  337. package/dist/smoothly/{p-ae467192.entry.js → p-7bf147bf.entry.js} +2 -2
  338. package/dist/smoothly/p-823e02b0.entry.js +2 -0
  339. package/dist/smoothly/p-823e02b0.entry.js.map +1 -0
  340. package/dist/smoothly/p-9b828bde.js +2 -0
  341. package/dist/smoothly/p-9b828bde.js.map +1 -0
  342. package/dist/smoothly/p-a0ebd646.entry.js +2 -0
  343. package/dist/smoothly/p-a0ebd646.entry.js.map +1 -0
  344. package/dist/smoothly/{p-b3eef141.entry.js → p-b3eac6af.entry.js} +2 -2
  345. package/dist/smoothly/p-b9165e1d.entry.js +2 -0
  346. package/dist/smoothly/p-b9165e1d.entry.js.map +1 -0
  347. package/dist/smoothly/p-c833c402.js +2 -0
  348. package/dist/smoothly/p-c833c402.js.map +1 -0
  349. package/dist/smoothly/{p-3a6873ed.entry.js → p-cb493516.entry.js} +2 -2
  350. package/dist/smoothly/p-ede93d69.js +2 -0
  351. package/dist/smoothly/p-ede93d69.js.map +1 -0
  352. package/dist/smoothly/p-eef1c80b.entry.js +2 -0
  353. package/dist/smoothly/p-eef1c80b.entry.js.map +1 -0
  354. package/dist/smoothly/p-f125610c.entry.js +2 -0
  355. package/dist/smoothly/p-f125610c.entry.js.map +1 -0
  356. package/dist/smoothly/p-fa664317.js +2 -0
  357. package/dist/smoothly/p-fa664317.js.map +1 -0
  358. package/dist/smoothly/smoothly.esm.js +1 -1
  359. package/dist/smoothly/smoothly.esm.js.map +1 -1
  360. package/dist/types/components/Button.d.ts +1 -2
  361. package/dist/types/components/accordion/index.d.ts +1 -1
  362. package/dist/types/components/accordion-item/index.d.ts +5 -4
  363. package/dist/types/components/app/index.d.ts +23 -10
  364. package/dist/types/components/app/room/index.d.ts +21 -7
  365. package/dist/types/components/app-demo/index.d.ts +1 -0
  366. package/dist/types/components/backtotop/index.d.ts +1 -1
  367. package/dist/types/components/burger/index.d.ts +7 -2
  368. package/dist/types/components/button/index.d.ts +2 -2
  369. package/dist/types/components/calendar/index.d.ts +5 -5
  370. package/dist/types/components/checkbox/index.d.ts +7 -3
  371. package/dist/types/components/confirm/index.d.ts +19 -0
  372. package/dist/types/components/filter/Filter.d.ts +21 -0
  373. package/dist/types/components/filter/field/index.d.ts +10 -0
  374. package/dist/types/components/filter/index.d.ts +13 -12
  375. package/dist/types/components/filter/input/index.d.ts +15 -23
  376. package/dist/types/components/filter/picker/index.d.ts +24 -0
  377. package/dist/types/components/filter/toggle/index.d.ts +22 -0
  378. package/dist/types/components/form/index.d.ts +23 -7
  379. package/dist/types/components/icon/index.d.ts +3 -9
  380. package/dist/types/components/input/Editable.d.ts +20 -0
  381. package/dist/types/components/input/Input.d.ts +22 -0
  382. package/dist/types/components/input/Looks.d.ts +7 -0
  383. package/dist/types/components/input/Submittable.d.ts +6 -0
  384. package/dist/types/components/input/checkbox/index.d.ts +20 -0
  385. package/dist/types/components/input/clear/index.d.ts +17 -0
  386. package/dist/types/components/input/color/index.d.ts +24 -0
  387. package/dist/types/components/input/date/index.d.ts +28 -0
  388. package/dist/types/components/input/date/range/index.d.ts +33 -0
  389. package/dist/types/components/input/demo/index.d.ts +6 -0
  390. package/dist/types/components/input/edit/index.d.ts +17 -0
  391. package/dist/types/components/input/file/index.d.ts +24 -0
  392. package/dist/types/components/input/index.d.ts +30 -11
  393. package/dist/types/components/{input-month → input/month}/index.d.ts +2 -2
  394. package/dist/types/components/input/radio/Selected.d.ts +10 -0
  395. package/dist/types/components/input/radio/index.d.ts +35 -0
  396. package/dist/types/components/input/radio/item/index.d.ts +15 -0
  397. package/dist/types/components/input/range/index.d.ts +24 -0
  398. package/dist/types/components/input/reset/index.d.ts +18 -0
  399. package/dist/types/components/input/select/index.d.ts +36 -0
  400. package/dist/types/components/input/submit/index.d.ts +17 -0
  401. package/dist/types/components/item/index.d.ts +1 -1
  402. package/dist/types/components/label/index.d.ts +6 -0
  403. package/dist/types/components/lazy/index.d.ts +7 -0
  404. package/dist/types/components/load-more/index.d.ts +11 -0
  405. package/dist/types/components/notification/index.d.ts +3 -1
  406. package/dist/types/components/picker/demo/index.d.ts +22 -0
  407. package/dist/types/components/picker/index.d.ts +33 -45
  408. package/dist/types/components/picker/menu/index.d.ts +54 -0
  409. package/dist/types/components/picker/option/index.d.ts +23 -0
  410. package/dist/types/components/picker/slot-elements/index.d.ts +15 -0
  411. package/dist/types/components/picker/slotted-elements/index.d.ts +8 -0
  412. package/dist/types/components/popup/index.d.ts +1 -1
  413. package/dist/types/components/select-demo/index.d.ts +0 -9
  414. package/dist/types/components/submit/index.d.ts +6 -1
  415. package/dist/types/components/summary/index.d.ts +4 -0
  416. package/dist/types/components/table/demo/filtered/Root.d.ts +2 -0
  417. package/dist/types/components/table/demo/filtered/index.d.ts +7 -7
  418. package/dist/types/components/table/demo/index.d.ts +1 -1
  419. package/dist/types/components/table/demo/testing/data.d.ts +5 -0
  420. package/dist/types/components/table/demo/testing/index.d.ts +4 -0
  421. package/dist/types/components/table/expandable/cell/index.d.ts +4 -5
  422. package/dist/types/components/table/expandable/row/index.d.ts +3 -8
  423. package/dist/types/components/table/footer/index.d.ts +3 -0
  424. package/dist/types/components/table/index.d.ts +6 -3
  425. package/dist/types/components/table/row/index.d.ts +3 -1
  426. package/dist/types/components/theme/color/index.d.ts +5 -0
  427. package/dist/types/components/theme/color/variant/index.d.ts +6 -0
  428. package/dist/types/components/theme/colors/index.d.ts +3 -0
  429. package/dist/types/components/theme/picker/index.d.ts +4 -0
  430. package/dist/types/components/toggle-switch/index.d.ts +7 -2
  431. package/dist/types/components/trigger-source/index.d.ts +1 -1
  432. package/dist/types/components.d.ts +914 -347
  433. package/dist/types/global/Observers.d.ts +8 -0
  434. package/dist/types/global/index.d.ts +4 -0
  435. package/dist/types/index.d.ts +1 -3
  436. package/dist/types/model/Color.d.ts +7 -1
  437. package/dist/types/{components/form → model}/Data.d.ts +4 -0
  438. package/dist/types/model/Icon.d.ts +8 -0
  439. package/dist/types/model/Listenable.d.ts +10 -1
  440. package/dist/types/model/Notice.d.ts +1 -1
  441. package/dist/types/model/Option.d.ts +24 -6
  442. package/dist/types/model/index.d.ts +3 -0
  443. package/dist/types/model/redirect.d.ts +1 -0
  444. package/dist/types/smoothly.d.ts +3 -0
  445. package/package.json +7 -6
  446. package/dist/cjs/Listenable-63ea2d90.js.map +0 -1
  447. package/dist/cjs/Notice-88ba4c70.js.map +0 -1
  448. package/dist/cjs/getLanguage-4f0a45d5.js +0 -12227
  449. package/dist/cjs/getLanguage-4f0a45d5.js.map +0 -1
  450. package/dist/cjs/index-8adc5c1b.js.map +0 -1
  451. package/dist/cjs/index-d16d46f4.js +0 -1224
  452. package/dist/cjs/index-d16d46f4.js.map +0 -1
  453. package/dist/cjs/smoothly-accordion_62.cjs.entry.js +0 -28199
  454. package/dist/cjs/smoothly-accordion_62.cjs.entry.js.map +0 -1
  455. package/dist/cjs/smoothly-radio-group.cjs.entry.js +0 -22
  456. package/dist/cjs/smoothly-radio-group.cjs.entry.js.map +0 -1
  457. package/dist/collection/components/filter/Clearable.js.map +0 -1
  458. package/dist/collection/components/form/Clearable.js +0 -8
  459. package/dist/collection/components/form/Clearable.js.map +0 -1
  460. package/dist/collection/components/form/Data.js.map +0 -1
  461. package/dist/collection/components/input-date/index.js +0 -206
  462. package/dist/collection/components/input-date/index.js.map +0 -1
  463. package/dist/collection/components/input-date/style.css +0 -40
  464. package/dist/collection/components/input-date-range/index.js.map +0 -1
  465. package/dist/collection/components/input-date-range/style.css +0 -51
  466. package/dist/collection/components/input-demo/index.js +0 -45
  467. package/dist/collection/components/input-demo/index.js.map +0 -1
  468. package/dist/collection/components/input-demo/style.css +0 -4
  469. package/dist/collection/components/input-month/index.js.map +0 -1
  470. package/dist/collection/components/menu-options/index.js +0 -413
  471. package/dist/collection/components/menu-options/index.js.map +0 -1
  472. package/dist/collection/components/menu-options/style.css +0 -18
  473. package/dist/collection/components/option/index.js +0 -270
  474. package/dist/collection/components/option/index.js.map +0 -1
  475. package/dist/collection/components/option/style.css +0 -42
  476. package/dist/collection/components/radio/index.js.map +0 -1
  477. package/dist/collection/components/radio/style.css +0 -31
  478. package/dist/collection/components/radio-button/Selected.js +0 -2
  479. package/dist/collection/components/radio-button/Selected.js.map +0 -1
  480. package/dist/collection/components/radio-button/index.js +0 -137
  481. package/dist/collection/components/radio-button/index.js.map +0 -1
  482. package/dist/collection/components/radio-button/item/index.js +0 -117
  483. package/dist/collection/components/radio-button/item/index.js.map +0 -1
  484. package/dist/collection/components/radio-button/item/style.css +0 -85
  485. package/dist/collection/components/radio-group/index.js +0 -43
  486. package/dist/collection/components/radio-group/index.js.map +0 -1
  487. package/dist/collection/components/radio-group/style.css +0 -36
  488. package/dist/collection/components/select/index.js +0 -108
  489. package/dist/collection/components/select/index.js.map +0 -1
  490. package/dist/collection/components/select/style.css +0 -20
  491. package/dist/collection/components/selector/index.js +0 -234
  492. package/dist/collection/components/selector/index.js.map +0 -1
  493. package/dist/collection/components/selector/style.css +0 -46
  494. package/dist/custom-elements/index2.js +0 -1222
  495. package/dist/custom-elements/index2.js.map +0 -1
  496. package/dist/esm/Listenable-fb6f4723.js.map +0 -1
  497. package/dist/esm/Notice-1fa17794.js.map +0 -1
  498. package/dist/esm/getLanguage-ffacd7b7.js +0 -12225
  499. package/dist/esm/getLanguage-ffacd7b7.js.map +0 -1
  500. package/dist/esm/index-6ac4212d.js.map +0 -1
  501. package/dist/esm/index-d5330059.js +0 -1222
  502. package/dist/esm/index-d5330059.js.map +0 -1
  503. package/dist/esm/smoothly-accordion_62.entry.js +0 -28134
  504. package/dist/esm/smoothly-accordion_62.entry.js.map +0 -1
  505. package/dist/esm/smoothly-radio-group.entry.js +0 -18
  506. package/dist/esm/smoothly-radio-group.entry.js.map +0 -1
  507. package/dist/smoothly/p-06337b89.js +0 -2
  508. package/dist/smoothly/p-06337b89.js.map +0 -1
  509. package/dist/smoothly/p-16cba662.entry.js +0 -2
  510. package/dist/smoothly/p-16cba662.entry.js.map +0 -1
  511. package/dist/smoothly/p-3ad51805.entry.js +0 -2
  512. package/dist/smoothly/p-3ad51805.entry.js.map +0 -1
  513. package/dist/smoothly/p-5e34795b.js +0 -2
  514. package/dist/smoothly/p-5e34795b.js.map +0 -1
  515. package/dist/smoothly/p-75373584.js +0 -2
  516. package/dist/smoothly/p-75373584.js.map +0 -1
  517. package/dist/smoothly/p-75452eb8.js +0 -2
  518. package/dist/smoothly/p-75452eb8.js.map +0 -1
  519. package/dist/smoothly/p-ae33d7e1.entry.js +0 -2
  520. package/dist/smoothly/p-ae33d7e1.entry.js.map +0 -1
  521. package/dist/smoothly/p-b98cd447.js +0 -3
  522. package/dist/smoothly/p-b98cd447.js.map +0 -1
  523. package/dist/smoothly/p-c109fc66.entry.js +0 -2
  524. package/dist/smoothly/p-c109fc66.entry.js.map +0 -1
  525. package/dist/smoothly/p-f29cc9ff.entry.js +0 -2
  526. package/dist/types/components/form/Clearable.d.ts +0 -6
  527. package/dist/types/components/input-date/index.d.ts +0 -14
  528. package/dist/types/components/input-date-range/index.d.ts +0 -23
  529. package/dist/types/components/input-demo/index.d.ts +0 -3
  530. package/dist/types/components/menu-options/index.d.ts +0 -35
  531. package/dist/types/components/option/index.d.ts +0 -32
  532. package/dist/types/components/radio/index.d.ts +0 -13
  533. package/dist/types/components/radio-button/Selected.d.ts +0 -5
  534. package/dist/types/components/radio-button/index.d.ts +0 -15
  535. package/dist/types/components/radio-button/item/index.d.ts +0 -12
  536. package/dist/types/components/radio-group/index.d.ts +0 -4
  537. package/dist/types/components/select/index.d.ts +0 -14
  538. package/dist/types/components/selector/index.d.ts +0 -23
  539. /package/dist/collection/components/{filter → input}/Clearable.js +0 -0
  540. /package/dist/collection/components/{input-month → input/month}/style.css +0 -0
  541. /package/dist/collection/components/{radio-button → lazy}/style.css +0 -0
  542. /package/dist/smoothly/{p-04fb45e1.entry.js.map → p-12182a73.entry.js.map} +0 -0
  543. /package/dist/smoothly/{p-5629e452.entry.js.map → p-127dcc56.entry.js.map} +0 -0
  544. /package/dist/smoothly/{p-f29cc9ff.entry.js.map → p-47151a53.entry.js.map} +0 -0
  545. /package/dist/smoothly/{p-0fec28cc.entry.js.map → p-6aebb818.entry.js.map} +0 -0
  546. /package/dist/smoothly/{p-ae467192.entry.js.map → p-7bf147bf.entry.js.map} +0 -0
  547. /package/dist/smoothly/{p-b3eef141.entry.js.map → p-b3eac6af.entry.js.map} +0 -0
  548. /package/dist/smoothly/{p-3a6873ed.entry.js.map → p-cb493516.entry.js.map} +0 -0
  549. /package/dist/types/components/{filter → input}/Clearable.d.ts +0 -0
@@ -1,1222 +0,0 @@
1
- // src/path-to-regex-modified.ts
2
- var regexIdentifierStart = /[$_\p{ID_Start}]/u;
3
- var regexIdentifierPart = /[$_\u200C\u200D\p{ID_Continue}]/u;
4
- function isASCII(str, extended) {
5
- return (extended ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(str);
6
- }
7
- function lexer(str, lenient = false) {
8
- const tokens = [];
9
- let i = 0;
10
- while (i < str.length) {
11
- const char = str[i];
12
- const ErrorOrInvalid = function(msg) {
13
- if (!lenient)
14
- throw new TypeError(msg);
15
- tokens.push({ type: "INVALID_CHAR", index: i, value: str[i++] });
16
- };
17
- if (char === "*") {
18
- tokens.push({ type: "ASTERISK", index: i, value: str[i++] });
19
- continue;
20
- }
21
- if (char === "+" || char === "?") {
22
- tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
23
- continue;
24
- }
25
- if (char === "\\") {
26
- tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
27
- continue;
28
- }
29
- if (char === "{") {
30
- tokens.push({ type: "OPEN", index: i, value: str[i++] });
31
- continue;
32
- }
33
- if (char === "}") {
34
- tokens.push({ type: "CLOSE", index: i, value: str[i++] });
35
- continue;
36
- }
37
- if (char === ":") {
38
- let name = "";
39
- let j = i + 1;
40
- while (j < str.length) {
41
- const code = str.substr(j, 1);
42
- if (j === i + 1 && regexIdentifierStart.test(code) || j !== i + 1 && regexIdentifierPart.test(code)) {
43
- name += str[j++];
44
- continue;
45
- }
46
- break;
47
- }
48
- if (!name) {
49
- ErrorOrInvalid(`Missing parameter name at ${i}`);
50
- continue;
51
- }
52
- tokens.push({ type: "NAME", index: i, value: name });
53
- i = j;
54
- continue;
55
- }
56
- if (char === "(") {
57
- let count = 1;
58
- let pattern = "";
59
- let j = i + 1;
60
- let error = false;
61
- if (str[j] === "?") {
62
- ErrorOrInvalid(`Pattern cannot start with "?" at ${j}`);
63
- continue;
64
- }
65
- while (j < str.length) {
66
- if (!isASCII(str[j], false)) {
67
- ErrorOrInvalid(`Invalid character '${str[j]}' at ${j}.`);
68
- error = true;
69
- break;
70
- }
71
- if (str[j] === "\\") {
72
- pattern += str[j++] + str[j++];
73
- continue;
74
- }
75
- if (str[j] === ")") {
76
- count--;
77
- if (count === 0) {
78
- j++;
79
- break;
80
- }
81
- } else if (str[j] === "(") {
82
- count++;
83
- if (str[j + 1] !== "?") {
84
- ErrorOrInvalid(`Capturing groups are not allowed at ${j}`);
85
- error = true;
86
- break;
87
- }
88
- }
89
- pattern += str[j++];
90
- }
91
- if (error) {
92
- continue;
93
- }
94
- if (count) {
95
- ErrorOrInvalid(`Unbalanced pattern at ${i}`);
96
- continue;
97
- }
98
- if (!pattern) {
99
- ErrorOrInvalid(`Missing pattern at ${i}`);
100
- continue;
101
- }
102
- tokens.push({ type: "PATTERN", index: i, value: pattern });
103
- i = j;
104
- continue;
105
- }
106
- tokens.push({ type: "CHAR", index: i, value: str[i++] });
107
- }
108
- tokens.push({ type: "END", index: i, value: "" });
109
- return tokens;
110
- }
111
- function parse(str, options = {}) {
112
- const tokens = lexer(str);
113
- const { prefixes = "./" } = options;
114
- const defaultPattern = `[^${escapeString(options.delimiter === void 0 ? "/#?" : options.delimiter)}]+?`;
115
- const result = [];
116
- let key = 0;
117
- let i = 0;
118
- let path = "";
119
- let nameSet = /* @__PURE__ */ new Set();
120
- const tryConsume = (type) => {
121
- if (i < tokens.length && tokens[i].type === type)
122
- return tokens[i++].value;
123
- };
124
- const tryConsumeModifier = () => {
125
- const r = tryConsume("MODIFIER");
126
- if (r) {
127
- return r;
128
- }
129
- return tryConsume("ASTERISK");
130
- };
131
- const mustConsume = (type) => {
132
- const value = tryConsume(type);
133
- if (value !== void 0)
134
- return value;
135
- const { type: nextType, index } = tokens[i];
136
- throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`);
137
- };
138
- const consumeText = () => {
139
- let result2 = "";
140
- let value;
141
- while (value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) {
142
- result2 += value;
143
- }
144
- return result2;
145
- };
146
- const DefaultEncodePart = (value) => {
147
- return value;
148
- };
149
- const encodePart = options.encodePart || DefaultEncodePart;
150
- while (i < tokens.length) {
151
- const char = tryConsume("CHAR");
152
- const name = tryConsume("NAME");
153
- let pattern = tryConsume("PATTERN");
154
- if (!name && !pattern && tryConsume("ASTERISK")) {
155
- pattern = ".*";
156
- }
157
- if (name || pattern) {
158
- let prefix = char || "";
159
- if (prefixes.indexOf(prefix) === -1) {
160
- path += prefix;
161
- prefix = "";
162
- }
163
- if (path) {
164
- result.push(encodePart(path));
165
- path = "";
166
- }
167
- const finalName = name || key++;
168
- if (nameSet.has(finalName)) {
169
- throw new TypeError(`Duplicate name '${finalName}'.`);
170
- }
171
- nameSet.add(finalName);
172
- result.push({
173
- name: finalName,
174
- prefix: encodePart(prefix),
175
- suffix: "",
176
- pattern: pattern || defaultPattern,
177
- modifier: tryConsumeModifier() || ""
178
- });
179
- continue;
180
- }
181
- const value = char || tryConsume("ESCAPED_CHAR");
182
- if (value) {
183
- path += value;
184
- continue;
185
- }
186
- const open = tryConsume("OPEN");
187
- if (open) {
188
- const prefix = consumeText();
189
- const name2 = tryConsume("NAME") || "";
190
- let pattern2 = tryConsume("PATTERN") || "";
191
- if (!name2 && !pattern2 && tryConsume("ASTERISK")) {
192
- pattern2 = ".*";
193
- }
194
- const suffix = consumeText();
195
- mustConsume("CLOSE");
196
- const modifier = tryConsumeModifier() || "";
197
- if (!name2 && !pattern2 && !modifier) {
198
- path += prefix;
199
- continue;
200
- }
201
- if (!name2 && !pattern2 && !prefix) {
202
- continue;
203
- }
204
- if (path) {
205
- result.push(encodePart(path));
206
- path = "";
207
- }
208
- result.push({
209
- name: name2 || (pattern2 ? key++ : ""),
210
- pattern: name2 && !pattern2 ? defaultPattern : pattern2,
211
- prefix: encodePart(prefix),
212
- suffix: encodePart(suffix),
213
- modifier
214
- });
215
- continue;
216
- }
217
- if (path) {
218
- result.push(encodePart(path));
219
- path = "";
220
- }
221
- mustConsume("END");
222
- }
223
- return result;
224
- }
225
- function escapeString(str) {
226
- return str.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
227
- }
228
- function flags(options) {
229
- return options && options.ignoreCase ? "ui" : "u";
230
- }
231
- function regexpToRegexp(path, keys) {
232
- if (!keys)
233
- return path;
234
- const groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
235
- let index = 0;
236
- let execResult = groupsRegex.exec(path.source);
237
- while (execResult) {
238
- keys.push({
239
- name: execResult[1] || index++,
240
- prefix: "",
241
- suffix: "",
242
- modifier: "",
243
- pattern: ""
244
- });
245
- execResult = groupsRegex.exec(path.source);
246
- }
247
- return path;
248
- }
249
- function arrayToRegexp(paths, keys, options) {
250
- const parts = paths.map((path) => pathToRegexp(path, keys, options).source);
251
- return new RegExp(`(?:${parts.join("|")})`, flags(options));
252
- }
253
- function stringToRegexp(path, keys, options) {
254
- return tokensToRegexp(parse(path, options), keys, options);
255
- }
256
- function tokensToRegexp(tokens, keys, options = {}) {
257
- const {
258
- strict = false,
259
- start = true,
260
- end = true,
261
- encode = (x) => x
262
- } = options;
263
- const endsWith = `[${escapeString(options.endsWith === void 0 ? "" : options.endsWith)}]|$`;
264
- const delimiter = `[${escapeString(options.delimiter === void 0 ? "/#?" : options.delimiter)}]`;
265
- let route = start ? "^" : "";
266
- for (const token of tokens) {
267
- if (typeof token === "string") {
268
- route += escapeString(encode(token));
269
- } else {
270
- const prefix = escapeString(encode(token.prefix));
271
- const suffix = escapeString(encode(token.suffix));
272
- if (token.pattern) {
273
- if (keys)
274
- keys.push(token);
275
- if (prefix || suffix) {
276
- if (token.modifier === "+" || token.modifier === "*") {
277
- const mod = token.modifier === "*" ? "?" : "";
278
- route += `(?:${prefix}((?:${token.pattern})(?:${suffix}${prefix}(?:${token.pattern}))*)${suffix})${mod}`;
279
- } else {
280
- route += `(?:${prefix}(${token.pattern})${suffix})${token.modifier}`;
281
- }
282
- } else {
283
- if (token.modifier === "+" || token.modifier === "*") {
284
- route += `((?:${token.pattern})${token.modifier})`;
285
- } else {
286
- route += `(${token.pattern})${token.modifier}`;
287
- }
288
- }
289
- } else {
290
- route += `(?:${prefix}${suffix})${token.modifier}`;
291
- }
292
- }
293
- }
294
- if (end) {
295
- if (!strict)
296
- route += `${delimiter}?`;
297
- route += !options.endsWith ? "$" : `(?=${endsWith})`;
298
- } else {
299
- const endToken = tokens[tokens.length - 1];
300
- const isEndDelimited = typeof endToken === "string" ? delimiter.indexOf(endToken[endToken.length - 1]) > -1 : endToken === void 0;
301
- if (!strict) {
302
- route += `(?:${delimiter}(?=${endsWith}))?`;
303
- }
304
- if (!isEndDelimited) {
305
- route += `(?=${delimiter}|${endsWith})`;
306
- }
307
- }
308
- return new RegExp(route, flags(options));
309
- }
310
- function pathToRegexp(path, keys, options) {
311
- if (path instanceof RegExp)
312
- return regexpToRegexp(path, keys);
313
- if (Array.isArray(path))
314
- return arrayToRegexp(path, keys, options);
315
- return stringToRegexp(path, keys, options);
316
- }
317
-
318
- // src/url-utils.ts
319
- var DEFAULT_OPTIONS = {
320
- delimiter: "",
321
- prefixes: "",
322
- sensitive: true,
323
- strict: true
324
- };
325
- var HOSTNAME_OPTIONS = {
326
- delimiter: ".",
327
- prefixes: "",
328
- sensitive: true,
329
- strict: true
330
- };
331
- var PATHNAME_OPTIONS = {
332
- delimiter: "/",
333
- prefixes: "/",
334
- sensitive: true,
335
- strict: true
336
- };
337
- function isAbsolutePathname(pathname, isPattern) {
338
- if (!pathname.length) {
339
- return false;
340
- }
341
- if (pathname[0] === "/") {
342
- return true;
343
- }
344
- if (!isPattern) {
345
- return false;
346
- }
347
- if (pathname.length < 2) {
348
- return false;
349
- }
350
- if ((pathname[0] == "\\" || pathname[0] == "{") && pathname[1] == "/") {
351
- return true;
352
- }
353
- return false;
354
- }
355
- function maybeStripPrefix(value, prefix) {
356
- if (value.startsWith(prefix)) {
357
- return value.substring(prefix.length, value.length);
358
- }
359
- return value;
360
- }
361
- function maybeStripSuffix(value, suffix) {
362
- if (value.endsWith(suffix)) {
363
- return value.substr(0, value.length - suffix.length);
364
- }
365
- return value;
366
- }
367
- function treatAsIPv6Hostname(value) {
368
- if (!value || value.length < 2) {
369
- return false;
370
- }
371
- if (value[0] === "[") {
372
- return true;
373
- }
374
- if ((value[0] === "\\" || value[0] === "{") && value[1] === "[") {
375
- return true;
376
- }
377
- return false;
378
- }
379
- var SPECIAL_SCHEMES = [
380
- "ftp",
381
- "file",
382
- "http",
383
- "https",
384
- "ws",
385
- "wss"
386
- ];
387
- function isSpecialScheme(protocol_regexp) {
388
- if (!protocol_regexp) {
389
- return true;
390
- }
391
- for (const scheme of SPECIAL_SCHEMES) {
392
- if (protocol_regexp.test(scheme)) {
393
- return true;
394
- }
395
- }
396
- return false;
397
- }
398
- function canonicalizeHash(hash, isPattern) {
399
- hash = maybeStripPrefix(hash, "#");
400
- if (isPattern || hash === "") {
401
- return hash;
402
- }
403
- const url = new URL("https://example.com");
404
- url.hash = hash;
405
- return url.hash ? url.hash.substring(1, url.hash.length) : "";
406
- }
407
- function canonicalizeSearch(search, isPattern) {
408
- search = maybeStripPrefix(search, "?");
409
- if (isPattern || search === "") {
410
- return search;
411
- }
412
- const url = new URL("https://example.com");
413
- url.search = search;
414
- return url.search ? url.search.substring(1, url.search.length) : "";
415
- }
416
- function canonicalizeHostname(hostname, isPattern) {
417
- if (isPattern || hostname === "") {
418
- return hostname;
419
- }
420
- if (treatAsIPv6Hostname(hostname)) {
421
- return ipv6HostnameEncodeCallback(hostname);
422
- } else {
423
- return hostnameEncodeCallback(hostname);
424
- }
425
- }
426
- function canonicalizePassword(password, isPattern) {
427
- if (isPattern || password === "") {
428
- return password;
429
- }
430
- const url = new URL("https://example.com");
431
- url.password = password;
432
- return url.password;
433
- }
434
- function canonicalizeUsername(username, isPattern) {
435
- if (isPattern || username === "") {
436
- return username;
437
- }
438
- const url = new URL("https://example.com");
439
- url.username = username;
440
- return url.username;
441
- }
442
- function canonicalizePathname(pathname, protocol, isPattern) {
443
- if (isPattern || pathname === "") {
444
- return pathname;
445
- }
446
- if (protocol && !SPECIAL_SCHEMES.includes(protocol)) {
447
- const url = new URL(`${protocol}:${pathname}`);
448
- return url.pathname;
449
- }
450
- const leadingSlash = pathname[0] == "/";
451
- pathname = new URL(
452
- !leadingSlash ? "/-" + pathname : pathname,
453
- "https://example.com"
454
- ).pathname;
455
- if (!leadingSlash) {
456
- pathname = pathname.substring(2, pathname.length);
457
- }
458
- return pathname;
459
- }
460
- function canonicalizePort(port, protocol, isPattern) {
461
- if (defaultPortForProtocol(protocol) === port) {
462
- port = "";
463
- }
464
- if (isPattern || port === "") {
465
- return port;
466
- }
467
- return portEncodeCallback(port);
468
- }
469
- function canonicalizeProtocol(protocol, isPattern) {
470
- protocol = maybeStripSuffix(protocol, ":");
471
- if (isPattern || protocol === "") {
472
- return protocol;
473
- }
474
- return protocolEncodeCallback(protocol);
475
- }
476
- function defaultPortForProtocol(protocol) {
477
- switch (protocol) {
478
- case "ws":
479
- case "http":
480
- return "80";
481
- case "wws":
482
- case "https":
483
- return "443";
484
- case "ftp":
485
- return "21";
486
- default:
487
- return "";
488
- }
489
- }
490
- function protocolEncodeCallback(input) {
491
- if (input === "") {
492
- return input;
493
- }
494
- if (/^[-+.A-Za-z0-9]*$/.test(input))
495
- return input.toLowerCase();
496
- throw new TypeError(`Invalid protocol '${input}'.`);
497
- }
498
- function usernameEncodeCallback(input) {
499
- if (input === "") {
500
- return input;
501
- }
502
- const url = new URL("https://example.com");
503
- url.username = input;
504
- return url.username;
505
- }
506
- function passwordEncodeCallback(input) {
507
- if (input === "") {
508
- return input;
509
- }
510
- const url = new URL("https://example.com");
511
- url.password = input;
512
- return url.password;
513
- }
514
- function hostnameEncodeCallback(input) {
515
- if (input === "") {
516
- return input;
517
- }
518
- if (/[\t\n\r #%/:<>?@[\]^\\|]/g.test(input)) {
519
- throw new TypeError(`Invalid hostname '${input}'`);
520
- }
521
- const url = new URL("https://example.com");
522
- url.hostname = input;
523
- return url.hostname;
524
- }
525
- function ipv6HostnameEncodeCallback(input) {
526
- if (input === "") {
527
- return input;
528
- }
529
- if (/[^0-9a-fA-F[\]:]/g.test(input)) {
530
- throw new TypeError(`Invalid IPv6 hostname '${input}'`);
531
- }
532
- return input.toLowerCase();
533
- }
534
- function portEncodeCallback(input) {
535
- if (input === "") {
536
- return input;
537
- }
538
- if (/^[0-9]*$/.test(input) && parseInt(input) <= 65535) {
539
- return input;
540
- }
541
- throw new TypeError(`Invalid port '${input}'.`);
542
- }
543
- function standardURLPathnameEncodeCallback(input) {
544
- if (input === "") {
545
- return input;
546
- }
547
- const url = new URL("https://example.com");
548
- url.pathname = input[0] !== "/" ? "/-" + input : input;
549
- if (input[0] !== "/") {
550
- return url.pathname.substring(2, url.pathname.length);
551
- }
552
- return url.pathname;
553
- }
554
- function pathURLPathnameEncodeCallback(input) {
555
- if (input === "") {
556
- return input;
557
- }
558
- const url = new URL(`data:${input}`);
559
- return url.pathname;
560
- }
561
- function searchEncodeCallback(input) {
562
- if (input === "") {
563
- return input;
564
- }
565
- const url = new URL("https://example.com");
566
- url.search = input;
567
- return url.search.substring(1, url.search.length);
568
- }
569
- function hashEncodeCallback(input) {
570
- if (input === "") {
571
- return input;
572
- }
573
- const url = new URL("https://example.com");
574
- url.hash = input;
575
- return url.hash.substring(1, url.hash.length);
576
- }
577
-
578
- // src/url-pattern-parser.ts
579
- var Parser = class {
580
- constructor(input) {
581
- this.tokenList = [];
582
- this.internalResult = {};
583
- this.tokenIndex = 0;
584
- this.tokenIncrement = 1;
585
- this.componentStart = 0;
586
- this.state = 0 /* INIT */;
587
- this.groupDepth = 0;
588
- this.hostnameIPv6BracketDepth = 0;
589
- this.shouldTreatAsStandardURL = false;
590
- this.input = input;
591
- }
592
- get result() {
593
- return this.internalResult;
594
- }
595
- parse() {
596
- this.tokenList = lexer(this.input, true);
597
- for (; this.tokenIndex < this.tokenList.length; this.tokenIndex += this.tokenIncrement) {
598
- this.tokenIncrement = 1;
599
- if (this.tokenList[this.tokenIndex].type === "END") {
600
- if (this.state === 0 /* INIT */) {
601
- this.rewind();
602
- if (this.isHashPrefix()) {
603
- this.changeState(9 /* HASH */, 1);
604
- } else if (this.isSearchPrefix()) {
605
- this.changeState(8 /* SEARCH */, 1);
606
- this.internalResult.hash = "";
607
- } else {
608
- this.changeState(7 /* PATHNAME */, 0);
609
- this.internalResult.search = "";
610
- this.internalResult.hash = "";
611
- }
612
- continue;
613
- } else if (this.state === 2 /* AUTHORITY */) {
614
- this.rewindAndSetState(5 /* HOSTNAME */);
615
- continue;
616
- }
617
- this.changeState(10 /* DONE */, 0);
618
- break;
619
- }
620
- if (this.groupDepth > 0) {
621
- if (this.isGroupClose()) {
622
- this.groupDepth -= 1;
623
- } else {
624
- continue;
625
- }
626
- }
627
- if (this.isGroupOpen()) {
628
- this.groupDepth += 1;
629
- continue;
630
- }
631
- switch (this.state) {
632
- case 0 /* INIT */:
633
- if (this.isProtocolSuffix()) {
634
- this.internalResult.username = "";
635
- this.internalResult.password = "";
636
- this.internalResult.hostname = "";
637
- this.internalResult.port = "";
638
- this.internalResult.pathname = "";
639
- this.internalResult.search = "";
640
- this.internalResult.hash = "";
641
- this.rewindAndSetState(1 /* PROTOCOL */);
642
- }
643
- break;
644
- case 1 /* PROTOCOL */:
645
- if (this.isProtocolSuffix()) {
646
- this.computeShouldTreatAsStandardURL();
647
- let nextState = 7 /* PATHNAME */;
648
- let skip = 1;
649
- if (this.shouldTreatAsStandardURL) {
650
- this.internalResult.pathname = "/";
651
- }
652
- if (this.nextIsAuthoritySlashes()) {
653
- nextState = 2 /* AUTHORITY */;
654
- skip = 3;
655
- } else if (this.shouldTreatAsStandardURL) {
656
- nextState = 2 /* AUTHORITY */;
657
- }
658
- this.changeState(nextState, skip);
659
- }
660
- break;
661
- case 2 /* AUTHORITY */:
662
- if (this.isIdentityTerminator()) {
663
- this.rewindAndSetState(3 /* USERNAME */);
664
- } else if (this.isPathnameStart() || this.isSearchPrefix() || this.isHashPrefix()) {
665
- this.rewindAndSetState(5 /* HOSTNAME */);
666
- }
667
- break;
668
- case 3 /* USERNAME */:
669
- if (this.isPasswordPrefix()) {
670
- this.changeState(4 /* PASSWORD */, 1);
671
- } else if (this.isIdentityTerminator()) {
672
- this.changeState(5 /* HOSTNAME */, 1);
673
- }
674
- break;
675
- case 4 /* PASSWORD */:
676
- if (this.isIdentityTerminator()) {
677
- this.changeState(5 /* HOSTNAME */, 1);
678
- }
679
- break;
680
- case 5 /* HOSTNAME */:
681
- if (this.isIPv6Open()) {
682
- this.hostnameIPv6BracketDepth += 1;
683
- } else if (this.isIPv6Close()) {
684
- this.hostnameIPv6BracketDepth -= 1;
685
- }
686
- if (this.isPortPrefix() && !this.hostnameIPv6BracketDepth) {
687
- this.changeState(6 /* PORT */, 1);
688
- } else if (this.isPathnameStart()) {
689
- this.changeState(7 /* PATHNAME */, 0);
690
- } else if (this.isSearchPrefix()) {
691
- this.changeState(8 /* SEARCH */, 1);
692
- } else if (this.isHashPrefix()) {
693
- this.changeState(9 /* HASH */, 1);
694
- }
695
- break;
696
- case 6 /* PORT */:
697
- if (this.isPathnameStart()) {
698
- this.changeState(7 /* PATHNAME */, 0);
699
- } else if (this.isSearchPrefix()) {
700
- this.changeState(8 /* SEARCH */, 1);
701
- } else if (this.isHashPrefix()) {
702
- this.changeState(9 /* HASH */, 1);
703
- }
704
- break;
705
- case 7 /* PATHNAME */:
706
- if (this.isSearchPrefix()) {
707
- this.changeState(8 /* SEARCH */, 1);
708
- } else if (this.isHashPrefix()) {
709
- this.changeState(9 /* HASH */, 1);
710
- }
711
- break;
712
- case 8 /* SEARCH */:
713
- if (this.isHashPrefix()) {
714
- this.changeState(9 /* HASH */, 1);
715
- }
716
- break;
717
- }
718
- }
719
- }
720
- changeState(newState, skip) {
721
- switch (this.state) {
722
- case 0 /* INIT */:
723
- break;
724
- case 1 /* PROTOCOL */:
725
- this.internalResult.protocol = this.makeComponentString();
726
- break;
727
- case 2 /* AUTHORITY */:
728
- break;
729
- case 3 /* USERNAME */:
730
- this.internalResult.username = this.makeComponentString();
731
- break;
732
- case 4 /* PASSWORD */:
733
- this.internalResult.password = this.makeComponentString();
734
- break;
735
- case 5 /* HOSTNAME */:
736
- this.internalResult.hostname = this.makeComponentString();
737
- break;
738
- case 6 /* PORT */:
739
- this.internalResult.port = this.makeComponentString();
740
- break;
741
- case 7 /* PATHNAME */:
742
- this.internalResult.pathname = this.makeComponentString();
743
- break;
744
- case 8 /* SEARCH */:
745
- this.internalResult.search = this.makeComponentString();
746
- break;
747
- case 9 /* HASH */:
748
- this.internalResult.hash = this.makeComponentString();
749
- break;
750
- }
751
- this.changeStateWithoutSettingComponent(newState, skip);
752
- }
753
- changeStateWithoutSettingComponent(newState, skip) {
754
- this.state = newState;
755
- this.componentStart = this.tokenIndex + skip;
756
- this.tokenIndex += skip;
757
- this.tokenIncrement = 0;
758
- }
759
- rewind() {
760
- this.tokenIndex = this.componentStart;
761
- this.tokenIncrement = 0;
762
- }
763
- rewindAndSetState(newState) {
764
- this.rewind();
765
- this.state = newState;
766
- }
767
- safeToken(index) {
768
- if (index < 0) {
769
- index = this.tokenList.length - index;
770
- }
771
- if (index < this.tokenList.length) {
772
- return this.tokenList[index];
773
- }
774
- return this.tokenList[this.tokenList.length - 1];
775
- }
776
- isNonSpecialPatternChar(index, value) {
777
- const token = this.safeToken(index);
778
- return token.value === value && (token.type === "CHAR" || token.type === "ESCAPED_CHAR" || token.type === "INVALID_CHAR");
779
- }
780
- isProtocolSuffix() {
781
- return this.isNonSpecialPatternChar(this.tokenIndex, ":");
782
- }
783
- nextIsAuthoritySlashes() {
784
- return this.isNonSpecialPatternChar(this.tokenIndex + 1, "/") && this.isNonSpecialPatternChar(this.tokenIndex + 2, "/");
785
- }
786
- isIdentityTerminator() {
787
- return this.isNonSpecialPatternChar(this.tokenIndex, "@");
788
- }
789
- isPasswordPrefix() {
790
- return this.isNonSpecialPatternChar(this.tokenIndex, ":");
791
- }
792
- isPortPrefix() {
793
- return this.isNonSpecialPatternChar(this.tokenIndex, ":");
794
- }
795
- isPathnameStart() {
796
- return this.isNonSpecialPatternChar(this.tokenIndex, "/");
797
- }
798
- isSearchPrefix() {
799
- if (this.isNonSpecialPatternChar(this.tokenIndex, "?")) {
800
- return true;
801
- }
802
- if (this.tokenList[this.tokenIndex].value !== "?") {
803
- return false;
804
- }
805
- const previousToken = this.safeToken(this.tokenIndex - 1);
806
- return previousToken.type !== "NAME" && previousToken.type !== "PATTERN" && previousToken.type !== "CLOSE" && previousToken.type !== "ASTERISK";
807
- }
808
- isHashPrefix() {
809
- return this.isNonSpecialPatternChar(this.tokenIndex, "#");
810
- }
811
- isGroupOpen() {
812
- return this.tokenList[this.tokenIndex].type == "OPEN";
813
- }
814
- isGroupClose() {
815
- return this.tokenList[this.tokenIndex].type == "CLOSE";
816
- }
817
- isIPv6Open() {
818
- return this.isNonSpecialPatternChar(this.tokenIndex, "[");
819
- }
820
- isIPv6Close() {
821
- return this.isNonSpecialPatternChar(this.tokenIndex, "]");
822
- }
823
- makeComponentString() {
824
- const token = this.tokenList[this.tokenIndex];
825
- const componentCharStart = this.safeToken(this.componentStart).index;
826
- return this.input.substring(componentCharStart, token.index);
827
- }
828
- computeShouldTreatAsStandardURL() {
829
- const options = {};
830
- Object.assign(options, DEFAULT_OPTIONS);
831
- options.encodePart = protocolEncodeCallback;
832
- const regexp = pathToRegexp(this.makeComponentString(), void 0, options);
833
- this.shouldTreatAsStandardURL = isSpecialScheme(regexp);
834
- }
835
- };
836
-
837
- // src/url-pattern.ts
838
- var COMPONENTS = [
839
- "protocol",
840
- "username",
841
- "password",
842
- "hostname",
843
- "port",
844
- "pathname",
845
- "search",
846
- "hash"
847
- ];
848
- var DEFAULT_PATTERN = "*";
849
- function extractValues(url, baseURL) {
850
- if (typeof url !== "string") {
851
- throw new TypeError(`parameter 1 is not of type 'string'.`);
852
- }
853
- const o = new URL(url, baseURL);
854
- return {
855
- protocol: o.protocol.substring(0, o.protocol.length - 1),
856
- username: o.username,
857
- password: o.password,
858
- hostname: o.hostname,
859
- port: o.port,
860
- pathname: o.pathname,
861
- search: o.search != "" ? o.search.substring(1, o.search.length) : void 0,
862
- hash: o.hash != "" ? o.hash.substring(1, o.hash.length) : void 0
863
- };
864
- }
865
- function processBaseURLString(input, isPattern) {
866
- if (!isPattern) {
867
- return input;
868
- }
869
- return escapePatternString(input);
870
- }
871
- function applyInit(o, init, isPattern) {
872
- let baseURL;
873
- if (typeof init.baseURL === "string") {
874
- try {
875
- baseURL = new URL(init.baseURL);
876
- o.protocol = processBaseURLString(baseURL.protocol.substring(0, baseURL.protocol.length - 1), isPattern);
877
- o.username = processBaseURLString(baseURL.username, isPattern);
878
- o.password = processBaseURLString(baseURL.password, isPattern);
879
- o.hostname = processBaseURLString(baseURL.hostname, isPattern);
880
- o.port = processBaseURLString(baseURL.port, isPattern);
881
- o.pathname = processBaseURLString(baseURL.pathname, isPattern);
882
- o.search = processBaseURLString(baseURL.search.substring(1, baseURL.search.length), isPattern);
883
- o.hash = processBaseURLString(baseURL.hash.substring(1, baseURL.hash.length), isPattern);
884
- } catch {
885
- throw new TypeError(`invalid baseURL '${init.baseURL}'.`);
886
- }
887
- }
888
- if (typeof init.protocol === "string") {
889
- o.protocol = canonicalizeProtocol(init.protocol, isPattern);
890
- }
891
- if (typeof init.username === "string") {
892
- o.username = canonicalizeUsername(init.username, isPattern);
893
- }
894
- if (typeof init.password === "string") {
895
- o.password = canonicalizePassword(init.password, isPattern);
896
- }
897
- if (typeof init.hostname === "string") {
898
- o.hostname = canonicalizeHostname(init.hostname, isPattern);
899
- }
900
- if (typeof init.port === "string") {
901
- o.port = canonicalizePort(init.port, o.protocol, isPattern);
902
- }
903
- if (typeof init.pathname === "string") {
904
- o.pathname = init.pathname;
905
- if (baseURL && !isAbsolutePathname(o.pathname, isPattern)) {
906
- const slashIndex = baseURL.pathname.lastIndexOf("/");
907
- if (slashIndex >= 0) {
908
- o.pathname = processBaseURLString(baseURL.pathname.substring(0, slashIndex + 1), isPattern) + o.pathname;
909
- }
910
- }
911
- o.pathname = canonicalizePathname(o.pathname, o.protocol, isPattern);
912
- }
913
- if (typeof init.search === "string") {
914
- o.search = canonicalizeSearch(init.search, isPattern);
915
- }
916
- if (typeof init.hash === "string") {
917
- o.hash = canonicalizeHash(init.hash, isPattern);
918
- }
919
- return o;
920
- }
921
- function escapePatternString(value) {
922
- return value.replace(/([+*?:{}()\\])/g, "\\$1");
923
- }
924
- function escapeRegexpString(value) {
925
- return value.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
926
- }
927
- function tokensToPattern(tokens, options) {
928
- const wildcardPattern = ".*";
929
- const segmentWildcardPattern = `[^${escapeRegexpString(options.delimiter === void 0 ? "/#?" : options.delimiter)}]+?`;
930
- const regexIdentifierPart2 = /[$_\u200C\u200D\p{ID_Continue}]/u;
931
- let result = "";
932
- for (let i = 0; i < tokens.length; ++i) {
933
- const token = tokens[i];
934
- const lastToken = i > 0 ? tokens[i - 1] : null;
935
- const nextToken = i < tokens.length - 1 ? tokens[i + 1] : null;
936
- if (typeof token === "string") {
937
- result += escapePatternString(token);
938
- continue;
939
- }
940
- if (token.pattern === "") {
941
- if (token.modifier === "") {
942
- result += escapePatternString(token.prefix);
943
- continue;
944
- }
945
- result += `{${escapePatternString(token.prefix)}}${token.modifier}`;
946
- continue;
947
- }
948
- const customName = typeof token.name !== "number";
949
- const optionsPrefixes = options.prefixes !== void 0 ? options.prefixes : "./";
950
- let needsGrouping = token.suffix !== "" || token.prefix !== "" && (token.prefix.length !== 1 || !optionsPrefixes.includes(token.prefix));
951
- if (!needsGrouping && customName && token.pattern === segmentWildcardPattern && token.modifier === "" && nextToken && !nextToken.prefix && !nextToken.suffix) {
952
- if (typeof nextToken === "string") {
953
- const code = nextToken.length > 0 ? nextToken[0] : "";
954
- needsGrouping = regexIdentifierPart2.test(code);
955
- } else {
956
- needsGrouping = typeof nextToken.name === "number";
957
- }
958
- }
959
- if (!needsGrouping && token.prefix === "" && lastToken && typeof lastToken === "string" && lastToken.length > 0) {
960
- const code = lastToken[lastToken.length - 1];
961
- needsGrouping = optionsPrefixes.includes(code);
962
- }
963
- if (needsGrouping) {
964
- result += "{";
965
- }
966
- result += escapePatternString(token.prefix);
967
- if (customName) {
968
- result += `:${token.name}`;
969
- }
970
- if (token.pattern === wildcardPattern) {
971
- if (!customName && (!lastToken || typeof lastToken === "string" || lastToken.modifier || needsGrouping || token.prefix !== "")) {
972
- result += "*";
973
- } else {
974
- result += `(${wildcardPattern})`;
975
- }
976
- } else if (token.pattern === segmentWildcardPattern) {
977
- if (!customName) {
978
- result += `(${segmentWildcardPattern})`;
979
- }
980
- } else {
981
- result += `(${token.pattern})`;
982
- }
983
- if (token.pattern === segmentWildcardPattern && customName && token.suffix !== "") {
984
- if (regexIdentifierPart2.test(token.suffix[0])) {
985
- result += "\\";
986
- }
987
- }
988
- result += escapePatternString(token.suffix);
989
- if (needsGrouping) {
990
- result += "}";
991
- }
992
- result += token.modifier;
993
- }
994
- return result;
995
- }
996
- var URLPattern = class {
997
- constructor(init = {}, baseURLOrOptions, options) {
998
- this.regexp = {};
999
- this.keys = {};
1000
- this.component_pattern = {};
1001
- try {
1002
- let baseURL = void 0;
1003
- if (typeof baseURLOrOptions === "string") {
1004
- baseURL = baseURLOrOptions;
1005
- } else {
1006
- options = baseURLOrOptions;
1007
- }
1008
- if (typeof init === "string") {
1009
- const parser = new Parser(init);
1010
- parser.parse();
1011
- init = parser.result;
1012
- if (baseURL === void 0 && typeof init.protocol !== "string") {
1013
- throw new TypeError(`A base URL must be provided for a relative constructor string.`);
1014
- }
1015
- init.baseURL = baseURL;
1016
- } else {
1017
- if (!init || typeof init !== "object") {
1018
- throw new TypeError(`parameter 1 is not of type 'string' and cannot convert to dictionary.`);
1019
- }
1020
- if (baseURL) {
1021
- throw new TypeError(`parameter 1 is not of type 'string'.`);
1022
- }
1023
- }
1024
- if (typeof options === "undefined") {
1025
- options = { ignoreCase: false };
1026
- }
1027
- const ignoreCaseOptions = { ignoreCase: options.ignoreCase === true };
1028
- const defaults = {
1029
- pathname: DEFAULT_PATTERN,
1030
- protocol: DEFAULT_PATTERN,
1031
- username: DEFAULT_PATTERN,
1032
- password: DEFAULT_PATTERN,
1033
- hostname: DEFAULT_PATTERN,
1034
- port: DEFAULT_PATTERN,
1035
- search: DEFAULT_PATTERN,
1036
- hash: DEFAULT_PATTERN
1037
- };
1038
- this.pattern = applyInit(defaults, init, true);
1039
- if (defaultPortForProtocol(this.pattern.protocol) === this.pattern.port) {
1040
- this.pattern.port = "";
1041
- }
1042
- let component;
1043
- for (component of COMPONENTS) {
1044
- if (!(component in this.pattern))
1045
- continue;
1046
- const options2 = {};
1047
- const pattern = this.pattern[component];
1048
- this.keys[component] = [];
1049
- switch (component) {
1050
- case "protocol":
1051
- Object.assign(options2, DEFAULT_OPTIONS);
1052
- options2.encodePart = protocolEncodeCallback;
1053
- break;
1054
- case "username":
1055
- Object.assign(options2, DEFAULT_OPTIONS);
1056
- options2.encodePart = usernameEncodeCallback;
1057
- break;
1058
- case "password":
1059
- Object.assign(options2, DEFAULT_OPTIONS);
1060
- options2.encodePart = passwordEncodeCallback;
1061
- break;
1062
- case "hostname":
1063
- Object.assign(options2, HOSTNAME_OPTIONS);
1064
- if (treatAsIPv6Hostname(pattern)) {
1065
- options2.encodePart = ipv6HostnameEncodeCallback;
1066
- } else {
1067
- options2.encodePart = hostnameEncodeCallback;
1068
- }
1069
- break;
1070
- case "port":
1071
- Object.assign(options2, DEFAULT_OPTIONS);
1072
- options2.encodePart = portEncodeCallback;
1073
- break;
1074
- case "pathname":
1075
- if (isSpecialScheme(this.regexp.protocol)) {
1076
- Object.assign(options2, PATHNAME_OPTIONS, ignoreCaseOptions);
1077
- options2.encodePart = standardURLPathnameEncodeCallback;
1078
- } else {
1079
- Object.assign(options2, DEFAULT_OPTIONS, ignoreCaseOptions);
1080
- options2.encodePart = pathURLPathnameEncodeCallback;
1081
- }
1082
- break;
1083
- case "search":
1084
- Object.assign(options2, DEFAULT_OPTIONS, ignoreCaseOptions);
1085
- options2.encodePart = searchEncodeCallback;
1086
- break;
1087
- case "hash":
1088
- Object.assign(options2, DEFAULT_OPTIONS, ignoreCaseOptions);
1089
- options2.encodePart = hashEncodeCallback;
1090
- break;
1091
- }
1092
- try {
1093
- const tokens = parse(pattern, options2);
1094
- this.regexp[component] = tokensToRegexp(tokens, this.keys[component], options2);
1095
- this.component_pattern[component] = tokensToPattern(tokens, options2);
1096
- } catch {
1097
- throw new TypeError(`invalid ${component} pattern '${this.pattern[component]}'.`);
1098
- }
1099
- }
1100
- } catch (err) {
1101
- throw new TypeError(`Failed to construct 'URLPattern': ${err.message}`);
1102
- }
1103
- }
1104
- test(input = {}, baseURL) {
1105
- let values = {
1106
- pathname: "",
1107
- protocol: "",
1108
- username: "",
1109
- password: "",
1110
- hostname: "",
1111
- port: "",
1112
- search: "",
1113
- hash: ""
1114
- };
1115
- if (typeof input !== "string" && baseURL) {
1116
- throw new TypeError(`parameter 1 is not of type 'string'.`);
1117
- }
1118
- if (typeof input === "undefined") {
1119
- return false;
1120
- }
1121
- try {
1122
- if (typeof input === "object") {
1123
- values = applyInit(values, input, false);
1124
- } else {
1125
- values = applyInit(values, extractValues(input, baseURL), false);
1126
- }
1127
- } catch (err) {
1128
- return false;
1129
- }
1130
- let component;
1131
- for (component of COMPONENTS) {
1132
- if (!this.regexp[component].exec(values[component])) {
1133
- return false;
1134
- }
1135
- }
1136
- return true;
1137
- }
1138
- exec(input = {}, baseURL) {
1139
- let values = {
1140
- pathname: "",
1141
- protocol: "",
1142
- username: "",
1143
- password: "",
1144
- hostname: "",
1145
- port: "",
1146
- search: "",
1147
- hash: ""
1148
- };
1149
- if (typeof input !== "string" && baseURL) {
1150
- throw new TypeError(`parameter 1 is not of type 'string'.`);
1151
- }
1152
- if (typeof input === "undefined") {
1153
- return;
1154
- }
1155
- try {
1156
- if (typeof input === "object") {
1157
- values = applyInit(values, input, false);
1158
- } else {
1159
- values = applyInit(values, extractValues(input, baseURL), false);
1160
- }
1161
- } catch (err) {
1162
- return null;
1163
- }
1164
- let result = {};
1165
- if (baseURL) {
1166
- result.inputs = [input, baseURL];
1167
- } else {
1168
- result.inputs = [input];
1169
- }
1170
- let component;
1171
- for (component of COMPONENTS) {
1172
- let match = this.regexp[component].exec(values[component]);
1173
- if (!match) {
1174
- return null;
1175
- }
1176
- let groups = {};
1177
- for (let [i, key] of this.keys[component].entries()) {
1178
- if (typeof key.name === "string" || typeof key.name === "number") {
1179
- let value = match[i + 1];
1180
- groups[key.name] = value;
1181
- }
1182
- }
1183
- result[component] = {
1184
- input: values[component] || "",
1185
- groups
1186
- };
1187
- }
1188
- return result;
1189
- }
1190
- get protocol() {
1191
- return this.component_pattern.protocol;
1192
- }
1193
- get username() {
1194
- return this.component_pattern.username;
1195
- }
1196
- get password() {
1197
- return this.component_pattern.password;
1198
- }
1199
- get hostname() {
1200
- return this.component_pattern.hostname;
1201
- }
1202
- get port() {
1203
- return this.component_pattern.port;
1204
- }
1205
- get pathname() {
1206
- return this.component_pattern.pathname;
1207
- }
1208
- get search() {
1209
- return this.component_pattern.search;
1210
- }
1211
- get hash() {
1212
- return this.component_pattern.hash;
1213
- }
1214
- };
1215
-
1216
- if (!globalThis.URLPattern) {
1217
- globalThis.URLPattern = URLPattern;
1218
- }
1219
-
1220
- export { URLPattern };
1221
-
1222
- //# sourceMappingURL=index-d5330059.js.map