@haiilo/catalyst 10.2.0 → 10.4.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 (282) hide show
  1. package/dist/catalyst/assets/fonts/Lato-Black.ttf +0 -0
  2. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  3. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/Lato-BlackItalic.ttf +0 -0
  5. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  6. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/Lato-Bold.ttf +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-BoldItalic.ttf +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Hairline.ttf +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-Heavy.ttf +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Italic.ttf +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Light.ttf +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-LightItalic.ttf +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Medium.ttf +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-MediumItalic.ttf +0 -0
  38. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  39. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  40. package/dist/catalyst/assets/fonts/Lato-Regular.ttf +0 -0
  41. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  42. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  43. package/dist/catalyst/assets/fonts/Lato-Semibold.ttf +0 -0
  44. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  45. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  46. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  47. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  48. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  49. package/dist/catalyst/assets/fonts/Lato-Thin.ttf +0 -0
  50. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  51. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  52. package/dist/catalyst/assets/fonts/Lato-ThinItalic.ttf +0 -0
  53. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  54. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  55. package/dist/catalyst/catalyst.css +10 -1
  56. package/dist/catalyst/catalyst.esm.js +1 -1
  57. package/dist/catalyst/catalyst.esm.js.map +1 -1
  58. package/dist/catalyst/index.esm.js +1 -1
  59. package/dist/catalyst/p-81800b65.js +2 -0
  60. package/dist/catalyst/p-81800b65.js.map +1 -0
  61. package/dist/catalyst/p-8a1d505d.entry.js +10 -0
  62. package/dist/catalyst/p-8a1d505d.entry.js.map +1 -0
  63. package/dist/catalyst/scss/core/_form.scss +12 -3
  64. package/dist/cjs/{cat-alert_26.cjs.entry.js → cat-alert_28.cjs.entry.js} +2293 -128
  65. package/dist/cjs/cat-alert_28.cjs.entry.js.map +1 -0
  66. package/dist/cjs/catalyst.cjs.js +1 -1
  67. package/dist/cjs/index.cjs.js +1 -1
  68. package/dist/cjs/loader.cjs.js +1 -1
  69. package/dist/cjs/{of-a6e7c491.js → of-45281229.js} +34 -19
  70. package/dist/cjs/of-45281229.js.map +1 -0
  71. package/dist/collection/assets/fonts/Lato-Black.ttf +0 -0
  72. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  73. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  74. package/dist/collection/assets/fonts/Lato-BlackItalic.ttf +0 -0
  75. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  76. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  77. package/dist/collection/assets/fonts/Lato-Bold.ttf +0 -0
  78. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  79. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-BoldItalic.ttf +0 -0
  81. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  82. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  83. package/dist/collection/assets/fonts/Lato-Hairline.ttf +0 -0
  84. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  87. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  88. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  89. package/dist/collection/assets/fonts/Lato-Heavy.ttf +0 -0
  90. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  92. package/dist/collection/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  93. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  94. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  95. package/dist/collection/assets/fonts/Lato-Italic.ttf +0 -0
  96. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  97. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  98. package/dist/collection/assets/fonts/Lato-Light.ttf +0 -0
  99. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  100. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  101. package/dist/collection/assets/fonts/Lato-LightItalic.ttf +0 -0
  102. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  103. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  104. package/dist/collection/assets/fonts/Lato-Medium.ttf +0 -0
  105. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  106. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  107. package/dist/collection/assets/fonts/Lato-MediumItalic.ttf +0 -0
  108. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  109. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  110. package/dist/collection/assets/fonts/Lato-Regular.ttf +0 -0
  111. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  112. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  113. package/dist/collection/assets/fonts/Lato-Semibold.ttf +0 -0
  114. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  115. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  116. package/dist/collection/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  117. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  118. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  119. package/dist/collection/assets/fonts/Lato-Thin.ttf +0 -0
  120. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  121. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  122. package/dist/collection/assets/fonts/Lato-ThinItalic.ttf +0 -0
  123. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  124. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  125. package/dist/collection/collection-manifest.json +3 -1
  126. package/dist/collection/components/cat-alert/cat-alert.spec.js +2 -9
  127. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
  128. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +3 -7
  129. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
  130. package/dist/collection/components/cat-badge/cat-badge.spec.js +2 -6
  131. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
  132. package/dist/collection/components/cat-button/cat-button.css +29 -0
  133. package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
  134. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  135. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +2 -6
  136. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
  137. package/dist/collection/components/cat-card/cat-card.spec.js +2 -6
  138. package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
  139. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +2 -17
  140. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
  141. package/dist/collection/components/cat-date/cat-date-locale.js +54 -0
  142. package/dist/collection/components/cat-date/cat-date-locale.js.map +1 -0
  143. package/dist/collection/components/cat-date/cat-date-math.js +28 -0
  144. package/dist/collection/components/cat-date/cat-date-math.js.map +1 -0
  145. package/dist/collection/components/cat-date/cat-date.css +122 -0
  146. package/dist/collection/components/cat-date/cat-date.e2e.js +11 -0
  147. package/dist/collection/components/cat-date/cat-date.e2e.js.map +1 -0
  148. package/dist/collection/components/cat-date/cat-date.js +923 -0
  149. package/dist/collection/components/cat-date/cat-date.js.map +1 -0
  150. package/dist/collection/components/cat-date/cat-date.spec.js +16 -0
  151. package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -0
  152. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
  153. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +3 -8
  154. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
  155. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  156. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +2 -8
  157. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
  158. package/dist/collection/components/cat-dropdown/cat-dropdown.js +100 -30
  159. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  160. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +2 -8
  161. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
  162. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  163. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +2 -6
  164. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
  165. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
  166. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
  167. package/dist/collection/components/cat-icon/cat-icon-registry.js +27 -15
  168. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  169. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  170. package/dist/collection/components/cat-icon/cat-icon.spec.js +1 -1
  171. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
  172. package/dist/collection/components/cat-input/cat-input.css +15 -0
  173. package/dist/collection/components/cat-input/cat-input.js +44 -6
  174. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  175. package/dist/collection/components/cat-input/cat-input.spec.js +2 -23
  176. package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
  177. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  178. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +2 -18
  179. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
  180. package/dist/collection/components/cat-radio/cat-radio.js +1 -1
  181. package/dist/collection/components/cat-radio/cat-radio.spec.js +3 -13
  182. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
  183. package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
  184. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +2 -8
  185. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
  186. package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
  187. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +2 -13
  188. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
  189. package/dist/collection/components/cat-select/cat-select.js +4 -4
  190. package/dist/collection/components/cat-select/cat-select.spec.js +2 -28
  191. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
  192. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  193. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  194. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  195. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +2 -6
  196. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
  197. package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
  198. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +1 -1
  199. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
  200. package/dist/collection/components/cat-tab/cat-tab.js +1 -1
  201. package/dist/collection/components/cat-tab/cat-tab.spec.js +2 -5
  202. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
  203. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  204. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +2 -5
  205. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
  206. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  207. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +2 -21
  208. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
  209. package/dist/collection/components/cat-time/cat-time-locale.js +15 -0
  210. package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -0
  211. package/dist/collection/components/cat-time/cat-time-math.js +28 -0
  212. package/dist/collection/components/cat-time/cat-time-math.js.map +1 -0
  213. package/dist/collection/components/cat-time/cat-time.css +41 -0
  214. package/dist/collection/components/cat-time/cat-time.e2e.js +11 -0
  215. package/dist/collection/components/cat-time/cat-time.e2e.js.map +1 -0
  216. package/dist/collection/components/cat-time/cat-time.js +801 -0
  217. package/dist/collection/components/cat-time/cat-time.js.map +1 -0
  218. package/dist/collection/components/cat-time/cat-time.spec.js +16 -0
  219. package/dist/collection/components/cat-time/cat-time.spec.js.map +1 -0
  220. package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
  221. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +2 -10
  222. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
  223. package/dist/collection/components/cat-tooltip/cat-tooltip.js +2 -2
  224. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +1 -9
  225. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
  226. package/dist/collection/scss/core/_form.scss +12 -3
  227. package/dist/components/cat-button2.js +1 -1
  228. package/dist/components/cat-button2.js.map +1 -1
  229. package/dist/components/cat-date.d.ts +11 -0
  230. package/dist/components/cat-date.js +469 -0
  231. package/dist/components/cat-date.js.map +1 -0
  232. package/dist/components/cat-datepicker-inline.js +2 -2
  233. package/dist/components/cat-datepicker.js +2 -2
  234. package/dist/components/cat-dropdown2.js +35 -30
  235. package/dist/components/cat-dropdown2.js.map +1 -1
  236. package/dist/components/cat-form-group.js +1 -1
  237. package/dist/components/cat-icon-registry.js +33 -18
  238. package/dist/components/cat-icon-registry.js.map +1 -1
  239. package/dist/components/cat-icon2.js +1 -1
  240. package/dist/components/cat-input2.js +1572 -6
  241. package/dist/components/cat-input2.js.map +1 -1
  242. package/dist/components/cat-pagination.js +2 -2
  243. package/dist/components/cat-radio-group.js +1 -1
  244. package/dist/components/cat-radio.js +1 -1
  245. package/dist/components/cat-scrollable2.js +3 -3
  246. package/dist/components/cat-select-demo.js +1 -1
  247. package/dist/components/cat-select-demo.js.map +1 -1
  248. package/dist/components/cat-skeleton2.js +1 -1
  249. package/dist/components/cat-spinner2.js +2 -2
  250. package/dist/components/cat-tab.js +1 -1
  251. package/dist/components/cat-tabs.js +1 -1
  252. package/dist/components/cat-textarea.js +3 -3
  253. package/dist/components/cat-time.d.ts +11 -0
  254. package/dist/components/cat-time.js +303 -0
  255. package/dist/components/cat-time.js.map +1 -0
  256. package/dist/components/cat-toggle.js +1 -1
  257. package/dist/components/cat-tooltip.js +2 -2
  258. package/dist/esm/{cat-alert_26.entry.js → cat-alert_28.entry.js} +2293 -130
  259. package/dist/esm/cat-alert_28.entry.js.map +1 -0
  260. package/dist/esm/catalyst.js +1 -1
  261. package/dist/esm/index.js +2 -2
  262. package/dist/esm/loader.js +1 -1
  263. package/dist/esm/{of-d37c1933.js → of-19888f3b.js} +34 -19
  264. package/dist/esm/of-19888f3b.js.map +1 -0
  265. package/dist/types/components/cat-date/cat-date-locale.d.ts +24 -0
  266. package/dist/types/components/cat-date/cat-date-math.d.ts +7 -0
  267. package/dist/types/components/cat-date/cat-date.d.ts +180 -0
  268. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -3
  269. package/dist/types/components/cat-input/cat-input.d.ts +9 -2
  270. package/dist/types/components/cat-time/cat-time-locale.d.ts +6 -0
  271. package/dist/types/components/cat-time/cat-time-math.d.ts +3 -0
  272. package/dist/types/components/cat-time/cat-time.d.ts +168 -0
  273. package/dist/types/components.d.ts +551 -8
  274. package/package.json +7 -5
  275. package/dist/catalyst/p-37905c93.entry.js +0 -10
  276. package/dist/catalyst/p-37905c93.entry.js.map +0 -1
  277. package/dist/catalyst/p-8fc7b0f0.js +0 -2
  278. package/dist/catalyst/p-8fc7b0f0.js.map +0 -1
  279. package/dist/cjs/cat-alert_26.cjs.entry.js.map +0 -1
  280. package/dist/cjs/of-a6e7c491.js.map +0 -1
  281. package/dist/esm/cat-alert_26.entry.js.map +0 -1
  282. package/dist/esm/of-d37c1933.js.map +0 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-13aff0b4.js');
6
- const of = require('./of-a6e7c491.js');
6
+ const of = require('./of-45281229.js');
7
7
 
8
8
  const ObjectUnsubscribedError = of.createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
9
9
  _super(this);
@@ -1044,7 +1044,7 @@ function createEmptyStyleRule(query) {
1044
1044
  }
1045
1045
  }
1046
1046
 
1047
- const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}";
1047
+ const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding-left:0;padding-right:0}";
1048
1048
  const CatButtonStyle0 = catButtonCss;
1049
1049
 
1050
1050
  const CatButton = class {
@@ -1348,6 +1348,388 @@ const CatCheckbox = class {
1348
1348
  };
1349
1349
  CatCheckbox.style = CatCheckboxStyle0;
1350
1350
 
1351
+ function getDays(language, weekday = 'long') {
1352
+ const date = new Date();
1353
+ const firstDayOfWeek = (date.getUTCDate() - date.getUTCDay() + 7) % 7;
1354
+ const format = new Intl.DateTimeFormat(language, { weekday }).format;
1355
+ return [...Array(7).keys()].map(day => format(new Date(date.getTime()).setUTCDate(firstDayOfWeek + day)));
1356
+ }
1357
+ function getMonths(language, month = 'long') {
1358
+ const date = new Date(0);
1359
+ const format = new Intl.DateTimeFormat(language, { month }).format;
1360
+ return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));
1361
+ }
1362
+ function getWeekInfo(language) {
1363
+ const locale = new Intl.Locale(language);
1364
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1365
+ const weekInfo = locale.getWeekInfo?.() ?? locale.weekInfo;
1366
+ return {
1367
+ firstDay: weekInfo?.firstDay ?? 1,
1368
+ minDays: weekInfo?.minDays ?? 4,
1369
+ weekend: weekInfo?.weekend ?? [6, 7]
1370
+ };
1371
+ }
1372
+ function getFormat$1(language) {
1373
+ const format = new Intl.DateTimeFormat(language, { year: 'numeric', month: '2-digit', day: '2-digit' })
1374
+ .format(new Date(3456, 10, 22))
1375
+ .replace('3456', 'YYYY')
1376
+ .replace('56', 'YY')
1377
+ .replace('11', 'MM')
1378
+ .replace('22', 'DD');
1379
+ return /^(YYYY|YY|MM|DD)\W(YYYY|YY|MM|DD)\W(YYYY|YY|MM|DD)$/.test(format) ? format : 'DD-MM-YYYY';
1380
+ }
1381
+ function getLocale$2(language) {
1382
+ return {
1383
+ prevYear: of.catI18nRegistry.t('datepicker.prevYear'),
1384
+ nextYear: of.catI18nRegistry.t('datepicker.nextYear'),
1385
+ prevMonth: of.catI18nRegistry.t('datepicker.prevMonth'),
1386
+ nextMonth: of.catI18nRegistry.t('datepicker.nextMonth'),
1387
+ arrowKeys: of.catI18nRegistry.t('datepicker.arrowKeys'),
1388
+ today: of.catI18nRegistry.t('datepicker.today'),
1389
+ change: of.catI18nRegistry.t('datepicker.change'),
1390
+ choose: of.catI18nRegistry.t('datepicker.choose'),
1391
+ formatStr: getFormat$1(language),
1392
+ weekInfo: getWeekInfo(language),
1393
+ days: {
1394
+ short: getDays(language, 'short'),
1395
+ long: getDays(language, 'long')
1396
+ },
1397
+ months: {
1398
+ short: getMonths(language, 'short'),
1399
+ long: getMonths(language, 'long')
1400
+ }
1401
+ };
1402
+ }
1403
+
1404
+ function isLeapYear(year) {
1405
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
1406
+ }
1407
+ function addDays(date, n) {
1408
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);
1409
+ }
1410
+ function addMonth(date, n) {
1411
+ const [year, month, day] = [date.getFullYear(), date.getMonth(), date.getDate()];
1412
+ const maxDays = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1413
+ const newDate = new Date(date);
1414
+ newDate.setDate(1);
1415
+ newDate.setMonth(newDate.getMonth() + n);
1416
+ newDate.setDate(Math.min(day, maxDays[(month + (n % 12) + 12) % 12]));
1417
+ return newDate;
1418
+ }
1419
+ function isSameYear(date1, date2) {
1420
+ return !!date1 && !!date2 && date1.getFullYear() === date2.getFullYear();
1421
+ }
1422
+ function isSameMonth(date1, date2) {
1423
+ return !!date1 && !!date2 && date1.getMonth() === date2.getMonth() && isSameYear(date1, date2);
1424
+ }
1425
+ function isSameDay(date1, date2) {
1426
+ return !!date1 && !!date2 && date1.getDate() === date2.getDate() && isSameMonth(date1, date2);
1427
+ }
1428
+ function clampDate(min, date, max) {
1429
+ return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));
1430
+ }
1431
+
1432
+ const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.picker{padding:1rem;display:inline-flex;flex-direction:column}.picker-head{display:flex;gap:0.5rem;align-items:center}.picker-head h3{flex:1;text-align:center;margin:0}.picker-grid{display:grid;grid-template-rows:2rem repeat(6, 1fr);grid-template-columns:2rem repeat(7, 1fr);grid-template-areas:\". h h h h h h h\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\";margin:1rem 0 0.5rem}.picker-grid-head{grid-area:h;display:grid;grid-template-columns:repeat(7, 1fr);place-items:end center;padding-bottom:0.5rem}.picker-grid-weeks{grid-area:w;display:grid;grid-template-rows:repeat(6, 1fr);place-items:center right;padding-right:0.5rem}.picker-grid-days{grid-area:d;display:grid;grid-template-rows:repeat(6, 1fr);grid-template-columns:repeat(7, 1fr)}.picker-grid-head>*,.picker-grid-weeks>*{font-size:0.75rem;line-height:1rem;font-weight:600;color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-decoration:none}.date-other{opacity:0.5}.date-disabled{opacity:0.25}.picker-foot{display:flex;gap:1rem;align-items:center}.cursor-help{flex:1;margin:0;font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-align:center}.cursor-help.cursor-right{text-align:right}.cursor-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}";
1433
+ const CatDateStyle0 = catDateCss;
1434
+
1435
+ const CatDate = class {
1436
+ constructor(hostRef) {
1437
+ index.registerInstance(this, hostRef);
1438
+ this.catChange = index.createEvent(this, "catChange", 7);
1439
+ this.catFocus = index.createEvent(this, "catFocus", 7);
1440
+ this.catBlur = index.createEvent(this, "catBlur", 7);
1441
+ this.language = of.catI18nRegistry.getLocale();
1442
+ this.locale = getLocale$2(this.language);
1443
+ this.isOpen = false;
1444
+ // additonally store the focus date to ensure correct focus after potential re-render
1445
+ this.focusDate = null;
1446
+ this.hasSlottedLabel = false;
1447
+ this.hasSlottedHint = false;
1448
+ this.viewDate = this.now;
1449
+ this.selectionDate = null;
1450
+ this.requiredMarker = 'optional';
1451
+ this.horizontal = false;
1452
+ this.autoComplete = undefined;
1453
+ this.clearable = false;
1454
+ this.disabled = false;
1455
+ this.hint = undefined;
1456
+ this.icon = undefined;
1457
+ this.iconRight = false;
1458
+ this.identifier = undefined;
1459
+ this.label = '';
1460
+ this.labelHidden = false;
1461
+ this.max = undefined;
1462
+ this.min = undefined;
1463
+ this.name = undefined;
1464
+ this.placeholder = undefined;
1465
+ this.textPrefix = undefined;
1466
+ this.textSuffix = undefined;
1467
+ this.readonly = false;
1468
+ this.required = false;
1469
+ this.value = undefined;
1470
+ this.errors = undefined;
1471
+ this.errorUpdate = 0;
1472
+ this.nativeAttributes = undefined;
1473
+ this.placement = 'bottom-end';
1474
+ }
1475
+ get maxDate() {
1476
+ const [y, m, d] = this.max?.split('-').map(Number) || [];
1477
+ return this.max ? new Date(y, m - 1, d) : null;
1478
+ }
1479
+ get minDate() {
1480
+ const [y, m, d] = this.min?.split('-').map(Number) || [];
1481
+ return this.min ? new Date(y, m - 1, d) : null;
1482
+ }
1483
+ get now() {
1484
+ const date = new Date();
1485
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
1486
+ }
1487
+ get focusedDate() {
1488
+ const [all, year, month, day] = this.hostElement.shadowRoot
1489
+ ?.querySelector(`[data-date]:focus`)
1490
+ ?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
1491
+ return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
1492
+ }
1493
+ componentWillLoad() {
1494
+ const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
1495
+ if (match) {
1496
+ this.select(new Date(Number(year), Number(month) - 1, Number(day)));
1497
+ }
1498
+ }
1499
+ componentWillRender() {
1500
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
1501
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
1502
+ }
1503
+ componentDidLoad() {
1504
+ const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');
1505
+ const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(format) || [];
1506
+ this.input?.mask({
1507
+ date: true,
1508
+ dateMin: this.min,
1509
+ dateMax: this.max,
1510
+ delimiter: d1,
1511
+ datePattern: [p1, p2, p3]
1512
+ });
1513
+ }
1514
+ componentDidRender() {
1515
+ if (this.focusDate) {
1516
+ this.hostElement.shadowRoot
1517
+ ?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
1518
+ ?.doFocus();
1519
+ this.focusDate = null;
1520
+ }
1521
+ }
1522
+ onOpen() {
1523
+ this.isOpen = true;
1524
+ this.setAriaLive('');
1525
+ const viewDate = this.selectionDate
1526
+ ? new Date(this.selectionDate.getFullYear(), this.selectionDate.getMonth(), 1)
1527
+ : this.now;
1528
+ this.viewDate = clampDate(this.minDate, viewDate, this.maxDate);
1529
+ }
1530
+ onClose() {
1531
+ this.isOpen = false;
1532
+ }
1533
+ onKeyDown(e) {
1534
+ if (!this.isOpen || !['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
1535
+ return;
1536
+ }
1537
+ const focused = this.focusedDate;
1538
+ if (!focused) {
1539
+ e.preventDefault();
1540
+ this.focus(this.selectionDate || this.now);
1541
+ }
1542
+ else if (e.key === 'ArrowLeft') {
1543
+ e.preventDefault();
1544
+ this.focus(e.shiftKey ? addMonth(focused, -1) : addDays(focused, -1));
1545
+ }
1546
+ else if (e.key === 'ArrowRight') {
1547
+ e.preventDefault();
1548
+ this.focus(e.shiftKey ? addMonth(focused, 1) : addDays(focused, 1));
1549
+ }
1550
+ else if (e.key === 'ArrowUp') {
1551
+ e.preventDefault();
1552
+ this.focus(addDays(focused, -7));
1553
+ }
1554
+ else if (e.key === 'ArrowDown') {
1555
+ e.preventDefault();
1556
+ this.focus(addDays(focused, 7));
1557
+ }
1558
+ }
1559
+ /**
1560
+ * Select a date in the picker.
1561
+ *
1562
+ * @param date The date to select.
1563
+ */
1564
+ async select(date) {
1565
+ const oldValue = this.value;
1566
+ const newDate = clampDate(this.minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), this.maxDate);
1567
+ this.focus(newDate);
1568
+ this.selectionDate = newDate;
1569
+ this.value = newDate.toISOString();
1570
+ if (oldValue !== this.value) {
1571
+ this.catChange.emit(this.value);
1572
+ }
1573
+ }
1574
+ /**
1575
+ * Programmatically move focus to the input. Use this method instead of
1576
+ * `input.focus()`.
1577
+ *
1578
+ * @param options An optional object providing options to control aspects of
1579
+ * the focusing process.
1580
+ */
1581
+ async doFocus(options) {
1582
+ this.input?.doFocus(options);
1583
+ }
1584
+ /**
1585
+ * Programmatically remove focus from the input. Use this method instead of
1586
+ * `input.blur()`.
1587
+ */
1588
+ async doBlur() {
1589
+ this.input?.doBlur();
1590
+ }
1591
+ /**
1592
+ * Clear the input.
1593
+ */
1594
+ async clear() {
1595
+ this.input?.clear();
1596
+ }
1597
+ render() {
1598
+ const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
1599
+ return (index.h(index.Host, { key: 'ebb5f193ca43bc3306449c91d2e391cb25b3287c' }, index.h("cat-input", { key: '27292844d077a8d79022074a191c47e72736d2c5', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.getInputValue(), onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, index.h("span", { key: 'e9c9ad5b5374fcf944396a7ae45ae61775336be4', slot: "label" }, this.label, index.h("span", { key: '5a05917857fdc967bb122e0403f64b8b71ecf08a', class: "label-aria" }, " (", this.locale.formatStr, ")")), index.h("cat-dropdown", { key: 'ac1b7f5e1efae2648fa82acb31059ab41d0adb55', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true }, index.h("cat-button", { key: 'bfaabd6f8120333b497b262894489628beb1d886', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.selectionDate
1600
+ ? `${this.locale.change}, ${this.getA11yLabelDay(this.selectionDate)}`
1601
+ : this.locale.choose }), index.h("div", { key: '9cfb02ca034584dcdd23fadb5f41ca598552a605', class: "picker", slot: "content" }, index.h("div", { key: '4d09c5f3ca84346bbcc68f4c83f3413159b8b608', class: "picker-head" }, index.h("cat-button", { key: '9e8d1695f1a882f2388a2b57ccd8cc51e8b52483', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), index.h("cat-button", { key: '5af1b092c2f0d13e5c12d49699e85ea5dded7580', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), index.h("h3", { key: 'cd730386e0fc19a4b12ee2910e6de7f079133584' }, this.getHeadline()), index.h("cat-button", { key: 'f0c76ac04573977e255956d2e377dd197080a5b8', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), index.h("cat-button", { key: 'd58917e0665df029acc6dac35e7ab05eab60f9d4', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), index.h("div", { key: '5307170ba72c90fceef4276aa5feb74dc569c74d', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, index.h("div", { key: 'acd6b0e720722ed3e3d013463645fe294a75b68d', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (index.h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), index.h("div", { key: 'a8b349d48f3595b7a29a037fb48b130dfb9af438', class: "picker-grid-weeks" }, dateGrid
1602
+ .filter((_, i) => i % 7 === 0)
1603
+ .map(day => (index.h("div", null, this.getWeekNumber(day))))), index.h("div", { key: '1e7750157710763ad977d866bb2e511b6ec44d03', class: "picker-grid-days" }, dateGrid.map(day => (index.h("cat-button", { class: {
1604
+ 'cat-date-item': true,
1605
+ 'date-other': !isSameMonth(this.viewDate, day),
1606
+ 'date-today': isSameDay(this.now, day),
1607
+ 'date-selected': isSameDay(this.selectionDate, day),
1608
+ 'date-focusable': this.canFocus(day),
1609
+ 'date-disabled': !this.canClick(day)
1610
+ }, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isSameDay(this.selectionDate, day) ? 'filled' : isSameDay(this.now, day) ? 'outlined' : 'text', a11yLabel: this.getA11yLabelDay(day), active: isSameDay(this.selectionDate, day), color: isSameDay(this.selectionDate, day) || isSameDay(this.now, day) ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.toLocalISO(day) }, day.getDate()))))), index.h("div", { key: 'd8874097357312b5ddd4bda5e4018d3e642aaf99', class: "picker-foot" }, this.canClick(this.now) && (index.h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.now) }, this.locale.today)), index.h("p", { key: '42d936d44ef0cb07375415ae42a95565cd7f342b', class: {
1611
+ 'cursor-help': true,
1612
+ 'cursor-right': this.canClick(this.now)
1613
+ } }, this.locale.arrowKeys), index.h("p", { key: '6df5566486d5082b3c2cb79fde22cedd7608c8bf', class: "cursor-aria", "aria-live": "polite" })))))));
1614
+ }
1615
+ parse(value) {
1616
+ const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
1617
+ const formatParts = [p1, p2, p3];
1618
+ const parts = value.split(d1).map(s => Number(s || 'x'));
1619
+ let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.now.getFullYear();
1620
+ const month = parts[formatParts.indexOf('MM')];
1621
+ const day = parts[formatParts.indexOf('DD')];
1622
+ if (!Number.isInteger(month) || !Number.isInteger(day)) {
1623
+ return null;
1624
+ }
1625
+ else if (year < 100) {
1626
+ year += year < 50 ? 2000 : 1900;
1627
+ }
1628
+ return new Date(year, month - 1, day);
1629
+ }
1630
+ focus(date) {
1631
+ this.focusDate = clampDate(this.minDate, date, this.maxDate);
1632
+ this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());
1633
+ this.hostElement.shadowRoot
1634
+ ?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
1635
+ ?.doFocus();
1636
+ }
1637
+ navigate(direction, period) {
1638
+ this.viewDate = new Date(direction === 'prev'
1639
+ ? period === 'year'
1640
+ ? this.viewDate.setFullYear(this.viewDate.getFullYear() - 1)
1641
+ : this.viewDate.setMonth(this.viewDate.getMonth() - 1)
1642
+ : period === 'year'
1643
+ ? this.viewDate.setFullYear(this.viewDate.getFullYear() + 1)
1644
+ : this.viewDate.setMonth(this.viewDate.getMonth() + 1));
1645
+ // announce the new month and year
1646
+ this.setAriaLive(this.getHeadline());
1647
+ }
1648
+ setAriaLive(text) {
1649
+ const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');
1650
+ if (node) {
1651
+ node.innerHTML = text;
1652
+ }
1653
+ }
1654
+ onInputBlur(e) {
1655
+ if (!this.input) {
1656
+ return;
1657
+ }
1658
+ const oldValue = this.value;
1659
+ const value = this.parse(this.input.value ?? '');
1660
+ this.selectionDate = value ? clampDate(this.minDate, value, this.maxDate) : value;
1661
+ this.value = this.selectionDate?.toISOString();
1662
+ if (oldValue !== this.value) {
1663
+ this.catChange.emit(this.value);
1664
+ }
1665
+ this.input.value = this.getInputValue();
1666
+ this.catBlur.emit(e);
1667
+ }
1668
+ dateGrid(year, month) {
1669
+ const firstDayOfWeek = new Date(year, month, 1).getDay();
1670
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1671
+ const days = [...Array(daysInMonth).keys()];
1672
+ const daysBefore = [...Array(firstDayOfWeek).keys()].map(day => new Date(year, month, day - firstDayOfWeek).getDate());
1673
+ const daysAfter = [...Array(42 - days.length - daysBefore.length).keys()];
1674
+ return [
1675
+ ...daysBefore.map(day => new Date(year, month - 1, day + 1)),
1676
+ ...days.map(day => new Date(year, month, day + 1)),
1677
+ ...daysAfter.map(day => new Date(year, month + 1, day + 1))
1678
+ ];
1679
+ }
1680
+ getHeadline() {
1681
+ return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
1682
+ }
1683
+ getInputValue() {
1684
+ const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
1685
+ return this.selectionDate ? format.format(this.selectionDate) : '';
1686
+ }
1687
+ getA11yLabelDay(date) {
1688
+ const format = new Intl.DateTimeFormat(this.language, {
1689
+ year: 'numeric',
1690
+ month: 'long',
1691
+ day: 'numeric',
1692
+ weekday: 'long'
1693
+ });
1694
+ return format.format(date);
1695
+ }
1696
+ getWeekNumber(date, iso8601 = true) {
1697
+ const currentDate = new Date(date.getTime());
1698
+ const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();
1699
+ currentDate.setDate(currentDate.getDate() + 4 - dayNum);
1700
+ const yearStart = new Date(currentDate.getFullYear(), 0, 1);
1701
+ return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);
1702
+ }
1703
+ canFocus(date) {
1704
+ const now = this.now;
1705
+ const focused = this.focusedDate;
1706
+ if (focused && isSameMonth(focused, this.viewDate)) {
1707
+ return isSameMonth(focused, date) && isSameDay(focused, date);
1708
+ }
1709
+ else if (this.selectionDate && isSameMonth(this.selectionDate, this.viewDate)) {
1710
+ return isSameMonth(this.selectionDate, date) && isSameDay(this.selectionDate, date);
1711
+ }
1712
+ else if (isSameMonth(this.viewDate, now) && (!this.minDate || this.minDate <= now)) {
1713
+ return isSameMonth(this.viewDate, date) && isSameDay(now, date);
1714
+ }
1715
+ const minDay = isSameMonth(date, this.minDate) ? this.minDate?.getDate() ?? 1 : 1;
1716
+ return isSameMonth(this.viewDate, date) && date.getDate() === minDay;
1717
+ }
1718
+ canClick(date) {
1719
+ const min = this.minDate;
1720
+ const max = this.maxDate;
1721
+ return (!min || min <= date) && (!max || max >= date);
1722
+ }
1723
+ toLocalISO(date) {
1724
+ const year = date.getFullYear();
1725
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
1726
+ const day = date.getDate().toString().padStart(2, '0');
1727
+ return `${year}-${month}-${day}`;
1728
+ }
1729
+ get hostElement() { return index.getElement(this); }
1730
+ };
1731
+ CatDate.style = CatDateStyle0;
1732
+
1351
1733
  var HOOKS = [
1352
1734
  "onChange",
1353
1735
  "onClose",
@@ -4109,7 +4491,7 @@ function getFormat(language, mode) {
4109
4491
  .replace(/AM|PM/i, 'K');
4110
4492
  }
4111
4493
 
4112
- function getHour12(language) {
4494
+ function getHour12$1(language) {
4113
4495
  const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })
4114
4496
  .format(new Date())
4115
4497
  .toLowerCase();
@@ -4132,7 +4514,7 @@ function monthsForLocale(language, month = 'long') {
4132
4514
  const format = new Intl.DateTimeFormat(language, { month }).format;
4133
4515
  return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));
4134
4516
  }
4135
- function getLocale(language) {
4517
+ function getLocale$1(language) {
4136
4518
  return {
4137
4519
  firstDayOfWeek: getFirstDayOfWeek(language),
4138
4520
  rangeSeparator: ' - ',
@@ -4143,7 +4525,7 @@ function getLocale(language) {
4143
4525
  minuteAriaLabel: of.catI18nRegistry.t('datepicker.minute'),
4144
4526
  toggleTitle: of.catI18nRegistry.t('datepicker.toggle'),
4145
4527
  scrollTitle: of.catI18nRegistry.t('datepicker.scroll'),
4146
- time_24hr: !getHour12(language),
4528
+ time_24hr: !getHour12$1(language),
4147
4529
  weekdays: {
4148
4530
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4149
4531
  shorthand: daysForLocale(language, 'short'),
@@ -5706,7 +6088,7 @@ const CatDatepickerFlat = class {
5706
6088
  }
5707
6089
  render() {
5708
6090
  return [
5709
- index.h("cat-input", { key: 'd3848f35807c0d52c576af50c46fb609afb043d2', ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
6091
+ index.h("cat-input", { key: '30fb619a94e93a583bf7df28945917562c6b184f', ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
5710
6092
  e.stopPropagation();
5711
6093
  this.value = e.detail || undefined;
5712
6094
  }, onCatFocus: e => {
@@ -5716,7 +6098,7 @@ const CatDatepickerFlat = class {
5716
6098
  e.stopPropagation();
5717
6099
  this.catBlur.emit(e.detail);
5718
6100
  } }, this.hasSlottedLabel && (index.h("span", { slot: "label" }, index.h("slot", { name: "label" }))), this.hasSlottedHint && (index.h("span", { slot: "hint" }, index.h("slot", { name: "hint" })))),
5719
- index.h("div", { key: 'f773fd3007b93efbaf270376e6029f45e94e42b3', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
6101
+ index.h("div", { key: 'f28f001436363260ec7c9dff26a8f82475c98ac5', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
5720
6102
  ];
5721
6103
  }
5722
6104
  initDatepicker(input) {
@@ -5727,7 +6109,7 @@ const CatDatepickerFlat = class {
5727
6109
  const withinDropdown = !!findClosest('cat-dropdown', input);
5728
6110
  const nativePickerAttributes = withinDropdown ? { 'data-dropdown-no-close': '' } : {};
5729
6111
  return flatpickr(input, getConfig({
5730
- locale: getLocale(of.catI18nRegistry.getLocale()),
6112
+ locale: getLocale$1(of.catI18nRegistry.getLocale()),
5731
6113
  format: getFormat(of.catI18nRegistry.getLocale(), this.mode),
5732
6114
  mode: this.mode,
5733
6115
  min: this.min,
@@ -5819,18 +6201,18 @@ const CatDatepickerInline = class {
5819
6201
  this.pickr = this.initDatepicker(this.input);
5820
6202
  }
5821
6203
  render() {
5822
- return (index.h(index.Host, { key: '76c2554d2968d81f9610a48498a2cc688d65f596' }, index.h("div", { key: '029811c7aaec4382d62be054965864556112a017', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
6204
+ return (index.h(index.Host, { key: 'bb9ebb60420d1268751f6136e38d1aed5bc74602' }, index.h("div", { key: 'b84cc674ab3b677ceb646dee84b1b83d5d969746', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
5823
6205
  'datepicker-wrapper': true,
5824
6206
  'datepicker-disabled': this.disabled,
5825
6207
  'datepicker-readonly': this.readonly
5826
- } }, index.h("input", { key: '2f4ccdf0392adcb7d231639d078b12eba82cd477', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
6208
+ } }, index.h("input", { key: '6f7706220aa7465a907391e78f97a5e1ad91fdf0', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
5827
6209
  }
5828
6210
  initDatepicker(input) {
5829
6211
  if (!input) {
5830
6212
  return;
5831
6213
  }
5832
6214
  return flatpickr(input, getConfig({
5833
- locale: getLocale(of.catI18nRegistry.getLocale()),
6215
+ locale: getLocale$1(of.catI18nRegistry.getLocale()),
5834
6216
  format: getFormat(of.catI18nRegistry.getLocale(), this.mode),
5835
6217
  mode: this.mode,
5836
6218
  min: this.min,
@@ -7379,6 +7761,8 @@ const CatDropdown = class {
7379
7761
  this.isOpen = false;
7380
7762
  this.placement = 'bottom-start';
7381
7763
  this.noAutoClose = false;
7764
+ this.arrowNavigation = 'vertical';
7765
+ this.noResize = false;
7382
7766
  this.overflow = false;
7383
7767
  }
7384
7768
  clickHandler(event) {
@@ -7421,7 +7805,6 @@ const CatDropdown = class {
7421
7805
  this.isOpen = true;
7422
7806
  this.content.classList.add('show');
7423
7807
  this.trigger?.setAttribute('aria-expanded', 'true');
7424
- this.catOpen.emit();
7425
7808
  this.trap = this.trap
7426
7809
  ? this.trap.updateContainerElements(this.content)
7427
7810
  : createFocusTrap(this.content, {
@@ -7434,7 +7817,25 @@ const CatDropdown = class {
7434
7817
  !event.composedPath().includes(this.content) &&
7435
7818
  // check if click was not on an element marked with data-dropdown-no-close
7436
7819
  !event.composedPath().find(el => this.hasAttribute(el, 'data-dropdown-no-close')),
7437
- onPostDeactivate: () => this.close()
7820
+ onPostDeactivate: () => this.close(),
7821
+ onPostActivate: () => this.catOpen.emit(),
7822
+ setReturnFocus: elem => this.trigger || elem,
7823
+ isKeyForward: event => {
7824
+ if ((this.arrowNavigation === 'horizontal' && event.key === 'ArrowRight') ||
7825
+ (this.arrowNavigation === 'vertical' && event.key === 'ArrowDown')) {
7826
+ event.preventDefault();
7827
+ return true;
7828
+ }
7829
+ return event.key === 'Tab';
7830
+ },
7831
+ isKeyBackward: event => {
7832
+ if ((this.arrowNavigation === 'horizontal' && event.key === 'ArrowLeft') ||
7833
+ (this.arrowNavigation === 'vertical' && event.key === 'ArrowUp')) {
7834
+ event.preventDefault();
7835
+ return true;
7836
+ }
7837
+ return event.key === 'Tab' && event.shiftKey;
7838
+ }
7438
7839
  });
7439
7840
  this.trap.activate();
7440
7841
  });
@@ -7458,27 +7859,8 @@ const CatDropdown = class {
7458
7859
  this.catClose.emit();
7459
7860
  }, timeTransitionS);
7460
7861
  }
7461
- componentDidLoad() {
7462
- this.keyListener = event => {
7463
- if (this.isOpen && ['ArrowDown', 'ArrowUp'].includes(event.key)) {
7464
- const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });
7465
- const activeElement = firstTabbable(document.activeElement);
7466
- const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;
7467
- const activeOff = event.key === 'ArrowDown' ? 1 : -1;
7468
- const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
7469
- targetElements[targetIdx].focus();
7470
- event.preventDefault();
7471
- }
7472
- };
7473
- document.addEventListener('keydown', this.keyListener);
7474
- }
7475
- disconnectedCallback() {
7476
- if (this.keyListener) {
7477
- document.removeEventListener('keydown', this.keyListener);
7478
- }
7479
- }
7480
7862
  render() {
7481
- return (index.h(index.Host, { key: '1302105901512a7bc803b09b677403c29a7e4d0f' }, index.h("slot", { key: 'b99d3b3428881473ef9cc1e8060b6664287108d7', name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { key: 'e221df97109e862d3f8af2ba83f4554ff19fff5b', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, index.h("slot", { key: 'bac2c0b2b1550f53e30ab34bf818f12b48706902', name: "content" }))));
7863
+ return (index.h(index.Host, { key: 'b9a95b9b2c0e084fe0036989f174ee1681ecfe96' }, index.h("slot", { key: '73d2e8b7dd4c67f95c6b9faa34142de00eb25c4e', name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { key: '6555cf3ab1b4f0cfcea0e9ba85221f3de5cede82', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, index.h("slot", { key: '70dab119fa43e67e1d17b558519028c0f9da60d4', name: "content" }))));
7482
7864
  }
7483
7865
  get contentId() {
7484
7866
  return `cat-dropdown-${this.id}`;
@@ -7510,12 +7892,9 @@ const CatDropdown = class {
7510
7892
  }
7511
7893
  update() {
7512
7894
  if (this.trigger) {
7513
- computePosition(this.trigger, this.content, {
7514
- strategy: 'fixed',
7515
- placement: this.placement,
7516
- middleware: [
7517
- offset(CatDropdown.OFFSET),
7518
- flip(),
7895
+ const resize = this.noResize
7896
+ ? []
7897
+ : [
7519
7898
  size({
7520
7899
  padding: CatDropdown.OFFSET,
7521
7900
  apply({ availableWidth, availableHeight, elements }) {
@@ -7525,7 +7904,11 @@ const CatDropdown = class {
7525
7904
  });
7526
7905
  }
7527
7906
  })
7528
- ]
7907
+ ];
7908
+ computePosition(this.trigger, this.content, {
7909
+ strategy: 'fixed',
7910
+ placement: this.placement,
7911
+ middleware: [offset(CatDropdown.OFFSET), flip(), ...resize]
7529
7912
  }).then(({ x, y, placement }) => {
7530
7913
  this.content.dataset.placement = placement;
7531
7914
  Object.assign(this.content.style, {
@@ -7563,7 +7946,7 @@ const CatFormGroup = class {
7563
7946
  });
7564
7947
  }
7565
7948
  render() {
7566
- return (index.h(index.Host, { key: '548a16590d7b83ed3e85de1ef3c9a78698c4e9b9', style: { '--label-size': this.labelSize } }, index.h("slot", { key: 'ff24db84c7429388eb78e57d7438e0c3c6e93e76', onSlotchange: this.onSlotChange.bind(this) })));
7949
+ return (index.h(index.Host, { key: 'd9805ae9997123327fa6259d9e849dff68576b31', style: { '--label-size': this.labelSize } }, index.h("slot", { key: 'e7e254cf202b8ee8a219ec077e659fde18db3530', onSlotchange: this.onSlotChange.bind(this) })));
7567
7950
  }
7568
7951
  onSlotChange() {
7569
7952
  this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
@@ -7595,7 +7978,7 @@ const CatIcon = class {
7595
7978
  this.a11yLabel = undefined;
7596
7979
  }
7597
7980
  render() {
7598
- return (index.h("span", { key: 'f7ef8a40c1fe37966b886ef9cd1a726a536dd08b', innerHTML: this.iconSrc || (this.icon ? of.catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
7981
+ return (index.h("span", { key: 'ace2ec39a623d9c8168269a5b4c46c4efef2fbc7', innerHTML: this.iconSrc || (this.icon ? of.catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
7599
7982
  icon: true,
7600
7983
  [`icon-${this.size}`]: this.size !== 'inline'
7601
7984
  } }));
@@ -7603,70 +7986,1627 @@ const CatIcon = class {
7603
7986
  };
7604
7987
  CatIcon.style = CatIconStyle0;
7605
7988
 
7606
- /* eslint-disable @typescript-eslint/no-explicit-any */
7607
- function coerceBoolean(value) {
7608
- return value != null && `${value}` !== 'false';
7609
- }
7610
- function coerceNumber(value, fallbackValue = 0) {
7611
- return isNumberValue(value) ? Number(value) : fallbackValue;
7612
- }
7613
- function isNumberValue(value) {
7614
- return !isNaN(parseFloat(value)) && !isNaN(Number(value));
7615
- }
7989
+ var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7990
+
7991
+ var NumeralFormatter = function (numeralDecimalMark,
7992
+ numeralIntegerScale,
7993
+ numeralDecimalScale,
7994
+ numeralThousandsGroupStyle,
7995
+ numeralPositiveOnly,
7996
+ stripLeadingZeroes,
7997
+ prefix,
7998
+ signBeforePrefix,
7999
+ tailPrefix,
8000
+ delimiter) {
8001
+ var owner = this;
8002
+
8003
+ owner.numeralDecimalMark = numeralDecimalMark || '.';
8004
+ owner.numeralIntegerScale = numeralIntegerScale > 0 ? numeralIntegerScale : 0;
8005
+ owner.numeralDecimalScale = numeralDecimalScale >= 0 ? numeralDecimalScale : 2;
8006
+ owner.numeralThousandsGroupStyle = numeralThousandsGroupStyle || NumeralFormatter.groupStyle.thousand;
8007
+ owner.numeralPositiveOnly = !!numeralPositiveOnly;
8008
+ owner.stripLeadingZeroes = stripLeadingZeroes !== false;
8009
+ owner.prefix = (prefix || prefix === '') ? prefix : '';
8010
+ owner.signBeforePrefix = !!signBeforePrefix;
8011
+ owner.tailPrefix = !!tailPrefix;
8012
+ owner.delimiter = (delimiter || delimiter === '') ? delimiter : ',';
8013
+ owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : '';
8014
+ };
7616
8015
 
7617
- const catInputCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-info{background-color:rgb(var(--cat-info-bg, 0, 115, 230)) !important;color:rgb(var(--cat-info-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-info-hover{transition:background-color 125ms, color 125ms}.cat-bg-info-hover:hover{background-color:rgb(var(--cat-info-bg-hover, 0, 107, 227)) !important;color:rgb(var(--cat-info-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-info,.cat-link-info{color:rgb(var(--cat-info-text, 0, 115, 230)) !important}.cat-link-info,.cat-text-info-hover{transition:color 125ms}.cat-link-info:hover,.cat-text-info-hover:hover{color:rgb(var(--cat-info-text-hover, 0, 107, 227)) !important}.cat-link-info:active,.cat-text-info-hover:active{color:rgb(var(--cat-info-text-active, 0, 96, 223)) !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-text-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-bg-muted{background-color:#f2f4f7 !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-optional,.label-character-count{display:inline-flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem}.label-character-count{margin-left:auto}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;font-size:0.9375rem;line-height:1.25rem}:host([hidden]){display:none}.input-field,.input-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.input-field.input-horizontal{flex-direction:row;gap:1rem}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-readonly{pointer-events:none}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input.has-clearable,input.has-toggle-password{padding-right:1.5rem}input.has-clearable.has-toggle-password{padding-right:3.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.toggle-password{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.has-clearable~.toggle-password{right:1.5rem}";
7618
- const CatInputStyle0 = catInputCss;
8016
+ NumeralFormatter.groupStyle = {
8017
+ thousand: 'thousand',
8018
+ lakh: 'lakh',
8019
+ wan: 'wan',
8020
+ none: 'none'
8021
+ };
7619
8022
 
7620
- let nextUniqueId$6 = 0;
7621
- const CatInput = class {
7622
- constructor(hostRef) {
7623
- index.registerInstance(this, hostRef);
7624
- this.catChange = index.createEvent(this, "catChange", 7);
7625
- this.catFocus = index.createEvent(this, "catFocus", 7);
7626
- this.catBlur = index.createEvent(this, "catBlur", 7);
7627
- this._id = `cat-input-${nextUniqueId$6++}`;
7628
- this.hasSlottedLabel = false;
7629
- this.hasSlottedHint = false;
7630
- this.isPasswordShown = false;
7631
- this.errorMap = undefined;
7632
- this.requiredMarker = 'optional';
7633
- this.horizontal = false;
7634
- this.autoComplete = undefined;
7635
- this.clearable = false;
7636
- this.togglePassword = false;
7637
- this.disabled = false;
7638
- this.hint = undefined;
7639
- this.icon = undefined;
7640
- this.iconRight = false;
7641
- this.identifier = undefined;
7642
- this.label = '';
7643
- this.labelHidden = false;
7644
- this.max = undefined;
7645
- this.maxLength = undefined;
7646
- this.min = undefined;
7647
- this.minLength = undefined;
7648
- this.name = undefined;
7649
- this.placeholder = undefined;
7650
- this.textPrefix = undefined;
7651
- this.textSuffix = undefined;
7652
- this.readonly = false;
7653
- this.required = false;
7654
- this.round = false;
7655
- this.type = 'text';
7656
- this.value = undefined;
7657
- this.errors = undefined;
7658
- this.errorUpdate = 0;
7659
- this.nativeAttributes = undefined;
7660
- }
7661
- get id() {
7662
- return this.identifier || this._id;
7663
- }
7664
- componentWillRender() {
7665
- this.onErrorsChanged(this.errors);
7666
- this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
7667
- this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
7668
- if (!this.label && !this.hasSlottedLabel) {
7669
- of.log.warn('[A11y] Missing ARIA label on input', this);
8023
+ NumeralFormatter.prototype = {
8024
+ getRawValue: function (value) {
8025
+ return value.replace(this.delimiterRE, '').replace(this.numeralDecimalMark, '.');
8026
+ },
8027
+
8028
+ format: function (value) {
8029
+ var owner = this, parts, partSign, partSignAndPrefix, partInteger, partDecimal = '';
8030
+
8031
+ // strip alphabet letters
8032
+ value = value.replace(/[A-Za-z]/g, '')
8033
+ // replace the first decimal mark with reserved placeholder
8034
+ .replace(owner.numeralDecimalMark, 'M')
8035
+
8036
+ // strip non numeric letters except minus and "M"
8037
+ // this is to ensure prefix has been stripped
8038
+ .replace(/[^\dM-]/g, '')
8039
+
8040
+ // replace the leading minus with reserved placeholder
8041
+ .replace(/^\-/, 'N')
8042
+
8043
+ // strip the other minus sign (if present)
8044
+ .replace(/\-/g, '')
8045
+
8046
+ // replace the minus sign (if present)
8047
+ .replace('N', owner.numeralPositiveOnly ? '' : '-')
8048
+
8049
+ // replace decimal mark
8050
+ .replace('M', owner.numeralDecimalMark);
8051
+
8052
+ // strip any leading zeros
8053
+ if (owner.stripLeadingZeroes) {
8054
+ value = value.replace(/^(-)?0+(?=\d)/, '$1');
8055
+ }
8056
+
8057
+ partSign = value.slice(0, 1) === '-' ? '-' : '';
8058
+ if (typeof owner.prefix != 'undefined') {
8059
+ if (owner.signBeforePrefix) {
8060
+ partSignAndPrefix = partSign + owner.prefix;
8061
+ } else {
8062
+ partSignAndPrefix = owner.prefix + partSign;
8063
+ }
8064
+ } else {
8065
+ partSignAndPrefix = partSign;
8066
+ }
8067
+
8068
+ partInteger = value;
8069
+
8070
+ if (value.indexOf(owner.numeralDecimalMark) >= 0) {
8071
+ parts = value.split(owner.numeralDecimalMark);
8072
+ partInteger = parts[0];
8073
+ partDecimal = owner.numeralDecimalMark + parts[1].slice(0, owner.numeralDecimalScale);
8074
+ }
8075
+
8076
+ if(partSign === '-') {
8077
+ partInteger = partInteger.slice(1);
8078
+ }
8079
+
8080
+ if (owner.numeralIntegerScale > 0) {
8081
+ partInteger = partInteger.slice(0, owner.numeralIntegerScale);
8082
+ }
8083
+
8084
+ switch (owner.numeralThousandsGroupStyle) {
8085
+ case NumeralFormatter.groupStyle.lakh:
8086
+ partInteger = partInteger.replace(/(\d)(?=(\d\d)+\d$)/g, '$1' + owner.delimiter);
8087
+
8088
+ break;
8089
+
8090
+ case NumeralFormatter.groupStyle.wan:
8091
+ partInteger = partInteger.replace(/(\d)(?=(\d{4})+$)/g, '$1' + owner.delimiter);
8092
+
8093
+ break;
8094
+
8095
+ case NumeralFormatter.groupStyle.thousand:
8096
+ partInteger = partInteger.replace(/(\d)(?=(\d{3})+$)/g, '$1' + owner.delimiter);
8097
+
8098
+ break;
8099
+ }
8100
+
8101
+ if (owner.tailPrefix) {
8102
+ return partSign + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '') + owner.prefix;
8103
+ }
8104
+
8105
+ return partSignAndPrefix + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '');
8106
+ }
8107
+ };
8108
+
8109
+ var NumeralFormatter_1 = NumeralFormatter;
8110
+
8111
+ var DateFormatter = function (datePattern, dateMin, dateMax) {
8112
+ var owner = this;
8113
+
8114
+ owner.date = [];
8115
+ owner.blocks = [];
8116
+ owner.datePattern = datePattern;
8117
+ owner.dateMin = dateMin
8118
+ .split('-')
8119
+ .reverse()
8120
+ .map(function(x) {
8121
+ return parseInt(x, 10);
8122
+ });
8123
+ if (owner.dateMin.length === 2) owner.dateMin.unshift(0);
8124
+
8125
+ owner.dateMax = dateMax
8126
+ .split('-')
8127
+ .reverse()
8128
+ .map(function(x) {
8129
+ return parseInt(x, 10);
8130
+ });
8131
+ if (owner.dateMax.length === 2) owner.dateMax.unshift(0);
8132
+
8133
+ owner.initBlocks();
8134
+ };
8135
+
8136
+ DateFormatter.prototype = {
8137
+ initBlocks: function () {
8138
+ var owner = this;
8139
+ owner.datePattern.forEach(function (value) {
8140
+ if (value === 'Y') {
8141
+ owner.blocks.push(4);
8142
+ } else {
8143
+ owner.blocks.push(2);
8144
+ }
8145
+ });
8146
+ },
8147
+
8148
+ getISOFormatDate: function () {
8149
+ var owner = this,
8150
+ date = owner.date;
8151
+
8152
+ return date[2] ? (
8153
+ date[2] + '-' + owner.addLeadingZero(date[1]) + '-' + owner.addLeadingZero(date[0])
8154
+ ) : '';
8155
+ },
8156
+
8157
+ getBlocks: function () {
8158
+ return this.blocks;
8159
+ },
8160
+
8161
+ getValidatedDate: function (value) {
8162
+ var owner = this, result = '';
8163
+
8164
+ value = value.replace(/[^\d]/g, '');
8165
+
8166
+ owner.blocks.forEach(function (length, index) {
8167
+ if (value.length > 0) {
8168
+ var sub = value.slice(0, length),
8169
+ sub0 = sub.slice(0, 1),
8170
+ rest = value.slice(length);
8171
+
8172
+ switch (owner.datePattern[index]) {
8173
+ case 'd':
8174
+ if (sub === '00') {
8175
+ sub = '01';
8176
+ } else if (parseInt(sub0, 10) > 3) {
8177
+ sub = '0' + sub0;
8178
+ } else if (parseInt(sub, 10) > 31) {
8179
+ sub = '31';
8180
+ }
8181
+
8182
+ break;
8183
+
8184
+ case 'm':
8185
+ if (sub === '00') {
8186
+ sub = '01';
8187
+ } else if (parseInt(sub0, 10) > 1) {
8188
+ sub = '0' + sub0;
8189
+ } else if (parseInt(sub, 10) > 12) {
8190
+ sub = '12';
8191
+ }
8192
+
8193
+ break;
8194
+ }
8195
+
8196
+ result += sub;
8197
+
8198
+ // update remaining string
8199
+ value = rest;
8200
+ }
8201
+ });
8202
+
8203
+ return this.getFixedDateString(result);
8204
+ },
8205
+
8206
+ getFixedDateString: function (value) {
8207
+ var owner = this, datePattern = owner.datePattern, date = [],
8208
+ dayIndex = 0, monthIndex = 0, yearIndex = 0,
8209
+ dayStartIndex = 0, monthStartIndex = 0, yearStartIndex = 0,
8210
+ day, month, year, fullYearDone = false;
8211
+
8212
+ // mm-dd || dd-mm
8213
+ if (value.length === 4 && datePattern[0].toLowerCase() !== 'y' && datePattern[1].toLowerCase() !== 'y') {
8214
+ dayStartIndex = datePattern[0] === 'd' ? 0 : 2;
8215
+ monthStartIndex = 2 - dayStartIndex;
8216
+ day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10);
8217
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8218
+
8219
+ date = this.getFixedDate(day, month, 0);
8220
+ }
8221
+
8222
+ // yyyy-mm-dd || yyyy-dd-mm || mm-dd-yyyy || dd-mm-yyyy || dd-yyyy-mm || mm-yyyy-dd
8223
+ if (value.length === 8) {
8224
+ datePattern.forEach(function (type, index) {
8225
+ switch (type) {
8226
+ case 'd':
8227
+ dayIndex = index;
8228
+ break;
8229
+ case 'm':
8230
+ monthIndex = index;
8231
+ break;
8232
+ default:
8233
+ yearIndex = index;
8234
+ break;
8235
+ }
8236
+ });
8237
+
8238
+ yearStartIndex = yearIndex * 2;
8239
+ dayStartIndex = (dayIndex <= yearIndex) ? dayIndex * 2 : (dayIndex * 2 + 2);
8240
+ monthStartIndex = (monthIndex <= yearIndex) ? monthIndex * 2 : (monthIndex * 2 + 2);
8241
+
8242
+ day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10);
8243
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8244
+ year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10);
8245
+
8246
+ fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4;
8247
+
8248
+ date = this.getFixedDate(day, month, year);
8249
+ }
8250
+
8251
+ // mm-yy || yy-mm
8252
+ if (value.length === 4 && (datePattern[0] === 'y' || datePattern[1] === 'y')) {
8253
+ monthStartIndex = datePattern[0] === 'm' ? 0 : 2;
8254
+ yearStartIndex = 2 - monthStartIndex;
8255
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8256
+ year = parseInt(value.slice(yearStartIndex, yearStartIndex + 2), 10);
8257
+
8258
+ fullYearDone = value.slice(yearStartIndex, yearStartIndex + 2).length === 2;
8259
+
8260
+ date = [0, month, year];
8261
+ }
8262
+
8263
+ // mm-yyyy || yyyy-mm
8264
+ if (value.length === 6 && (datePattern[0] === 'Y' || datePattern[1] === 'Y')) {
8265
+ monthStartIndex = datePattern[0] === 'm' ? 0 : 4;
8266
+ yearStartIndex = 2 - 0.5 * monthStartIndex;
8267
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8268
+ year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10);
8269
+
8270
+ fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4;
8271
+
8272
+ date = [0, month, year];
8273
+ }
8274
+
8275
+ date = owner.getRangeFixedDate(date);
8276
+ owner.date = date;
8277
+
8278
+ var result = date.length === 0 ? value : datePattern.reduce(function (previous, current) {
8279
+ switch (current) {
8280
+ case 'd':
8281
+ return previous + (date[0] === 0 ? '' : owner.addLeadingZero(date[0]));
8282
+ case 'm':
8283
+ return previous + (date[1] === 0 ? '' : owner.addLeadingZero(date[1]));
8284
+ case 'y':
8285
+ return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], false) : '');
8286
+ case 'Y':
8287
+ return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], true) : '');
8288
+ }
8289
+ }, '');
8290
+
8291
+ return result;
8292
+ },
8293
+
8294
+ getRangeFixedDate: function (date) {
8295
+ var owner = this,
8296
+ datePattern = owner.datePattern,
8297
+ dateMin = owner.dateMin || [],
8298
+ dateMax = owner.dateMax || [];
8299
+
8300
+ if (!date.length || (dateMin.length < 3 && dateMax.length < 3)) return date;
8301
+
8302
+ if (
8303
+ datePattern.find(function(x) {
8304
+ return x.toLowerCase() === 'y';
8305
+ }) &&
8306
+ date[2] === 0
8307
+ ) return date;
8308
+
8309
+ if (dateMax.length && (dateMax[2] < date[2] || (
8310
+ dateMax[2] === date[2] && (dateMax[1] < date[1] || (
8311
+ dateMax[1] === date[1] && dateMax[0] < date[0]
8312
+ ))
8313
+ ))) return dateMax;
8314
+
8315
+ if (dateMin.length && (dateMin[2] > date[2] || (
8316
+ dateMin[2] === date[2] && (dateMin[1] > date[1] || (
8317
+ dateMin[1] === date[1] && dateMin[0] > date[0]
8318
+ ))
8319
+ ))) return dateMin;
8320
+
8321
+ return date;
8322
+ },
8323
+
8324
+ getFixedDate: function (day, month, year) {
8325
+ day = Math.min(day, 31);
8326
+ month = Math.min(month, 12);
8327
+ year = parseInt((year || 0), 10);
8328
+
8329
+ if ((month < 7 && month % 2 === 0) || (month > 8 && month % 2 === 1)) {
8330
+ day = Math.min(day, month === 2 ? (this.isLeapYear(year) ? 29 : 28) : 30);
8331
+ }
8332
+
8333
+ return [day, month, year];
8334
+ },
8335
+
8336
+ isLeapYear: function (year) {
8337
+ return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);
8338
+ },
8339
+
8340
+ addLeadingZero: function (number) {
8341
+ return (number < 10 ? '0' : '') + number;
8342
+ },
8343
+
8344
+ addLeadingZeroForYear: function (number, fullYearMode) {
8345
+ if (fullYearMode) {
8346
+ return (number < 10 ? '000' : (number < 100 ? '00' : (number < 1000 ? '0' : ''))) + number;
8347
+ }
8348
+
8349
+ return (number < 10 ? '0' : '') + number;
8350
+ }
8351
+ };
8352
+
8353
+ var DateFormatter_1 = DateFormatter;
8354
+
8355
+ var TimeFormatter = function (timePattern, timeFormat) {
8356
+ var owner = this;
8357
+
8358
+ owner.time = [];
8359
+ owner.blocks = [];
8360
+ owner.timePattern = timePattern;
8361
+ owner.timeFormat = timeFormat;
8362
+ owner.initBlocks();
8363
+ };
8364
+
8365
+ TimeFormatter.prototype = {
8366
+ initBlocks: function () {
8367
+ var owner = this;
8368
+ owner.timePattern.forEach(function () {
8369
+ owner.blocks.push(2);
8370
+ });
8371
+ },
8372
+
8373
+ getISOFormatTime: function () {
8374
+ var owner = this,
8375
+ time = owner.time;
8376
+
8377
+ return time[2] ? (
8378
+ owner.addLeadingZero(time[0]) + ':' + owner.addLeadingZero(time[1]) + ':' + owner.addLeadingZero(time[2])
8379
+ ) : '';
8380
+ },
8381
+
8382
+ getBlocks: function () {
8383
+ return this.blocks;
8384
+ },
8385
+
8386
+ getTimeFormatOptions: function () {
8387
+ var owner = this;
8388
+ if (String(owner.timeFormat) === '12') {
8389
+ return {
8390
+ maxHourFirstDigit: 1,
8391
+ maxHours: 12,
8392
+ maxMinutesFirstDigit: 5,
8393
+ maxMinutes: 60
8394
+ };
8395
+ }
8396
+
8397
+ return {
8398
+ maxHourFirstDigit: 2,
8399
+ maxHours: 23,
8400
+ maxMinutesFirstDigit: 5,
8401
+ maxMinutes: 60
8402
+ };
8403
+ },
8404
+
8405
+ getValidatedTime: function (value) {
8406
+ var owner = this, result = '';
8407
+
8408
+ value = value.replace(/[^\d]/g, '');
8409
+
8410
+ var timeFormatOptions = owner.getTimeFormatOptions();
8411
+
8412
+ owner.blocks.forEach(function (length, index) {
8413
+ if (value.length > 0) {
8414
+ var sub = value.slice(0, length),
8415
+ sub0 = sub.slice(0, 1),
8416
+ rest = value.slice(length);
8417
+
8418
+ switch (owner.timePattern[index]) {
8419
+
8420
+ case 'h':
8421
+ if (parseInt(sub0, 10) > timeFormatOptions.maxHourFirstDigit) {
8422
+ sub = '0' + sub0;
8423
+ } else if (parseInt(sub, 10) > timeFormatOptions.maxHours) {
8424
+ sub = timeFormatOptions.maxHours + '';
8425
+ }
8426
+
8427
+ break;
8428
+
8429
+ case 'm':
8430
+ case 's':
8431
+ if (parseInt(sub0, 10) > timeFormatOptions.maxMinutesFirstDigit) {
8432
+ sub = '0' + sub0;
8433
+ } else if (parseInt(sub, 10) > timeFormatOptions.maxMinutes) {
8434
+ sub = timeFormatOptions.maxMinutes + '';
8435
+ }
8436
+ break;
8437
+ }
8438
+
8439
+ result += sub;
8440
+
8441
+ // update remaining string
8442
+ value = rest;
8443
+ }
8444
+ });
8445
+
8446
+ return this.getFixedTimeString(result);
8447
+ },
8448
+
8449
+ getFixedTimeString: function (value) {
8450
+ var owner = this, timePattern = owner.timePattern, time = [],
8451
+ secondIndex = 0, minuteIndex = 0, hourIndex = 0,
8452
+ secondStartIndex = 0, minuteStartIndex = 0, hourStartIndex = 0,
8453
+ second, minute, hour;
8454
+
8455
+ if (value.length === 6) {
8456
+ timePattern.forEach(function (type, index) {
8457
+ switch (type) {
8458
+ case 's':
8459
+ secondIndex = index * 2;
8460
+ break;
8461
+ case 'm':
8462
+ minuteIndex = index * 2;
8463
+ break;
8464
+ case 'h':
8465
+ hourIndex = index * 2;
8466
+ break;
8467
+ }
8468
+ });
8469
+
8470
+ hourStartIndex = hourIndex;
8471
+ minuteStartIndex = minuteIndex;
8472
+ secondStartIndex = secondIndex;
8473
+
8474
+ second = parseInt(value.slice(secondStartIndex, secondStartIndex + 2), 10);
8475
+ minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10);
8476
+ hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10);
8477
+
8478
+ time = this.getFixedTime(hour, minute, second);
8479
+ }
8480
+
8481
+ if (value.length === 4 && owner.timePattern.indexOf('s') < 0) {
8482
+ timePattern.forEach(function (type, index) {
8483
+ switch (type) {
8484
+ case 'm':
8485
+ minuteIndex = index * 2;
8486
+ break;
8487
+ case 'h':
8488
+ hourIndex = index * 2;
8489
+ break;
8490
+ }
8491
+ });
8492
+
8493
+ hourStartIndex = hourIndex;
8494
+ minuteStartIndex = minuteIndex;
8495
+
8496
+ second = 0;
8497
+ minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10);
8498
+ hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10);
8499
+
8500
+ time = this.getFixedTime(hour, minute, second);
8501
+ }
8502
+
8503
+ owner.time = time;
8504
+
8505
+ return time.length === 0 ? value : timePattern.reduce(function (previous, current) {
8506
+ switch (current) {
8507
+ case 's':
8508
+ return previous + owner.addLeadingZero(time[2]);
8509
+ case 'm':
8510
+ return previous + owner.addLeadingZero(time[1]);
8511
+ case 'h':
8512
+ return previous + owner.addLeadingZero(time[0]);
8513
+ }
8514
+ }, '');
8515
+ },
8516
+
8517
+ getFixedTime: function (hour, minute, second) {
8518
+ second = Math.min(parseInt(second || 0, 10), 60);
8519
+ minute = Math.min(minute, 60);
8520
+ hour = Math.min(hour, 60);
8521
+
8522
+ return [hour, minute, second];
8523
+ },
8524
+
8525
+ addLeadingZero: function (number) {
8526
+ return (number < 10 ? '0' : '') + number;
8527
+ }
8528
+ };
8529
+
8530
+ var TimeFormatter_1 = TimeFormatter;
8531
+
8532
+ var PhoneFormatter = function (formatter, delimiter) {
8533
+ var owner = this;
8534
+
8535
+ owner.delimiter = (delimiter || delimiter === '') ? delimiter : ' ';
8536
+ owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : '';
8537
+
8538
+ owner.formatter = formatter;
8539
+ };
8540
+
8541
+ PhoneFormatter.prototype = {
8542
+ setFormatter: function (formatter) {
8543
+ this.formatter = formatter;
8544
+ },
8545
+
8546
+ format: function (phoneNumber) {
8547
+ var owner = this;
8548
+
8549
+ owner.formatter.clear();
8550
+
8551
+ // only keep number and +
8552
+ phoneNumber = phoneNumber.replace(/[^\d+]/g, '');
8553
+
8554
+ // strip non-leading +
8555
+ phoneNumber = phoneNumber.replace(/^\+/, 'B').replace(/\+/g, '').replace('B', '+');
8556
+
8557
+ // strip delimiter
8558
+ phoneNumber = phoneNumber.replace(owner.delimiterRE, '');
8559
+
8560
+ var result = '', current, validated = false;
8561
+
8562
+ for (var i = 0, iMax = phoneNumber.length; i < iMax; i++) {
8563
+ current = owner.formatter.inputDigit(phoneNumber.charAt(i));
8564
+
8565
+ // has ()- or space inside
8566
+ if (/[\s()-]/g.test(current)) {
8567
+ result = current;
8568
+
8569
+ validated = true;
8570
+ } else {
8571
+ if (!validated) {
8572
+ result = current;
8573
+ }
8574
+ // else: over length input
8575
+ // it turns to invalid number again
8576
+ }
8577
+ }
8578
+
8579
+ // strip ()
8580
+ // e.g. US: 7161234567 returns (716) 123-4567
8581
+ result = result.replace(/[()]/g, '');
8582
+ // replace library delimiter with user customized delimiter
8583
+ result = result.replace(/[\s-]/g, owner.delimiter);
8584
+
8585
+ return result;
8586
+ }
8587
+ };
8588
+
8589
+ var PhoneFormatter_1 = PhoneFormatter;
8590
+
8591
+ var CreditCardDetector = {
8592
+ blocks: {
8593
+ uatp: [4, 5, 6],
8594
+ amex: [4, 6, 5],
8595
+ diners: [4, 6, 4],
8596
+ discover: [4, 4, 4, 4],
8597
+ mastercard: [4, 4, 4, 4],
8598
+ dankort: [4, 4, 4, 4],
8599
+ instapayment: [4, 4, 4, 4],
8600
+ jcb15: [4, 6, 5],
8601
+ jcb: [4, 4, 4, 4],
8602
+ maestro: [4, 4, 4, 4],
8603
+ visa: [4, 4, 4, 4],
8604
+ mir: [4, 4, 4, 4],
8605
+ unionPay: [4, 4, 4, 4],
8606
+ general: [4, 4, 4, 4]
8607
+ },
8608
+
8609
+ re: {
8610
+ // starts with 1; 15 digits, not starts with 1800 (jcb card)
8611
+ uatp: /^(?!1800)1\d{0,14}/,
8612
+
8613
+ // starts with 34/37; 15 digits
8614
+ amex: /^3[47]\d{0,13}/,
8615
+
8616
+ // starts with 6011/65/644-649; 16 digits
8617
+ discover: /^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,
8618
+
8619
+ // starts with 300-305/309 or 36/38/39; 14 digits
8620
+ diners: /^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,
8621
+
8622
+ // starts with 51-55/2221–2720; 16 digits
8623
+ mastercard: /^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,
8624
+
8625
+ // starts with 5019/4175/4571; 16 digits
8626
+ dankort: /^(5019|4175|4571)\d{0,12}/,
8627
+
8628
+ // starts with 637-639; 16 digits
8629
+ instapayment: /^63[7-9]\d{0,13}/,
8630
+
8631
+ // starts with 2131/1800; 15 digits
8632
+ jcb15: /^(?:2131|1800)\d{0,11}/,
8633
+
8634
+ // starts with 2131/1800/35; 16 digits
8635
+ jcb: /^(?:35\d{0,2})\d{0,12}/,
8636
+
8637
+ // starts with 50/56-58/6304/67; 16 digits
8638
+ maestro: /^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,
8639
+
8640
+ // starts with 22; 16 digits
8641
+ mir: /^220[0-4]\d{0,12}/,
8642
+
8643
+ // starts with 4; 16 digits
8644
+ visa: /^4\d{0,15}/,
8645
+
8646
+ // starts with 62/81; 16 digits
8647
+ unionPay: /^(62|81)\d{0,14}/
8648
+ },
8649
+
8650
+ getStrictBlocks: function (block) {
8651
+ var total = block.reduce(function (prev, current) {
8652
+ return prev + current;
8653
+ }, 0);
8654
+
8655
+ return block.concat(19 - total);
8656
+ },
8657
+
8658
+ getInfo: function (value, strictMode) {
8659
+ var blocks = CreditCardDetector.blocks,
8660
+ re = CreditCardDetector.re;
8661
+
8662
+ // Some credit card can have up to 19 digits number.
8663
+ // Set strictMode to true will remove the 16 max-length restrain,
8664
+ // however, I never found any website validate card number like
8665
+ // this, hence probably you don't want to enable this option.
8666
+ strictMode = !!strictMode;
8667
+
8668
+ for (var key in re) {
8669
+ if (re[key].test(value)) {
8670
+ var matchedBlocks = blocks[key];
8671
+ return {
8672
+ type: key,
8673
+ blocks: strictMode ? this.getStrictBlocks(matchedBlocks) : matchedBlocks
8674
+ };
8675
+ }
8676
+ }
8677
+
8678
+ return {
8679
+ type: 'unknown',
8680
+ blocks: strictMode ? this.getStrictBlocks(blocks.general) : blocks.general
8681
+ };
8682
+ }
8683
+ };
8684
+
8685
+ var CreditCardDetector_1 = CreditCardDetector;
8686
+
8687
+ var Util = {
8688
+ noop: function () {
8689
+ },
8690
+
8691
+ strip: function (value, re) {
8692
+ return value.replace(re, '');
8693
+ },
8694
+
8695
+ getPostDelimiter: function (value, delimiter, delimiters) {
8696
+ // single delimiter
8697
+ if (delimiters.length === 0) {
8698
+ return value.slice(-delimiter.length) === delimiter ? delimiter : '';
8699
+ }
8700
+
8701
+ // multiple delimiters
8702
+ var matchedDelimiter = '';
8703
+ delimiters.forEach(function (current) {
8704
+ if (value.slice(-current.length) === current) {
8705
+ matchedDelimiter = current;
8706
+ }
8707
+ });
8708
+
8709
+ return matchedDelimiter;
8710
+ },
8711
+
8712
+ getDelimiterREByDelimiter: function (delimiter) {
8713
+ return new RegExp(delimiter.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'), 'g');
8714
+ },
8715
+
8716
+ getNextCursorPosition: function (prevPos, oldValue, newValue, delimiter, delimiters) {
8717
+ // If cursor was at the end of value, just place it back.
8718
+ // Because new value could contain additional chars.
8719
+ if (oldValue.length === prevPos) {
8720
+ return newValue.length;
8721
+ }
8722
+
8723
+ return prevPos + this.getPositionOffset(prevPos, oldValue, newValue, delimiter ,delimiters);
8724
+ },
8725
+
8726
+ getPositionOffset: function (prevPos, oldValue, newValue, delimiter, delimiters) {
8727
+ var oldRawValue, newRawValue, lengthOffset;
8728
+
8729
+ oldRawValue = this.stripDelimiters(oldValue.slice(0, prevPos), delimiter, delimiters);
8730
+ newRawValue = this.stripDelimiters(newValue.slice(0, prevPos), delimiter, delimiters);
8731
+ lengthOffset = oldRawValue.length - newRawValue.length;
8732
+
8733
+ return (lengthOffset !== 0) ? (lengthOffset / Math.abs(lengthOffset)) : 0;
8734
+ },
8735
+
8736
+ stripDelimiters: function (value, delimiter, delimiters) {
8737
+ var owner = this;
8738
+
8739
+ // single delimiter
8740
+ if (delimiters.length === 0) {
8741
+ var delimiterRE = delimiter ? owner.getDelimiterREByDelimiter(delimiter) : '';
8742
+
8743
+ return value.replace(delimiterRE, '');
8744
+ }
8745
+
8746
+ // multiple delimiters
8747
+ delimiters.forEach(function (current) {
8748
+ current.split('').forEach(function (letter) {
8749
+ value = value.replace(owner.getDelimiterREByDelimiter(letter), '');
8750
+ });
8751
+ });
8752
+
8753
+ return value;
8754
+ },
8755
+
8756
+ headStr: function (str, length) {
8757
+ return str.slice(0, length);
8758
+ },
8759
+
8760
+ getMaxLength: function (blocks) {
8761
+ return blocks.reduce(function (previous, current) {
8762
+ return previous + current;
8763
+ }, 0);
8764
+ },
8765
+
8766
+ // strip prefix
8767
+ // Before type | After type | Return value
8768
+ // PEFIX-... | PEFIX-... | ''
8769
+ // PREFIX-123 | PEFIX-123 | 123
8770
+ // PREFIX-123 | PREFIX-23 | 23
8771
+ // PREFIX-123 | PREFIX-1234 | 1234
8772
+ getPrefixStrippedValue: function (value, prefix, prefixLength, prevResult, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix) {
8773
+ // No prefix
8774
+ if (prefixLength === 0) {
8775
+ return value;
8776
+ }
8777
+
8778
+ // Value is prefix
8779
+ if (value === prefix && value !== '') {
8780
+ return '';
8781
+ }
8782
+
8783
+ if (signBeforePrefix && (value.slice(0, 1) == '-')) {
8784
+ var prev = (prevResult.slice(0, 1) == '-') ? prevResult.slice(1) : prevResult;
8785
+ return '-' + this.getPrefixStrippedValue(value.slice(1), prefix, prefixLength, prev, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix);
8786
+ }
8787
+
8788
+ // Pre result prefix string does not match pre-defined prefix
8789
+ if (prevResult.slice(0, prefixLength) !== prefix && !tailPrefix) {
8790
+ // Check if the first time user entered something
8791
+ if (noImmediatePrefix && !prevResult && value) return value;
8792
+ return '';
8793
+ } else if (prevResult.slice(-prefixLength) !== prefix && tailPrefix) {
8794
+ // Check if the first time user entered something
8795
+ if (noImmediatePrefix && !prevResult && value) return value;
8796
+ return '';
8797
+ }
8798
+
8799
+ var prevValue = this.stripDelimiters(prevResult, delimiter, delimiters);
8800
+
8801
+ // New value has issue, someone typed in between prefix letters
8802
+ // Revert to pre value
8803
+ if (value.slice(0, prefixLength) !== prefix && !tailPrefix) {
8804
+ return prevValue.slice(prefixLength);
8805
+ } else if (value.slice(-prefixLength) !== prefix && tailPrefix) {
8806
+ return prevValue.slice(0, -prefixLength - 1);
8807
+ }
8808
+
8809
+ // No issue, strip prefix for new value
8810
+ return tailPrefix ? value.slice(0, -prefixLength) : value.slice(prefixLength);
8811
+ },
8812
+
8813
+ getFirstDiffIndex: function (prev, current) {
8814
+ var index = 0;
8815
+
8816
+ while (prev.charAt(index) === current.charAt(index)) {
8817
+ if (prev.charAt(index++) === '') {
8818
+ return -1;
8819
+ }
8820
+ }
8821
+
8822
+ return index;
8823
+ },
8824
+
8825
+ getFormattedValue: function (value, blocks, blocksLength, delimiter, delimiters, delimiterLazyShow) {
8826
+ var result = '',
8827
+ multipleDelimiters = delimiters.length > 0,
8828
+ currentDelimiter = '';
8829
+
8830
+ // no options, normal input
8831
+ if (blocksLength === 0) {
8832
+ return value;
8833
+ }
8834
+
8835
+ blocks.forEach(function (length, index) {
8836
+ if (value.length > 0) {
8837
+ var sub = value.slice(0, length),
8838
+ rest = value.slice(length);
8839
+
8840
+ if (multipleDelimiters) {
8841
+ currentDelimiter = delimiters[delimiterLazyShow ? (index - 1) : index] || currentDelimiter;
8842
+ } else {
8843
+ currentDelimiter = delimiter;
8844
+ }
8845
+
8846
+ if (delimiterLazyShow) {
8847
+ if (index > 0) {
8848
+ result += currentDelimiter;
8849
+ }
8850
+
8851
+ result += sub;
8852
+ } else {
8853
+ result += sub;
8854
+
8855
+ if (sub.length === length && index < blocksLength - 1) {
8856
+ result += currentDelimiter;
8857
+ }
8858
+ }
8859
+
8860
+ // update remaining string
8861
+ value = rest;
8862
+ }
8863
+ });
8864
+
8865
+ return result;
8866
+ },
8867
+
8868
+ // move cursor to the end
8869
+ // the first time user focuses on an input with prefix
8870
+ fixPrefixCursor: function (el, prefix, delimiter, delimiters) {
8871
+ if (!el) {
8872
+ return;
8873
+ }
8874
+
8875
+ var val = el.value,
8876
+ appendix = delimiter || (delimiters[0] || ' ');
8877
+
8878
+ if (!el.setSelectionRange || !prefix || (prefix.length + appendix.length) <= val.length) {
8879
+ return;
8880
+ }
8881
+
8882
+ var len = val.length * 2;
8883
+
8884
+ // set timeout to avoid blink
8885
+ setTimeout(function () {
8886
+ el.setSelectionRange(len, len);
8887
+ }, 1);
8888
+ },
8889
+
8890
+ // Check if input field is fully selected
8891
+ checkFullSelection: function(value) {
8892
+ try {
8893
+ var selection = window.getSelection() || document.getSelection() || {};
8894
+ return selection.toString().length === value.length;
8895
+ } catch (ex) {
8896
+ // Ignore
8897
+ }
8898
+
8899
+ return false;
8900
+ },
8901
+
8902
+ setSelection: function (element, position, doc) {
8903
+ if (element !== this.getActiveElement(doc)) {
8904
+ return;
8905
+ }
8906
+
8907
+ // cursor is already in the end
8908
+ if (element && element.value.length <= position) {
8909
+ return;
8910
+ }
8911
+
8912
+ if (element.createTextRange) {
8913
+ var range = element.createTextRange();
8914
+
8915
+ range.move('character', position);
8916
+ range.select();
8917
+ } else {
8918
+ try {
8919
+ element.setSelectionRange(position, position);
8920
+ } catch (e) {
8921
+ // eslint-disable-next-line
8922
+ console.warn('The input element type does not support selection');
8923
+ }
8924
+ }
8925
+ },
8926
+
8927
+ getActiveElement: function(parent) {
8928
+ var activeElement = parent.activeElement;
8929
+ if (activeElement && activeElement.shadowRoot) {
8930
+ return this.getActiveElement(activeElement.shadowRoot);
8931
+ }
8932
+ return activeElement;
8933
+ },
8934
+
8935
+ isAndroid: function () {
8936
+ return navigator && /android/i.test(navigator.userAgent);
8937
+ },
8938
+
8939
+ // On Android chrome, the keyup and keydown events
8940
+ // always return key code 229 as a composition that
8941
+ // buffers the user’s keystrokes
8942
+ // see https://github.com/nosir/cleave.js/issues/147
8943
+ isAndroidBackspaceKeydown: function (lastInputValue, currentInputValue) {
8944
+ if (!this.isAndroid() || !lastInputValue || !currentInputValue) {
8945
+ return false;
8946
+ }
8947
+
8948
+ return currentInputValue === lastInputValue.slice(0, -1);
8949
+ }
8950
+ };
8951
+
8952
+ var Util_1 = Util;
8953
+
8954
+ /**
8955
+ * Props Assignment
8956
+ *
8957
+ * Separate this, so react module can share the usage
8958
+ */
8959
+ var DefaultProperties = {
8960
+ // Maybe change to object-assign
8961
+ // for now just keep it as simple
8962
+ assign: function (target, opts) {
8963
+ target = target || {};
8964
+ opts = opts || {};
8965
+
8966
+ // credit card
8967
+ target.creditCard = !!opts.creditCard;
8968
+ target.creditCardStrictMode = !!opts.creditCardStrictMode;
8969
+ target.creditCardType = '';
8970
+ target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || (function () {});
8971
+
8972
+ // phone
8973
+ target.phone = !!opts.phone;
8974
+ target.phoneRegionCode = opts.phoneRegionCode || 'AU';
8975
+ target.phoneFormatter = {};
8976
+
8977
+ // time
8978
+ target.time = !!opts.time;
8979
+ target.timePattern = opts.timePattern || ['h', 'm', 's'];
8980
+ target.timeFormat = opts.timeFormat || '24';
8981
+ target.timeFormatter = {};
8982
+
8983
+ // date
8984
+ target.date = !!opts.date;
8985
+ target.datePattern = opts.datePattern || ['d', 'm', 'Y'];
8986
+ target.dateMin = opts.dateMin || '';
8987
+ target.dateMax = opts.dateMax || '';
8988
+ target.dateFormatter = {};
8989
+
8990
+ // numeral
8991
+ target.numeral = !!opts.numeral;
8992
+ target.numeralIntegerScale = opts.numeralIntegerScale > 0 ? opts.numeralIntegerScale : 0;
8993
+ target.numeralDecimalScale = opts.numeralDecimalScale >= 0 ? opts.numeralDecimalScale : 2;
8994
+ target.numeralDecimalMark = opts.numeralDecimalMark || '.';
8995
+ target.numeralThousandsGroupStyle = opts.numeralThousandsGroupStyle || 'thousand';
8996
+ target.numeralPositiveOnly = !!opts.numeralPositiveOnly;
8997
+ target.stripLeadingZeroes = opts.stripLeadingZeroes !== false;
8998
+ target.signBeforePrefix = !!opts.signBeforePrefix;
8999
+ target.tailPrefix = !!opts.tailPrefix;
9000
+
9001
+ // others
9002
+ target.swapHiddenInput = !!opts.swapHiddenInput;
9003
+
9004
+ target.numericOnly = target.creditCard || target.date || !!opts.numericOnly;
9005
+
9006
+ target.uppercase = !!opts.uppercase;
9007
+ target.lowercase = !!opts.lowercase;
9008
+
9009
+ target.prefix = (target.creditCard || target.date) ? '' : (opts.prefix || '');
9010
+ target.noImmediatePrefix = !!opts.noImmediatePrefix;
9011
+ target.prefixLength = target.prefix.length;
9012
+ target.rawValueTrimPrefix = !!opts.rawValueTrimPrefix;
9013
+ target.copyDelimiter = !!opts.copyDelimiter;
9014
+
9015
+ target.initValue = (opts.initValue !== undefined && opts.initValue !== null) ? opts.initValue.toString() : '';
9016
+
9017
+ target.delimiter =
9018
+ (opts.delimiter || opts.delimiter === '') ? opts.delimiter :
9019
+ (opts.date ? '/' :
9020
+ (opts.time ? ':' :
9021
+ (opts.numeral ? ',' :
9022
+ (opts.phone ? ' ' :
9023
+ ' '))));
9024
+ target.delimiterLength = target.delimiter.length;
9025
+ target.delimiterLazyShow = !!opts.delimiterLazyShow;
9026
+ target.delimiters = opts.delimiters || [];
9027
+
9028
+ target.blocks = opts.blocks || [];
9029
+ target.blocksLength = target.blocks.length;
9030
+
9031
+ target.root = (typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window;
9032
+ target.document = opts.document || target.root.document;
9033
+
9034
+ target.maxLength = 0;
9035
+
9036
+ target.backspace = false;
9037
+ target.result = '';
9038
+
9039
+ target.onValueChanged = opts.onValueChanged || (function () {});
9040
+
9041
+ return target;
9042
+ }
9043
+ };
9044
+
9045
+ var DefaultProperties_1 = DefaultProperties;
9046
+
9047
+ /**
9048
+ * Construct a new Cleave instance by passing the configuration object
9049
+ *
9050
+ * @param {String | HTMLElement} element
9051
+ * @param {Object} opts
9052
+ */
9053
+ var Cleave = function (element, opts) {
9054
+ var owner = this;
9055
+ var hasMultipleElements = false;
9056
+
9057
+ if (typeof element === 'string') {
9058
+ owner.element = document.querySelector(element);
9059
+ hasMultipleElements = document.querySelectorAll(element).length > 1;
9060
+ } else {
9061
+ if (typeof element.length !== 'undefined' && element.length > 0) {
9062
+ owner.element = element[0];
9063
+ hasMultipleElements = element.length > 1;
9064
+ } else {
9065
+ owner.element = element;
9066
+ }
9067
+ }
9068
+
9069
+ if (!owner.element) {
9070
+ throw new Error('[cleave.js] Please check the element');
9071
+ }
9072
+
9073
+ if (hasMultipleElements) {
9074
+ try {
9075
+ // eslint-disable-next-line
9076
+ console.warn('[cleave.js] Multiple input fields matched, cleave.js will only take the first one.');
9077
+ } catch (e) {
9078
+ // Old IE
9079
+ }
9080
+ }
9081
+
9082
+ opts.initValue = owner.element.value;
9083
+
9084
+ owner.properties = Cleave.DefaultProperties.assign({}, opts);
9085
+
9086
+ owner.init();
9087
+ };
9088
+
9089
+ Cleave.prototype = {
9090
+ init: function () {
9091
+ var owner = this, pps = owner.properties;
9092
+
9093
+ // no need to use this lib
9094
+ if (!pps.numeral && !pps.phone && !pps.creditCard && !pps.time && !pps.date && (pps.blocksLength === 0 && !pps.prefix)) {
9095
+ owner.onInput(pps.initValue);
9096
+
9097
+ return;
9098
+ }
9099
+
9100
+ pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);
9101
+
9102
+ owner.isAndroid = Cleave.Util.isAndroid();
9103
+ owner.lastInputValue = '';
9104
+ owner.isBackward = '';
9105
+
9106
+ owner.onChangeListener = owner.onChange.bind(owner);
9107
+ owner.onKeyDownListener = owner.onKeyDown.bind(owner);
9108
+ owner.onFocusListener = owner.onFocus.bind(owner);
9109
+ owner.onCutListener = owner.onCut.bind(owner);
9110
+ owner.onCopyListener = owner.onCopy.bind(owner);
9111
+
9112
+ owner.initSwapHiddenInput();
9113
+
9114
+ owner.element.addEventListener('input', owner.onChangeListener);
9115
+ owner.element.addEventListener('keydown', owner.onKeyDownListener);
9116
+ owner.element.addEventListener('focus', owner.onFocusListener);
9117
+ owner.element.addEventListener('cut', owner.onCutListener);
9118
+ owner.element.addEventListener('copy', owner.onCopyListener);
9119
+
9120
+
9121
+ owner.initPhoneFormatter();
9122
+ owner.initDateFormatter();
9123
+ owner.initTimeFormatter();
9124
+ owner.initNumeralFormatter();
9125
+
9126
+ // avoid touch input field if value is null
9127
+ // otherwise Firefox will add red box-shadow for <input required />
9128
+ if (pps.initValue || (pps.prefix && !pps.noImmediatePrefix)) {
9129
+ owner.onInput(pps.initValue);
9130
+ }
9131
+ },
9132
+
9133
+ initSwapHiddenInput: function () {
9134
+ var owner = this, pps = owner.properties;
9135
+ if (!pps.swapHiddenInput) return;
9136
+
9137
+ var inputFormatter = owner.element.cloneNode(true);
9138
+ owner.element.parentNode.insertBefore(inputFormatter, owner.element);
9139
+
9140
+ owner.elementSwapHidden = owner.element;
9141
+ owner.elementSwapHidden.type = 'hidden';
9142
+
9143
+ owner.element = inputFormatter;
9144
+ owner.element.id = '';
9145
+ },
9146
+
9147
+ initNumeralFormatter: function () {
9148
+ var owner = this, pps = owner.properties;
9149
+
9150
+ if (!pps.numeral) {
9151
+ return;
9152
+ }
9153
+
9154
+ pps.numeralFormatter = new Cleave.NumeralFormatter(
9155
+ pps.numeralDecimalMark,
9156
+ pps.numeralIntegerScale,
9157
+ pps.numeralDecimalScale,
9158
+ pps.numeralThousandsGroupStyle,
9159
+ pps.numeralPositiveOnly,
9160
+ pps.stripLeadingZeroes,
9161
+ pps.prefix,
9162
+ pps.signBeforePrefix,
9163
+ pps.tailPrefix,
9164
+ pps.delimiter
9165
+ );
9166
+ },
9167
+
9168
+ initTimeFormatter: function() {
9169
+ var owner = this, pps = owner.properties;
9170
+
9171
+ if (!pps.time) {
9172
+ return;
9173
+ }
9174
+
9175
+ pps.timeFormatter = new Cleave.TimeFormatter(pps.timePattern, pps.timeFormat);
9176
+ pps.blocks = pps.timeFormatter.getBlocks();
9177
+ pps.blocksLength = pps.blocks.length;
9178
+ pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);
9179
+ },
9180
+
9181
+ initDateFormatter: function () {
9182
+ var owner = this, pps = owner.properties;
9183
+
9184
+ if (!pps.date) {
9185
+ return;
9186
+ }
9187
+
9188
+ pps.dateFormatter = new Cleave.DateFormatter(pps.datePattern, pps.dateMin, pps.dateMax);
9189
+ pps.blocks = pps.dateFormatter.getBlocks();
9190
+ pps.blocksLength = pps.blocks.length;
9191
+ pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);
9192
+ },
9193
+
9194
+ initPhoneFormatter: function () {
9195
+ var owner = this, pps = owner.properties;
9196
+
9197
+ if (!pps.phone) {
9198
+ return;
9199
+ }
9200
+
9201
+ // Cleave.AsYouTypeFormatter should be provided by
9202
+ // external google closure lib
9203
+ try {
9204
+ pps.phoneFormatter = new Cleave.PhoneFormatter(
9205
+ new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
9206
+ pps.delimiter
9207
+ );
9208
+ } catch (ex) {
9209
+ throw new Error('[cleave.js] Please include phone-type-formatter.{country}.js lib');
9210
+ }
9211
+ },
9212
+
9213
+ onKeyDown: function (event) {
9214
+ var owner = this,
9215
+ charCode = event.which || event.keyCode;
9216
+
9217
+ owner.lastInputValue = owner.element.value;
9218
+ owner.isBackward = charCode === 8;
9219
+ },
9220
+
9221
+ onChange: function (event) {
9222
+ var owner = this, pps = owner.properties,
9223
+ Util = Cleave.Util;
9224
+
9225
+ owner.isBackward = owner.isBackward || event.inputType === 'deleteContentBackward';
9226
+
9227
+ var postDelimiter = Util.getPostDelimiter(owner.lastInputValue, pps.delimiter, pps.delimiters);
9228
+
9229
+ if (owner.isBackward && postDelimiter) {
9230
+ pps.postDelimiterBackspace = postDelimiter;
9231
+ } else {
9232
+ pps.postDelimiterBackspace = false;
9233
+ }
9234
+
9235
+ this.onInput(this.element.value);
9236
+ },
9237
+
9238
+ onFocus: function () {
9239
+ var owner = this,
9240
+ pps = owner.properties;
9241
+ owner.lastInputValue = owner.element.value;
9242
+
9243
+ if (pps.prefix && pps.noImmediatePrefix && !owner.element.value) {
9244
+ this.onInput(pps.prefix);
9245
+ }
9246
+
9247
+ Cleave.Util.fixPrefixCursor(owner.element, pps.prefix, pps.delimiter, pps.delimiters);
9248
+ },
9249
+
9250
+ onCut: function (e) {
9251
+ if (!Cleave.Util.checkFullSelection(this.element.value)) return;
9252
+ this.copyClipboardData(e);
9253
+ this.onInput('');
9254
+ },
9255
+
9256
+ onCopy: function (e) {
9257
+ if (!Cleave.Util.checkFullSelection(this.element.value)) return;
9258
+ this.copyClipboardData(e);
9259
+ },
9260
+
9261
+ copyClipboardData: function (e) {
9262
+ var owner = this,
9263
+ pps = owner.properties,
9264
+ Util = Cleave.Util,
9265
+ inputValue = owner.element.value,
9266
+ textToCopy = '';
9267
+
9268
+ if (!pps.copyDelimiter) {
9269
+ textToCopy = Util.stripDelimiters(inputValue, pps.delimiter, pps.delimiters);
9270
+ } else {
9271
+ textToCopy = inputValue;
9272
+ }
9273
+
9274
+ try {
9275
+ if (e.clipboardData) {
9276
+ e.clipboardData.setData('Text', textToCopy);
9277
+ } else {
9278
+ window.clipboardData.setData('Text', textToCopy);
9279
+ }
9280
+
9281
+ e.preventDefault();
9282
+ } catch (ex) {
9283
+ // empty
9284
+ }
9285
+ },
9286
+
9287
+ onInput: function (value) {
9288
+ var owner = this, pps = owner.properties,
9289
+ Util = Cleave.Util;
9290
+
9291
+ // case 1: delete one more character "4"
9292
+ // 1234*| -> hit backspace -> 123|
9293
+ // case 2: last character is not delimiter which is:
9294
+ // 12|34* -> hit backspace -> 1|34*
9295
+ // note: no need to apply this for numeral mode
9296
+ var postDelimiterAfter = Util.getPostDelimiter(value, pps.delimiter, pps.delimiters);
9297
+ if (!pps.numeral && pps.postDelimiterBackspace && !postDelimiterAfter) {
9298
+ value = Util.headStr(value, value.length - pps.postDelimiterBackspace.length);
9299
+ }
9300
+
9301
+ // phone formatter
9302
+ if (pps.phone) {
9303
+ if (pps.prefix && (!pps.noImmediatePrefix || value.length)) {
9304
+ pps.result = pps.prefix + pps.phoneFormatter.format(value).slice(pps.prefix.length);
9305
+ } else {
9306
+ pps.result = pps.phoneFormatter.format(value);
9307
+ }
9308
+ owner.updateValueState();
9309
+
9310
+ return;
9311
+ }
9312
+
9313
+ // numeral formatter
9314
+ if (pps.numeral) {
9315
+ // Do not show prefix when noImmediatePrefix is specified
9316
+ // This mostly because we need to show user the native input placeholder
9317
+ if (pps.prefix && pps.noImmediatePrefix && value.length === 0) {
9318
+ pps.result = '';
9319
+ } else {
9320
+ pps.result = pps.numeralFormatter.format(value);
9321
+ }
9322
+ owner.updateValueState();
9323
+
9324
+ return;
9325
+ }
9326
+
9327
+ // date
9328
+ if (pps.date) {
9329
+ value = pps.dateFormatter.getValidatedDate(value);
9330
+ }
9331
+
9332
+ // time
9333
+ if (pps.time) {
9334
+ value = pps.timeFormatter.getValidatedTime(value);
9335
+ }
9336
+
9337
+ // strip delimiters
9338
+ value = Util.stripDelimiters(value, pps.delimiter, pps.delimiters);
9339
+
9340
+ // strip prefix
9341
+ value = Util.getPrefixStrippedValue(value, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix);
9342
+
9343
+ // strip non-numeric characters
9344
+ value = pps.numericOnly ? Util.strip(value, /[^\d]/g) : value;
9345
+
9346
+ // convert case
9347
+ value = pps.uppercase ? value.toUpperCase() : value;
9348
+ value = pps.lowercase ? value.toLowerCase() : value;
9349
+
9350
+ // prevent from showing prefix when no immediate option enabled with empty input value
9351
+ if (pps.prefix) {
9352
+ if (pps.tailPrefix) {
9353
+ value = value + pps.prefix;
9354
+ } else {
9355
+ value = pps.prefix + value;
9356
+ }
9357
+
9358
+
9359
+ // no blocks specified, no need to do formatting
9360
+ if (pps.blocksLength === 0) {
9361
+ pps.result = value;
9362
+ owner.updateValueState();
9363
+
9364
+ return;
9365
+ }
9366
+ }
9367
+
9368
+ // update credit card props
9369
+ if (pps.creditCard) {
9370
+ owner.updateCreditCardPropsByValue(value);
9371
+ }
9372
+
9373
+ // strip over length characters
9374
+ value = Util.headStr(value, pps.maxLength);
9375
+
9376
+ // apply blocks
9377
+ pps.result = Util.getFormattedValue(
9378
+ value,
9379
+ pps.blocks, pps.blocksLength,
9380
+ pps.delimiter, pps.delimiters, pps.delimiterLazyShow
9381
+ );
9382
+
9383
+ owner.updateValueState();
9384
+ },
9385
+
9386
+ updateCreditCardPropsByValue: function (value) {
9387
+ var owner = this, pps = owner.properties,
9388
+ Util = Cleave.Util,
9389
+ creditCardInfo;
9390
+
9391
+ // At least one of the first 4 characters has changed
9392
+ if (Util.headStr(pps.result, 4) === Util.headStr(value, 4)) {
9393
+ return;
9394
+ }
9395
+
9396
+ creditCardInfo = Cleave.CreditCardDetector.getInfo(value, pps.creditCardStrictMode);
9397
+
9398
+ pps.blocks = creditCardInfo.blocks;
9399
+ pps.blocksLength = pps.blocks.length;
9400
+ pps.maxLength = Util.getMaxLength(pps.blocks);
9401
+
9402
+ // credit card type changed
9403
+ if (pps.creditCardType !== creditCardInfo.type) {
9404
+ pps.creditCardType = creditCardInfo.type;
9405
+
9406
+ pps.onCreditCardTypeChanged.call(owner, pps.creditCardType);
9407
+ }
9408
+ },
9409
+
9410
+ updateValueState: function () {
9411
+ var owner = this,
9412
+ Util = Cleave.Util,
9413
+ pps = owner.properties;
9414
+
9415
+ if (!owner.element) {
9416
+ return;
9417
+ }
9418
+
9419
+ var endPos = owner.element.selectionEnd;
9420
+ var oldValue = owner.element.value;
9421
+ var newValue = pps.result;
9422
+
9423
+ endPos = Util.getNextCursorPosition(endPos, oldValue, newValue, pps.delimiter, pps.delimiters);
9424
+
9425
+ // fix Android browser type="text" input field
9426
+ // cursor not jumping issue
9427
+ if (owner.isAndroid) {
9428
+ window.setTimeout(function () {
9429
+ owner.element.value = newValue;
9430
+ Util.setSelection(owner.element, endPos, pps.document, false);
9431
+ owner.callOnValueChanged();
9432
+ }, 1);
9433
+
9434
+ return;
9435
+ }
9436
+
9437
+ owner.element.value = newValue;
9438
+ if (pps.swapHiddenInput) owner.elementSwapHidden.value = owner.getRawValue();
9439
+
9440
+ Util.setSelection(owner.element, endPos, pps.document, false);
9441
+ owner.callOnValueChanged();
9442
+ },
9443
+
9444
+ callOnValueChanged: function () {
9445
+ var owner = this,
9446
+ pps = owner.properties;
9447
+
9448
+ pps.onValueChanged.call(owner, {
9449
+ target: {
9450
+ name: owner.element.name,
9451
+ value: pps.result,
9452
+ rawValue: owner.getRawValue()
9453
+ }
9454
+ });
9455
+ },
9456
+
9457
+ setPhoneRegionCode: function (phoneRegionCode) {
9458
+ var owner = this, pps = owner.properties;
9459
+
9460
+ pps.phoneRegionCode = phoneRegionCode;
9461
+ owner.initPhoneFormatter();
9462
+ owner.onChange();
9463
+ },
9464
+
9465
+ setRawValue: function (value) {
9466
+ var owner = this, pps = owner.properties;
9467
+
9468
+ value = value !== undefined && value !== null ? value.toString() : '';
9469
+
9470
+ if (pps.numeral) {
9471
+ value = value.replace('.', pps.numeralDecimalMark);
9472
+ }
9473
+
9474
+ pps.postDelimiterBackspace = false;
9475
+
9476
+ owner.element.value = value;
9477
+ owner.onInput(value);
9478
+ },
9479
+
9480
+ getRawValue: function () {
9481
+ var owner = this,
9482
+ pps = owner.properties,
9483
+ Util = Cleave.Util,
9484
+ rawValue = owner.element.value;
9485
+
9486
+ if (pps.rawValueTrimPrefix) {
9487
+ rawValue = Util.getPrefixStrippedValue(rawValue, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix);
9488
+ }
9489
+
9490
+ if (pps.numeral) {
9491
+ rawValue = pps.numeralFormatter.getRawValue(rawValue);
9492
+ } else {
9493
+ rawValue = Util.stripDelimiters(rawValue, pps.delimiter, pps.delimiters);
9494
+ }
9495
+
9496
+ return rawValue;
9497
+ },
9498
+
9499
+ getISOFormatDate: function () {
9500
+ var owner = this,
9501
+ pps = owner.properties;
9502
+
9503
+ return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
9504
+ },
9505
+
9506
+ getISOFormatTime: function () {
9507
+ var owner = this,
9508
+ pps = owner.properties;
9509
+
9510
+ return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
9511
+ },
9512
+
9513
+ getFormattedValue: function () {
9514
+ return this.element.value;
9515
+ },
9516
+
9517
+ destroy: function () {
9518
+ var owner = this;
9519
+
9520
+ owner.element.removeEventListener('input', owner.onChangeListener);
9521
+ owner.element.removeEventListener('keydown', owner.onKeyDownListener);
9522
+ owner.element.removeEventListener('focus', owner.onFocusListener);
9523
+ owner.element.removeEventListener('cut', owner.onCutListener);
9524
+ owner.element.removeEventListener('copy', owner.onCopyListener);
9525
+ },
9526
+
9527
+ toString: function () {
9528
+ return '[Cleave Object]';
9529
+ }
9530
+ };
9531
+
9532
+ Cleave.NumeralFormatter = NumeralFormatter_1;
9533
+ Cleave.DateFormatter = DateFormatter_1;
9534
+ Cleave.TimeFormatter = TimeFormatter_1;
9535
+ Cleave.PhoneFormatter = PhoneFormatter_1;
9536
+ Cleave.CreditCardDetector = CreditCardDetector_1;
9537
+ Cleave.Util = Util_1;
9538
+ Cleave.DefaultProperties = DefaultProperties_1;
9539
+
9540
+ // for angular directive
9541
+ ((typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window)['Cleave'] = Cleave;
9542
+
9543
+ // CommonJS
9544
+ var Cleave_1 = Cleave;
9545
+
9546
+ /* eslint-disable @typescript-eslint/no-explicit-any */
9547
+ function coerceBoolean(value) {
9548
+ return value != null && `${value}` !== 'false';
9549
+ }
9550
+ function coerceNumber(value, fallbackValue = 0) {
9551
+ return isNumberValue(value) ? Number(value) : fallbackValue;
9552
+ }
9553
+ function isNumberValue(value) {
9554
+ return !isNaN(parseFloat(value)) && !isNaN(Number(value));
9555
+ }
9556
+
9557
+ const catInputCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-info{background-color:rgb(var(--cat-info-bg, 0, 115, 230)) !important;color:rgb(var(--cat-info-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-info-hover{transition:background-color 125ms, color 125ms}.cat-bg-info-hover:hover{background-color:rgb(var(--cat-info-bg-hover, 0, 107, 227)) !important;color:rgb(var(--cat-info-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-info,.cat-link-info{color:rgb(var(--cat-info-text, 0, 115, 230)) !important}.cat-link-info,.cat-text-info-hover{transition:color 125ms}.cat-link-info:hover,.cat-text-info-hover:hover{color:rgb(var(--cat-info-text-hover, 0, 107, 227)) !important}.cat-link-info:active,.cat-text-info-hover:active{color:rgb(var(--cat-info-text-active, 0, 96, 223)) !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-text-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-bg-muted{background-color:#f2f4f7 !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-optional,.label-character-count{display:inline-flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem}.label-character-count{margin-left:auto}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;font-size:0.9375rem;line-height:1.25rem}:host([hidden]){display:none}.input-field,.input-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.input-field.input-horizontal{flex-direction:row;gap:1rem}.input-wrapper{flex:1 1 auto;display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-readonly{pointer-events:none}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper:focus-within:has(.clearable:focus){outline:none}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-outer-wrapper{display:flex}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input.has-clearable,input.has-toggle-password{padding-right:1.5rem}input.has-clearable.has-toggle-password{padding-right:3.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.toggle-password{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.has-clearable~.toggle-password{right:1.5rem}:host(.cat-date-input) .input-wrapper,:host(.cat-time-input) .input-wrapper{z-index:1;border-top-right-radius:0;border-bottom-right-radius:0}";
9558
+ const CatInputStyle0 = catInputCss;
9559
+
9560
+ let nextUniqueId$6 = 0;
9561
+ const CatInput = class {
9562
+ constructor(hostRef) {
9563
+ index.registerInstance(this, hostRef);
9564
+ this.catChange = index.createEvent(this, "catChange", 7);
9565
+ this.catFocus = index.createEvent(this, "catFocus", 7);
9566
+ this.catBlur = index.createEvent(this, "catBlur", 7);
9567
+ this._id = `cat-input-${nextUniqueId$6++}`;
9568
+ this.hasSlottedLabel = false;
9569
+ this.hasSlottedHint = false;
9570
+ this.isPasswordShown = false;
9571
+ this.errorMap = undefined;
9572
+ this.requiredMarker = 'optional';
9573
+ this.horizontal = false;
9574
+ this.autoComplete = undefined;
9575
+ this.clearable = false;
9576
+ this.togglePassword = false;
9577
+ this.disabled = false;
9578
+ this.hint = undefined;
9579
+ this.icon = undefined;
9580
+ this.iconRight = false;
9581
+ this.identifier = undefined;
9582
+ this.label = '';
9583
+ this.labelHidden = false;
9584
+ this.max = undefined;
9585
+ this.maxLength = undefined;
9586
+ this.min = undefined;
9587
+ this.minLength = undefined;
9588
+ this.name = undefined;
9589
+ this.placeholder = undefined;
9590
+ this.textPrefix = undefined;
9591
+ this.textSuffix = undefined;
9592
+ this.readonly = false;
9593
+ this.required = false;
9594
+ this.round = false;
9595
+ this.type = 'text';
9596
+ this.value = undefined;
9597
+ this.errors = undefined;
9598
+ this.errorUpdate = 0;
9599
+ this.nativeAttributes = undefined;
9600
+ }
9601
+ get id() {
9602
+ return this.identifier || this._id;
9603
+ }
9604
+ componentWillRender() {
9605
+ this.onErrorsChanged(this.errors);
9606
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
9607
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
9608
+ if (!this.label && !this.hasSlottedLabel) {
9609
+ of.log.warn('[A11y] Missing ARIA label on input', this);
7670
9610
  }
7671
9611
  }
7672
9612
  /**
@@ -7697,6 +9637,14 @@ const CatInput = class {
7697
9637
  this.value = '';
7698
9638
  this.catChange.emit(this.value);
7699
9639
  }
9640
+ /**
9641
+ * Adds a Cleave.js mask to the input.
9642
+ *
9643
+ * @param options The Cleave.js options.
9644
+ */
9645
+ async mask(options) {
9646
+ new Cleave_1(this.input, options);
9647
+ }
7700
9648
  onErrorsChanged(value) {
7701
9649
  if (!coerceBoolean(this.errorUpdate)) {
7702
9650
  this.errorMap = undefined;
@@ -7711,19 +9659,19 @@ const CatInput = class {
7711
9659
  }
7712
9660
  }
7713
9661
  render() {
7714
- return (index.h("div", { key: 'fe89677c5a5768818b2ac9b1536cb50c2cde2edd', class: {
9662
+ return (index.h("div", { key: 'aab57f9704562874b2dee392630c473fc31a33cb', class: {
7715
9663
  'input-field': true,
7716
9664
  'input-horizontal': this.horizontal
7717
- } }, index.h("div", { key: '92aaf9f42e27da513f87648888551f221bb45d52', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, part: "label" }, index.h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, index.h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.required'), ")")), this.maxLength && (index.h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), index.h("div", { key: '24008f6704d6108ae439ba96507bf45db7b38978', class: "input-container" }, index.h("div", { key: 'fd329b7aff321121d771b325ff59a51668d5ad70', class: {
9665
+ } }, index.h("div", { key: 'f599b443389362d9eb3ee72d496d225ca2a8bf8d', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, part: "label" }, index.h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, index.h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.required'), ")")), this.maxLength && (index.h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), index.h("div", { key: 'ddce0aaa854e32ae4b8a8686a3886089beac6300', class: "input-container" }, index.h("div", { key: '25eb9aa776ba2cee97fb2bf79bc52d5c44c54b55', class: "input-outer-wrapper" }, index.h("div", { key: '7cd420c3525b8e15a7c0f2d8405cdd70f2e5291c', class: {
7718
9666
  'input-wrapper': true,
7719
9667
  'input-round': this.round,
7720
9668
  'input-readonly': this.readonly,
7721
9669
  'input-disabled': this.disabled,
7722
9670
  'input-invalid': this.invalid
7723
- }, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (index.h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), index.h("div", { key: '0a6fcef52829bd6429ca419a544a64fe68779afa', class: "input-inner-wrapper" }, index.h("input", { key: '43a4affa77f7f8f75b52da2cc553f20096519000', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
9671
+ }, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (index.h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), index.h("div", { key: '7f0c24c572ddfb4a1f76457955b28c111c1b444a', class: "input-inner-wrapper" }, index.h("input", { key: 'fcef418a1eb7c5d54f47e239f8db0cf52f23d3f7', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
7724
9672
  'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
7725
9673
  'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
7726
- }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (index.h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": of.catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (index.h("cat-button", { class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": of.catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (index.h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (index.h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap })))));
9674
+ }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (index.h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": of.catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (index.h("cat-button", { class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": of.catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (index.h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (index.h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), index.h("slot", { key: '3c3ff6368c631ae0634a7d0b875cb0d6a69edcba', name: "addon" })), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap })))));
7727
9675
  }
7728
9676
  get hasHint() {
7729
9677
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -7801,9 +9749,9 @@ const CatPagination = class {
7801
9749
  this.iconNext = '$cat:pagination-right';
7802
9750
  }
7803
9751
  render() {
7804
- return (index.h("nav", { key: 'b6166d7adf97431fcd6cd0b451f1c3287b3fca52', role: "navigation" }, index.h("ol", { key: '1810a4226ab05830a0b7e9d8d010d0e13dd6bd7f', class: {
9752
+ return (index.h("nav", { key: '113d4e757e003c8351efe53f8baeaffe28428c8f', role: "navigation" }, index.h("ol", { key: '15d86b0fd427abdd7f1af9ababb324806a746d05', class: {
7805
9753
  [`cat-pagination-${this.size}`]: Boolean(this.size)
7806
- } }, index.h("li", { key: '3b76a3f4a56ddbb998ba0da43cd99d759629567c' }, index.h("cat-button", { key: '7a07b951565187f86a2048bae6d9139eda2ecf57', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: of.catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, index.h("li", { key: '14e62c6284d2d52cb0d14f86bc960ff7bba8fb9d' }, index.h("cat-button", { key: '922396cb778f9a1f439557c5b15627415a733347', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: of.catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
9754
+ } }, index.h("li", { key: 'b6e6dad6d903b65850cd33c15327386a61fde3d4' }, index.h("cat-button", { key: 'd32aa4a3af4aaae84b5d2de695deadf0852f4ae0', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: of.catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, index.h("li", { key: '19567f748e4f3976576ea1c894c2524865d6201a' }, index.h("cat-button", { key: '6170034891849aef2e248a1f531d86806aa4f4c1', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: of.catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
7807
9755
  }
7808
9756
  get isFirst() {
7809
9757
  return this.page === 0;
@@ -7908,7 +9856,7 @@ const CatRadio = class {
7908
9856
  this.input.blur();
7909
9857
  }
7910
9858
  render() {
7911
- return (index.h(index.Host, { key: 'c44f5c1369b86ff3cc51d724a93ad0b2f3ec305d' }, index.h("label", { key: '921bc4790f98c244d60f60dad26eafb6f2dfe2a4', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, index.h("span", { key: 'dea160109a4e097630b4dcccf22b4f201e79261d', class: "radio" }, index.h("input", { key: 'f03523fe726e79745b296983ff39803bf797b164', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { key: '71259c52a7f46c1b49e4ccfa2e78e539ddf8c98f', class: "circle" })), index.h("span", { key: '93f2193a483bf6b8ad6e01d323393403714a1d95', class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "circle-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
9859
+ return (index.h(index.Host, { key: '9e3d983eeda3b42a67db73775cafcb9a5d98953a' }, index.h("label", { key: 'e2c5919edf0540000622a239b4acaa7704b2b3a8', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, index.h("span", { key: '1f8d95c1728e910305c6ef827b6779b4642102d8', class: "radio" }, index.h("input", { key: 'd0217cd454023eb440ef4c2481899f30c15c340f', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { key: '83a85842c187adf508cba7497d9e2a545163967b', class: "circle" })), index.h("span", { key: 'de6ed4d4a62b894406ec53380ac4949a265fe74b', class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "circle-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
7912
9860
  }
7913
9861
  get hasHint() {
7914
9862
  return !!this.hint || !!this.hasSlottedHint;
@@ -7999,7 +9947,7 @@ const CatRadioGroup = class {
7999
9947
  }
8000
9948
  }
8001
9949
  render() {
8002
- return (index.h("div", { key: '75b4eaacbbe46c9117d1668b088aaa2dd19dbc07', role: "radiogroup", "aria-label": this.a11yLabel }, index.h("slot", { key: '1d74e89695ff302ac5f166814a7912ba2826432d' })));
9950
+ return (index.h("div", { key: '05f0e3dddf696ecc2de0ea7491011e9ce6cf7ce4', role: "radiogroup", "aria-label": this.a11yLabel }, index.h("slot", { key: 'f67dc6e9f7e8410104626a1c5e54587d4cae51b0' })));
8003
9951
  }
8004
9952
  init() {
8005
9953
  this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
@@ -8088,13 +10036,13 @@ const CatScrollable = class {
8088
10036
  }
8089
10037
  render() {
8090
10038
  return [
8091
- index.h("div", { key: '349eb12cb7425f63471426378203dd4cfffbc39a', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && index.h("div", { class: "shadow-top" }), !this.noShadowX && index.h("div", { class: "shadow-left" }), !this.noShadowX && index.h("div", { class: "shadow-right" }), !this.noShadowY && index.h("div", { class: "shadow-bottom" })),
8092
- index.h("div", { key: '2e4bfaf86ca554f75941f62350a3e08eee36cb4a', ref: el => (this.scrollElement = el), class: {
10039
+ index.h("div", { key: 'a665d0c5a252ffb60c451b47b19e58d720aa7cc5', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && index.h("div", { class: "shadow-top" }), !this.noShadowX && index.h("div", { class: "shadow-left" }), !this.noShadowX && index.h("div", { class: "shadow-right" }), !this.noShadowY && index.h("div", { class: "shadow-bottom" })),
10040
+ index.h("div", { key: 'b5148d1b4d36da8f58dfd1a9f5ee4f8281e7bf48', ref: el => (this.scrollElement = el), class: {
8093
10041
  'scrollable-content': true,
8094
10042
  'scroll-x': !this.noOverflowX,
8095
10043
  'scroll-y': !this.noOverflowY,
8096
10044
  'no-overscroll': this.noOverscroll
8097
- } }, index.h("slot", { key: 'f0ed2418f5a797285f445a0d34135b4290448220' }))
10045
+ } }, index.h("slot", { key: '58770dc6389091b4fcd010b0ef867098bbdbd324' }))
8098
10046
  ];
8099
10047
  }
8100
10048
  attachEmitter(from, emitter) {
@@ -9038,7 +10986,7 @@ const CatSelectTest = class {
9038
10986
  setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
9039
10987
  }
9040
10988
  render() {
9041
- return (index.h(index.Host, { key: '855f08143eb0eac251258488f5c3e38ce913ffe5', style: { display: 'flex', flexDirection: 'column' } }, index.h("cat-select", { key: 'b8cea61a78ec33ec5f2a07975e077878998e7d91', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, index.h("span", { key: 'af5f8a887adcfef7167f0ae73e1d12062762f698', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), index.h("cat-select", { key: '42244b9525e5f9055114eaa5cd8b00204a1a0572', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: '371052ebd2cc689d91263e42f1e9caedd5ad09c2', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: 'e192a41b714c06726601d65c590df33ef06636ed', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: '612235ad95acfb4a6b3f472928bac192636f10fd', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), index.h("cat-select", { key: '19738b2c9f165c6e613ebad4c8c546f5659598df', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), index.h("cat-select", { key: '654a7ca6e2a3656082417a8815339eb65d30151a', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), index.h("cat-dropdown", { key: '55d9456a63202045b0626eeb2cf4af6d3345c581', overflow: true }, index.h("cat-button", { key: 'ce0438f8e79de3a545fe604db8a97c3d279d1d1a', slot: "trigger", style: { width: '50%' } }, "Open select"), index.h("div", { key: 'da8a050195eeffdead1e45d6b77c05644c1ca379', slot: "content", style: { width: '400px' } }, index.h("cat-select", { key: 'f9f5c6bc85c0140366a19ec5f695dd92b5d80456', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
10989
+ return (index.h(index.Host, { key: '917d1993ffdeb3df253cb69c4f91670bae865ffe', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, index.h("cat-select", { key: '0783adb9958ab099ee05514ab1eff2c2e9c19a3d', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, index.h("span", { key: 'a022a3f75759761d9f8cc75855c15c8bd577ec6d', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), index.h("cat-select", { key: '6e5ff0f3f69a6b8eb812a73243de623afe6958aa', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: 'f1f365f238c40179536fed2fdecf9562e9a2313b', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: '3444b60c5c4e65e96288f0773e0a1fa1aa2e6418', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: '9de06f744b6b072184fd8b5d25f1ecd1e6377152', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), index.h("cat-select", { key: '64e4286713877e81dbd587a2b46a4836d3e6a003', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), index.h("cat-select", { key: 'd3a3435025715aa6b2cfb82ca7093ebfc6537038', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), index.h("cat-dropdown", { key: '24a8e325652f4fac91a7548d1c7db43930ae3dba', overflow: true }, index.h("cat-button", { key: 'fe655431da67831a02855510e864d65895efc20e', slot: "trigger", style: { width: '50%' } }, "Open select"), index.h("div", { key: '01fc39c99c6f2bc2eabda4c8a26ab6aa46ea49d3', slot: "content", style: { width: '400px' } }, index.h("cat-select", { key: '7bd02aadc9a84797f4868e9a236e9af7245a2bd7', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
9042
10990
  }
9043
10991
  get countryConnector() {
9044
10992
  return {
@@ -10294,7 +12242,7 @@ const CatSkeleton = class {
10294
12242
  this.lines = undefined;
10295
12243
  }
10296
12244
  render() {
10297
- return (index.h(index.Host, { key: '87c950d3e3d3ee5b8518adf2cf8b64ee1efee533' }, Array.from(Array(this.count)).map(() => (index.h("div", { style: this.style, class: {
12245
+ return (index.h(index.Host, { key: 'a19807a77a26996cffe07ac155ad7765618b5845' }, Array.from(Array(this.count)).map(() => (index.h("div", { style: this.style, class: {
10298
12246
  skeleton: true,
10299
12247
  [`skeleton-${this.effect}`]: Boolean(this.effect),
10300
12248
  [`skeleton-${this.variant}`]: Boolean(this.variant),
@@ -10334,9 +12282,9 @@ const CatSpinner = class {
10334
12282
  this.a11yLabel = undefined;
10335
12283
  }
10336
12284
  render() {
10337
- return (index.h("span", { key: '0d0291bbe429aab9c2e29eddc4f30e49fff688be', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
12285
+ return (index.h("span", { key: '9959df68cbff0d66f606eddd9ad4d28e6387016c', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
10338
12286
  [`spinner-${this.size}`]: this.size !== 'inline'
10339
- } }, index.h("svg", { key: 'cf2afc31127f79c98db843a3486b8ded495f1d0f', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, index.h("circle", { key: '93a4fbe77e50120eaeb171fb347f9262ca228262', cx: "24", cy: "24", r: "21.5" }))));
12287
+ } }, index.h("svg", { key: '5f1f119ac83d334ef537e58a18631b064504de42', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, index.h("circle", { key: 'c86f44033ed4cd7b13e08332dd0219001a1aa05d', cx: "24", cy: "24", r: "21.5" }))));
10340
12288
  }
10341
12289
  };
10342
12290
  CatSpinner.style = CatSpinnerStyle0;
@@ -10368,7 +12316,7 @@ const CatTab = class {
10368
12316
  this.catClick.emit(event);
10369
12317
  }
10370
12318
  render() {
10371
- return index.h(index.Host, { key: '90cadd626e7b128e0b45ca482b56659714a782f5' });
12319
+ return index.h(index.Host, { key: 'd82385eb808736eea3c76a3df8381b9d4e0d742e' });
10372
12320
  }
10373
12321
  get hostElement() { return index.getElement(this); }
10374
12322
  };
@@ -10432,7 +12380,7 @@ const CatTabs = class {
10432
12380
  this.activate(this.tabs[index]);
10433
12381
  }
10434
12382
  render() {
10435
- return (index.h(index.Host, { key: '94f164ecb863a882bbe537eafab2585d9db86668' }, this.tabs.map((tab) => {
12383
+ return (index.h(index.Host, { key: '94b84f077e41ac18206865152cabfc9f3a51ccc0' }, this.tabs.map((tab) => {
10436
12384
  return (index.h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
10437
12385
  'cat-tab': true,
10438
12386
  'cat-tab-active': tab.id === this.activeTab,
@@ -10552,15 +12500,15 @@ const CatTextarea = class {
10552
12500
  }
10553
12501
  }
10554
12502
  render() {
10555
- return (index.h(index.Host, { key: 'a63d3665fbcd9525f524e38c6dd0691288ba3f0f' }, index.h("div", { key: '46fc76eb9a81499b948cf0a0749d2e1e5a756a08', class: {
12503
+ return (index.h(index.Host, { key: 'cb67b2133a56d47e02cc099e0a52670d8b2ba808' }, index.h("div", { key: 'bd7af8f7626ea32983a2cd2595556722b9384384', class: {
10556
12504
  'textarea-field': true,
10557
12505
  'textarea-horizontal': this.horizontal
10558
- } }, index.h("div", { key: '986dba66ccf0da2f0f20d624e4924b30cd19615d', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, part: "label" }, index.h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, index.h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.required'), ")")), this.maxLength && (index.h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), index.h("div", { key: '531df74c444c7927fd423125c055477e088a9f32', class: "textarea-container" }, index.h("div", { key: '56e11b8a7115423964349121f372b59249b7da2f', class: {
12506
+ } }, index.h("div", { key: '58eaf7f6f077148933667818c80ba7c61f3f599c', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, part: "label" }, index.h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, index.h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.required'), ")")), this.maxLength && (index.h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), index.h("div", { key: '697555f611a053df4df7dfe12cbd7e6fdcb4f0a1', class: "textarea-container" }, index.h("div", { key: '85c1b4a93bf03b3b6046f310bbb841d312638d3b', class: {
10559
12507
  'textarea-wrapper': true,
10560
12508
  'textarea-readonly': this.readonly,
10561
12509
  'textarea-disabled': this.disabled,
10562
12510
  'textarea-invalid': this.invalid
10563
- } }, index.h("textarea", { key: '11230cb5c9508d5a44172902d0f72e6305b11a65', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
12511
+ } }, index.h("textarea", { key: '2646d5e59ea09e361c87ad1635d641c9ce2d1fb6', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
10564
12512
  }
10565
12513
  get hasHint() {
10566
12514
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -10607,6 +12555,221 @@ const CatTextarea = class {
10607
12555
  };
10608
12556
  CatTextarea.style = CatTextareaStyle0;
10609
12557
 
12558
+ function getHour12(language) {
12559
+ const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })
12560
+ .format(new Date())
12561
+ .toLowerCase();
12562
+ return dateStr.includes('am') || dateStr.includes('pm');
12563
+ }
12564
+ function getLocale(language) {
12565
+ return {
12566
+ change: of.catI18nRegistry.t('timepicker.change'),
12567
+ choose: of.catI18nRegistry.t('timepicker.choose'),
12568
+ timeFormat: getHour12(language) ? '12' : '24'
12569
+ };
12570
+ }
12571
+
12572
+ function clampTime(min, date, max) {
12573
+ const [, hhMin, mmMin] = min?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12574
+ const [, hhMax, mmMax] = max?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12575
+ let minTime = -Infinity;
12576
+ let maxTime = Infinity;
12577
+ if (hhMin !== undefined && mmMin !== undefined) {
12578
+ minTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMin, mmMin).getTime();
12579
+ }
12580
+ if (hhMax !== undefined && mmMax !== undefined) {
12581
+ maxTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMax, mmMax).getTime();
12582
+ }
12583
+ return new Date(Math.min(Math.max(date.getTime(), minTime), maxTime));
12584
+ }
12585
+ function isBefore(date, time) {
12586
+ const [, hh, mm] = time?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12587
+ if (hh === undefined || mm === undefined) {
12588
+ return false;
12589
+ }
12590
+ return date.getHours() < hh || (date.getHours() === hh && date.getMinutes() < mm);
12591
+ }
12592
+ function isAfter(date, time) {
12593
+ const [, hh, mm] = time?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12594
+ if (hh === undefined || mm === undefined) {
12595
+ return false;
12596
+ }
12597
+ return date.getHours() > hh || (date.getHours() === hh && date.getMinutes() > mm);
12598
+ }
12599
+
12600
+ const catTimeCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.cat-time-addon{margin-left:-1px}nav{max-height:16rem}nav ul{list-style:none;margin:0;padding:0}.time-disabled{opacity:0.25}";
12601
+ const CatTimeStyle0 = catTimeCss;
12602
+
12603
+ const CatTime = class {
12604
+ constructor(hostRef) {
12605
+ index.registerInstance(this, hostRef);
12606
+ this.catChange = index.createEvent(this, "catChange", 7);
12607
+ this.catFocus = index.createEvent(this, "catFocus", 7);
12608
+ this.catBlur = index.createEvent(this, "catBlur", 7);
12609
+ this.language = of.catI18nRegistry.getLocale();
12610
+ this.locale = getLocale(this.language);
12611
+ this.hasSlottedLabel = false;
12612
+ this.hasSlottedHint = false;
12613
+ this.selectionTime = null;
12614
+ this.isAm = true;
12615
+ this.requiredMarker = 'optional';
12616
+ this.horizontal = false;
12617
+ this.autoComplete = undefined;
12618
+ this.clearable = false;
12619
+ this.disabled = false;
12620
+ this.hint = undefined;
12621
+ this.icon = undefined;
12622
+ this.iconRight = false;
12623
+ this.identifier = undefined;
12624
+ this.label = '';
12625
+ this.labelHidden = false;
12626
+ this.max = undefined;
12627
+ this.min = undefined;
12628
+ this.name = undefined;
12629
+ this.placeholder = undefined;
12630
+ this.textPrefix = undefined;
12631
+ this.textSuffix = undefined;
12632
+ this.readonly = false;
12633
+ this.required = false;
12634
+ this.value = undefined;
12635
+ this.errors = undefined;
12636
+ this.errorUpdate = 0;
12637
+ this.nativeAttributes = undefined;
12638
+ this.placement = 'bottom-end';
12639
+ this.step = 30;
12640
+ }
12641
+ componentWillLoad() {
12642
+ this.syncValue(this.value ?? '');
12643
+ }
12644
+ componentWillRender() {
12645
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
12646
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
12647
+ }
12648
+ componentDidLoad() {
12649
+ this.input?.mask({
12650
+ time: true,
12651
+ timeFormat: this.locale.timeFormat,
12652
+ timePattern: ['h', 'm']
12653
+ });
12654
+ }
12655
+ onOpen() {
12656
+ const query = (selector) => this.hostElement.shadowRoot?.querySelector(selector);
12657
+ const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);
12658
+ const elem1 = query(`[data-time="${this.formatIso(time)}"]`);
12659
+ time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);
12660
+ const elem2 = query(`[data-time="${this.formatIso(time)}"]`);
12661
+ setTimeout(() => {
12662
+ (elem2 ?? elem1)?.doFocus();
12663
+ (elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);
12664
+ }); // not entirely sure why this is necessary
12665
+ }
12666
+ /**
12667
+ * Select a time in the picker.
12668
+ *
12669
+ * @param date The time to select.
12670
+ */
12671
+ async select(date) {
12672
+ const oldValue = this.value;
12673
+ if (!date) {
12674
+ this.selectionTime = null;
12675
+ this.value = undefined;
12676
+ }
12677
+ else {
12678
+ const time = clampTime(this.min ?? null, date, this.max ?? null);
12679
+ this.isAm = this.format(time).toLowerCase().includes('am');
12680
+ this.selectionTime = time;
12681
+ this.value = this.formatIso(time);
12682
+ }
12683
+ // we need to set the input explicitly to sync the input even without a
12684
+ // rerender (if the value is not changed)
12685
+ if (this.input) {
12686
+ this.input.value = this.format(this.selectionTime, false);
12687
+ }
12688
+ if (oldValue !== this.value) {
12689
+ this.catChange.emit(this.value);
12690
+ }
12691
+ }
12692
+ /**
12693
+ * Programmatically move focus to the input. Use this method instead of
12694
+ * `input.focus()`.
12695
+ *
12696
+ * @param options An optional object providing options to control aspects of
12697
+ * the focusing process.
12698
+ */
12699
+ async doFocus(options) {
12700
+ this.input?.doFocus(options);
12701
+ }
12702
+ /**
12703
+ * Programmatically remove focus from the input. Use this method instead of
12704
+ * `input.blur()`.
12705
+ */
12706
+ async doBlur() {
12707
+ this.input?.doBlur();
12708
+ }
12709
+ /**
12710
+ * Clear the input.
12711
+ */
12712
+ async clear() {
12713
+ this.input?.clear();
12714
+ }
12715
+ render() {
12716
+ return (index.h(index.Host, { key: '417fe04aff5d229b3f99595cd464ed1b35a64655' }, index.h("cat-input", { key: 'a240ad76627fcc5013d8e51e0728e0296dbb0e42', class: "cat-time-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, index.h("span", { key: 'cf2026f70a32a5df5331b82d1d64cb4695a0b42e', slot: "label" }, this.hasSlottedLabel && index.h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, index.h("span", { key: '46b4a5363823a48d5569f77bcbadbaf0ef93e7b1', class: "label-aria" }, " (HH:mm)")), index.h("div", { key: 'cfad61c399b5b4a487b211976e61c3e33fb37a98', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (index.h("cat-button", { class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), index.h("cat-dropdown", { key: '2a158234c4cc55920105b326cdf31fbe02fedfb7', slot: "addon", placement: this.placement }, index.h("cat-button", { key: '1aa21b054ef608a4f1e9cc32312a762fa64d8b2d', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), index.h("nav", { key: 'dd604da9f2244c970ca62ca68385cc86d0b98bef', slot: "content", class: "cat-nav" }, index.h("ul", { key: '3c5e331defd7f192c27aab7085f5337a2eaf0fe7' }, this.timeArray().map(time => {
12717
+ const isoTime = this.formatIso(time);
12718
+ const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
12719
+ return (index.h("li", null, index.h("cat-button", { class: {
12720
+ 'cat-nav-item': true,
12721
+ 'time-disabled': disabled
12722
+ }, disabled: disabled, active: isoTime === this.value, color: isoTime === this.value ? 'primary' : 'secondary', variant: isoTime === this.value ? 'filled' : 'outlined', onCatClick: () => this.select(time), "data-time": isoTime }, this.format(time))));
12723
+ }))))), this.hasSlottedHint && (index.h("span", { slot: "hint" }, index.h("slot", { name: "hint" }))))));
12724
+ }
12725
+ timeArray() {
12726
+ const result = [];
12727
+ const start = new Date(2000, 5, 1, 0, 0, 0);
12728
+ let time = new Date(start.getTime());
12729
+ while (time.getDate() === start.getDate()) {
12730
+ result.push(time);
12731
+ time = new Date(time.getTime() + this.step * 60000);
12732
+ }
12733
+ return result;
12734
+ }
12735
+ syncValue(value) {
12736
+ const [, hh, mm] = value.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12737
+ if (hh === undefined || mm === undefined) {
12738
+ this.select(null);
12739
+ return;
12740
+ }
12741
+ this.select(this.locale.timeFormat === '24'
12742
+ ? new Date(2000, 5, 1, hh, mm, 0)
12743
+ : new Date(2000, 5, 1, (hh % 12) + (this.isAm ? 0 : 12), mm, 0));
12744
+ }
12745
+ toggleAm() {
12746
+ if (this.selectionTime) {
12747
+ this.select(new Date(this.selectionTime.getTime() + (this.isAm ? 12 : -12) * 3600000));
12748
+ }
12749
+ else {
12750
+ this.isAm = !this.isAm;
12751
+ }
12752
+ }
12753
+ onInputBlur(e) {
12754
+ this.syncValue(this.input?.value ?? '');
12755
+ this.catBlur.emit(e);
12756
+ }
12757
+ format(date, includeAmPm = true) {
12758
+ const str = date
12759
+ ? new Intl.DateTimeFormat(this.language, {
12760
+ hour: '2-digit',
12761
+ minute: '2-digit'
12762
+ }).format(date)
12763
+ : '';
12764
+ return includeAmPm ? str : str.replace(/\s?(am|pm)/i, '');
12765
+ }
12766
+ formatIso(date) {
12767
+ return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
12768
+ }
12769
+ get hostElement() { return index.getElement(this); }
12770
+ };
12771
+ CatTime.style = CatTimeStyle0;
12772
+
10610
12773
  const catToggleCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle-placeholder{width:calc(2rem + 1px);flex-shrink:0}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-dark, 215, 219, 224));transition:background-color 125ms ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 125ms linear;box-shadow:0 1px 2px rgba(27, 31, 38, 0.06), 0 1px 3px rgba(27, 31, 38, 0.1)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}.is-disabled .toggle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
10611
12774
  const CatToggleStyle0 = catToggleCss;
10612
12775
 
@@ -10665,7 +12828,7 @@ const CatToggle = class {
10665
12828
  this.input.blur();
10666
12829
  }
10667
12830
  render() {
10668
- return (index.h(index.Host, { key: '4b3382d701601d99d73293b42204c75a626fb931' }, index.h("label", { key: '43cb12fa74fa2208c4bd194a89a564ec574bb47e', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { key: 'd515d70a2a6e0301d9749e765093f85e3fdfd9ae', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { key: 'fc31a34c19aa738c80b46c07a2bf84ac512f5c56', class: "toggle" }), index.h("span", { key: '31445ceb7673fb76b71c8f038b57ec4b7aeb4ded', class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "toggle-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
12831
+ return (index.h(index.Host, { key: '1cc91400d302cd19fa92216ec3fdf45ae869b761' }, index.h("label", { key: '981ac74c7a9aa3324cab60067849e2ffff9d4158', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { key: 'f4c1a4398f73d2c3da8fd26b360d4a4d94dae3c3', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { key: '4a8c4e21fcb48dc3f2260d5abfcf2351fa0eeb13', class: "toggle" }), index.h("span", { key: 'b911ffc5f29252efba3989e494eca1c5ec0fbd54', class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "toggle-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
10669
12832
  }
10670
12833
  get hasHint() {
10671
12834
  return !!this.hint || !!this.hasSlottedHint;
@@ -10752,12 +12915,12 @@ const CatTooltip = class {
10752
12915
  }
10753
12916
  }
10754
12917
  render() {
10755
- return (index.h(index.Host, { key: '96ef4df283a341b1db46cf696b8b564ceac066da' }, index.h("slot", { key: 'ee530f90636a06425eb285cc594ba310deb9dca6' }), index.h("div", { key: '8d689cb8641c1f1eb59f0fe956ae63513bebf8ae', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
12918
+ return (index.h(index.Host, { key: 'f1bfba8c8ce1a2d43959b18b00627af819536428' }, index.h("slot", { key: '0366fe88ce8bd0382beed9c298dbd945cad70bec' }), index.h("div", { key: 'dd9f7cd786780cd64e3fa2670f516eda71d15351', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
10756
12919
  tooltip: true,
10757
12920
  'tooltip-hidden': this.inactive,
10758
12921
  'tooltip-round': this.round,
10759
12922
  [`tooltip-${this.size}`]: Boolean(this.size)
10760
- } }, index.h("slot", { key: 'e0dcfcc366684f8b5fdcf5f4804646e8e41ce8b1', name: "content" }, index.h("p", { key: '1fc7d41fedbf7808d9917245920f7c94822dc36a' }, this.content)))));
12923
+ } }, index.h("slot", { key: '2a6f92d2cfc845849730792f08e65ffb70c03e5f', name: "content" }, index.h("p", { key: '23b8d57bcb92506d5c88a59261716158b0daa0ba' }, this.content)))));
10761
12924
  }
10762
12925
  async update() {
10763
12926
  if (this.trigger && this.tooltip) {
@@ -10844,6 +13007,7 @@ exports.cat_button = CatButton;
10844
13007
  exports.cat_button_group = CatButtonGroup;
10845
13008
  exports.cat_card = CatCard;
10846
13009
  exports.cat_checkbox = CatCheckbox;
13010
+ exports.cat_date = CatDate;
10847
13011
  exports.cat_datepicker = CatDatepickerFlat;
10848
13012
  exports.cat_datepicker_inline = CatDatepickerInline;
10849
13013
  exports.cat_dropdown = CatDropdown;
@@ -10861,7 +13025,8 @@ exports.cat_spinner = CatSpinner;
10861
13025
  exports.cat_tab = CatTab;
10862
13026
  exports.cat_tabs = CatTabs;
10863
13027
  exports.cat_textarea = CatTextarea;
13028
+ exports.cat_time = CatTime;
10864
13029
  exports.cat_toggle = CatToggle;
10865
13030
  exports.cat_tooltip = CatTooltip;
10866
13031
 
10867
- //# sourceMappingURL=cat-alert_26.cjs.entry.js.map
13032
+ //# sourceMappingURL=cat-alert_28.cjs.entry.js.map