@livenetworks/ashlar 1.6.1 → 2.0.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 (559) hide show
  1. package/LICENSE +641 -0
  2. package/README.md +202 -86
  3. package/{js → components}/COMPONENTS.md +1116 -1108
  4. package/{js → components}/index.js +81 -58
  5. package/{js → components}/ln-accordion/README.md +7 -6
  6. package/components/ln-accordion/ln-accordion-dev.scss +8 -0
  7. package/components/ln-accordion/ln-accordion.js +1 -0
  8. package/components/ln-accordion/ln-accordion.schema.json +30 -0
  9. package/components/ln-accordion/ln-accordion.scss +8 -0
  10. package/{js → components}/ln-accordion/src/ln-accordion.js +8 -2
  11. package/{js → components}/ln-ajax/README.md +171 -160
  12. package/components/ln-ajax/ln-ajax-dev.scss +8 -0
  13. package/components/ln-ajax/ln-ajax.js +1 -0
  14. package/components/ln-ajax/ln-ajax.schema.json +30 -0
  15. package/{js → components}/ln-ajax/src/ln-ajax.js +65 -30
  16. package/{js → components}/ln-api-connector/README.md +27 -5
  17. package/components/ln-api-connector/ln-api-connector.js +1 -0
  18. package/components/ln-api-connector/ln-api-connector.schema.json +96 -0
  19. package/components/ln-api-connector/src/connector-core.js +97 -0
  20. package/components/ln-api-connector/src/ln-api-connector.js +447 -0
  21. package/{js → components}/ln-api-queue/README.md +12 -9
  22. package/components/ln-api-queue/ln-api-queue.js +1 -0
  23. package/components/ln-api-queue/ln-api-queue.schema.json +34 -0
  24. package/{js → components}/ln-api-queue/src/ln-api-queue.js +33 -14
  25. package/{js → components}/ln-api-queue/src/queue-storage.js +7 -3
  26. package/{js → components}/ln-autoresize/README.md +129 -127
  27. package/components/ln-autoresize/ln-autoresize-dev.scss +8 -0
  28. package/components/ln-autoresize/ln-autoresize.js +1 -0
  29. package/components/ln-autoresize/ln-autoresize.schema.json +22 -0
  30. package/{js → components}/ln-autoresize/src/ln-autoresize.js +8 -1
  31. package/{js → components}/ln-autosave/README.md +127 -124
  32. package/components/ln-autosave/ln-autosave-dev.scss +13 -0
  33. package/components/ln-autosave/ln-autosave.js +1 -0
  34. package/components/ln-autosave/ln-autosave.schema.json +48 -0
  35. package/components/ln-autosave/src/autosave-model.js +34 -0
  36. package/{js → components}/ln-autosave/src/ln-autosave.js +65 -58
  37. package/components/ln-chart/README.md +145 -0
  38. package/components/ln-chart/ln-chart-dev.scss +20 -0
  39. package/components/ln-chart/ln-chart.js +1 -0
  40. package/components/ln-chart/ln-chart.schema.json +146 -0
  41. package/components/ln-chart/ln-chart.scss +8 -0
  42. package/components/ln-chart/src/chart-model.js +154 -0
  43. package/components/ln-chart/src/ln-chart.js +176 -0
  44. package/{js → components}/ln-circular-progress/README.md +15 -14
  45. package/components/ln-circular-progress/ln-circular-progress-dev.scss +8 -0
  46. package/components/ln-circular-progress/ln-circular-progress.js +1 -0
  47. package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -0
  48. package/{js → components}/ln-circular-progress/src/ln-circular-progress.js +32 -50
  49. package/{js → components}/ln-confirm/README.md +69 -18
  50. package/components/ln-confirm/ln-confirm-dev.scss +24 -0
  51. package/components/ln-confirm/ln-confirm.js +1 -0
  52. package/components/ln-confirm/ln-confirm.schema.json +66 -0
  53. package/components/ln-confirm/ln-confirm.scss +24 -0
  54. package/{js → components}/ln-confirm/src/ln-confirm.js +180 -171
  55. package/{js → components}/ln-core/README.md +374 -149
  56. package/components/ln-core/attrs.js +273 -0
  57. package/components/ln-core/compare.js +40 -0
  58. package/components/ln-core/crypto.js +265 -0
  59. package/components/ln-core/date.js +50 -0
  60. package/components/ln-core/dom.js +115 -0
  61. package/components/ln-core/events.js +122 -0
  62. package/components/ln-core/form.js +136 -0
  63. package/{js → components}/ln-core/hash.js +149 -92
  64. package/components/ln-core/helpers.js +33 -0
  65. package/components/ln-core/http.js +48 -0
  66. package/components/ln-core/index.js +11 -0
  67. package/components/ln-core/lifecycle.js +403 -0
  68. package/components/ln-core/ln-core.schema.json +109 -0
  69. package/components/ln-core/locale.js +55 -0
  70. package/components/ln-core/matching.js +78 -0
  71. package/components/ln-core/number.js +125 -0
  72. package/components/ln-core/progress.js +30 -0
  73. package/components/ln-core/template.js +206 -0
  74. package/{js → components}/ln-core/window-cache.js +247 -213
  75. package/{js → components}/ln-couchdb-connector/README.md +7 -5
  76. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -0
  77. package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -0
  78. package/{js → components}/ln-couchdb-connector/src/ln-couchdb-connector.js +29 -43
  79. package/{js → components}/ln-data-coordinator/README.md +109 -73
  80. package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -0
  81. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -0
  82. package/components/ln-data-coordinator/ln-data-coordinator.schema.json +196 -0
  83. package/components/ln-data-coordinator/src/data-read-policy.js +41 -0
  84. package/{js → components}/ln-data-coordinator/src/ln-data-coordinator.js +411 -154
  85. package/{js → components}/ln-data-coordinator/src/mutation-receipts.js +0 -5
  86. package/{js → components}/ln-data-store/README.md +42 -17
  87. package/components/ln-data-store/ln-data-store-dev.scss +13 -0
  88. package/components/ln-data-store/ln-data-store.js +1 -0
  89. package/components/ln-data-store/ln-data-store.schema.json +84 -0
  90. package/components/ln-data-store/src/data-store-model.js +155 -0
  91. package/{js → components}/ln-data-store/src/ln-data-store.js +407 -105
  92. package/components/ln-data-store/src/window-index.js +119 -0
  93. package/{js → components}/ln-date/README.md +17 -7
  94. package/{js → components}/ln-date/ln-date-dev.scss +14 -14
  95. package/components/ln-date/ln-date.js +1 -0
  96. package/components/ln-date/ln-date.schema.json +92 -0
  97. package/components/ln-date/src/date-model.js +186 -0
  98. package/components/ln-date/src/ln-date.js +486 -0
  99. package/components/ln-debug/README.md +132 -0
  100. package/components/ln-debug/ln-debug.js +1 -0
  101. package/components/ln-debug/ln-debug.schema.json +28 -0
  102. package/components/ln-debug/src/console-sink.js +19 -0
  103. package/components/ln-debug/src/debug-verifier.js +331 -0
  104. package/components/ln-debug/src/gate.js +95 -0
  105. package/components/ln-debug/src/generated-attributes.js +299 -0
  106. package/components/ln-debug/src/ln-debug.js +60 -0
  107. package/{js → components}/ln-dropdown/README.md +150 -140
  108. package/components/ln-dropdown/ln-dropdown-dev.scss +13 -0
  109. package/components/ln-dropdown/ln-dropdown.js +1 -0
  110. package/components/ln-dropdown/ln-dropdown.schema.json +90 -0
  111. package/components/ln-dropdown/ln-dropdown.scss +18 -0
  112. package/{js → components}/ln-dropdown/src/ln-dropdown.js +114 -11
  113. package/{js → components}/ln-editor/README.md +11 -9
  114. package/components/ln-editor/ln-editor-dev.scss +18 -0
  115. package/components/ln-editor/ln-editor.js +1 -0
  116. package/components/ln-editor/ln-editor.schema.json +58 -0
  117. package/components/ln-editor/ln-editor.scss +13 -0
  118. package/{js → components}/ln-editor/src/ln-editor.js +59 -11
  119. package/{js → components}/ln-external-links/README.md +10 -8
  120. package/components/ln-external-links/ln-external-links.js +1 -0
  121. package/components/ln-external-links/ln-external-links.schema.json +18 -0
  122. package/{js → components}/ln-external-links/src/ln-external-links.js +13 -11
  123. package/{js → components}/ln-fill/README.md +6 -8
  124. package/components/ln-fill/ln-fill.js +1 -0
  125. package/components/ln-fill/ln-fill.schema.json +23 -0
  126. package/{js → components}/ln-fill/src/ln-fill.js +7 -1
  127. package/components/ln-filter/README.md +131 -0
  128. package/components/ln-filter/ln-filter-dev.scss +13 -0
  129. package/components/ln-filter/ln-filter.js +1 -0
  130. package/components/ln-filter/ln-filter.schema.json +153 -0
  131. package/components/ln-filter/src/filter-model.js +185 -0
  132. package/components/ln-filter/src/ln-filter.js +435 -0
  133. package/{js → components}/ln-form/README.md +260 -264
  134. package/components/ln-form/ln-form-dev.scss +8 -0
  135. package/components/ln-form/ln-form.js +1 -0
  136. package/components/ln-form/ln-form.schema.json +45 -0
  137. package/{js → components}/ln-form/src/ln-form.js +107 -99
  138. package/{js → components}/ln-http/README.md +11 -6
  139. package/components/ln-http/ln-http.js +1 -0
  140. package/components/ln-http/ln-http.schema.json +6 -0
  141. package/components/ln-http/src/http-core.js +51 -0
  142. package/{js → components}/ln-http/src/ln-http.js +28 -33
  143. package/{js → components}/ln-icon/README.md +16 -9
  144. package/components/ln-icon/ln-icon.schema.json +6 -0
  145. package/components/ln-include/README.md +75 -0
  146. package/components/ln-include/ln-include-dev.scss +13 -0
  147. package/components/ln-include/ln-include.js +1 -0
  148. package/components/ln-include/ln-include.schema.json +23 -0
  149. package/components/ln-include/src/ln-include.js +111 -0
  150. package/components/ln-key/README.md +130 -0
  151. package/components/ln-key/ln-key-dev.scss +18 -0
  152. package/components/ln-key/ln-key.js +1 -0
  153. package/components/ln-key/ln-key.schema.json +56 -0
  154. package/components/ln-key/src/key-model.js +146 -0
  155. package/components/ln-key/src/ln-key.js +201 -0
  156. package/{js → components}/ln-link/README.md +7 -9
  157. package/components/ln-link/ln-link-dev.scss +8 -0
  158. package/components/ln-link/ln-link.js +1 -0
  159. package/components/ln-link/ln-link.schema.json +22 -0
  160. package/{js → components}/ln-link/src/ln-link.js +16 -11
  161. package/components/ln-list/README.md +152 -0
  162. package/components/ln-list/ln-list-dev.scss +8 -0
  163. package/components/ln-list/ln-list.js +1 -0
  164. package/components/ln-list/ln-list.schema.json +166 -0
  165. package/components/ln-list/ln-list.scss +25 -0
  166. package/{js → components}/ln-list/src/ln-list.js +1301 -1216
  167. package/{js → components}/ln-modal/README.md +13 -10
  168. package/components/ln-modal/ln-modal-dev.scss +18 -0
  169. package/components/ln-modal/ln-modal.js +1 -0
  170. package/components/ln-modal/ln-modal.schema.json +54 -0
  171. package/components/ln-modal/ln-modal.scss +51 -0
  172. package/{js → components}/ln-modal/src/ln-modal.js +164 -137
  173. package/{js → components}/ln-nav/README.md +11 -11
  174. package/components/ln-nav/ln-nav.js +1 -0
  175. package/components/ln-nav/ln-nav.schema.json +25 -0
  176. package/{js → components}/ln-nav/src/ln-nav.js +25 -14
  177. package/components/ln-number/README.md +205 -0
  178. package/{js → components}/ln-number/ln-number-dev.scss +13 -13
  179. package/components/ln-number/ln-number.js +1 -0
  180. package/components/ln-number/ln-number.schema.json +63 -0
  181. package/components/ln-number/src/ln-number.js +400 -0
  182. package/components/ln-number/src/number-model.js +31 -0
  183. package/components/ln-obfuscator/README.md +60 -0
  184. package/components/ln-obfuscator/ln-obfuscator.js +1 -0
  185. package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -0
  186. package/components/ln-obfuscator/src/ln-obfuscator.js +159 -0
  187. package/components/ln-obfuscator/src/obfuscator-model.js +250 -0
  188. package/{js → components}/ln-options/README.md +3 -1
  189. package/components/ln-options/ln-options-dev.scss +13 -0
  190. package/components/ln-options/ln-options.js +1 -0
  191. package/components/ln-options/ln-options.schema.json +41 -0
  192. package/{js → components}/ln-options/src/ln-options.js +13 -5
  193. package/components/ln-persist/README.md +151 -0
  194. package/components/ln-persist/ln-persist.js +1 -0
  195. package/components/ln-persist/ln-persist.schema.json +28 -0
  196. package/components/ln-persist/src/ln-persist.js +83 -0
  197. package/components/ln-picklist/README.md +230 -0
  198. package/components/ln-picklist/ln-picklist-dev.scss +22 -0
  199. package/components/ln-picklist/ln-picklist.js +1 -0
  200. package/components/ln-picklist/ln-picklist.schema.json +49 -0
  201. package/components/ln-picklist/src/ln-picklist.js +228 -0
  202. package/{js → components}/ln-popover/README.md +164 -162
  203. package/components/ln-popover/ln-popover-dev.scss +13 -0
  204. package/components/ln-popover/ln-popover.js +1 -0
  205. package/components/ln-popover/ln-popover.schema.json +82 -0
  206. package/components/ln-popover/ln-popover.scss +18 -0
  207. package/{js → components}/ln-popover/src/ln-popover.js +42 -36
  208. package/{js → components}/ln-progress/README.md +410 -413
  209. package/components/ln-progress/ln-progress-dev.scss +8 -0
  210. package/components/ln-progress/ln-progress.js +1 -0
  211. package/components/ln-progress/ln-progress.schema.json +40 -0
  212. package/components/ln-progress/src/ln-progress.js +91 -0
  213. package/components/ln-progress/src/progress-model.js +20 -0
  214. package/{js → components}/ln-router/README.md +443 -432
  215. package/components/ln-router/ln-router-dev.scss +13 -0
  216. package/components/ln-router/ln-router.js +1 -0
  217. package/components/ln-router/ln-router.schema.json +68 -0
  218. package/{js → components}/ln-router/src/ln-router.js +585 -539
  219. package/components/ln-router/src/router-model.js +50 -0
  220. package/components/ln-scroll/README.md +45 -0
  221. package/components/ln-scroll/ln-scroll.js +1 -0
  222. package/components/ln-scroll/ln-scroll.schema.json +85 -0
  223. package/components/ln-scroll/src/ln-scroll.js +150 -0
  224. package/components/ln-search/README.md +188 -0
  225. package/components/ln-search/ln-search-dev.scss +13 -0
  226. package/components/ln-search/ln-search.js +1 -0
  227. package/components/ln-search/ln-search.schema.json +103 -0
  228. package/components/ln-search/src/ln-search.js +330 -0
  229. package/{js → components}/ln-slug/README.md +6 -3
  230. package/components/ln-slug/ln-slug-dev.scss +18 -0
  231. package/components/ln-slug/ln-slug.js +1 -0
  232. package/components/ln-slug/ln-slug.schema.json +23 -0
  233. package/{js → components}/ln-slug/src/ln-slug.js +20 -13
  234. package/components/ln-slug/src/slug-model.js +21 -0
  235. package/{js → components}/ln-sort/README.md +178 -170
  236. package/{js → components}/ln-sort/ln-sort-dev.scss +8 -8
  237. package/components/ln-sort/ln-sort.js +1 -0
  238. package/components/ln-sort/ln-sort.schema.json +104 -0
  239. package/components/ln-sort/src/ln-sort.js +321 -0
  240. package/components/ln-sort/src/sort-model.js +117 -0
  241. package/{js → components}/ln-sortable/README.md +7 -11
  242. package/components/ln-sortable/ln-sortable-dev.scss +13 -0
  243. package/components/ln-sortable/ln-sortable.js +1 -0
  244. package/components/ln-sortable/ln-sortable.schema.json +36 -0
  245. package/{js → components}/ln-sortable/src/ln-sortable.js +8 -13
  246. package/{js → components}/ln-stat/README.md +3 -1
  247. package/components/ln-stat/ln-stat-dev.scss +8 -0
  248. package/components/ln-stat/ln-stat.js +1 -0
  249. package/components/ln-stat/ln-stat.schema.json +32 -0
  250. package/{js → components}/ln-stat/src/ln-stat.js +14 -18
  251. package/components/ln-stat/src/stat-model.js +28 -0
  252. package/{js → components}/ln-table/README.md +37 -24
  253. package/{js → components}/ln-table/ln-table-dev.scss +17 -17
  254. package/components/ln-table/ln-table.js +1 -0
  255. package/components/ln-table/ln-table.schema.json +211 -0
  256. package/components/ln-table/ln-table.scss +15 -0
  257. package/{js → components}/ln-table/src/ln-table.js +1365 -1493
  258. package/components/ln-table/src/table-model.js +98 -0
  259. package/components/ln-table-coordinator/README.md +61 -0
  260. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -0
  261. package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -0
  262. package/components/ln-table-coordinator/src/ln-table-coordinator.js +193 -0
  263. package/{js → components}/ln-tabs/README.md +32 -14
  264. package/components/ln-tabs/ln-tabs-dev.scss +24 -0
  265. package/components/ln-tabs/ln-tabs.js +1 -0
  266. package/components/ln-tabs/ln-tabs.schema.json +75 -0
  267. package/components/ln-tabs/ln-tabs.scss +8 -0
  268. package/components/ln-tabs/src/ln-tabs.js +207 -0
  269. package/components/ln-tabs/src/tabs-model.js +82 -0
  270. package/{js → components}/ln-time/README.md +96 -95
  271. package/components/ln-time/ln-time-dev.scss +13 -0
  272. package/components/ln-time/ln-time.js +1 -0
  273. package/components/ln-time/ln-time.schema.json +38 -0
  274. package/{js → components}/ln-time/src/ln-time.js +206 -223
  275. package/components/ln-time/src/time-model.js +64 -0
  276. package/{js → components}/ln-toast/README.md +23 -5
  277. package/components/ln-toast/ln-toast-dev.scss +8 -0
  278. package/components/ln-toast/ln-toast.js +1 -0
  279. package/components/ln-toast/ln-toast.schema.json +65 -0
  280. package/components/ln-toast/ln-toast.scss +59 -0
  281. package/{js → components}/ln-toast/src/ln-toast.js +233 -232
  282. package/{js → components}/ln-toggle/README.md +198 -196
  283. package/{js → components}/ln-toggle/ln-toggle-dev.scss +13 -13
  284. package/components/ln-toggle/ln-toggle.js +1 -0
  285. package/components/ln-toggle/ln-toggle.schema.json +52 -0
  286. package/components/ln-toggle/ln-toggle.scss +37 -0
  287. package/{js → components}/ln-toggle/src/ln-toggle.js +61 -46
  288. package/{js → components}/ln-tooltip/README.md +6 -6
  289. package/{js → components}/ln-tooltip/ln-tooltip-dev.scss +9 -9
  290. package/components/ln-tooltip/ln-tooltip.js +1 -0
  291. package/components/ln-tooltip/ln-tooltip.schema.json +86 -0
  292. package/components/ln-tooltip/ln-tooltip.scss +9 -0
  293. package/{js → components}/ln-tooltip/src/ln-tooltip.js +14 -3
  294. package/{js → components}/ln-translations/README.md +3 -1
  295. package/components/ln-translations/ln-translations-dev.scss +13 -0
  296. package/components/ln-translations/ln-translations.js +1 -0
  297. package/components/ln-translations/ln-translations.schema.json +120 -0
  298. package/{js → components}/ln-translations/src/ln-translations.js +25 -10
  299. package/components/ln-ui-coordinator/README.md +101 -0
  300. package/components/ln-ui-coordinator/ln-ui-coordinator-dev.scss +8 -0
  301. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -0
  302. package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +60 -0
  303. package/{js/ln-modal-coordinator/src/ln-modal-coordinator.js → components/ln-ui-coordinator/src/ln-ui-coordinator.js} +403 -345
  304. package/components/ln-upload/README.md +133 -0
  305. package/components/ln-upload/ln-upload-dev.scss +18 -0
  306. package/components/ln-upload/ln-upload.js +1 -0
  307. package/components/ln-upload/ln-upload.schema.json +193 -0
  308. package/components/ln-upload/ln-upload.scss +20 -0
  309. package/components/ln-upload/src/ln-upload.js +652 -0
  310. package/components/ln-upload/src/upload-model.js +78 -0
  311. package/{js → components}/ln-validate/README.md +182 -180
  312. package/{js → components}/ln-validate/ln-validate-dev.scss +15 -15
  313. package/components/ln-validate/ln-validate.js +1 -0
  314. package/components/ln-validate/ln-validate.schema.json +50 -0
  315. package/components/ln-validate/ln-validate.scss +7 -0
  316. package/{js → components}/ln-validate/src/ln-validate.js +23 -45
  317. package/components/ln-validate/src/validate-model.js +64 -0
  318. package/components/ln-websocket-connector/README.md +166 -0
  319. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -0
  320. package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -0
  321. package/components/ln-websocket-connector/src/ln-websocket-connector.js +279 -0
  322. package/ln-ashlar.html-data.json +1796 -0
  323. package/package.json +84 -61
  324. package/{scss → theme}/base/_global.scss +1 -2
  325. package/{scss → theme}/base/_reset.scss +1 -1
  326. package/{scss → theme}/base/_typography.scss +2 -0
  327. package/theme/brand.css +73 -0
  328. package/{scss → theme}/components/_app-shell.scss +8 -0
  329. package/theme/components/_button.scss +24 -0
  330. package/theme/components/_chart.scss +5 -0
  331. package/theme/components/_confirm.scss +6 -0
  332. package/{scss → theme}/components/_date.scss +30 -22
  333. package/{scss → theme}/components/_dropdown.scss +6 -1
  334. package/theme/components/_form.scss +140 -0
  335. package/{scss → theme}/components/_layout.scss +6 -0
  336. package/{scss → theme}/components/_ln-table.scss +1 -6
  337. package/theme/components/_picklist.scss +3 -0
  338. package/{scss → theme}/components/_sort.scss +10 -10
  339. package/theme/components/_status-badge.scss +6 -0
  340. package/{scss → theme}/components/_table.scss +16 -0
  341. package/{scss → theme}/components/_tabs.scss +0 -4
  342. package/theme/components/_toast.scss +48 -0
  343. package/{scss → theme}/components/_toggle.scss +1 -1
  344. package/theme/components/_upload.scss +45 -0
  345. package/{scss → theme}/config/_breakpoints.scss +1 -1
  346. package/theme/config/_contrast.scss +128 -0
  347. package/{scss → theme}/config/_density.scss +191 -205
  348. package/theme/config/_palette.scss +274 -0
  349. package/theme/config/_theme.scss +293 -0
  350. package/{scss → theme}/config/_tokens.scss +285 -441
  351. package/{scss → theme}/config/mixins/_accordion.scss +1 -1
  352. package/{scss → theme}/config/mixins/_alert.scss +1 -0
  353. package/{scss → theme}/config/mixins/_app-shell.scss +4 -2
  354. package/{scss → theme}/config/mixins/_borders.scss +2 -0
  355. package/theme/config/mixins/_btn.scss +175 -0
  356. package/{scss → theme}/config/mixins/_card.scss +55 -46
  357. package/theme/config/mixins/_chart.scss +82 -0
  358. package/{scss → theme}/config/mixins/_collapsible.scss +2 -1
  359. package/{scss → theme}/config/mixins/_colors.scss +8 -14
  360. package/{scss → theme}/config/mixins/_diagnostics.scss +48 -48
  361. package/theme/config/mixins/_dropdown.scss +169 -0
  362. package/{scss → theme}/config/mixins/_editor.scss +0 -7
  363. package/{scss → theme}/config/mixins/_filter.scss +47 -47
  364. package/{scss → theme}/config/mixins/_footer.scss +1 -1
  365. package/{scss → theme}/config/mixins/_form.scss +49 -18
  366. package/{scss → theme}/config/mixins/_index.scss +62 -61
  367. package/{scss → theme}/config/mixins/_layout.scss +6 -2
  368. package/{scss → theme}/config/mixins/_ln-table.scss +31 -10
  369. package/{scss → theme}/config/mixins/_loader.scss +1 -1
  370. package/{scss → theme}/config/mixins/_modal.scss +145 -149
  371. package/{scss → theme}/config/mixins/_motion.scss +13 -0
  372. package/{scss → theme}/config/mixins/_nav.scss +7 -7
  373. package/theme/config/mixins/_picklist.scss +66 -0
  374. package/theme/config/mixins/_popover.scss +96 -0
  375. package/{scss → theme}/config/mixins/_sidebar.scss +7 -4
  376. package/{scss → theme}/config/mixins/_sort.scss +43 -42
  377. package/{scss → theme}/config/mixins/_status-badge.scss +15 -2
  378. package/{scss → theme}/config/mixins/_table.scss +25 -14
  379. package/{scss → theme}/config/mixins/_tabs.scss +1 -1
  380. package/{scss → theme}/config/mixins/_toast.scss +174 -179
  381. package/{scss → theme}/config/mixins/_tooltip.scss +2 -2
  382. package/{scss → theme}/config/mixins/_typography.scss +16 -5
  383. package/{scss → theme}/config/mixins/_upload.scss +8 -6
  384. package/theme/ln-ashlar-core.scss +24 -0
  385. package/theme/ln-ashlar-dev.scss +66 -0
  386. package/theme/ln-ashlar-landing.scss +56 -0
  387. package/{scss/ln-ashlar.scss → theme/ln-ashlar-theme.scss} +63 -69
  388. package/theme/ln-ashlar.scss +8 -0
  389. package/theme/presentation/_bento.scss +151 -0
  390. package/theme/presentation/_cta.scss +111 -0
  391. package/theme/presentation/_effects.scss +216 -0
  392. package/theme/presentation/_features.scss +108 -0
  393. package/theme/presentation/_footer.scss +129 -0
  394. package/theme/presentation/_hero.scss +158 -0
  395. package/theme/presentation/_layout.scss +170 -0
  396. package/theme/presentation/_navbar.scss +140 -0
  397. package/theme/presentation/_pricing.scss +262 -0
  398. package/theme/presentation/_stats.scss +87 -0
  399. package/theme/presentation/_testimonials.scss +124 -0
  400. package/theme/presentation/_tokens.scss +39 -0
  401. package/theme/presentation/_typography.scss +163 -0
  402. package/{scss → theme}/utilities/_animations.scss +38 -0
  403. package/{scss → theme}/utilities/_utilities.scss +6 -0
  404. package/web-types.json +2312 -0
  405. package/js/ln-accordion/ln-accordion.js +0 -1
  406. package/js/ln-ajax/ln-ajax.js +0 -1
  407. package/js/ln-api-connector/ln-api-connector.js +0 -1
  408. package/js/ln-api-connector/src/ln-api-connector.js +0 -368
  409. package/js/ln-api-queue/ln-api-queue.js +0 -1
  410. package/js/ln-autoresize/ln-autoresize.js +0 -1
  411. package/js/ln-autosave/ln-autosave.js +0 -1
  412. package/js/ln-circular-progress/ln-circular-progress.js +0 -1
  413. package/js/ln-confirm/_ln-confirm.scss +0 -24
  414. package/js/ln-confirm/ln-confirm.js +0 -1
  415. package/js/ln-core/crypto.js +0 -83
  416. package/js/ln-core/helpers.js +0 -788
  417. package/js/ln-core/index.js +0 -7
  418. package/js/ln-core/persist.js +0 -97
  419. package/js/ln-couchdb-connector/ln-couchdb-connector.js +0 -1
  420. package/js/ln-data-coordinator/ln-data-coordinator.js +0 -1
  421. package/js/ln-data-coordinator/src/data-read-policy.js +0 -18
  422. package/js/ln-data-store/ln-data-store.js +0 -1
  423. package/js/ln-date/ln-date.js +0 -1
  424. package/js/ln-date/src/ln-date.js +0 -603
  425. package/js/ln-debug/README.md +0 -58
  426. package/js/ln-debug/ln-debug.js +0 -1
  427. package/js/ln-debug/src/ln-debug.js +0 -19
  428. package/js/ln-dropdown/ln-dropdown.js +0 -1
  429. package/js/ln-dropdown/ln-dropdown.scss +0 -15
  430. package/js/ln-editor/ln-editor.js +0 -1
  431. package/js/ln-editor/ln-editor.scss +0 -43
  432. package/js/ln-external-links/ln-external-links.js +0 -1
  433. package/js/ln-fill/ln-fill.js +0 -1
  434. package/js/ln-filter/README.md +0 -189
  435. package/js/ln-filter/ln-filter-dev.scss +0 -8
  436. package/js/ln-filter/ln-filter.js +0 -1
  437. package/js/ln-filter/src/ln-filter.js +0 -419
  438. package/js/ln-form/ln-form.js +0 -1
  439. package/js/ln-http/ln-http.js +0 -1
  440. package/js/ln-link/ln-link.js +0 -1
  441. package/js/ln-list/README.md +0 -129
  442. package/js/ln-list/ln-list.js +0 -1
  443. package/js/ln-list/ln-list.scss +0 -28
  444. package/js/ln-modal/ln-modal-dev.scss +0 -13
  445. package/js/ln-modal/ln-modal.js +0 -1
  446. package/js/ln-modal/ln-modal.scss +0 -35
  447. package/js/ln-modal-coordinator/README.md +0 -99
  448. package/js/ln-modal-coordinator/ln-modal-coordinator-dev.scss +0 -8
  449. package/js/ln-modal-coordinator/ln-modal-coordinator.js +0 -1
  450. package/js/ln-nav/ln-nav.js +0 -1
  451. package/js/ln-number/README.md +0 -149
  452. package/js/ln-number/ln-number.js +0 -1
  453. package/js/ln-number/src/ln-number.js +0 -443
  454. package/js/ln-options/ln-options.js +0 -1
  455. package/js/ln-popover/ln-popover.js +0 -1
  456. package/js/ln-progress/ln-progress.js +0 -1
  457. package/js/ln-progress/src/ln-progress.js +0 -98
  458. package/js/ln-router/ln-router.js +0 -1
  459. package/js/ln-search/README.md +0 -158
  460. package/js/ln-search/ln-search-dev.scss +0 -8
  461. package/js/ln-search/ln-search.js +0 -1
  462. package/js/ln-search/src/ln-search.js +0 -117
  463. package/js/ln-slug/ln-slug.js +0 -1
  464. package/js/ln-sort/ln-sort.js +0 -1
  465. package/js/ln-sort/src/ln-sort.js +0 -178
  466. package/js/ln-sortable/ln-sortable.js +0 -1
  467. package/js/ln-stat/ln-stat.js +0 -1
  468. package/js/ln-table/ln-table.js +0 -1
  469. package/js/ln-table/ln-table.scss +0 -11
  470. package/js/ln-table-coordinator/README.md +0 -73
  471. package/js/ln-table-coordinator/ln-table-coordinator.js +0 -1
  472. package/js/ln-table-coordinator/src/ln-table-coordinator.js +0 -160
  473. package/js/ln-tabs/ln-tabs-dev.scss +0 -18
  474. package/js/ln-tabs/ln-tabs.js +0 -1
  475. package/js/ln-tabs/src/ln-tabs.js +0 -188
  476. package/js/ln-time/ln-time.js +0 -1
  477. package/js/ln-toast/ln-toast.js +0 -1
  478. package/js/ln-toggle/ln-toggle.js +0 -1
  479. package/js/ln-tooltip/ln-tooltip.js +0 -1
  480. package/js/ln-tooltip/ln-tooltip.scss +0 -9
  481. package/js/ln-translations/ln-translations.js +0 -1
  482. package/js/ln-upload/README.md +0 -255
  483. package/js/ln-upload/ln-upload.js +0 -1
  484. package/js/ln-upload/ln-upload.scss +0 -20
  485. package/js/ln-upload/src/ln-upload.js +0 -423
  486. package/js/ln-validate/ln-validate.js +0 -1
  487. package/scss/components/_button.scss +0 -20
  488. package/scss/components/_confirm.scss +0 -5
  489. package/scss/components/_form.scss +0 -107
  490. package/scss/components/_status-badge.scss +0 -4
  491. package/scss/components/_toast.scss +0 -68
  492. package/scss/components/_upload.scss +0 -51
  493. package/scss/config/_theme.scss +0 -216
  494. package/scss/config/mixins/_btn.scss +0 -179
  495. package/scss/config/mixins/_confirm.scss +0 -31
  496. package/scss/config/mixins/_dropdown.scss +0 -141
  497. package/scss/config/mixins/_popover.scss +0 -64
  498. package/scss/ln-ashlar-dev.scss +0 -39
  499. /package/{js → components}/ln-core/positioning.js +0 -0
  500. /package/{js → components}/ln-core/reactive.js +0 -0
  501. /package/{js → components}/ln-filter/ln-filter.scss +0 -0
  502. /package/{js → components}/ln-icon/ln-icon.js +0 -0
  503. /package/{js → components}/ln-icon/src/ln-icon.js +0 -0
  504. /package/{js → components}/ln-search/ln-search.scss +0 -0
  505. /package/{js → components}/ln-toast/template.html +0 -0
  506. /package/{scss → theme}/components/_accordion.scss +0 -0
  507. /package/{scss → theme}/components/_ajax.scss +0 -0
  508. /package/{scss → theme}/components/_alert.scss +0 -0
  509. /package/{scss → theme}/components/_avatar.scss +0 -0
  510. /package/{scss → theme}/components/_breadcrumbs.scss +0 -0
  511. /package/{scss → theme}/components/_card.scss +0 -0
  512. /package/{scss → theme}/components/_chip.scss +0 -0
  513. /package/{scss → theme}/components/_circular-progress.scss +0 -0
  514. /package/{scss → theme}/components/_editor.scss +0 -0
  515. /package/{scss → theme}/components/_empty-state.scss +0 -0
  516. /package/{scss → theme}/components/_filter.scss +0 -0
  517. /package/{scss → theme}/components/_link.scss +0 -0
  518. /package/{scss → theme}/components/_loader.scss +0 -0
  519. /package/{scss → theme}/components/_modal.scss +0 -0
  520. /package/{scss → theme}/components/_nav.scss +0 -0
  521. /package/{scss → theme}/components/_page-header.scss +0 -0
  522. /package/{scss → theme}/components/_popover.scss +0 -0
  523. /package/{scss → theme}/components/_progress.scss +0 -0
  524. /package/{scss → theme}/components/_prose.scss +0 -0
  525. /package/{scss → theme}/components/_scrollbar.scss +0 -0
  526. /package/{scss → theme}/components/_sections.scss +0 -0
  527. /package/{scss → theme}/components/_sidebar.scss +0 -0
  528. /package/{scss → theme}/components/_stat-card.scss +0 -0
  529. /package/{scss → theme}/components/_stepper.scss +0 -0
  530. /package/{scss → theme}/components/_timeline.scss +0 -0
  531. /package/{scss → theme}/components/_tooltip.scss +0 -0
  532. /package/{scss → theme}/components/_translations.scss +0 -0
  533. /package/{scss → theme}/config/_icons.scss +0 -0
  534. /package/{scss → theme}/config/_mixins.scss +0 -0
  535. /package/{scss → theme}/config/mixins/_ajax.scss +0 -0
  536. /package/{scss → theme}/config/mixins/_avatar.scss +0 -0
  537. /package/{scss → theme}/config/mixins/_breadcrumbs.scss +0 -0
  538. /package/{scss → theme}/config/mixins/_breakpoints.scss +0 -0
  539. /package/{scss → theme}/config/mixins/_chip.scss +0 -0
  540. /package/{scss → theme}/config/mixins/_circular-progress.scss +0 -0
  541. /package/{scss → theme}/config/mixins/_display.scss +0 -0
  542. /package/{scss → theme}/config/mixins/_empty-state.scss +0 -0
  543. /package/{scss → theme}/config/mixins/_focus.scss +0 -0
  544. /package/{scss → theme}/config/mixins/_interaction.scss +0 -0
  545. /package/{scss → theme}/config/mixins/_kbd.scss +0 -0
  546. /package/{scss → theme}/config/mixins/_link.scss +0 -0
  547. /package/{scss → theme}/config/mixins/_page-header.scss +0 -0
  548. /package/{scss → theme}/config/mixins/_position.scss +0 -0
  549. /package/{scss → theme}/config/mixins/_progress.scss +0 -0
  550. /package/{scss → theme}/config/mixins/_prose.scss +0 -0
  551. /package/{scss → theme}/config/mixins/_shadows.scss +0 -0
  552. /package/{scss → theme}/config/mixins/_sizing.scss +0 -0
  553. /package/{scss → theme}/config/mixins/_spacing.scss +0 -0
  554. /package/{scss → theme}/config/mixins/_stat-card.scss +0 -0
  555. /package/{scss → theme}/config/mixins/_stepper.scss +0 -0
  556. /package/{scss → theme}/config/mixins/_timeline.scss +0 -0
  557. /package/{scss → theme}/config/mixins/_transitions.scss +0 -0
  558. /package/{scss → theme}/config/mixins/_translations.scss +0 -0
  559. /package/{scss → theme}/tabler-icons.txt +0 -0
@@ -1 +0,0 @@
1
- (function(){"use strict";if(typeof window<"u"){const i=console.warn;console.warn=function(...l){typeof l[0]=="string"&&(l[0].startsWith("[ln-")||l[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||i.apply(console,l)}}const R={};function B(i,l){R[i]||(R[i]=document.querySelector('[data-ln-template="'+i+'"]'));const o=R[i];return o?o.content.cloneNode(!0):(console.warn("["+(l||"ln-core")+'] Template "'+i+'" not found'),null)}function T(i,l,o){i.dispatchEvent(new CustomEvent(l,{bubbles:!0,detail:o||{}}))}function Q(i,l,o){const h=new CustomEvent(l,{bubbles:!0,cancelable:!0,detail:o||{}});return i.dispatchEvent(h),h}function J(i,l,o){i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter();const h={sort:i.currentSort,filters:i.currentFilters,search:i.currentSearch};h[o]=i.name,T(i.dom,l,h)}function N(i,l){if(!i||!l)return i;const o=i.querySelectorAll("[data-ln-field]");for(let d=0;d<o.length;d++){const a=o[d],u=a.getAttribute("data-ln-field");l[u]!=null&&(a.textContent=l[u])}const h=i.querySelectorAll("[data-ln-attr]");for(let d=0;d<h.length;d++){const a=h[d],u=a.getAttribute("data-ln-attr").split(",");for(let m=0;m<u.length;m++){const g=u[m].trim().split(":");if(g.length!==2)continue;const A=g[0].trim(),E=g[1].trim();l[E]!=null&&a.setAttribute(A,l[E])}}const y=i.querySelectorAll("[data-ln-show]");for(let d=0;d<y.length;d++){const a=y[d],u=a.getAttribute("data-ln-show");u in l&&a.classList.toggle("hidden",!l[u])}const b=i.querySelectorAll("[data-ln-class]");for(let d=0;d<b.length;d++){const a=b[d],u=a.getAttribute("data-ln-class").split(",");for(let m=0;m<u.length;m++){const g=u[m].trim().split(":");if(g.length!==2)continue;const A=g[0].trim(),E=g[1].trim();E in l&&a.classList.toggle(A,!!l[E])}}return i}function Z(i,l){i.matches&&i.matches("[data-ln-form], [data-ln-fillable]")&&i.dispatchEvent(new CustomEvent("ln-fill",{detail:l??null,bubbles:!0}));const o=i.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let h=0;h<o.length;h++)o[h].dispatchEvent(new CustomEvent("ln-fill",{detail:l??null,bubbles:!0}));return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(i){if(!(!i.target.matches||!i.target.matches("[data-ln-fillable]")))if(i.detail)N(i.target,i.detail);else{const l=i.target.querySelectorAll("[data-ln-field]");for(let o=0;o<l.length;o++)l[o].textContent=""}})));function W(i,l){if(!i||!l)return i;const o=document.createTreeWalker(i,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const b=o.currentNode;b.textContent.indexOf("{{")!==-1&&(b.textContent=b.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(d,a){return l[a]!==void 0?l[a]:""}))}const h=function(b,d){return l[d]!==void 0?l[d]:""},y=Array.from(i.querySelectorAll("*"));i.nodeType===1&&y.push(i);for(let b=0;b<y.length;b++){const d=y[b],a=d.attributes;for(let u=0;u<a.length;u++){const m=a[u];m.value.indexOf("{{")!==-1&&d.setAttribute(m.name,m.value.replace(/\{\{\s*(\w+)\s*\}\}/g,h))}}return i}function tt(i,l,o,h,y,b){const d={};for(let u=0;u<i.children.length;u++){const m=i.children[u],g=m.getAttribute("data-ln-key");g&&(d[g]=m)}const a=document.createDocumentFragment();for(let u=0;u<l.length;u++){const m=l[u],g=String(h(m));let A=d[g];if(A)y(A,m,u);else{const E=B(o,b);if(!E||(W(E,m),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-key",g),y(A,m,u)}a.appendChild(A)}i.textContent="",i.appendChild(a)}function V(i,l){if(!document.body){document.addEventListener("DOMContentLoaded",function(){V(i,l)}),console.warn("["+l+'] Script loaded before <body> — add "defer" to your <script> tag');return}i()}function G(i,l,o){if(i){const h=i.querySelector('[data-ln-template="'+l+'"]');if(h)return h.content.cloneNode(!0)}return B(l,o)}function z(i,l,o,h){if(i.nodeType!==1)return;const b=l.indexOf("[")!==-1||l.indexOf(".")!==-1||l.indexOf("#")!==-1?l:"["+l+"]",d=Array.from(i.querySelectorAll(b));i.matches&&i.matches(b)&&d.push(i);for(const a of d)a[o]||(a[o]=new h(a))}const P={mk:"mk-MK",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",nl:"nl-NL",pt:"pt-PT",ru:"ru-RU",bg:"bg-BG",hr:"hr-HR",sr:"sr-RS",sq:"sq-AL",el:"el-GR",en:"en-US"};function j(i){const l=i?i.closest("[lang]"):null,o=(l?l.getAttribute("lang")||l.lang:null)||(document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||navigator.language;if(!o)return"en-US";const h=o.trim().toLowerCase();return h.indexOf("-")===-1&&P[h]?P[h]:o}function et(i){let l=!1;for(let o=0;o<i.length;o++){const h=i[o];if(!(h===""||h==null)&&(l=!0,!Number.isFinite(Number(h))))return"string"}return l?"number":"string"}function it(i,l,o,h){if(o==="number"){const d=parseFloat(i),a=parseFloat(l);return(isNaN(d)?0:d)-(isNaN(a)?0:a)}const y=i!=null?String(i):"",b=l!=null?String(l):"";return h?h.compare(y,b):y<b?-1:y>b?1:0}function nt(i,l,o,h,y={}){const b=y.extraAttributes||[],d=y.onAttributeChange||null,a=y.onInit||null;function u(m){const g=m||document.body;z(g,i,l,o),a&&a(g)}return V(function(){const m=new MutationObserver(function(A){for(let E=0;E<A.length;E++){const f=A[E];if(f.type==="childList"){for(let t=0;t<f.addedNodes.length;t++){const e=f.addedNodes[t];e.nodeType===1&&(z(e,i,l,o),a&&a(e))}for(let t=0;t<f.removedNodes.length;t++){const e=f.removedNodes[t];if(e.nodeType===1){const s=i.indexOf("[")!==-1||i.indexOf(".")!==-1||i.indexOf("#")!==-1?i:"["+i+"]",c=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&c.push(e);for(let _=0;_<c.length;_++){const S=c[_];if(!document.contains(S)){const w=S[l];w&&typeof w.destroy=="function"&&w.destroy()}}}}}else f.type==="attributes"&&(d&&f.target[l]?d(f.target,f.attributeName):(z(f.target,i,l,o),a&&a(f.target)))}});let g=[];if(i.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let E;for(;(E=A.exec(i))!==null;)g.push(E[1])}else g.push(i);m.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:g.concat(b)})},h),window[l]=u,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){u(document.body)}):u(document.body),u}const $={};function st(i,l){$[i]=l}function lt(i){return $[i]||{ingress:l=>l,egress:l=>l}}const K={};function Y(i,l){if(!i||typeof l!="object")return;const o=i.toLowerCase().split("-")[0];K[o]=l}function rt(i){if(!i)return null;const l=i.toLowerCase().split("-")[0];return K[l]||null}Y("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=st,window.lnCore.getDataMapper=lt,window.lnCore.registerLocaleFallback=Y,window.lnCore.getLocaleFallback=rt,window.lnCore.fillTemplate=W,window.lnCore.fill=N,window.lnCore.lnFill=Z,window.lnCore.renderList=tt);function ot(i,l){let o=!1;return function(){o||(o=!0,queueMicrotask(function(){o=!1,i()}))}}function at(i){i=i||{};let l=i.windowSize>0?i.windowSize:1e3,o=i.pageSize>0?i.pageSize:200,h=i.threshold!=null?i.threshold:25,y=i.fetchDebounce!=null?i.fetchDebounce:120;const b=typeof i.requestPage=="function"?i.requestPage:function(){},d=typeof i.onChange=="function"?i.onChange:function(){},a=new Map,u=new Map,m=new Set;let g=0,A=0,E=0,f={sort:null,filters:{},search:""},t=null,e=0,n=0,s=!1;function c(r){u.set(r,++e)}function _(){return!!(f&&(f.search||f.filters&&Object.keys(f.filters).length))}function S(){if(a.size<=l)return;const r=Array.from(a.keys()).sort(function(v,D){return(u.get(v)||0)-(u.get(D)||0)});let p=0;for(;a.size>l&&p<r.length;)a.delete(r[p]),u.delete(r[p]),p++}function w(r,p){m.add(r),b(f,r,p)}return{get:function(r){return a.get(r)},has:function(r){return a.has(r)},peek:function(){return a.size?a.values().next().value:void 0},get logicalTotal(){return g},get grandTotal(){return A},get queryGen(){return E},get size(){return a.size},ensure:function(r,p){clearTimeout(t),n=r;for(let k=r;k<p;k++)a.has(k)&&c(k);if(g<=0)return;const v=Math.max(0,r-h),D=Math.min(g,p+h),H=Math.floor(v/o),M=Math.floor(Math.max(0,D-1)/o);let F=-1,q=o;for(let k=H;k<=M;k++){const I=k*o,x=Math.min(o,g-I);let L=!1;for(let C=I;C<I+x;C++)if(!a.has(C)){L=!0;break}if(L&&!m.has(I)){F=I,q=x;break}}F!==-1&&(t=setTimeout(function(){w(F,q)},y))},ingest:function(r){if(r=r||{},r.queryGen!=null&&r.queryGen!==E)return;s&&(a.clear(),u.clear(),s=!1),A=r.total!=null?r.total:A,g=r.filtered!=null?r.filtered:r.data?r.data.length:g;const p=r.offset||0,v=r.data||[];for(let D=0;D<v.length;D++)a.set(p+D,v[D]),c(p+D);m.delete(p),S(),d()},requestInitial:function(r){r&&(f=r),w(0,o)},invalidate:function(r){E++,m.clear(),clearTimeout(t),r&&(f=r),s=!0,w(0,o)},revalidate:function(){E++,m.clear(),clearTimeout(t),s=!0;const r=Math.max(0,Math.floor(n/o)*o),p=g>0?Math.min(o,Math.max(1,g-r)):o;w(r,p)},release:function(r){m.delete(r)},destroy:function(){clearTimeout(t),a.clear(),u.clear(),m.clear()},configure:function(r){r=r||{};let p=!1;if(r.windowSize!=null&&r.windowSize>0&&r.windowSize!==l){const v=r.windowSize<l;l=r.windowSize,v&&S(),p=!0}r.pageSize!=null&&r.pageSize>0&&(o=r.pageSize),r.threshold!=null&&r.threshold>=0&&(h=r.threshold),r.fetchDebounce!=null&&r.fetchDebounce>=0&&(y=r.fetchDebounce),p&&d()},setGrandTotal:function(r){r==null||isNaN(r)||r<0||(A=r,_()||(g=r),d())}}}function X(i){return(i||"").replace(/^#/,"")}function U(i){const l=i===void 0?location.hash:i,o={},h=X(l);if(!h)return o;const y=h.split("&");for(let b=0;b<y.length;b++){const d=y[b];if(!d)continue;const a=d.indexOf(":"),u=a>-1?d.slice(0,a):d,m=a>-1?d.slice(a+1):"";if(u)try{o[u]=decodeURIComponent(m)}catch{o[u]=m}}return o}function ct(i){if(!i)return null;const l=U();return i in l?l[i]:null}function dt(i,l){if(!i)return;const o=U();l==null?delete o[i]:o[i]=String(l);const y=Object.keys(o).map(function(b){const d=o[b];return d===""?b:b+":"+encodeURIComponent(d)}).join("&");X(location.hash)!==y&&(location.hash=y)}function ht(i){return i.button===1||i.ctrlKey||i.metaKey||i.shiftKey?!1:(i.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=U,window.lnCore.hashGet=ct,window.lnCore.hashSet=dt,window.lnCore.hashLinkClick=ht),(function(){const i="data-ln-list",l="lnList",o="data-ln-list-empty";if(window[l]!==void 0)return;function u(t,e){if(t==null||isNaN(t))return"";try{return new Intl.NumberFormat(j(e)).format(t)}catch{return String(t)}}function m(t){let e=t;for(;e&&e!==document.body&&e!==document.documentElement;){const s=getComputedStyle(e).overflowY;if(s==="auto"||s==="scroll")return e;e=e.parentElement}return null}function g(t){const e=t._scrollContainer||m(t.dom);return{container:e,top:e?e.scrollTop:window.scrollY}}function A(t){t.container?t.container.scrollTop=t.top:window.scrollTo(window.scrollX,t.top)}function E(t){if(!t)return 0;const e=getComputedStyle(t),n=parseFloat(e.marginTop)||0,s=parseFloat(e.marginBottom)||0;return t.offsetHeight+n+s}function f(t){this.dom=t,this.tbody=t.querySelector("[data-ln-list-body]")||t,this.isDataDriven=t.hasAttribute("data-ln-list-source"),this.name=t.getAttribute(i)||"",this.source=t.getAttribute("data-ln-list-source")||"",this._totalSpan=t.querySelector("[data-ln-list-total]"),this._filteredSpan=t.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==t?this._filteredSpan.parentElement:null),this._selectedSpan=t.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==t?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this._searchTerm="",this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const e=this;return this._selectable=t.hasAttribute("data-ln-list-selectable"),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._windowed=!1,this._cache=null,this.isDataDriven&&t.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._lastTotal=0,this._lastFiltered=0,this._onSetData=function(n){const s=n.detail||{};if(e._windowed){t.classList.remove("ln-list--loading"),e._cache.ingest(s);return}e._data=s.data||[],e._lastTotal=s.total!=null?s.total:e._data.length,e._lastFiltered=s.filtered!=null?s.filtered:e._data.length,e.totalCount=e._lastTotal,e.visibleCount=e._lastFiltered,e.isLoaded=!0,t.classList.remove("ln-list--loading"),e._vStart=-1,e._vEnd=-1,e._applyFilterAndSort(),e._render(),e._updateFooter(),T(t,"ln-list:rendered",{list:e.name,total:e.totalCount,visible:e.visibleCount})},t.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(n){const s=n.detail&&n.detail.loading;t.classList.toggle("ln-list--loading",!!s),s&&(e.isLoaded=!1)},t.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(n){!e._windowed||!e._cache||e._cache.release(n.detail&&n.detail.offset)},t.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!e._windowed||!e._cache||e._cache.revalidate()},t.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onClearAll=function(n){n.target.closest("[data-ln-list-clear-all]")&&(e.currentFilters={},T(t,"ln-list:clear-filters",{list:e.name}),e._requestData())},t.addEventListener("click",this._onClearAll),this._onSort=function(n){n.detail.field!=null&&(n.preventDefault(),e.currentSort=n.detail.direction==="none"?null:{field:n.detail.field,direction:n.detail.direction},e._windowed?e._requestData():(e._applyFilterAndSort(),e._vStart=-1,e._vEnd=-1,e._render()))},t.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onItemClick=function(n){if(n.target.closest("[data-ln-item-select]")||n.target.closest("[data-ln-item-action]")||n.target.closest("a")||n.target.closest("button")||n.ctrlKey||n.metaKey||n.button===1)return;const s=n.target.closest("[data-ln-item]");if(!s)return;const c=s.getAttribute("data-ln-item-id"),_=s._lnRecord||{};T(t,"ln-list:item-click",{list:e.name,id:c,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(n){const s=n.target.closest("[data-ln-item-action]");if(!s)return;n.stopPropagation();const c=s.closest("[data-ln-item]");if(!c)return;const _=s.getAttribute("data-ln-item-action"),S=c.getAttribute("data-ln-item-id"),w=c._lnRecord||{};T(t,"ln-list:item-action",{list:e.name,id:S,action:_,record:w})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this._onSearchChange=function(n){n.preventDefault(),e.currentSearch=n.detail&&n.detail.term||"",T(t,"ln-list:search",{list:e.name,query:e.currentSearch}),e._requestData()},t.addEventListener("ln-search:change",this._onSearchChange),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():T(t,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){e.tbody.children.length>0&&(e._emptyObserver.disconnect(),e._emptyObserver=null,e._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onSearch=function(n){n.preventDefault(),e._searchTerm=n.detail&&n.detail.term||"",e._applyFilterAndSort(),e._vStart=-1,e._vEnd=-1,e._render(),e._updateFooter(),T(t,"ln-list:filter",{term:e._searchTerm,matched:e._filteredData.length,total:e._data.length})},t.addEventListener("ln-search:change",this._onSearch)),this._onClear=function(n){if(!n.target.closest("[data-ln-list-clear]")||Q(t,"ln-list:before-clear-search",{list:e.name}).defaultPrevented)return;e.isDataDriven?e.currentSearch="":e._searchTerm="";const _=document.querySelector('[data-ln-search="'+t.id+'"]');if(_){const S=_.tagName==="INPUT"?_:_.querySelector("input");S&&(S.value="",S.dispatchEvent(new Event("input",{bubbles:!0})))}e.isDataDriven?(T(t,"ln-list:search",{list:e.name,query:""}),e._requestData()):(e._applyFilterAndSort(),e._vStart=-1,e._vEnd=-1,e._render(),e._updateFooter(),T(t,"ln-list:filter",{term:"",matched:e._filteredData.length,total:e._data.length}))},t.addEventListener("click",this._onClear),this}f.prototype._parseChildren=function(){const t=Array.from(this.tbody.children).filter(e=>!e.classList.contains("ln-list__spacer"));this._data=[],t.length>0&&(this._itemHeight=E(t[0])||50);for(let e=0;e<t.length;e++){const n=t[e],s=n.getAttribute("data-ln-item-id")||n.getAttribute("id"),c=n.textContent.trim().toLowerCase();let _=null;if(this.isDataDriven){_={},s!=null&&(_.id=s);const S=n.querySelectorAll("[data-ln-list-field]");for(let w=0;w<S.length;w++){const r=S[w],p=r.getAttribute("data-ln-list-field");p&&(_[p]=r.textContent.trim())}}this._data.push({html:n.outerHTML,searchText:c,id:s,..._})}this._filteredData=this._data.slice(),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),T(this.dom,"ln-list:ready",{total:this._data.length})},f.prototype._applyFilterAndSort=function(){if(this.isDataDriven){const t=(this.currentSearch||"").trim().toLowerCase(),e=this.currentFilters||{},n=Object.keys(e).length>0;if(this._filteredData=this._data.filter(function(r){if(t){let p=!1;for(const v in r)if(r.hasOwnProperty(v)&&typeof r[v]=="string"&&v!=="html"&&v!=="searchText"&&r[v].toLowerCase().indexOf(t)!==-1){p=!0;break}if(!p)return!1}if(n)for(const p in e){const v=e[p];if(v&&v.length>0){const D=r[p],H=D!=null?String(D):"";if(v.indexOf(H)===-1)return!1}}return!0}),this.visibleCount=this._filteredData.length,!this.currentSort||!this.currentSort.field||!this.currentSort.direction)return;const s=this.currentSort.field,c=this.currentSort.direction==="desc"?-1:1,_=this._filteredData.map(function(r){return r[s]}),S=et(_),w=typeof Intl<"u"?new Intl.Collator(j(this.dom),{sensitivity:"base"}):null;this._filteredData.sort(function(r,p){return it(r[s],p[s],S,w)*c})}else{const t=this._searchTerm;t?this._filteredData=this._data.filter(function(e){return e.searchText.indexOf(t)!==-1}):this._filteredData=this._data.slice()}},f.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const t=this._lastTotal,e=this.visibleCount;if(t===0||this._filteredData.length===0||e===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const t=this._filteredData.length;t===0&&this._searchTerm?(this._disableVirtualScroll(),this._showEmptyState()):t>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},f.prototype._renderAll=function(){if(this.isDataDriven){const t=this._filteredData,e=document.createDocumentFragment();for(let s=0;s<t.length;s++){const c=this._buildItem(t[s]);if(!c)break;e.appendChild(c)}const n=g(this);this.tbody.textContent="",this.tbody.appendChild(e),A(n),this._selectable&&this._updateSelectAll()}else{const t=[],e=this._filteredData;for(let s=0;s<e.length;s++)t.push(e[s].html);const n=g(this);this.tbody.innerHTML=t.join(""),A(n),this._selectable&&this._restoreSelection()}},f.prototype._readGridLayout=function(){const t=getComputedStyle(this.tbody),e=t.gridTemplateColumns;let n=1;if(e&&e!=="none"){const c=e.trim().split(/\s+/).filter(Boolean);c.length>0&&(n=c.length)}const s=parseFloat(t.rowGap);return{columns:n,rowGap:isNaN(s)?0:s}},f.prototype._measureItemHeight=function(){if(this._windowed){const t=this._cache.peek(),e=t?this._buildItem(t):this._buildPlaceholderItem();e&&(this.tbody.textContent="",this.tbody.appendChild(e),this._itemHeight=E(e)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const t=this._buildItem(this._data[0]);t&&(this.tbody.textContent="",this.tbody.appendChild(t),this._itemHeight=E(t)||50,this.tbody.textContent="")}}else{const t=this.tbody.children;t.length>0&&(this._itemHeight=E(t[0])||50)}},f.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const t=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=m(this.dom);const e=this._scrollContainer||window;this._scrollHandler=function(){t._rafId||(t._rafId=requestAnimationFrame(function(){t._rafId=null,t._windowed?t._renderWindowed():t._renderVirtual()}))},this._resizeHandler=function(){t._itemHeight=0,t._measureItemHeight(),t._vStart=-1,t._vEnd=-1,t._windowed?t._renderWindowed():t._renderVirtual()},e.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},f.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},f.prototype._renderVirtual=function(){const t=this._filteredData,e=t.length,n=this._itemHeight;if(!n||!e)return;const s=this._scrollContainer;let c,_;if(s){const x=this.tbody.getBoundingClientRect(),L=s.getBoundingClientRect(),C=s===this.tbody?0:x.top-L.top+s.scrollTop;c=s.scrollTop-C,_=s.clientHeight}else{const L=this.tbody.getBoundingClientRect().top+window.scrollY;c=window.scrollY-L,_=window.innerHeight}const S=this._readGridLayout(),w=S.columns,r=S.rowGap,p=n+r,v=Math.ceil(e/w);let D=Math.max(0,Math.floor(c/p)-15);D=Math.min(D,v);const H=Math.ceil(_/p)+30,M=Math.min(D+H,v),F=Math.min(D*w,e),q=Math.min(M*w,e);if(F===this._vStart&&q===this._vEnd)return;this._vStart=F,this._vEnd=q;const k=D*p,I=(v-M)*p;if(this.isDataDriven){const x=document.createDocumentFragment();if(k>0){const C=document.createElement(this.isUl?"li":"div");C.className="ln-list__spacer",C.style.height=k+"px",x.appendChild(C)}for(let C=F;C<q;C++){const O=this._buildItem(t[C]);O&&x.appendChild(O)}if(I>0){const C=document.createElement(this.isUl?"li":"div");C.className="ln-list__spacer",C.style.height=I+"px",x.appendChild(C)}const L=g(this);this.tbody.textContent="",this.tbody.appendChild(x),A(L),this._selectable&&this._updateSelectAll()}else{let x="";k>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" style="height:${k}px;padding:0;border:none"></${this.isUl?"li":"div"}>`);for(let C=F;C<q;C++)x+=t[C].html;I>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" style="height:${I}px;padding:0;border:none"></${this.isUl?"li":"div"}>`);const L=g(this);this.tbody.innerHTML=x,A(L),this._selectable&&this._restoreSelection()}},f.prototype._buildPlaceholderItem=function(){const t=document.createElement(this.isUl?"li":"div");return t.className="ln-list__placeholder",t.setAttribute("aria-hidden","true"),t.style.height=this._itemHeight+"px",t},f.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const t=this._itemHeight;if(!t)return;const e=this._scrollContainer;let n,s;if(e){const L=this.tbody.getBoundingClientRect(),C=e.getBoundingClientRect(),O=e===this.tbody?0:L.top-C.top+e.scrollTop;n=e.scrollTop-O,s=e.clientHeight}else{const C=this.tbody.getBoundingClientRect().top+window.scrollY;n=window.scrollY-C,s=window.innerHeight}const c=this._readGridLayout(),_=c.columns,S=c.rowGap,w=t+S,r=this._cache.logicalTotal,p=Math.ceil(r/_);let v=Math.max(0,Math.floor(n/w)-15);v=Math.min(v,p);const D=Math.ceil(s/w)+30,H=Math.min(v+D,p),M=Math.min(v*_,r),F=Math.min(H*_,r),q=v*w,k=(p-H)*w,I=document.createDocumentFragment();if(q>0){const L=document.createElement(this.isUl?"li":"div");L.className="ln-list__spacer",L.style.height=q+"px",I.appendChild(L)}for(let L=M;L<F;L++)if(this._cache.has(L)){const C=this._buildItem(this._cache.get(L));C&&I.appendChild(C)}else I.appendChild(this._buildPlaceholderItem());if(k>0){const L=document.createElement(this.isUl?"li":"div");L.className="ln-list__spacer",L.style.height=k+"px",I.appendChild(L)}const x=g(this);this.tbody.textContent="",this.tbody.appendChild(I),A(x),this._vStart=M,this._vEnd=F,this._cache.ensure(M,F)},f.prototype._showEmptyState=function(){this.tbody.textContent="";let t=null;if(this.isDataDriven){const e=this._lastTotal!=null?this._lastTotal:this._data.length,n=this.visibleCount,s=this.currentSearch&&(n<e||n===0),c=s?this.name+"-empty-filtered":this.name+"-empty";if(t=G(this.dom,c,"ln-list"),!t){const _=this.dom.querySelector("template[data-ln-empty]");if(_){const S=s?"search":"initial",w=_.content.querySelector(`[data-ln-empty-when="${S}"]`)||_.content.firstElementChild;w&&(t=document.importNode(w,!0))}}}else{const e=this.dom.querySelector(`template[${o}]`);e&&(t=document.importNode(e.content,!0))}if(t)if(t.tagName==="LI"||t.tagName==="TR")this.tbody.appendChild(t);else{const e=document.createElement(this.isUl?"li":"div");e.appendChild(t),this.tbody.appendChild(e)}T(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch:this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},f.prototype._buildItem=function(t){const e=G(this.dom,this.name+"-row","ln-list");if(!e)return null;const n=e.querySelector("[data-ln-item]")||e.firstElementChild;if(!n)return null;if(W(n,t),N(n,t),n._lnRecord=t,t.id!=null&&(n.setAttribute("data-ln-item-id",t.id),this._selectable&&this.selectedIds.has(String(t.id)))){n.classList.add("ln-item-selected");const s=n.querySelector("[data-ln-item-select]");s&&(s.checked=!0)}return n},f.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const t=this;this._onSelectionChange=function(e){const n=e.target.closest("[data-ln-item-select]");if(!n)return;const s=n.closest("[data-ln-item]");if(!s)return;const c=s.getAttribute("data-ln-item-id");c!=null&&(n.checked?(t.selectedIds.add(String(c)),s.classList.add("ln-item-selected")):(t.selectedIds.delete(String(c)),s.classList.remove("ln-item-selected")),t._updateSelectAll(),t._updateFooter(),T(t.dom,"ln-list:select",{list:t.name,selectedIds:t.selectedIds,count:t.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const e=t._selectAllCheckbox.checked,n=t.tbody.querySelectorAll("[data-ln-item]");for(let s=0;s<n.length;s++){const c=n[s],_=c.getAttribute("data-ln-item-id"),S=c.querySelector("[data-ln-item-select]");_!=null&&(e?(t.selectedIds.add(String(_)),c.classList.add("ln-item-selected")):(t.selectedIds.delete(String(_)),c.classList.remove("ln-item-selected")),S&&(S.checked=e))}T(t.dom,"ln-list:select-all",{list:t.name,selected:e}),T(t.dom,"ln-list:select",{list:t.name,selectedIds:t.selectedIds,count:t.selectedIds.size}),t._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},f.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const t=this.tbody.querySelectorAll("[data-ln-item]");let e=t.length>0;for(let n=0;n<t.length;n++){const s=t[n].getAttribute("data-ln-item-id");if(s!=null&&!this.selectedIds.has(String(s))){e=!1;break}}this._selectAllCheckbox.checked=e},f.prototype._restoreSelection=function(){if(!this.tbody)return;const t=this.tbody.querySelectorAll("[data-ln-item]");for(let e=0;e<t.length;e++){const n=t[e].getAttribute("data-ln-item-id"),s=n!=null&&this.selectedIds.has(String(n));t[e].classList.toggle("ln-item-selected",s);const c=t[e].querySelector("[data-ln-item-select]");c&&(c.checked=s)}this._updateSelectAll()},f.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}J(this,"ln-list:request-data","list")},f.prototype._enterWindowedMode=function(){const t=this,e=this.dom,n=parseInt(e.getAttribute("data-ln-list-window"),10),s=parseInt(e.getAttribute("data-ln-list-window-page"),10),c=parseInt(e.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!t._windowed||!t._cache||(t.totalCount=t._cache.grandTotal,t.visibleCount=t._cache.logicalTotal,t._lastTotal=t._cache.grandTotal,t.isLoaded=!0,t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter(),T(e,"ln-list:rendered",{list:t.name,total:t.totalCount,visible:t.visibleCount}))},this._renderBatch=ot(this._onCacheChange),this._cache=at({windowSize:n>0?n:1e3,pageSize:s>0?s:200,threshold:c>=0?c:25,fetchDebounce:120,requestPage:function(_,S,w){T(e,"ln-list:request-data",{list:t.name,sort:_.sort,filters:_.filters,search:_.search,offset:S,limit:w,queryGen:t._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},f.prototype._kickWindowInitial=function(){if(this._data.length>0){const t=parseInt(this.dom.getAttribute("data-ln-list-count"),10),e=t>0?t:this._data.length;this._cache.ingest({data:this._data,offset:0,total:e,filtered:e})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},f.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},f.prototype._updateFooter=function(){let t=0,e=0;this.isDataDriven?(t=this._lastTotal!=null?this._lastTotal:this._data.length,e=this.visibleCount):(t=this._data.length,e=this._filteredData.length);const n=e<t;if(this._totalSpan&&(this._totalSpan.textContent=u(t,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=n?u(e,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!n),this._selectedSpan){const s=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=s>0?u(s,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",s===0)}},f.prototype.destroy=function(){this.dom[l]&&(this._disableVirtualScroll(),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("click",this._onClearAll),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction)),this.dom.removeEventListener("ln-search:change",this._onSearchChange)):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this.dom.removeEventListener("ln-search:change",this._onSearch)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._onClear&&this.dom.removeEventListener("click",this._onClear),this._data=[],this._filteredData=[],delete this.dom[l])},nt(i,l,f,"ln-list",{extraAttributes:["data-ln-list-window","data-ln-list-window-page","data-ln-list-window-threshold","data-ln-list-count"],onAttributeChange:function(t,e){const n=t[l];if(!(!n||!n.isDataDriven)){if(e==="data-ln-list-window"){const s=t.hasAttribute("data-ln-list-window");if(s&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!s&&n._windowed)n._exitWindowedMode();else if(s&&n._windowed){const c=parseInt(t.getAttribute("data-ln-list-window"),10);c>0&&n._cache.configure({windowSize:c})}return}if(!(!n._windowed||!n._cache)){if(e==="data-ln-list-window-page"){const s=parseInt(t.getAttribute("data-ln-list-window-page"),10);s>0&&n._cache.configure({pageSize:s})}else if(e==="data-ln-list-window-threshold"){const s=parseInt(t.getAttribute("data-ln-list-window-threshold"),10);s>=0&&n._cache.configure({threshold:s})}else if(e==="data-ln-list-count"){const s=parseInt(t.getAttribute("data-ln-list-count"),10);s>=0&&n._cache.setGrandTotal(s)}}}}})})()})();
@@ -1,28 +0,0 @@
1
- // ── JS state: ln-list structural/state overrides ──
2
-
3
- .ln-list--loading [data-ln-list-body] {
4
- opacity: 0.5;
5
- pointer-events: none;
6
- }
7
-
8
- // The virtual-scroll spacer is library-injected. In a grid list body it must
9
- // span the full row so it occupies whole-row height, not a single track.
10
- // Harmless in plain single-column list mode (1 / -1 spans the lone column).
11
- .ln-list__spacer {
12
- grid-column: 1 / -1;
13
- }
14
-
15
- // Windowed-virtualization placeholder item — static fill, no shimmer, parity
16
- // with ln-table (window-cache.md §4). margin must stay zeroed: JS assigns
17
- // height from the real item's outerHeight (offsetHeight + margin already
18
- // folded in), so an inherited margin here would double-count and desync the
19
- // spacer math. padding/border zeroed so the fill paints edge-to-edge; no
20
- // grid-column override — each placeholder is one cell, not a collapsed
21
- // row block like the spacer.
22
- .ln-list__placeholder {
23
- margin: 0 !important;
24
- padding: 0 !important;
25
- border: none !important;
26
- list-style: none !important;
27
- background: var(--bg-sunken);
28
- }
@@ -1,13 +0,0 @@
1
- @use '../../scss/config/mixins' as *;
2
-
3
- [data-ln-debug] {
4
- // 1. Modal Trigger Check: [data-ln-modal-for] cannot have an empty target ID
5
- [data-ln-modal-for=""] {
6
- @include dev-inline-error("data-ln-modal-for is missing a target modal id");
7
- }
8
-
9
- // 2. Non-dialog modal: data-ln-modal must be on a <dialog> element (native showModal/close)
10
- [data-ln-modal]:not(dialog) {
11
- @include dev-inline-error("data-ln-modal must be on a <dialog> element");
12
- }
13
- }
@@ -1 +0,0 @@
1
- (function(){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const b={};function I(t,e){b[t]||(b[t]=document.querySelector('[data-ln-template="'+t+'"]'));const i=b[t];return i?i.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function y(t,e,i){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:i||{}}))}function O(t,e,i){const c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:i||{}});return t.dispatchEvent(c),c}function x(t,e){if(!t||!e)return t;const i=t.querySelectorAll("[data-ln-field]");for(let o=0;o<i.length;o++){const s=i[o],r=s.getAttribute("data-ln-field");e[r]!=null&&(s.textContent=e[r])}const c=t.querySelectorAll("[data-ln-attr]");for(let o=0;o<c.length;o++){const s=c[o],r=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const a=r[d].trim().split(":");if(a.length!==2)continue;const u=a[0].trim(),f=a[1].trim();e[f]!=null&&s.setAttribute(u,e[f])}}const n=t.querySelectorAll("[data-ln-show]");for(let o=0;o<n.length;o++){const s=n[o],r=s.getAttribute("data-ln-show");r in e&&s.classList.toggle("hidden",!e[r])}const l=t.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const s=l[o],r=s.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const a=r[d].trim().split(":");if(a.length!==2)continue;const u=a[0].trim(),f=a[1].trim();f in e&&s.classList.toggle(u,!!e[f])}}return t}function R(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const i=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let c=0;c<i.length;c++)i[c].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)x(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let i=0;i<e.length;i++)e[i].textContent=""}})));function q(t,e){if(!t||!e)return t;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const l=i.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return e[s]!==void 0?e[s]:""}))}const c=function(l,o){return e[o]!==void 0?e[o]:""},n=Array.from(t.querySelectorAll("*"));t.nodeType===1&&n.push(t);for(let l=0;l<n.length;l++){const o=n[l],s=o.attributes;for(let r=0;r<s.length;r++){const d=s[r];d.value.indexOf("{{")!==-1&&o.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,c))}}return t}function N(t,e,i,c,n,l){const o={};for(let r=0;r<t.children.length;r++){const d=t.children[r],a=d.getAttribute("data-ln-key");a&&(o[a]=d)}const s=document.createDocumentFragment();for(let r=0;r<e.length;r++){const d=e[r],a=String(c(d));let u=o[a];if(u)n(u,d,r);else{const f=I(i,l);if(!f||(q(f,d),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-key",a),n(u,d,r)}s.appendChild(u)}t.textContent="",t.appendChild(s)}function E(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function w(t,e,i,c){if(t.nodeType!==1)return;const l=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",o=Array.from(t.querySelectorAll(l));t.matches&&t.matches(l)&&o.push(t);for(const s of o)s[i]||(s[i]=new c(s))}function g(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function j(t,e,i,c,n={}){const l=n.extraAttributes||[],o=n.onAttributeChange||null,s=n.onInit||null;function r(d){const a=d||document.body;w(a,t,e,i),s&&s(a)}return E(function(){const d=new MutationObserver(function(u){for(let f=0;f<u.length;f++){const h=u[f];if(h.type==="childList"){for(let m=0;m<h.addedNodes.length;m++){const p=h.addedNodes[m];p.nodeType===1&&(w(p,t,e,i),s&&s(p))}for(let m=0;m<h.removedNodes.length;m++){const p=h.removedNodes[m];if(p.nodeType===1){const T=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",A=Array.from(p.querySelectorAll(T));p.matches&&p.matches(T)&&A.push(p);for(let v=0;v<A.length;v++){const D=A[v];if(!document.contains(D)){const L=D[e];L&&typeof L.destroy=="function"&&L.destroy()}}}}}else h.type==="attributes"&&(o&&h.target[e]?o(h.target,h.attributeName):(w(h.target,t,e,i),s&&s(h.target)))}});let a=[];if(t.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let f;for(;(f=u.exec(t))!==null;)a.push(f[1])}else a.push(t);d.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:a.concat(l)})},c),window[e]=r,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){r(document.body)}):r(document.body),r}const _={};function F(t,e){_[t]=e}function W(t){return _[t]||{ingress:e=>e,egress:e=>e}}const S={};function k(t,e){if(!t||typeof e!="object")return;const i=t.toLowerCase().split("-")[0];S[i]=e}function B(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return S[e]||null}k("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=F,window.lnCore.getDataMapper=W,window.lnCore.registerLocaleFallback=k,window.lnCore.getLocaleFallback=B,window.lnCore.fillTemplate=q,window.lnCore.fill=x,window.lnCore.lnFill=R,window.lnCore.renderList=N);function M(t){return(t||"").replace(/^#/,"")}function C(t){const e=t===void 0?location.hash:t,i={},c=M(e);if(!c)return i;const n=c.split("&");for(let l=0;l<n.length;l++){const o=n[l];if(!o)continue;const s=o.indexOf(":"),r=s>-1?o.slice(0,s):o,d=s>-1?o.slice(s+1):"";if(r)try{i[r]=decodeURIComponent(d)}catch{i[r]=d}}return i}function K(t){if(!t)return null;const e=C();return t in e?e[t]:null}function P(t,e){if(!t)return;const i=C();e==null?delete i[t]:i[t]=String(e);const n=Object.keys(i).map(function(l){const o=i[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");M(location.hash)!==n&&(location.hash=n)}function U(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=C,window.lnCore.hashGet=K,window.lnCore.hashSet=P,window.lnCore.hashLinkClick=U),(function(){const t="data-ln-modal",e="lnModal";if(window[e]!==void 0)return;function i(n){this.dom=n,this.isOpen=n.getAttribute(t)==="open";const l=this;return this._onRequestOpen=function(){l.dom.setAttribute(t,"open")},this._onRequestClose=function(){l.dom.setAttribute(t,"close")},this._onCancel=function(o){o.preventDefault(),l.dom.setAttribute(t,"close")},this._onClickClose=function(o){const s=o.target.closest("[data-ln-modal-close]");s&&l.dom.contains(s)&&(o.preventDefault(),l.dom.setAttribute(t,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("click",this._onClickClose),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open")),this}i.prototype.destroy=function(){if(this.dom[e]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("click",this._onClickClose),this.isOpen){const n=this.dom;Array.prototype.some.call(document.querySelectorAll("["+t+'="open"]'),function(o){return o!==n})||document.body.classList.remove("ln-modal-open")}y(this.dom,"ln-modal:destroyed",{modalId:this.dom.id,target:this.dom}),delete this.dom[e]}};function c(n){const l=n[e];if(!l)return;const s=n.getAttribute(t)==="open";if(s!==l.isOpen)if(s){if(O(n,"ln-modal:before-open",{modalId:n.id,target:n}).defaultPrevented){n.setAttribute(t,"close");return}l.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof n.showModal=="function"&&n.showModal();const d=n.querySelector("[autofocus]");if(d&&g(d))d.focus();else{const a=n.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),u=Array.prototype.find.call(a,g);if(u)u.focus();else{const f=n.querySelectorAll("a[href], button:not([disabled])"),h=Array.prototype.find.call(f,g);h&&h.focus()}}y(n,"ln-modal:open",{modalId:n.id,target:n})}else{if(O(n,"ln-modal:before-close",{modalId:n.id,target:n}).defaultPrevented){n.setAttribute(t,"open");return}l.isOpen=!1,y(n,"ln-modal:close",{modalId:n.id,target:n}),typeof n.close=="function"&&n.close(),document.querySelector("["+t+'="open"]')||document.body.classList.remove("ln-modal-open")}}j(t,e,i,"ln-modal",{onAttributeChange:c})})()})();
@@ -1,35 +0,0 @@
1
- // ── JS state: modal open/close ──
2
- // data-ln-modal attribute drives visibility. JS calls native showModal()/close();
3
- // this attribute is the CSS surface — reset native <dialog> UA styles and drive
4
- // the flex-centering layout on top.
5
- [data-ln-modal] {
6
- background: transparent;
7
- border: none;
8
- padding: 0;
9
- margin: 0;
10
- width: 100%;
11
- height: 100%;
12
- max-width: none;
13
- max-height: none;
14
- color: inherit;
15
- overflow: visible;
16
-
17
- &[data-ln-modal="open"] {
18
- display: flex;
19
- }
20
- }
21
-
22
- // Prevent body scroll when modal is open
23
- body.ln-modal-open {
24
- overflow: hidden;
25
- }
26
-
27
- // Mode-conditional title variants: shown only when ancestor modal matches the mode
28
- [data-ln-modal-when] {
29
- display: none;
30
- }
31
-
32
- [data-ln-modal-mode="new"] [data-ln-modal-when="new"],
33
- [data-ln-modal-mode="edit"] [data-ln-modal-when="edit"] {
34
- display: inline;
35
- }
@@ -1,99 +0,0 @@
1
- # ln-modal-coordinator
2
-
3
- A zero-instance, document-level singleton that wires `[data-ln-modal-for]` triggers, hash navigation, native-submit resume, and form-completion auto-close across every `ln-modal` on the page. `ln-modal` itself only knows `open`/`close`; this coordinator is the Layer-2 policy that decides *when* and *with what data*.
4
-
5
- ---
6
-
7
- ## 🧭 Philosophy & Architecture
8
-
9
- 1. **Layer separation.** `ln-modal` is a Layer 1 primitive: it manages the `data-ln-modal="open|close"` attribute and native `<dialog>` mechanics only — no trigger resolution, no record filling, no submit handling. `ln-modal-coordinator` is the Layer 2 coordinator that adds all of that on top, without `ln-modal` ever being aware it exists.
10
- 2. **No per-element instance.** There is nothing to construct per modal. The whole file is one IIFE guarded by `window.lnModalCoordinator`, attaching a handful of document-level listeners once per page load.
11
- 3. **Command events, not direct calls.** The coordinator never flips `data-ln-modal` itself — it dispatches `ln-modal:request-open` / `ln-modal:request-close` and lets `ln-modal`'s own attribute-sync logic own the transition (and any cancellation via `ln-modal:before-open`/`before-close`).
12
-
13
- ---
14
-
15
- ## 📦 Minimal Blueprint
16
-
17
- No markup is required to opt in — the coordinator listens on `document` and activates for any `[data-ln-modal-for]` trigger or `[data-ln-modal]` panel already on the page.
18
-
19
- ```html
20
- <!-- Trigger carries the record as a dataset — becomes the fill payload -->
21
- <button data-ln-modal-for="user-modal" data-ln-modal-id="42" data-ln-modal-name="Jane Doe">
22
- Edit Jane Doe
23
- </button>
24
-
25
- <dialog class="ln-modal" data-ln-modal id="user-modal">
26
- <form data-ln-field="name">
27
- <!-- ... -->
28
- </form>
29
- </dialog>
30
- ```
31
-
32
- Clicking the trigger sets `data-ln-modal-mode="edit"` (a record was harvested), fills the modal via `lnCore.fill`, and dispatches `ln-modal:request-open`.
33
-
34
- ---
35
-
36
- ## 🛠️ Declarative API Contract
37
-
38
- ### HTML Attributes
39
-
40
- | Attribute | Elements | Description |
41
- | :--- | :--- | :--- |
42
- | `data-ln-modal-for="modalId"` | Trigger (`<button>`, `<a>`) | Opens/closes the `[data-ln-modal][id="modalId"]` panel on click. |
43
- | `data-ln-modal-mode="edit\|new"` | Trigger (optional) | Forces the mode instead of letting it be inferred from whether a record was harvested. |
44
- | `data-ln-modal-{field}` | Trigger | Record fields harvested off the trigger's dataset (excluding `data-ln-modal-for`/`-close`/`-mode`) and passed to `lnCore.fill`. |
45
- | `<a href="#modalId">` / `<a href="#modalId:param">` | Anchor | Opens the modal by hash; `param` (if present) is passed as the fill id via `ln-fill:request`. |
46
-
47
- Cross-link: see [`js/ln-modal/README.md`](../ln-modal/README.md) for the primitive's own `data-ln-modal`/`data-ln-modal-close` contract.
48
-
49
- ---
50
-
51
- ## ⚡ DOM Events
52
-
53
- ### Consumed
54
-
55
- | Event | Source | Behavior |
56
- | :--- | :--- | :--- |
57
- | `click` | `document` | Resolves `[data-ln-modal-for]` triggers and `<a href="#modalId">` hash anchors. |
58
- | `submit` | `document` | Inside a modal, stores a `sessionStorage` pending-flag and clears the hash so a native (non-AJAX) submit + reload can resume. |
59
- | `hashchange` | `window` | Re-syncs every `[data-ln-modal][id]`'s open/close state against the URL hash. |
60
- | `ln-modal:before-open` | `document` | Mode `new` → resets the modal's forms before it opens. |
61
- | `ln-modal:open` | `document` | Reads the hash param for the modal's id and either dispatches `ln-fill:request` (`edit`) or resets the form (`new`, empty param). |
62
- | `ln-modal:close` | `document` | Clears the pending flag and hash; mode `new` → resets the modal's forms. |
63
- | `ln-form:success` / `ln-ajax:success` | `document` | Closes the modal and resets its forms. |
64
-
65
- ### Dispatched
66
-
67
- | Event | Target | Payload (`detail`) | Description |
68
- | :--- | :--- | :--- | :--- |
69
- | `ln-modal:request-open` | The modal | `{}` | Sent after trigger/hash resolution to open the modal. |
70
- | `ln-modal:request-close` | The modal | `{}` | Sent to close the modal (trigger toggle, form success, pending-resume with no errors). |
71
- | `ln-fill:request` | The modal | `{ id }` | Sent when a hash param (or a live hash change while open) identifies the record to fill. |
72
-
73
- ---
74
-
75
- ## 🔧 Internals
76
-
77
- Source: `js/ln-modal-coordinator/src/ln-modal-coordinator.js`. One IIFE, no `_component` constructor, no `MutationObserver` — every mechanism below is a single document/window-level listener bound once at load, guarded by `window.lnModalCoordinator`.
78
-
79
- ### Trigger delegation
80
-
81
- The `click` listener resolves `e.target.closest('[data-ln-modal-for]')`, looks up the target modal by id, and bails if it isn't an initialized `ln-modal` (`target.lnModal` missing). It harvests a record from the trigger's `dataset`, walking every `lnModal*` key, skipping the reserved `lnModalFor`/`lnModalClose`/`lnModalMode`, and lower-casing the first letter of the remaining suffix (`data-ln-modal-name` → `record.name`). Mode resolution: an explicit `data-ln-modal-mode` on the trigger wins; otherwise a non-empty harvested record implies `edit`, an empty one implies `new`. `edit` fills via `window.lnCore.fill(target, record)`; `new` resets the modal's forms via `_resetModalForm`. Finally it toggles based on the modal's current `data-ln-modal` value: `open` → dispatch `request-close`, anything else → dispatch `request-open`.
82
-
83
- ### Hash navigation
84
-
85
- A click on `a[href^="#"]` is parsed with `hashParse` into a `{ namespace: param }` map; if any namespace matches an initialized modal's `id`, `hashLinkClick(e)` gates the default navigation and `hashSet(ns, param)` writes the hash — the actual open/close is driven by the `hashchange` listener below, not the click handler itself.
86
-
87
- `_syncHashModals` (bound to `hashchange`, and run once on load after `DOMContentLoaded`/`setTimeout(0)`) walks every `[data-ln-modal][id]`. It first resolves any pending native-submit resume (see below), then compares `hashGet(hashNs)` against the modal's current open state: hash present + closed → `request-open` (mode `edit` if the param is non-empty, else `new`); hash present + already open with a changed param → re-dispatch `ln-fill:request` (or reset if the param went empty); hash absent + open → `request-close`. A re-entrancy guard (`_inSync`) prevents the listener from recursing on the `hashSet` calls it triggers indirectly through `ln-modal`'s own attribute sync.
88
-
89
- ### Native-submit resume
90
-
91
- On `submit` inside a `[data-ln-modal]` with an `id`, the coordinator writes `sessionStorage['ln-modal-pending:{id}'] = 'true'` and clears the hash (`hashSet(modal.id, null)`) *before* the native submit/reload happens, so the browser reloads on a clean URL. On the next load, `_syncHashModals` checks the pending flag first: if cleared and no error markers are found (`.has-error`, `[data-ln-validate-error]`, `.form-error`, `.alert-danger` — checked both document-wide and inside the modal) it removes the flag, clears the hash, dispatches `request-close`, and resets the form; if error markers are present, it reopens in `edit` mode instead so the user sees their errors in-context.
92
-
93
- ### Form-completion auto-close
94
-
95
- `ln-form:success` and `ln-ajax:success` share one handler: resolve the closest `[data-ln-modal]` ancestor of the event target, clear the pending flag and hash, dispatch `request-close`, and reset the form. `ln-modal:close` performs the same pending/hash cleanup and additionally resets forms when the mode is `new` (an `edit` close leaves the just-submitted data visible rather than blanking it).
96
-
97
- ### `_resetModalForm`
98
-
99
- Shared by every reset path above: clears `textContent` on every `[data-ln-field]` descendant, then for every `<form>` in the modal calls `window.lnCore.lnFill(form, null)` if available, falling back to the native `form.reset()` otherwise.
@@ -1,8 +0,0 @@
1
- @use '../../scss/config/mixins' as *;
2
-
3
- [data-ln-debug] {
4
- // 1. Non-dialog coordinator check: data-ln-modal-coordinator must be on a <dialog> element
5
- [data-ln-modal-coordinator]:not(dialog) {
6
- @include dev-inline-error("data-ln-modal-coordinator must be on a <dialog> element");
7
- }
8
- }
@@ -1 +0,0 @@
1
- (function(){"use strict";if(typeof window<"u"){const e=console.warn;console.warn=function(...n){typeof n[0]=="string"&&(n[0].startsWith("[ln-")||n[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||e.apply(console,n)}}const q={};function I(e,n){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=q[e];return r?r.content.cloneNode(!0):(console.warn("["+(n||"ln-core")+'] Template "'+e+'" not found'),null)}function A(e,n,r){e.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:r||{}}))}function O(e,n){if(!e||!n)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const s=r[i],d=s.getAttribute("data-ln-field");n[d]!=null&&(s.textContent=n[d])}const p=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<p.length;i++){const s=p[i],d=s.getAttribute("data-ln-attr").split(",");for(let f=0;f<d.length;f++){const h=d[f].trim().split(":");if(h.length!==2)continue;const l=h[0].trim(),t=h[1].trim();n[t]!=null&&s.setAttribute(l,n[t])}}const m=e.querySelectorAll("[data-ln-show]");for(let i=0;i<m.length;i++){const s=m[i],d=s.getAttribute("data-ln-show");d in n&&s.classList.toggle("hidden",!n[d])}const u=e.querySelectorAll("[data-ln-class]");for(let i=0;i<u.length;i++){const s=u[i],d=s.getAttribute("data-ln-class").split(",");for(let f=0;f<d.length;f++){const h=d[f].trim().split(":");if(h.length!==2)continue;const l=h[0].trim(),t=h[1].trim();t in n&&s.classList.toggle(l,!!n[t])}}return e}function W(e,n){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&e.dispatchEvent(new CustomEvent("ln-fill",{detail:n??null,bubbles:!0}));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let p=0;p<r.length;p++)r[p].dispatchEvent(new CustomEvent("ln-fill",{detail:n??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)O(e.target,e.detail);else{const n=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++)n[r].textContent=""}})));function _(e,n){if(!e||!n)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const u=r.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,s){return n[s]!==void 0?n[s]:""}))}const p=function(u,i){return n[i]!==void 0?n[i]:""},m=Array.from(e.querySelectorAll("*"));e.nodeType===1&&m.push(e);for(let u=0;u<m.length;u++){const i=m[u],s=i.attributes;for(let d=0;d<s.length;d++){const f=s[d];f.value.indexOf("{{")!==-1&&i.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,p))}}return e}function B(e,n,r,p,m,u){const i={};for(let d=0;d<e.children.length;d++){const f=e.children[d],h=f.getAttribute("data-ln-key");h&&(i[h]=f)}const s=document.createDocumentFragment();for(let d=0;d<n.length;d++){const f=n[d],h=String(p(f));let l=i[h];if(l)m(l,f,d);else{const t=I(r,u);if(!t||(_(t,f),l=t.firstElementChild,!l))continue;l.setAttribute("data-ln-key",h),m(l,f,d)}s.appendChild(l)}e.textContent="",e.appendChild(s)}function k(e,n){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,n)}),console.warn("["+n+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function E(e,n,r,p){if(e.nodeType!==1)return;const u=n.indexOf("[")!==-1||n.indexOf(".")!==-1||n.indexOf("#")!==-1?n:"["+n+"]",i=Array.from(e.querySelectorAll(u));e.matches&&e.matches(u)&&i.push(e);for(const s of i)s[r]||(s[r]=new p(s))}function K(e,n,r,p,m={}){const u=m.extraAttributes||[],i=m.onAttributeChange||null,s=m.onInit||null;function d(f){const h=f||document.body;E(h,e,n,r),s&&s(h)}return k(function(){const f=new MutationObserver(function(l){for(let t=0;t<l.length;t++){const o=l[t];if(o.type==="childList"){for(let c=0;c<o.addedNodes.length;c++){const a=o.addedNodes[c];a.nodeType===1&&(E(a,e,n,r),s&&s(a))}for(let c=0;c<o.removedNodes.length;c++){const a=o.removedNodes[c];if(a.nodeType===1){const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",M=Array.from(a.querySelectorAll(w));a.matches&&a.matches(w)&&M.push(a);for(let y=0;y<M.length;y++){const S=M[y];if(!document.contains(S)){const b=S[n];b&&typeof b.destroy=="function"&&b.destroy()}}}}}else o.type==="attributes"&&(i&&o.target[n]?i(o.target,o.attributeName):(E(o.target,e,n,r),s&&s(o.target)))}});let h=[];if(e.indexOf("[")!==-1){const l=/\[([\w-]+)/g;let t;for(;(t=l.exec(e))!==null;)h.push(t[1])}else h.push(e);f.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:h.concat(u)})},p),window[n]=d,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){d(document.body)}):d(document.body),d}const T={};function R(e,n){T[e]=n}function P(e){return T[e]||{ingress:n=>n,egress:n=>n}}const D={};function F(e,n){if(!e||typeof n!="object")return;const r=e.toLowerCase().split("-")[0];D[r]=n}function U(e){if(!e)return null;const n=e.toLowerCase().split("-")[0];return D[n]||null}F("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=P,window.lnCore.registerLocaleFallback=F,window.lnCore.getLocaleFallback=U,window.lnCore.fillTemplate=_,window.lnCore.fill=O,window.lnCore.lnFill=W,window.lnCore.renderList=B);function j(e){return(e||"").replace(/^#/,"")}function L(e){const n=e===void 0?location.hash:e,r={},p=j(n);if(!p)return r;const m=p.split("&");for(let u=0;u<m.length;u++){const i=m[u];if(!i)continue;const s=i.indexOf(":"),d=s>-1?i.slice(0,s):i,f=s>-1?i.slice(s+1):"";if(d)try{r[d]=decodeURIComponent(f)}catch{r[d]=f}}return r}function v(e){if(!e)return null;const n=L();return e in n?n[e]:null}function g(e,n){if(!e)return;const r=L();n==null?delete r[e]:r[e]=String(n);const m=Object.keys(r).map(function(u){const i=r[u];return i===""?u:u+":"+encodeURIComponent(i)}).join("&");j(location.hash)!==m&&(location.hash=m)}function N(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=v,window.lnCore.hashSet=g,window.lnCore.hashLinkClick=N),(function(){const e="data-ln-modal-coordinator",n="lnModalCoordinator";if(window[n]!==void 0)return;function r(l,t){if(t){if(l){const c=l.closest("["+e+"]");if(c){if(c.id===t&&c.hasAttribute("data-ln-modal"))return c;const a=c.querySelector("#"+CSS.escape(t)+'[data-ln-modal], [data-ln-modal="'+t+'"]');if(a)return a}}const o=document.getElementById(t)||document.querySelector('[data-ln-modal="'+t+'"]');if(o)return o}if(l){const o=l.closest("["+e+"]");if(o){if(o.hasAttribute("data-ln-modal"))return o;const a=o.querySelector("[data-ln-modal]");if(a)return a}const c=l.closest("[data-ln-modal]");if(c)return c}return document.querySelector("[data-ln-modal]")}function p(l,t){if(l!=="edit")return"";if(t){const o=t.getAttribute("data-ln-fill-id");if(o)return o}return"edit"}function m(l){if(!l)return;const t=l.querySelectorAll("[data-ln-field]");for(let c=0;c<t.length;c++)t[c].textContent="";const o=l.querySelectorAll("form");for(let c=0;c<o.length;c++)window.lnCore&&typeof window.lnCore.lnFill=="function"?window.lnCore.lnFill(o[c],null):o[c].reset()}document.addEventListener("submit",function(l){if(l.defaultPrevented)return;const o=l.target.closest("[data-ln-modal]");if(o&&o.id){try{sessionStorage.setItem("ln-modal-pending:"+o.id,"true")}catch{}g(o.id,null)}}),document.addEventListener("click",function(l){if(l.ctrlKey||l.metaKey||l.button===1)return;const t=l.target.closest("[data-ln-modal-for]");if(t){const c=t.getAttribute("data-ln-modal-for"),a=r(t,c);if(a&&a.lnModal){l.preventDefault();const C={lnModalFor:!0,lnModalClose:!0,lnModalMode:!0},w={},M=t.dataset;for(const b in M){if(!b.startsWith("lnModal")||C[b])continue;const x=b.slice(7);x&&(w[x.charAt(0).toLowerCase()+x.slice(1)]=M[b])}const y=Object.keys(w).length>0;t.hasAttribute("data-ln-modal-mode")?a.dataset.lnModalMode=t.getAttribute("data-ln-modal-mode"):a.dataset.lnModalMode=y?"edit":"new",y&&window.lnCore&&typeof window.lnCore.fill=="function"?window.lnCore.fill(a,w):a.dataset.lnModalMode==="new"&&m(a),a.getAttribute("data-ln-modal")==="open"?A(a,"ln-modal:request-close",{}):(a.id&&g(a.id,p(a.dataset.lnModalMode,t)),A(a,"ln-modal:request-open",{}))}return}const o=l.target.closest('a[href^="#"]');if(o){const c=L(o.getAttribute("href"));for(const a in c){const C=document.getElementById(a);if(C&&C.lnModal){if(!N(l))return;g(a,c[a]);return}}}}),document.addEventListener("ln-modal:before-open",function(l){const t=l.target;if(!t||!t.lnModal)return;(t.dataset.lnModalMode||"new")==="new"&&m(t)}),document.addEventListener("ln-modal:open",function(l){const t=l.target;if(!t||!t.lnModal||!t.id)return;let o=v(t.id);o===null&&(o=p(t.dataset.lnModalMode,null),g(t.id,o)),o?(t.dataset.lnModalMode="edit",t.dispatchEvent(new CustomEvent("ln-fill:request",{bubbles:!0,detail:{id:o}}))):(t.dataset.lnModalMode="new",m(t))});let u=!1;function i(){if(!u){u=!0;try{const l=document.querySelectorAll("[data-ln-modal][id]");for(let t=0;t<l.length;t++){const o=l[t];if(!o.lnModal)continue;const c=o.id,a="ln-modal-pending:"+c;let C=!1;try{C=sessionStorage.getItem(a)==="true"}catch{}if(C){try{sessionStorage.removeItem(a)}catch{}if(!!(document.querySelector(".has-error, [data-ln-validate-error], .form-error, .alert-danger")||o.querySelector(".has-error, [data-ln-validate-error], .form-error, .alert-danger"))){o.dataset.lnModalMode="edit",A(o,"ln-modal:request-open",{});continue}else{g(c,null),A(o,"ln-modal:request-close",{}),m(o);continue}}const w=v(c),M=w!==null,y=o.lnModal.isOpen;if(M){const S=w?"edit":"new";o.dataset.lnModalMode=S,y?w?o.dispatchEvent(new CustomEvent("ln-fill:request",{bubbles:!0,detail:{id:w}})):m(o):A(o,"ln-modal:request-open",{})}else y&&A(o,"ln-modal:request-close",{})}}finally{u=!1}}}function s(){const l=document.querySelectorAll('[data-ln-modal="open"][id]');for(let t=0;t<l.length;t++){const o=l[t];o.lnModal&&v(o.id)===null&&g(o.id,p(o.dataset.lnModalMode,null))}}window.addEventListener("hashchange",i);function d(){s(),i()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){setTimeout(d,0)}):setTimeout(d,0);function f(l){const t=l.target.closest("[data-ln-modal]");if(!(!t||!t.lnModal)){if(t.id){try{sessionStorage.removeItem("ln-modal-pending:"+t.id)}catch{}g(t.id,null)}A(t,"ln-modal:request-close",{}),m(t)}}document.addEventListener("ln-form:success",f),document.addEventListener("ln-ajax:success",f),document.addEventListener("ln-modal:close",function(l){const t=l.target;if(!(!t||!t.lnModal)){if(t.id){try{sessionStorage.removeItem("ln-modal-pending:"+t.id)}catch{}v(t.id)!==null&&g(t.id,null)}t.dataset.lnModalMode==="new"&&m(t)}});function h(l){return this.dom=l,this}h.prototype.destroy=function(){this.dom[n]&&delete this.dom[n]},K(e,n,h,"ln-modal-coordinator")})()})();
@@ -1 +0,0 @@
1
- (function(){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const w={};function D(t,e){w[t]||(w[t]=document.querySelector('[data-ln-template="'+t+'"]'));const i=w[t];return i?i.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function A(t,e,i){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:i||{}}))}function W(t,e,i){const c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:i||{}});return t.dispatchEvent(c),c}function x(t,e){if(!t||!e)return t;const i=t.querySelectorAll("[data-ln-field]");for(let n=0;n<i.length;n++){const o=i[n],r=o.getAttribute("data-ln-field");e[r]!=null&&(o.textContent=e[r])}const c=t.querySelectorAll("[data-ln-attr]");for(let n=0;n<c.length;n++){const o=c[n],r=o.getAttribute("data-ln-attr").split(",");for(let l=0;l<r.length;l++){const s=r[l].trim().split(":");if(s.length!==2)continue;const u=s[0].trim(),f=s[1].trim();e[f]!=null&&o.setAttribute(u,e[f])}}const d=t.querySelectorAll("[data-ln-show]");for(let n=0;n<d.length;n++){const o=d[n],r=o.getAttribute("data-ln-show");r in e&&o.classList.toggle("hidden",!e[r])}const a=t.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const o=a[n],r=o.getAttribute("data-ln-class").split(",");for(let l=0;l<r.length;l++){const s=r[l].trim().split(":");if(s.length!==2)continue;const u=s[0].trim(),f=s[1].trim();f in e&&o.classList.toggle(u,!!e[f])}}return t}function j(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const i=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let c=0;c<i.length;c++)i[c].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)x(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let i=0;i<e.length;i++)e[i].textContent=""}})));function L(t,e){if(!t||!e)return t;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,o){return e[o]!==void 0?e[o]:""}))}const c=function(a,n){return e[n]!==void 0?e[n]:""},d=Array.from(t.querySelectorAll("*"));t.nodeType===1&&d.push(t);for(let a=0;a<d.length;a++){const n=d[a],o=n.attributes;for(let r=0;r<o.length;r++){const l=o[r];l.value.indexOf("{{")!==-1&&n.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,c))}}return t}function M(t,e,i,c,d,a){const n={};for(let r=0;r<t.children.length;r++){const l=t.children[r],s=l.getAttribute("data-ln-key");s&&(n[s]=l)}const o=document.createDocumentFragment();for(let r=0;r<e.length;r++){const l=e[r],s=String(c(l));let u=n[s];if(u)d(u,l,r);else{const f=D(i,a);if(!f||(L(f,l),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-key",s),d(u,l,r)}o.appendChild(u)}t.textContent="",t.appendChild(o)}function S(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function b(t,e,i,c){if(t.nodeType!==1)return;const a=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",n=Array.from(t.querySelectorAll(a));t.matches&&t.matches(a)&&n.push(t);for(const o of n)o[i]||(o[i]=new c(o))}function N(t,e,i,c,d={}){const a=d.extraAttributes||[],n=d.onAttributeChange||null,o=d.onInit||null;function r(l){const s=l||document.body;b(s,t,e,i),o&&o(s)}return S(function(){const l=new MutationObserver(function(u){for(let f=0;f<u.length;f++){const h=u[f];if(h.type==="childList"){for(let p=0;p<h.addedNodes.length;p++){const m=h.addedNodes[p];m.nodeType===1&&(b(m,t,e,i),o&&o(m))}for(let p=0;p<h.removedNodes.length;p++){const m=h.removedNodes[p];if(m.nodeType===1){const T=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",y=Array.from(m.querySelectorAll(T));m.matches&&m.matches(T)&&y.push(m);for(let C=0;C<y.length;C++){const q=y[C];if(!document.contains(q)){const v=q[e];v&&typeof v.destroy=="function"&&v.destroy()}}}}}else h.type==="attributes"&&(n&&h.target[e]?n(h.target,h.attributeName):(b(h.target,t,e,i),o&&o(h.target)))}});let s=[];if(t.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let f;for(;(f=u.exec(t))!==null;)s.push(f[1])}else s.push(t);l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:s.concat(a)})},c),window[e]=r,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){r(document.body)}):r(document.body),r}const k={};function H(t,e){k[t]=e}function P(t){return k[t]||{ingress:e=>e,egress:e=>e}}const O={};function E(t,e){if(!t||typeof e!="object")return;const i=t.toLowerCase().split("-")[0];O[i]=e}function F(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return O[e]||null}E("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=H,window.lnCore.getDataMapper=P,window.lnCore.registerLocaleFallback=E,window.lnCore.getLocaleFallback=F,window.lnCore.fillTemplate=L,window.lnCore.fill=x,window.lnCore.lnFill=j,window.lnCore.renderList=M);function _(t){return(t||"").replace(/^#/,"")}function g(t){const e=t===void 0?location.hash:t,i={},c=_(e);if(!c)return i;const d=c.split("&");for(let a=0;a<d.length;a++){const n=d[a];if(!n)continue;const o=n.indexOf(":"),r=o>-1?n.slice(0,o):n,l=o>-1?n.slice(o+1):"";if(r)try{i[r]=decodeURIComponent(l)}catch{i[r]=l}}return i}function B(t){if(!t)return null;const e=g();return t in e?e[t]:null}function I(t,e){if(!t)return;const i=g();e==null?delete i[t]:i[t]=String(e);const d=Object.keys(i).map(function(a){const n=i[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");_(location.hash)!==d&&(location.hash=d)}function R(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=g,window.lnCore.hashGet=B,window.lnCore.hashSet=I,window.lnCore.hashLinkClick=R),(function(){const t="data-ln-nav",e="lnNav";if(window[e]!==void 0)return;const i=[];if(!history._lnNavPatched){const n=history.pushState;history.pushState=function(){n.apply(history,arguments);for(const o of i)o()},history._lnNavPatched=!0}function c(n){return this.dom=n,this.activeClass=n.getAttribute(t)||"active",this.exact=n.hasAttribute("data-ln-nav-exact"),this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),i.push(this.updateHandler),this.observer=new MutationObserver(()=>this.update()),this.observer.observe(n,{childList:!0,subtree:!0}),this.update(),this}c.prototype.update=function(){if(!this.activeClass||W(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const o=Array.from(this.dom.querySelectorAll("a")),r=window.location.pathname,l=d(r);for(const s of o){const u=s.getAttribute("href");if(!u||u==="#"||u.startsWith("#")||u.startsWith("javascript:")||u.startsWith("mailto:")||u.startsWith("tel:")){s.classList.remove(this.activeClass),s.removeAttribute("aria-current");continue}if(s.hostname&&s.hostname!==window.location.hostname){s.classList.remove(this.activeClass),s.removeAttribute("aria-current");continue}const f=d(u),h=f===l,p=!this.exact&&f!=="/"&&l.startsWith(f+"/");h||p?(s.classList.add(this.activeClass),s.setAttribute("aria-current","page")):(s.classList.remove(this.activeClass),s.removeAttribute("aria-current"))}A(this.dom,"ln-nav:update",{target:this.dom})},c.prototype.destroy=function(){if(!this.dom[e])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const n=i.indexOf(this.updateHandler);n!==-1&&i.splice(n,1),A(this.dom,"ln-nav:destroyed",{target:this.dom}),delete this.dom[e]};function d(n){try{return new URL(n,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return n.replace(/\/$/,"")||"/"}}function a(n,o){const r=n[e];if(r){if(o===t){if(!n.hasAttribute(t)){r.destroy();return}const l=r.activeClass,s=n.getAttribute(t)||"active";if(l!==s){const u=n.querySelectorAll("a");for(const f of u)l&&f.classList.remove(l);r.activeClass=s}}else o==="data-ln-nav-exact"&&(r.exact=n.hasAttribute("data-ln-nav-exact"));r.update()}}N(t,e,c,"ln-nav",{extraAttributes:["data-ln-nav-exact"],onAttributeChange:a})})()})();
@@ -1,149 +0,0 @@
1
- # ln-number
2
-
3
- Real-time locale-aware number formatting for input fields.
4
-
5
- ## Usage
6
-
7
- ```html
8
- <input type="number" name="amount" data-ln-number>
9
- ```
10
-
11
- The component creates a hidden input that holds the raw numeric value for form submission and formats the visible input with locale-aware thousand separators. After initialization:
12
-
13
- ```html
14
- <input type="text" inputmode="decimal" data-ln-number>
15
- <input type="hidden" name="amount" value="1234567">
16
- ```
17
-
18
- ## Loading & Source Files
19
-
20
- ### Loading the Component
21
-
22
- #### 1. In-Bundle (Standard Integration)
23
- To load `ln-number` as part of the main `ln-ashlar` bundle, include the compiled bundle script:
24
- ```html
25
- <script src="dist/ln-ashlar.iife.js" defer></script>
26
- ```
27
-
28
- #### 2. Standalone (Zero-Dependency IIFE)
29
- To load `ln-number` as a standalone component, include its compiled IIFE under the component directory:
30
- ```html
31
- <script src="js/ln-number/ln-number.js" defer></script>
32
- ```
33
-
34
- ### Source Files
35
-
36
- * **Active Development Source**: [js/ln-number/src/ln-number.js](file:///c:/laragon/www/ln-ashlar/js/ln-number/src/ln-number.js) (source of truth)
37
- * **Compiled Standalone**: [js/ln-number/ln-number.js](file:///c:/laragon/www/ln-ashlar/js/ln-number/ln-number.js)
38
-
39
- ## Attributes
40
-
41
- | Attribute | On | Description |
42
- |-----------|-----|-------------|
43
- | `data-ln-number` | `<input>` | Enables number formatting |
44
- | `data-ln-number-decimals` | `<input>` | Max decimal places (default: unlimited) |
45
- | `data-ln-number-min` | `<input>` | Minimum allowed value |
46
- | `data-ln-number-max` | `<input>` | Maximum allowed value |
47
-
48
- ## Events
49
-
50
- | Event | Bubbles | Cancelable | Detail |
51
- |-------|---------|------------|--------|
52
- | `ln-number:input` | yes | no | `{ value: Number, formatted: String }` |
53
- | `ln-number:destroyed` | yes | no | `{ target: Element }` |
54
-
55
- ## API
56
-
57
- ```javascript
58
- const el = document.querySelector('[data-ln-number]');
59
-
60
- el.lnNumber.value; // get raw number (Number or NaN if empty)
61
- el.lnNumber.value = 1234.56; // set value programmatically — formats display
62
- el.lnNumber.formatted; // get formatted display string
63
-
64
- el.lnNumber.destroy(); // remove component, restore original input
65
- ```
66
-
67
- ## Locale
68
-
69
- The component reads the nearest ancestor `[lang]` attribute (typically `<html lang>`); falls back to `navigator.language`. Locale changes propagate live — re-formatting all instances when `<html lang>` changes.
70
-
71
- | `lang` | Display |
72
- |---|---|
73
- | `mk` | `1.234.567` |
74
- | `en-US` | `1,234,567` |
75
-
76
- ## Examples
77
-
78
- ```html
79
- <!-- Basic -->
80
- <div class="form-element">
81
- <label for="amount">Amount</label>
82
- <input type="number" id="amount" name="amount" data-ln-number>
83
- </div>
84
-
85
- <!-- With decimal limit -->
86
- <div class="form-element">
87
- <label for="price">Price</label>
88
- <input type="number" id="price" name="price"
89
- data-ln-number data-ln-number-decimals="2">
90
- </div>
91
-
92
- <!-- With min/max -->
93
- <div class="form-element">
94
- <label for="quantity">Quantity</label>
95
- <input type="number" id="quantity" name="quantity"
96
- data-ln-number data-ln-number-min="0" data-ln-number-max="999999">
97
- </div>
98
-
99
- <!-- Pre-filled value -->
100
- <div class="form-element">
101
- <label for="budget">Budget</label>
102
- <input type="number" id="budget" name="budget" value="1500000"
103
- data-ln-number>
104
- </div>
105
- ```
106
-
107
- ## Integration with ln-validate
108
-
109
- Place `data-ln-validate` on the same input. The `required` attribute stays
110
- on the visible input and works as expected:
111
-
112
- ```html
113
- <div class="form-element">
114
- <label for="salary">Salary</label>
115
- <input type="number" id="salary" name="salary"
116
- required data-ln-validate data-ln-number>
117
- <ul data-ln-validate-errors>
118
- <li class="hidden" data-ln-validate-error="required">Required field</li>
119
- </ul>
120
- </div>
121
- ```
122
-
123
- ## Integration with ln-form
124
-
125
- Works automatically. `serializeForm()` reads the hidden input (which has the
126
- `name`). `populateForm()` sets the hidden input's value, which triggers the
127
- display update.
128
-
129
- ---
130
-
131
- ## 🔧 Internals
132
-
133
- Source: `js/ln-number/ln-number.js`. Each `[data-ln-number]` gets a `_component` instance at `element.lnNumber`, holding `dom` (visible input), `_hidden` (hidden input), and bound `_onInput`/`_onPaste` handlers.
134
-
135
- ### Formatter cache
136
-
137
- One `Intl.NumberFormat` instance per unique locale, cached at module level (`_formatters[locale]`), storing the formatter plus `groupSep`/`decimalSep` extracted once via `formatToParts()`. Separate cache keys (`locale + '|d' + max`, `locale + '|u' + n`) exist for decimal-fixed and user-decimal-preserving formatters. Reused across all instances sharing a locale — `Intl.NumberFormat` construction is the expensive part, not the format call.
138
-
139
- ### Input flow
140
-
141
- On every `input` event: empty value clears the hidden input and dispatches; a bare `-` (user starting a negative number) is left alone. Otherwise: cursor position is saved as a digit-count left of `selectionStart` (not a raw index — formatting inserts/removes separators, so digit-count is the only stable anchor). The typed string is parsed (strip `groupSep`, swap `decimalSep` for `.`); a trailing decimal point or trailing zeros after the decimal point short-circuit to a hidden-only update (so `"12."` doesn't get reformatted mid-type and eat the point the user just typed). Otherwise the decimal limit is enforced (truncated, not rounded), the value is formatted via `Intl.NumberFormat`, `dom.value` is set, the cursor is restored by walking the formatted string until the saved digit-count is reached, and `hidden.value` is set to the raw numeric string. `ln-number:input` dispatches last.
142
-
143
- ### Hidden input value interceptor
144
-
145
- `hidden.value` is wrapped via `Object.defineProperty` so programmatic sets (e.g. `populateForm()` writing `hidden.value = "1234"`) route through the same parse → format → display path as user input. Internal code writes through `_setHiddenRaw()`, which calls the prototype's original setter directly — bypassing the custom setter avoids the interceptor re-triggering itself (infinite loop).
146
-
147
- ### Auto-init
148
-
149
- A single `document.body` `MutationObserver` watches `childList` (subtree — new `[data-ln-number]` elements auto-initialize via `findElements`) and `attributes` on `data-ln-number` (attribute added to an existing element initializes it in place).
@@ -1 +0,0 @@
1
- (function(){"use strict";if(typeof window<"u"){const e=console.warn;console.warn=function(...n){typeof n[0]=="string"&&(n[0].startsWith("[ln-")||n[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||e.apply(console,n)}}const v={};function H(e,n){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const s=v[e];return s?s.content.cloneNode(!0):(console.warn("["+(n||"ln-core")+'] Template "'+e+'" not found'),null)}function S(e,n,s){e.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:s||{}}))}function R(e,n){if(!e||!n)return e;const s=e.querySelectorAll("[data-ln-field]");for(let l=0;l<s.length;l++){const a=s[l],d=a.getAttribute("data-ln-field");n[d]!=null&&(a.textContent=n[d])}const u=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<u.length;l++){const a=u[l],d=a.getAttribute("data-ln-attr").split(",");for(let t=0;t<d.length;t++){const i=d[t].trim().split(":");if(i.length!==2)continue;const r=i[0].trim(),m=i[1].trim();n[m]!=null&&a.setAttribute(r,n[m])}}const p=e.querySelectorAll("[data-ln-show]");for(let l=0;l<p.length;l++){const a=p[l],d=a.getAttribute("data-ln-show");d in n&&a.classList.toggle("hidden",!n[d])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const a=c[l],d=a.getAttribute("data-ln-class").split(",");for(let t=0;t<d.length;t++){const i=d[t].trim().split(":");if(i.length!==2)continue;const r=i[0].trim(),m=i[1].trim();m in n&&a.classList.toggle(r,!!n[m])}}return e}function P(e,n){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&e.dispatchEvent(new CustomEvent("ln-fill",{detail:n??null,bubbles:!0}));const s=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let u=0;u<s.length;u++)s[u].dispatchEvent(new CustomEvent("ln-fill",{detail:n??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const n=e.target.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++)n[s].textContent=""}})));function L(e,n){if(!e||!n)return e;const s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;s.nextNode();){const c=s.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return n[a]!==void 0?n[a]:""}))}const u=function(c,l){return n[l]!==void 0?n[l]:""},p=Array.from(e.querySelectorAll("*"));e.nodeType===1&&p.push(e);for(let c=0;c<p.length;c++){const l=p[c],a=l.attributes;for(let d=0;d<a.length;d++){const t=a[d];t.value.indexOf("{{")!==-1&&l.setAttribute(t.name,t.value.replace(/\{\{\s*(\w+)\s*\}\}/g,u))}}return e}function M(e,n,s,u,p,c){const l={};for(let d=0;d<e.children.length;d++){const t=e.children[d],i=t.getAttribute("data-ln-key");i&&(l[i]=t)}const a=document.createDocumentFragment();for(let d=0;d<n.length;d++){const t=n[d],i=String(u(t));let r=l[i];if(r)p(r,t,d);else{const m=H(s,c);if(!m||(L(m,t),r=m.firstElementChild,!r))continue;r.setAttribute("data-ln-key",i),p(r,t,d)}a.appendChild(r)}e.textContent="",e.appendChild(a)}function O(e,n){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(e,n)}),console.warn("["+n+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function D(e,n,s,u){if(e.nodeType!==1)return;const c=n.indexOf("[")!==-1||n.indexOf(".")!==-1||n.indexOf("#")!==-1?n:"["+n+"]",l=Array.from(e.querySelectorAll(c));e.matches&&e.matches(c)&&l.push(e);for(const a of l)a[s]||(a[s]=new u(a))}const F={mk:"mk-MK",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",nl:"nl-NL",pt:"pt-PT",ru:"ru-RU",bg:"bg-BG",hr:"hr-HR",sr:"sr-RS",sq:"sq-AL",el:"el-GR",en:"en-US"};function w(e){const n=e?e.closest("[lang]"):null,s=(n?n.getAttribute("lang")||n.lang:null)||(document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||navigator.language;if(!s)return"en-US";const u=s.trim().toLowerCase();return u.indexOf("-")===-1&&F[u]?F[u]:s}function V(e,n,{get:s,set:u}){Object.defineProperty(e,"value",{get:function(){return s?s.call(this):n.get.call(this)},set:function(p){u?u.call(this,p,c=>n.set.call(this,c)):n.set.call(this,p)},configurable:!0})}function W(e,n,s,u,p={}){const c=p.extraAttributes||[],l=p.onAttributeChange||null,a=p.onInit||null;function d(t){const i=t||document.body;D(i,e,n,s),a&&a(i)}return O(function(){const t=new MutationObserver(function(r){for(let m=0;m<r.length;m++){const o=r[m];if(o.type==="childList"){for(let f=0;f<o.addedNodes.length;f++){const h=o.addedNodes[f];h.nodeType===1&&(D(h,e,n,s),a&&a(h))}for(let f=0;f<o.removedNodes.length;f++){const h=o.removedNodes[f];if(h.nodeType===1){const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",x=Array.from(h.querySelectorAll(b));h.matches&&h.matches(b)&&x.push(h);for(let E=0;E<x.length;E++){const y=x[E];if(!document.contains(y)){const A=y[n];A&&typeof A.destroy=="function"&&A.destroy()}}}}}else o.type==="attributes"&&(l&&o.target[n]?l(o.target,o.attributeName):(D(o.target,e,n,s),a&&a(o.target)))}});let i=[];if(e.indexOf("[")!==-1){const r=/\[([\w-]+)/g;let m;for(;(m=r.exec(e))!==null;)i.push(m[1])}else i.push(e);t.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.concat(c)})},u),window[n]=d,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){d(document.body)}):d(document.body),d}const k={};function B(e,n){k[e]=n}function G(e){return k[e]||{ingress:n=>n,egress:n=>n}}const I={};function j(e,n){if(!e||typeof n!="object")return;const s=e.toLowerCase().split("-")[0];I[s]=n}function U(e){if(!e)return null;const n=e.toLowerCase().split("-")[0];return I[n]||null}j("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=B,window.lnCore.getDataMapper=G,window.lnCore.registerLocaleFallback=j,window.lnCore.getLocaleFallback=U,window.lnCore.fillTemplate=L,window.lnCore.fill=R,window.lnCore.lnFill=P,window.lnCore.renderList=M);function q(e){return(e||"").replace(/^#/,"")}function T(e){const n=e===void 0?location.hash:e,s={},u=q(n);if(!u)return s;const p=u.split("&");for(let c=0;c<p.length;c++){const l=p[c];if(!l)continue;const a=l.indexOf(":"),d=a>-1?l.slice(0,a):l,t=a>-1?l.slice(a+1):"";if(d)try{s[d]=decodeURIComponent(t)}catch{s[d]=t}}return s}function K(e){if(!e)return null;const n=T();return e in n?n[e]:null}function $(e,n){if(!e)return;const s=T();n==null?delete s[e]:s[e]=String(n);const p=Object.keys(s).map(function(c){const l=s[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");q(location.hash)!==p&&(location.hash=p)}function X(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=K,window.lnCore.hashSet=$,window.lnCore.hashLinkClick=X),(function(){const e="data-ln-number",n="lnNumber";if(window[n]!==void 0)return;const s={},u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function p(t){if(!s[t]){const i=new Intl.NumberFormat(t,{useGrouping:!0}),r=i.formatToParts(1234.5);let m="",o=".";for(let f=0;f<r.length;f++)r[f].type==="group"&&(m=r[f].value),r[f].type==="decimal"&&(o=r[f].value);s[t]={fmt:i,groupSep:m,decimalSep:o}}return s[t]}function c(t,i,r){if(r!==null){const m=parseInt(r,10),o=t+"|d"+m;return s[o]||(s[o]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:m})),s[o].format(i)}return p(t).fmt.format(i)}function l(t){if(t[n])return t[n];if(t[n]=this,this.dom=t,t.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const i=document.createElement("input");i.type="hidden",i.name=t.name,t.removeAttribute("name"),t.hasAttribute("data-ln-fill-as")&&i.setAttribute("data-ln-fill-as",t.getAttribute("data-ln-fill-as")),t.type="text",t.setAttribute("inputmode","decimal"),t.insertAdjacentElement("afterend",i),this._hidden=i;const r=this;Object.defineProperty(i,"value",{get:function(){return u.get.call(i)},set:function(o){u.set.call(i,o),o!==""&&!isNaN(parseFloat(o))?r._setDisplayRaw(c(w(r.dom),parseFloat(o),r.dom.getAttribute("data-ln-number-decimals"))):r._setDisplayRaw(""),r.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),V(t,u,{get:function(){return u.get.call(t)},set:function(o){if(o===""){r._setDisplayRaw(""),r._setHiddenRaw(""),t.dispatchEvent(new Event("input",{bubbles:!0}));return}const f=typeof o=="number"?o:parseFloat(String(o).replace(/[^\d.-]/g,""));isNaN(f)?(r._setDisplayRaw(String(o)),r._setHiddenRaw("")):(r._setHiddenRaw(f),r._setDisplayRaw(c(w(t),f,t.getAttribute("data-ln-number-decimals")))),t.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){r._handleInput()},t.addEventListener("input",this._onInput),this._onPaste=function(o){o.preventDefault();const f=(o.clipboardData||window.clipboardData).getData("text"),h=p(w(t)),C=h.decimalSep.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");let b=f.replace(new RegExp("[^0-9\\-"+C+".]","g"),"");h.groupSep&&(b=b.split(h.groupSep).join("")),h.decimalSep!=="."&&(b=b.replace(h.decimalSep,"."));const x=parseFloat(b);r.value=isNaN(x)?NaN:x},t.addEventListener("paste",this._onPaste);const m=t.value;if(m!==""){const o=parseFloat(m);isNaN(o)||(this._setHiddenRaw(o),this._setDisplayRaw(c(w(t),o,t.getAttribute("data-ln-number-decimals"))),t.dispatchEvent(new Event("input",{bubbles:!0})))}return this}function a(t){if(typeof t=="number")return isNaN(t)?null:t;if(!t||typeof t!="string")return null;let i=t.trim();if(i==="")return null;i=i.replace(/[\s\u00A0$€£]/g,""),i.indexOf(",")!==-1&&i.indexOf(".")!==-1?i.indexOf(".")<i.indexOf(",")?i=i.replace(/\./g,"").replace(",","."):i=i.replace(/,/g,""):i.indexOf(",")!==-1&&(i=i.replace(",",".")),i=i.replace(/[^\d.-]/g,"");const r=parseFloat(i);return isNaN(r)?null:r}l.prototype._initTextElement=function(){const t=this.dom;let i=t.getAttribute("data-ln-value"),r=t.getAttribute("data-ln-number"),m=null;i!==null&&i!==""?m=i:r!==null&&r!==""&&r!=="true"?m=r:m=t.textContent.trim();const o=a(m);o!==null?(this._rawValue=o,t.hasAttribute("data-ln-value")||t.setAttribute("data-ln-value",String(o)),this._formatTextContent()):this._rawValue=null},l.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const t=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=c(w(this.dom),this._rawValue,t)}},l.prototype._handleInput=function(){const t=this.dom,i=p(w(t)),r=u.get.call(t);if(r===""){this._setHiddenRaw(""),S(t,"ln-number:input",{value:NaN,formatted:""});return}if(r==="-"){this._setHiddenRaw("");return}const m=t.selectionStart;let o=0;for(let g=0;g<m;g++)/[0-9]/.test(r[g])&&o++;let f=r;if(i.groupSep&&(f=f.split(i.groupSep).join("")),f=f.replace(i.decimalSep,"."),r.endsWith(i.decimalSep)||r.endsWith(".")){const g=f.replace(/\.$/,""),_=parseFloat(g);isNaN(_)||this._setHiddenRaw(_);return}const h=f.indexOf(".");if(h!==-1&&f.slice(h+1).endsWith("0")){const _=parseFloat(f);isNaN(_)||this._setHiddenRaw(_);return}const C=t.getAttribute("data-ln-number-decimals");if(C!==null&&h!==-1){const g=parseInt(C,10);f.slice(h+1).length>g&&(f=f.slice(0,h+1+g))}const b=parseFloat(f);if(isNaN(b))return;const x=t.getAttribute("data-ln-number-min"),E=t.getAttribute("data-ln-number-max");if(x!==null&&b<parseFloat(x)||E!==null&&b>parseFloat(E))return;let y;if(C!==null)y=c(w(t),b,C);else{const g=h!==-1?f.slice(h+1).length:0;if(g>0){const _=w(t)+"|u"+g;s[_]||(s[_]=new Intl.NumberFormat(w(t),{useGrouping:!0,minimumFractionDigits:g,maximumFractionDigits:g})),y=s[_].format(b)}else y=i.fmt.format(b)}this._setDisplayRaw(y);let A=o,N=0;for(let g=0;g<y.length&&A>0;g++)N=g+1,/[0-9]/.test(y[g])&&A--;A>0&&(N=y.length),t.setSelectionRange(N,N),this._setHiddenRaw(b),S(t,"ln-number:input",{value:b,formatted:y})},l.prototype._setHiddenRaw=function(t){this._hidden&&u.set.call(this._hidden,String(t))},l.prototype._setDisplayRaw=function(t){this.isTextElement?this.dom.textContent=String(t):u.set.call(this.dom,String(t))},l.prototype._displayFormatted=function(t){this.isTextElement?this._formatTextContent():this._setDisplayRaw(c(w(this.dom),t,this.dom.getAttribute("data-ln-number-decimals")))},Object.defineProperty(l.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const t=u.get.call(this._hidden);return t===""?NaN:parseFloat(t)},set:function(t){if(this.isTextElement){typeof t!="number"||isNaN(t)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=t,this.dom.setAttribute("data-ln-value",String(t)),this._formatTextContent());return}if(typeof t!="number"||isNaN(t)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(t),this._setDisplayRaw(c(w(this.dom),t,this.dom.getAttribute("data-ln-number-decimals"))),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(l.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:u.get.call(this.dom)}}),l.prototype.destroy=function(){this.dom[n]&&(this.isTextElement||(this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),S(this.dom,"ln-number:destroyed",{target:this.dom}),delete this.dom[n])};function d(){new MutationObserver(function(){const t=document.querySelectorAll("["+e+"]");for(let i=0;i<t.length;i++){const r=t[i][n];r&&(r.isTextElement?r._formatTextContent():isNaN(r.value)||r._displayFormatted(r.value))}}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})}W(e,n,l,"ln-number",{extraAttributes:["data-ln-value","data-ln-number-decimals","data-ln-number-min","data-ln-number-max","lang"],onAttributeChange:function(t){const i=t[n];i&&(i.isTextElement?i._initTextElement():isNaN(i.value)||i._displayFormatted(i.value))}}),d()})()})();