@livenetworks/ashlar 1.4.0 → 1.5.1

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 (44) hide show
  1. package/js/ln-accordion/ln-accordion.js +1 -1
  2. package/js/ln-api-connector/ln-api-connector.js +1 -1
  3. package/js/ln-autoresize/ln-autoresize.js +1 -1
  4. package/js/ln-autosave/ln-autosave.js +1 -1
  5. package/js/ln-circular-progress/ln-circular-progress.js +1 -1
  6. package/js/ln-confirm/ln-confirm.js +1 -1
  7. package/js/ln-core/helpers.js +6 -3
  8. package/js/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  9. package/js/ln-data-coordinator/ln-data-coordinator.js +1 -1
  10. package/js/ln-data-store/ln-data-store.js +1 -1
  11. package/js/ln-data-table/ln-data-table.js +1 -1
  12. package/js/ln-data-table/src/ln-data-table.js +0 -16
  13. package/js/ln-date/ln-date.js +1 -1
  14. package/js/ln-dropdown/ln-dropdown.js +1 -1
  15. package/js/ln-filter/README.md +99 -99
  16. package/js/ln-filter/ln-filter.js +1 -1
  17. package/js/ln-form/ln-form.js +1 -1
  18. package/js/ln-modal/ln-modal.js +1 -1
  19. package/js/ln-number/ln-number.js +1 -1
  20. package/js/ln-popover/ln-popover.js +1 -1
  21. package/js/ln-search/ln-search.js +1 -1
  22. package/js/ln-sortable/ln-sortable.js +1 -1
  23. package/js/ln-table/ln-table-sort.js +1 -1
  24. package/js/ln-table/ln-table.js +1 -1
  25. package/js/ln-table/src/ln-table-sort.js +156 -168
  26. package/js/ln-tabs/ln-tabs.js +1 -1
  27. package/js/ln-time/ln-time.js +1 -1
  28. package/js/ln-toggle/ln-toggle.js +1 -1
  29. package/js/ln-tooltip/ln-tooltip.js +1 -1
  30. package/js/ln-translations/ln-translations.js +1 -1
  31. package/js/ln-validate/ln-validate.js +1 -1
  32. package/package.json +3 -2
  33. package/scss/components/_filter.scss +25 -0
  34. package/scss/components/_ln-table.scss +1 -2
  35. package/scss/components/_table.scss +55 -1
  36. package/scss/config/mixins/_diagnostics.scss +37 -0
  37. package/scss/config/mixins/_filter.scss +49 -0
  38. package/scss/config/mixins/_index.scss +2 -1
  39. package/scss/config/mixins/_ln-table.scss +10 -91
  40. package/scss/config/mixins/_table.scss +202 -33
  41. package/scss/ln-ashlar-dev.scss +21 -0
  42. package/scss/ln-ashlar.scss +1 -1
  43. package/scss/components/_data-table.scss +0 -83
  44. package/scss/config/mixins/_data-table.scss +0 -346
@@ -1 +1 @@
1
- (function(){"use strict";function v(t,e,n){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n||{}}))}function k(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function L(t,e,n,i){if(t.nodeType!==1)return;const s=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",d=Array.from(t.querySelectorAll(s));t.matches&&t.matches(s)&&d.push(t);for(const r of d)r[n]||(r[n]=new i(r))}function O(t,e,n,i,o={}){const s=o.extraAttributes||[],d=o.onAttributeChange||null,r=o.onInit||null;function f(y){const _=y||document.body;L(_,t,e,n),r&&r(_)}return k(function(){const y=new MutationObserver(function(h){for(let m=0;m<h.length;m++){const u=h[m];if(u.type==="childList"){for(let c=0;c<u.addedNodes.length;c++){const p=u.addedNodes[c];p.nodeType===1&&(L(p,t,e,n),r&&r(p))}for(let c=0;c<u.removedNodes.length;c++){const p=u.removedNodes[c];if(p.nodeType===1){const b=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a=Array.from(p.querySelectorAll(b));p.matches&&p.matches(b)&&a.push(p);for(let l=0;l<a.length;l++){const g=a[l][e];g&&typeof g.destroy=="function"&&g.destroy()}}}}else u.type==="attributes"&&(d&&u.target[e]?d(u.target,u.attributeName):(L(u.target,t,e,n),r&&r(u.target)))}});let _=[];if(t.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let m;for(;(m=h.exec(t))!==null;)_.push(m[1])}else _.push(t);y.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:_.concat(s)})},i),window[e]=f,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){f(document.body)}):f(document.body),f}const x={};function R(t,e){x[t]=e}function A(t){return x[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=A);function T(t,e,n,i){const o=typeof i=="number"?i:4,s=window.innerWidth,d=window.innerHeight,r=e.width,f=e.height,y=n.split("-"),_=y[0],h=y[1]==="start"||y[1]==="end"?y[1]:"center",m={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},u=m[_]||m.bottom;function c(l){return l==="top"||l==="bottom"?h==="start"?t.left:h==="end"?t.right-r:t.left+(t.width-r)/2:h==="start"?t.top:h==="end"?t.bottom-f:t.top+(t.height-f)/2}function p(l){let g,C,w=!0;return l==="top"?(g=t.top-o-f,C=c(l),g<0&&(w=!1)):l==="bottom"?(g=t.bottom+o,C=c(l),g+f>d&&(w=!1)):l==="left"?(g=c(l),C=t.left-o-r,C<0&&(w=!1)):(g=c(l),C=t.right+o,C+r>s&&(w=!1)),{top:g,left:C,side:l,fits:w}}let E=null;for(let l=0;l<u.length;l++){const g=p(u[l]);if(g.fits){E=g;break}}E||(E=p(u[0]));let b=E.top,a=E.left;return r>=s?a=0:(a<0&&(a=0),a+r>s&&(a=s-r)),f>=d?b=0:(b<0&&(b=0),b+f>d&&(b=d-f)),{top:b,left:a,placement:E.side}}function S(t){if(!t||t.parentNode===document.body)return function(){};const e=t.parentNode,n=document.createComment("ln-teleport");return e.insertBefore(n,t),document.body.appendChild(t),function(){n.parentNode&&(n.parentNode.insertBefore(t,n),n.parentNode.removeChild(n))}}function D(t){if(!t)return{width:0,height:0};const e=t.style,n=e.visibility,i=e.display,o=e.position;e.visibility="hidden",e.display="block",e.position="fixed";const s=t.offsetWidth,d=t.offsetHeight;return e.visibility=n,e.display=i,e.position=o,{width:s,height:d}}(function(){const t="data-ln-dropdown",e="lnDropdown";if(window[e]!==void 0)return;function n(i){if(this.dom=i,this.toggleEl=i.querySelector("[data-ln-toggle]"),this._teleportRestore=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu")),this.triggerBtn=i.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false")),this.toggleEl)for(const s of this.toggleEl.children)s.setAttribute("role","menuitem");const o=this;return this._onToggleOpen=function(s){s.detail.target===o.toggleEl&&(o.triggerBtn&&o.triggerBtn.setAttribute("aria-expanded","true"),o._teleportRestore=S(o.toggleEl),o.toggleEl.style.position="fixed",o.toggleEl.style.right="auto",o._reposition(),o._addOutsideClickListener(),o._addScrollRepositionListener(),o._addResizeCloseListener(),v(i,"ln-dropdown:open",{target:s.detail.target}))},this._onToggleClose=function(s){s.detail.target===o.toggleEl&&(o.triggerBtn&&o.triggerBtn.setAttribute("aria-expanded","false"),o._removeOutsideClickListener(),o._removeScrollRepositionListener(),o._removeResizeCloseListener(),o.toggleEl.style.position="",o.toggleEl.style.top="",o.toggleEl.style.left="",o.toggleEl.style.right="",o.toggleEl.style.transform="",o.toggleEl.style.margin="",o._teleportRestore&&(o._teleportRestore(),o._teleportRestore=null),v(i,"ln-dropdown:close",{target:s.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}n.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl)return;const i=this.triggerBtn.getBoundingClientRect(),o=D(this.toggleEl),s=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,d=T(i,o,"bottom-end",s);this.toggleEl.style.top=d.top+"px",this.toggleEl.style.left=d.left+"px"},n.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const i=this;this._boundDocClick=function(o){i.dom.contains(o.target)||i.toggleEl&&i.toggleEl.contains(o.target)||i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},i._docClickTimeout=setTimeout(function(){i._docClickTimeout=null,document.addEventListener("click",i._boundDocClick)},0)},n.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},n.prototype._addScrollRepositionListener=function(){const i=this;this._boundScrollReposition=function(){i._reposition()},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},n.prototype._removeScrollRepositionListener=function(){this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},n.prototype._addResizeCloseListener=function(){const i=this;this._boundResizeClose=function(){i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},n.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},n.prototype.destroy=function(){this.dom[e]&&(this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this._teleportRestore&&(this._teleportRestore(),this._teleportRestore=null),this.toggleEl&&(this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),v(this.dom,"ln-dropdown:destroyed",{target:this.dom}),delete this.dom[e])},O(t,e,n,"ln-dropdown")})()})();
1
+ (function(){"use strict";function v(t,e,n){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n||{}}))}function k(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function L(t,e,n,i){if(t.nodeType!==1)return;const s=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",d=Array.from(t.querySelectorAll(s));t.matches&&t.matches(s)&&d.push(t);for(const r of d)r[n]||(r[n]=new i(r))}function O(t,e,n,i,o={}){const s=o.extraAttributes||[],d=o.onAttributeChange||null,r=o.onInit||null;function f(_){const E=_||document.body;L(E,t,e,n),r&&r(E)}return k(function(){const _=new MutationObserver(function(m){for(let b=0;b<m.length;b++){const u=m[b];if(u.type==="childList"){for(let c=0;c<u.addedNodes.length;c++){const p=u.addedNodes[c];p.nodeType===1&&(L(p,t,e,n),r&&r(p))}for(let c=0;c<u.removedNodes.length;c++){const p=u.removedNodes[c];if(p.nodeType===1){const y=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",h=Array.from(p.querySelectorAll(y));p.matches&&p.matches(y)&&h.push(p);for(let l=0;l<h.length;l++){const g=h[l];if(!document.contains(g)){const a=g[e];a&&typeof a.destroy=="function"&&a.destroy()}}}}}else u.type==="attributes"&&(d&&u.target[e]?d(u.target,u.attributeName):(L(u.target,t,e,n),r&&r(u.target)))}});let E=[];if(t.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let b;for(;(b=m.exec(t))!==null;)E.push(b[1])}else E.push(t);_.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:E.concat(s)})},i),window[e]=f,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){f(document.body)}):f(document.body),f}const x={};function R(t,e){x[t]=e}function A(t){return x[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=A);function T(t,e,n,i){const o=typeof i=="number"?i:4,s=window.innerWidth,d=window.innerHeight,r=e.width,f=e.height,_=n.split("-"),E=_[0],m=_[1]==="start"||_[1]==="end"?_[1]:"center",b={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},u=b[E]||b.bottom;function c(l){return l==="top"||l==="bottom"?m==="start"?t.left:m==="end"?t.right-r:t.left+(t.width-r)/2:m==="start"?t.top:m==="end"?t.bottom-f:t.top+(t.height-f)/2}function p(l){let g,a,w=!0;return l==="top"?(g=t.top-o-f,a=c(l),g<0&&(w=!1)):l==="bottom"?(g=t.bottom+o,a=c(l),g+f>d&&(w=!1)):l==="left"?(g=c(l),a=t.left-o-r,a<0&&(w=!1)):(g=c(l),a=t.right+o,a+r>s&&(w=!1)),{top:g,left:a,side:l,fits:w}}let C=null;for(let l=0;l<u.length;l++){const g=p(u[l]);if(g.fits){C=g;break}}C||(C=p(u[0]));let y=C.top,h=C.left;return r>=s?h=0:(h<0&&(h=0),h+r>s&&(h=s-r)),f>=d?y=0:(y<0&&(y=0),y+f>d&&(y=d-f)),{top:y,left:h,placement:C.side}}function S(t){if(!t||t.parentNode===document.body)return function(){};const e=t.parentNode,n=document.createComment("ln-teleport");return e.insertBefore(n,t),document.body.appendChild(t),function(){n.parentNode&&(n.parentNode.insertBefore(t,n),n.parentNode.removeChild(n))}}function D(t){if(!t)return{width:0,height:0};const e=t.style,n=e.visibility,i=e.display,o=e.position;e.visibility="hidden",e.display="block",e.position="fixed";const s=t.offsetWidth,d=t.offsetHeight;return e.visibility=n,e.display=i,e.position=o,{width:s,height:d}}(function(){const t="data-ln-dropdown",e="lnDropdown";if(window[e]!==void 0)return;function n(i){if(this.dom=i,this.toggleEl=i.querySelector("[data-ln-toggle]"),this._teleportRestore=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu")),this.triggerBtn=i.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false")),this.toggleEl)for(const s of this.toggleEl.children)s.setAttribute("role","menuitem");const o=this;return this._onToggleOpen=function(s){s.detail.target===o.toggleEl&&(o.triggerBtn&&o.triggerBtn.setAttribute("aria-expanded","true"),o._teleportRestore=S(o.toggleEl),o.toggleEl.style.position="fixed",o.toggleEl.style.right="auto",o._reposition(),o._addOutsideClickListener(),o._addScrollRepositionListener(),o._addResizeCloseListener(),v(i,"ln-dropdown:open",{target:s.detail.target}))},this._onToggleClose=function(s){s.detail.target===o.toggleEl&&(o.triggerBtn&&o.triggerBtn.setAttribute("aria-expanded","false"),o._removeOutsideClickListener(),o._removeScrollRepositionListener(),o._removeResizeCloseListener(),o.toggleEl.style.position="",o.toggleEl.style.top="",o.toggleEl.style.left="",o.toggleEl.style.right="",o.toggleEl.style.transform="",o.toggleEl.style.margin="",o._teleportRestore&&(o._teleportRestore(),o._teleportRestore=null),v(i,"ln-dropdown:close",{target:s.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}n.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl)return;const i=this.triggerBtn.getBoundingClientRect(),o=D(this.toggleEl),s=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,d=T(i,o,"bottom-end",s);this.toggleEl.style.top=d.top+"px",this.toggleEl.style.left=d.left+"px"},n.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const i=this;this._boundDocClick=function(o){i.dom.contains(o.target)||i.toggleEl&&i.toggleEl.contains(o.target)||i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},i._docClickTimeout=setTimeout(function(){i._docClickTimeout=null,document.addEventListener("click",i._boundDocClick)},0)},n.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},n.prototype._addScrollRepositionListener=function(){const i=this;this._boundScrollReposition=function(){i._reposition()},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},n.prototype._removeScrollRepositionListener=function(){this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},n.prototype._addResizeCloseListener=function(){const i=this;this._boundResizeClose=function(){i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},n.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},n.prototype.destroy=function(){this.dom[e]&&(this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this._teleportRestore&&(this._teleportRestore(),this._teleportRestore=null),this.toggleEl&&(this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),v(this.dom,"ln-dropdown:destroyed",{target:this.dom}),delete this.dom[e])},O(t,e,n,"ln-dropdown")})()})();
@@ -1,99 +1,99 @@
1
- # ln-filter
2
-
3
- A zero-dependency, event-driven **Generic List & Table Filter Primitive** that manages item visibility states through declarative checkbox controls.
4
-
5
- It filters target elements either by comparing child dataset attributes (for custom cards/lists) or scanning table column cell contents (for plain HTML tables). It operates independently of and in harmony with `ln-search`, combining multiple filter criteria seamlessly.
6
-
7
- ---
8
-
9
- ## 🧭 Philosophy & Architecture
10
-
11
- 1. **Declarative State Model:** The component has no custom imperative state-change methods. Filter state is driven entirely by native checkboxes. External scripts update selections by writing `input.checked = true` and dispatching a standard bubbled `change` event.
12
- 2. **Sentinel Mutual Exclusion:** The `data-ln-filter-reset` ("All") checkbox is kept in sync automatically: checking any value checkbox unchecks the reset sentinel; checking the sentinel unchecks all value inputs; unchecking all value inputs re-checks the sentinel.
13
- 3. **Table Column & Auto-Population Mode:** By defining `data-ln-filter-col="N"`, the component filters plain HTML `<table>` rows by column cell text. When a `<template>` tag is nested inside, the component automatically populates value checkboxes from the column's unique values on page load.
14
- 4. **Local State Persistence:** Adding the `data-ln-persist` attribute saves active filter selections to `localStorage` under `lnf:{id}`, ensuring filter states survive page reloads and browser transitions.
15
-
16
- ---
17
-
18
- ## 📦 Minimal Blueprint
19
-
20
- ### Generic List Attribute Filter (Zero-JS)
21
- Bind the filter to a container `id`. Target items declare attributes matching the filter key.
22
- ```html
23
- <nav data-ln-filter="employees-list">
24
- <!-- Reset Sentinel -->
25
- <label><input type="checkbox" data-ln-filter-key="category" data-ln-filter-reset checked> All</label>
26
- <!-- Values -->
27
- <label><input type="checkbox" data-ln-filter-key="category" data-ln-filter-value="design"> Design</label>
28
- <label><input type="checkbox" data-ln-filter-key="category" data-ln-filter-value="dev"> Development</label>
29
- </nav>
30
-
31
- <ul id="employees-list">
32
- <li data-category="design">Ana Petrova — UI Designer</li>
33
- <li data-category="dev">Marko Nikolov — Developer</li>
34
- </ul>
35
- ```
36
-
37
- ### Table Column Filter with Auto-Population & Persistence
38
- Auto-populates filter checkboxes from Column Index `2` (Department) and saves state to storage.
39
- ```html
40
- <nav id="dept-filter" data-ln-filter="users-table" data-ln-filter-col="2" data-ln-persist>
41
- <label><input type="checkbox" data-ln-filter-key="dept" data-ln-filter-reset checked> All Departments</label>
42
- <!-- Checklist generated dynamically here -->
43
- <template>
44
- <label><input type="checkbox"> {{ text }}</label>
45
- </template>
46
- </nav>
47
-
48
- <table id="users-table">
49
- <thead>
50
- <tr><th>ID</th><th>Name</th><th>Department</th></tr>
51
- </thead>
52
- <tbody>
53
- <tr><td>1</td><td>Ana Petrova</td><td>Engineering</td></tr>
54
- <tr><td>2</td><td>Marko Nikolov</td><td>Design</td></tr>
55
- </tbody>
56
- </table>
57
- ```
58
-
59
- ---
60
-
61
- ## 🛠️ Declarative API Contract
62
-
63
- ### HTML Attributes
64
-
65
- | Attribute | Elements | Description |
66
- | :--- | :--- | :--- |
67
- | `data-ln-filter` | Container root | Component root. Value is the `id` of the target container whose items are filtered. |
68
- | `data-ln-filter-key` | `<input type="checkbox">` | The field name representing the target dataset attribute (e.g. `category` matches `data-category`). |
69
- | `data-ln-filter-value` | `<input type="checkbox">` | The value to match. Active checkboxes show matching items; others are hidden. |
70
- | `data-ln-filter-reset` | `<input type="checkbox">` | Marks the reset ("All") sentinel. |
71
- | `data-ln-filter-col` | Container root | Opt-in. 0-based column index to filter plain `<table>` rows by column cell text. |
72
- | `data-ln-persist` | Container root | Opt-in. Persists active checkbox selections in `localStorage` under `lnf:{id}`. |
73
- | `data-ln-filter-hide` | Children of target | *State*. Automatically toggled on non-matching elements (`display: none !important`). |
74
-
75
- ---
76
-
77
- ## ⚡ DOM Events
78
-
79
- Events are dispatched on **both** the filter navigation container and the target element (dual dispatch).
80
-
81
- ### `ln-filter:changed`
82
- Fired when any filter selection is modified.
83
- - **Payload (`detail`)**: `{ key: string, values: string[] }` (where `values` lists active filter options).
84
-
85
- ### `ln-filter:reset`
86
- Fired when the reset sentinel is activated.
87
- - **Payload (`detail`)**: `{}`
88
-
89
- ---
90
-
91
- ## ⚠️ Common Pitfalls
92
-
93
- - **Driving State Programmatically Without Events:** Changing `input.checked = true` using JavaScript does not trigger browser `change` listeners. You must explicitly dispatch the event:
94
- ```javascript
95
- input.checked = true;
96
- input.dispatchEvent(new Event('change', { bubbles: true }));
97
- ```
98
- - **Missing `id` on Persisted Filters:** The `data-ln-persist` storage key relies on the filter element's ID (e.g. `<nav id="my-filter" data-ln-persist>`). If the ID is missing, the component will fail to initialize persistence.
99
- - **Filtering Coordinated Tables:** `ln-filter` is designed for static lists or plain native tables. Do not target virtualised components like `ln-table` or `ln-data-table`, which manage their own column filters internally.
1
+ # ln-filter
2
+
3
+ A zero-dependency, event-driven **Generic List & Table Filter Primitive** that manages item visibility states through declarative checkbox controls.
4
+
5
+ It filters target elements either by comparing child dataset attributes (for custom cards/lists) or scanning table column cell contents (for plain HTML tables). It operates independently of and in harmony with `ln-search`, combining multiple filter criteria seamlessly.
6
+
7
+ ---
8
+
9
+ ## 🧭 Philosophy & Architecture
10
+
11
+ 1. **Declarative State Model:** The component has no custom imperative state-change methods. Filter state is driven entirely by native checkboxes. External scripts update selections by writing `input.checked = true` and dispatching a standard bubbled `change` event.
12
+ 2. **Sentinel Mutual Exclusion:** The `data-ln-filter-reset` ("All") checkbox is kept in sync automatically: checking any value checkbox unchecks the reset sentinel; checking the sentinel unchecks all value inputs; unchecking all value inputs re-checks the sentinel.
13
+ 3. **Table Column & Auto-Population Mode:** By defining `data-ln-filter-col="N"`, the component filters plain HTML `<table>` rows by column cell text. When a `<template>` tag is nested inside, the component automatically populates value checkboxes from the column's unique values on page load.
14
+ 4. **Local State Persistence:** Adding the `data-ln-persist` attribute saves active filter selections to `localStorage` under `lnf:{id}`, ensuring filter states survive page reloads and browser transitions.
15
+
16
+ ---
17
+
18
+ ## 📦 Minimal Blueprint
19
+
20
+ ### Generic List Attribute Filter (Zero-JS)
21
+ Bind the filter to a container `id`. Target items declare attributes matching the filter key.
22
+ ```html
23
+ <nav data-ln-filter="employees-list">
24
+ <!-- Reset Sentinel -->
25
+ <label><input type="checkbox" data-ln-filter-key="category" data-ln-filter-reset checked> All</label>
26
+ <!-- Values -->
27
+ <label><input type="checkbox" data-ln-filter-key="category" data-ln-filter-value="design"> Design</label>
28
+ <label><input type="checkbox" data-ln-filter-key="category" data-ln-filter-value="dev"> Development</label>
29
+ </nav>
30
+
31
+ <ul id="employees-list">
32
+ <li data-category="design">Ana Petrova — UI Designer</li>
33
+ <li data-category="dev">Marko Nikolov — Developer</li>
34
+ </ul>
35
+ ```
36
+
37
+ ### Table Column Filter with Auto-Population & Persistence
38
+ Auto-populates filter checkboxes from Column Index `2` (Department) and saves state to storage.
39
+ ```html
40
+ <nav id="dept-filter" data-ln-filter="users-table" data-ln-filter-col="2" data-ln-persist>
41
+ <label><input type="checkbox" data-ln-filter-key="dept" data-ln-filter-reset checked> All Departments</label>
42
+ <!-- Checklist generated dynamically here -->
43
+ <template>
44
+ <label><input type="checkbox"> {{ text }}</label>
45
+ </template>
46
+ </nav>
47
+
48
+ <table id="users-table">
49
+ <thead>
50
+ <tr><th>ID</th><th>Name</th><th>Department</th></tr>
51
+ </thead>
52
+ <tbody>
53
+ <tr><td>1</td><td>Ana Petrova</td><td>Engineering</td></tr>
54
+ <tr><td>2</td><td>Marko Nikolov</td><td>Design</td></tr>
55
+ </tbody>
56
+ </table>
57
+ ```
58
+
59
+ ---
60
+
61
+ ## 🛠️ Declarative API Contract
62
+
63
+ ### HTML Attributes
64
+
65
+ | Attribute | Elements | Description |
66
+ | :--- | :--- | :--- |
67
+ | `data-ln-filter` | Container root | Component root. Value is the `id` of the target container whose items are filtered. |
68
+ | `data-ln-filter-key` | `<input type="checkbox">` | The field name representing the target dataset attribute (e.g. `category` matches `data-category`). |
69
+ | `data-ln-filter-value` | `<input type="checkbox">` | The value to match. Active checkboxes show matching items; others are hidden. |
70
+ | `data-ln-filter-reset` | `<input type="checkbox">` | Marks the reset ("All") sentinel. |
71
+ | `data-ln-filter-col` | Container root | Opt-in. 0-based column index to filter plain `<table>` rows by column cell text. |
72
+ | `data-ln-persist` | Container root | Opt-in. Persists active checkbox selections in `localStorage` under `lnf:{id}`. |
73
+ | `data-ln-filter-hide` | Children of target | *State*. Automatically toggled on non-matching elements (`display: none !important`). |
74
+
75
+ ---
76
+
77
+ ## ⚡ DOM Events
78
+
79
+ Events are dispatched on **both** the filter navigation container and the target element (dual dispatch).
80
+
81
+ ### `ln-filter:changed`
82
+ Fired when any filter selection is modified.
83
+ - **Payload (`detail`)**: `{ key: string, values: string[] }` (where `values` lists active filter options).
84
+
85
+ ### `ln-filter:reset`
86
+ Fired when the reset sentinel is activated.
87
+ - **Payload (`detail`)**: `{}`
88
+
89
+ ---
90
+
91
+ ## ⚠️ Common Pitfalls
92
+
93
+ - **Driving State Programmatically Without Events:** Changing `input.checked = true` using JavaScript does not trigger browser `change` listeners. You must explicitly dispatch the event:
94
+ ```javascript
95
+ input.checked = true;
96
+ input.dispatchEvent(new Event('change', { bubbles: true }));
97
+ ```
98
+ - **Missing `id` on Persisted Filters:** The `data-ln-persist` storage key relies on the filter element's ID (e.g. `<nav id="my-filter" data-ln-persist>`). If the ID is missing, the component will fail to initialize persistence.
99
+ - **Filtering Coordinated Tables:** `ln-filter` is designed for static lists or plain native tables. Do not target virtualised components like `ln-table` or `ln-data-table`, which manage their own column filters internally.
@@ -1 +1 @@
1
- (function(){"use strict";function R(r,n,u){r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:u||{}}))}function D(r,n){if(!r||!n)return r;const u=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(;u.nextNode();){const c=u.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(m,h){return n[h]!==void 0?n[h]:""}))}return r}function B(r,n){if(!document.body){document.addEventListener("DOMContentLoaded",function(){B(r,n)}),console.warn("["+n+'] Script loaded before <body> — add "defer" to your <script> tag');return}r()}function S(r,n,u,c){if(r.nodeType!==1)return;const h=n.indexOf("[")!==-1||n.indexOf(".")!==-1||n.indexOf("#")!==-1?n:"["+n+"]",T=Array.from(r.querySelectorAll(h));r.matches&&r.matches(h)&&T.push(r);for(const y of T)y[u]||(y[u]=new c(y))}function F(r,n,u,c,m={}){const h=m.extraAttributes||[],T=m.onAttributeChange||null,y=m.onInit||null;function A(b){const _=b||document.body;S(_,r,n,u),y&&y(_)}return B(function(){const b=new MutationObserver(function(I){for(let w=0;w<I.length;w++){const a=I[w];if(a.type==="childList"){for(let t=0;t<a.addedNodes.length;t++){const e=a.addedNodes[t];e.nodeType===1&&(S(e,r,n,u),y&&y(e))}for(let t=0;t<a.removedNodes.length;t++){const e=a.removedNodes[t];if(e.nodeType===1){const s=r.indexOf("[")!==-1||r.indexOf(".")!==-1||r.indexOf("#")!==-1?r:"["+r+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(let l=0;l<o.length;l++){const d=o[l][n];d&&typeof d.destroy=="function"&&d.destroy()}}}}else a.type==="attributes"&&(T&&a.target[n]?T(a.target,a.attributeName):(S(a.target,r,n,u),y&&y(a.target)))}});let _=[];if(r.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let w;for(;(w=I.exec(r))!==null;)_.push(w[1])}else _.push(r);b.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:_.concat(h)})},c),window[n]=A,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){A(document.body)}):A(document.body),A}const L={};function K(r,n){L[r]=n}function j(r){return L[r]||{ingress:n=>n,egress:n=>n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=K,window.lnCore.getDataMapper=j);function H(r,n){let u=!1;return function(){u||(u=!0,queueMicrotask(function(){u=!1,r(),n&&n()}))}}const W="ln:";function J(){return location.pathname.replace(/\/+$/,"").toLowerCase()||"/"}function q(r,n){const u=n.getAttribute("data-ln-persist"),c=u!==null&&u!==""?u:n.id;return c?W+r+":"+J()+":"+c:(console.warn('[ln-persist] Element requires id or data-ln-persist="key"',n),null)}function U(r,n){const u=q(r,n);if(!u)return null;try{const c=localStorage.getItem(u);return c!==null?JSON.parse(c):null}catch{return null}}function N(r,n,u){const c=q(r,n);if(c)try{localStorage.setItem(c,JSON.stringify(u))}catch{}}(function(){const r="data-ln-filter",n="lnFilter",u="data-ln-filter-initialized",c="data-ln-filter-key",m="data-ln-filter-value",h="data-ln-filter-hide",T="data-ln-filter-reset",y="data-ln-filter-col",A=new WeakMap;if(window[n]!==void 0)return;function b(t){return t.hasAttribute(T)||t.getAttribute(m)===""}function _(t){let e=null;const i=[];for(let s=0;s<t.inputs.length;s++){const o=t.inputs[s];if(o.checked&&!b(o)){e===null&&(e=o.getAttribute(c));const l=o.getAttribute(m);l&&i.push(l)}}return{key:e,values:i}}function I(t,e){if(t.length!==e.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!0;return!1}function w(t){const e=t.dom,i=t.colIndex,s=e.querySelector("template");if(!s||i===null)return;const o=document.getElementById(t.targetId);if(!o)return;const l=o.tagName==="TABLE"?o:o.querySelector("table");if(!l||o.hasAttribute("data-ln-table"))return;const d={},f=[],x=l.tBodies;for(let g=0;g<x.length;g++){const p=x[g].rows;for(let v=0;v<p.length;v++){const O=p[v].cells[i],E=O?O.textContent.trim():"";E&&!d[E]&&(d[E]=!0,f.push(E))}}f.sort(function(g,p){return g.localeCompare(p)});const k=e.querySelector("["+c+"]"),C=k?k.getAttribute(c):e.getAttribute("data-ln-filter-key")||"col"+i;for(let g=0;g<f.length;g++){const p=s.content.cloneNode(!0),v=p.querySelector("input");v&&(v.setAttribute(c,C),v.setAttribute(m,f[g]),D(p,{text:f[g]}),e.appendChild(p))}}function a(t){if(t.hasAttribute(u))return this;this.dom=t,this.targetId=t.getAttribute(r);const e=t.getAttribute(y);this.colIndex=e!==null?parseInt(e,10):null,w(this),this.inputs=Array.from(t.querySelectorAll("["+c+"]")),this._filterKey=this.inputs.length>0?this.inputs[0].getAttribute(c):null,this._lastSnapshot=null;const i=this,s=H(function(){i._render()},function(){i._afterRender()});this._queueRender=s,this._attachHandlers();let o=!1;if(t.hasAttribute("data-ln-persist")){const l=U("filter",t);if(l&&l.key&&Array.isArray(l.values)&&l.values.length>0){for(let d=0;d<this.inputs.length;d++){const f=this.inputs[d];b(f)?f.checked=!1:f.getAttribute(c)===l.key&&l.values.indexOf(f.getAttribute(m))!==-1?f.checked=!0:f.checked=!1}s(),o=!0}}if(!o){for(let l=0;l<this.inputs.length;l++)if(this.inputs[l].checked&&!b(this.inputs[l])){s();break}}return t.setAttribute(u,""),this}a.prototype._attachHandlers=function(){const t=this;this.inputs.forEach(function(e){e[n+"Bound"]||(e[n+"Bound"]=!0,e._lnFilterChange=function(){if(b(e)){for(let i=0;i<t.inputs.length;i++)b(t.inputs[i])||(t.inputs[i].checked=!1);e.checked=!0,t._queueRender();return}if(e.checked)for(let i=0;i<t.inputs.length;i++)b(t.inputs[i])&&(t.inputs[i].checked=!1);else{let i=!1;for(let s=0;s<t.inputs.length;s++)if(!b(t.inputs[s])&&t.inputs[s].checked){i=!0;break}if(!i)for(let s=0;s<t.inputs.length;s++)b(t.inputs[s])&&(t.inputs[s].checked=!0)}t._queueRender()},e.addEventListener("change",e._lnFilterChange))})},a.prototype._render=function(){const t=this,e=_(this),i=e.key===null||e.values.length===0,s=[];for(let o=0;o<e.values.length;o++)s.push(e.values[o].toLowerCase());if(t.colIndex!==null)t._filterTableRows(e);else{const o=document.getElementById(t.targetId);if(!o)return;const l=o.children;for(let d=0;d<l.length;d++){const f=l[d];if(i){f.removeAttribute(h);continue}const x=f.getAttribute("data-"+e.key);f.removeAttribute(h),x!==null&&s.indexOf(x.toLowerCase())===-1&&f.setAttribute(h,"true")}}},a.prototype._afterRender=function(){const t=_(this),e=this._lastSnapshot;if(!e||e.key!==t.key||I(e.values,t.values)){this._dispatchOnBoth("ln-filter:changed",{key:t.key,values:t.values.slice()});const s=e&&e.values.length>0,o=t.values.length===0;s&&o&&this._dispatchOnBoth("ln-filter:reset",{}),this._lastSnapshot={key:t.key,values:t.values.slice()}}this.dom.hasAttribute("data-ln-persist")&&(t.key&&t.values.length>0?N("filter",this.dom,{key:t.key,values:t.values.slice()}):N("filter",this.dom,null))},a.prototype._dispatchOnBoth=function(t,e){R(this.dom,t,e);const i=document.getElementById(this.targetId);i&&i!==this.dom&&R(i,t,e)},a.prototype._filterTableRows=function(t){const e=document.getElementById(this.targetId);if(!e)return;const i=e.tagName==="TABLE"?e:e.querySelector("table");if(!i||e.hasAttribute("data-ln-table"))return;const s=t.key||this._filterKey,o=t.values;A.has(i)||A.set(i,{});const l=A.get(i);if(s&&o.length>0){const k=[];for(let C=0;C<o.length;C++)k.push(o[C].toLowerCase());l[s]={col:this.colIndex,values:k}}else s&&delete l[s];const d=Object.keys(l),f=d.length>0,x=i.tBodies;for(let k=0;k<x.length;k++){const C=x[k].rows;for(let g=0;g<C.length;g++){const p=C[g];if(!f){p.removeAttribute(h);continue}let v=!0;for(let O=0;O<d.length;O++){const E=l[d[O]],M=p.cells[E.col],V=M?M.textContent.trim().toLowerCase():"";if(E.values.indexOf(V)===-1){v=!1;break}}v?p.removeAttribute(h):p.setAttribute(h,"true")}}},a.prototype.destroy=function(){if(this.dom[n]){if(this.colIndex!==null){const t=document.getElementById(this.targetId);if(t){const e=t.tagName==="TABLE"?t:t.querySelector("table");if(e&&A.has(e)){const i=A.get(e),s=this._filterKey;s&&i[s]&&delete i[s],Object.keys(i).length===0&&A.delete(e)}}}this.inputs.forEach(function(t){t._lnFilterChange&&(t.removeEventListener("change",t._lnFilterChange),delete t._lnFilterChange),delete t[n+"Bound"]}),this.dom.removeAttribute(u),delete this.dom[n]}},F(r,n,a,"ln-filter")})()})();
1
+ (function(){"use strict";function R(s,n,u){s.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:u||{}}))}function D(s,n){if(!s||!n)return s;const u=document.createTreeWalker(s,NodeFilter.SHOW_TEXT);for(;u.nextNode();){const c=u.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(m,h){return n[h]!==void 0?n[h]:""}))}return s}function B(s,n){if(!document.body){document.addEventListener("DOMContentLoaded",function(){B(s,n)}),console.warn("["+n+'] Script loaded before <body> — add "defer" to your <script> tag');return}s()}function S(s,n,u,c){if(s.nodeType!==1)return;const h=n.indexOf("[")!==-1||n.indexOf(".")!==-1||n.indexOf("#")!==-1?n:"["+n+"]",T=Array.from(s.querySelectorAll(h));s.matches&&s.matches(h)&&T.push(s);for(const y of T)y[u]||(y[u]=new c(y))}function F(s,n,u,c,m={}){const h=m.extraAttributes||[],T=m.onAttributeChange||null,y=m.onInit||null;function A(b){const _=b||document.body;S(_,s,n,u),y&&y(_)}return B(function(){const b=new MutationObserver(function(I){for(let w=0;w<I.length;w++){const f=I[w];if(f.type==="childList"){for(let t=0;t<f.addedNodes.length;t++){const e=f.addedNodes[t];e.nodeType===1&&(S(e,s,n,u),y&&y(e))}for(let t=0;t<f.removedNodes.length;t++){const e=f.removedNodes[t];if(e.nodeType===1){const r=s.indexOf("[")!==-1||s.indexOf(".")!==-1||s.indexOf("#")!==-1?s:"["+s+"]",o=Array.from(e.querySelectorAll(r));e.matches&&e.matches(r)&&o.push(e);for(let l=0;l<o.length;l++){const d=o[l];if(!document.contains(d)){const a=d[n];a&&typeof a.destroy=="function"&&a.destroy()}}}}}else f.type==="attributes"&&(T&&f.target[n]?T(f.target,f.attributeName):(S(f.target,s,n,u),y&&y(f.target)))}});let _=[];if(s.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let w;for(;(w=I.exec(s))!==null;)_.push(w[1])}else _.push(s);b.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:_.concat(h)})},c),window[n]=A,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){A(document.body)}):A(document.body),A}const L={};function K(s,n){L[s]=n}function j(s){return L[s]||{ingress:n=>n,egress:n=>n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=K,window.lnCore.getDataMapper=j);function H(s,n){let u=!1;return function(){u||(u=!0,queueMicrotask(function(){u=!1,s(),n&&n()}))}}const W="ln:";function J(){return location.pathname.replace(/\/+$/,"").toLowerCase()||"/"}function q(s,n){const u=n.getAttribute("data-ln-persist"),c=u!==null&&u!==""?u:n.id;return c?W+s+":"+J()+":"+c:(console.warn('[ln-persist] Element requires id or data-ln-persist="key"',n),null)}function U(s,n){const u=q(s,n);if(!u)return null;try{const c=localStorage.getItem(u);return c!==null?JSON.parse(c):null}catch{return null}}function N(s,n,u){const c=q(s,n);if(c)try{localStorage.setItem(c,JSON.stringify(u))}catch{}}(function(){const s="data-ln-filter",n="lnFilter",u="data-ln-filter-initialized",c="data-ln-filter-key",m="data-ln-filter-value",h="data-ln-filter-hide",T="data-ln-filter-reset",y="data-ln-filter-col",A=new WeakMap;if(window[n]!==void 0)return;function b(t){return t.hasAttribute(T)||t.getAttribute(m)===""}function _(t){let e=null;const i=[];for(let r=0;r<t.inputs.length;r++){const o=t.inputs[r];if(o.checked&&!b(o)){e===null&&(e=o.getAttribute(c));const l=o.getAttribute(m);l&&i.push(l)}}return{key:e,values:i}}function I(t,e){if(t.length!==e.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!0;return!1}function w(t){const e=t.dom,i=t.colIndex,r=e.querySelector("template");if(!r||i===null)return;const o=document.getElementById(t.targetId);if(!o)return;const l=o.tagName==="TABLE"?o:o.querySelector("table");if(!l||o.hasAttribute("data-ln-table"))return;const d={},a=[],x=l.tBodies;for(let g=0;g<x.length;g++){const p=x[g].rows;for(let v=0;v<p.length;v++){const O=p[v].cells[i],E=O?O.textContent.trim():"";E&&!d[E]&&(d[E]=!0,a.push(E))}}a.sort(function(g,p){return g.localeCompare(p)});const k=e.querySelector("["+c+"]"),C=k?k.getAttribute(c):e.getAttribute("data-ln-filter-key")||"col"+i;for(let g=0;g<a.length;g++){const p=r.content.cloneNode(!0),v=p.querySelector("input");v&&(v.setAttribute(c,C),v.setAttribute(m,a[g]),D(p,{text:a[g]}),e.appendChild(p))}}function f(t){if(t.hasAttribute(u))return this;this.dom=t,this.targetId=t.getAttribute(s);const e=t.getAttribute(y);this.colIndex=e!==null?parseInt(e,10):null,w(this),this.inputs=Array.from(t.querySelectorAll("["+c+"]")),this._filterKey=this.inputs.length>0?this.inputs[0].getAttribute(c):null,this._lastSnapshot=null;const i=this,r=H(function(){i._render()},function(){i._afterRender()});this._queueRender=r,this._attachHandlers();let o=!1;if(t.hasAttribute("data-ln-persist")){const l=U("filter",t);if(l&&l.key&&Array.isArray(l.values)&&l.values.length>0){for(let d=0;d<this.inputs.length;d++){const a=this.inputs[d];b(a)?a.checked=!1:a.getAttribute(c)===l.key&&l.values.indexOf(a.getAttribute(m))!==-1?a.checked=!0:a.checked=!1}r(),o=!0}}if(!o){for(let l=0;l<this.inputs.length;l++)if(this.inputs[l].checked&&!b(this.inputs[l])){r();break}}return t.setAttribute(u,""),this}f.prototype._attachHandlers=function(){const t=this;this.inputs.forEach(function(e){e[n+"Bound"]||(e[n+"Bound"]=!0,e._lnFilterChange=function(){if(b(e)){for(let i=0;i<t.inputs.length;i++)b(t.inputs[i])||(t.inputs[i].checked=!1);e.checked=!0,t._queueRender();return}if(e.checked)for(let i=0;i<t.inputs.length;i++)b(t.inputs[i])&&(t.inputs[i].checked=!1);else{let i=!1;for(let r=0;r<t.inputs.length;r++)if(!b(t.inputs[r])&&t.inputs[r].checked){i=!0;break}if(!i)for(let r=0;r<t.inputs.length;r++)b(t.inputs[r])&&(t.inputs[r].checked=!0)}t._queueRender()},e.addEventListener("change",e._lnFilterChange))})},f.prototype._render=function(){const t=this,e=_(this),i=e.key===null||e.values.length===0,r=[];for(let o=0;o<e.values.length;o++)r.push(e.values[o].toLowerCase());if(t.colIndex!==null)t._filterTableRows(e);else{const o=document.getElementById(t.targetId);if(!o)return;const l=o.children;for(let d=0;d<l.length;d++){const a=l[d];if(i){a.removeAttribute(h);continue}const x=a.getAttribute("data-"+e.key);a.removeAttribute(h),x!==null&&r.indexOf(x.toLowerCase())===-1&&a.setAttribute(h,"true")}}},f.prototype._afterRender=function(){const t=_(this),e=this._lastSnapshot;if(!e||e.key!==t.key||I(e.values,t.values)){this._dispatchOnBoth("ln-filter:changed",{key:t.key,values:t.values.slice()});const r=e&&e.values.length>0,o=t.values.length===0;r&&o&&this._dispatchOnBoth("ln-filter:reset",{}),this._lastSnapshot={key:t.key,values:t.values.slice()}}this.dom.hasAttribute("data-ln-persist")&&(t.key&&t.values.length>0?N("filter",this.dom,{key:t.key,values:t.values.slice()}):N("filter",this.dom,null))},f.prototype._dispatchOnBoth=function(t,e){R(this.dom,t,e);const i=document.getElementById(this.targetId);i&&i!==this.dom&&R(i,t,e)},f.prototype._filterTableRows=function(t){const e=document.getElementById(this.targetId);if(!e)return;const i=e.tagName==="TABLE"?e:e.querySelector("table");if(!i||e.hasAttribute("data-ln-table"))return;const r=t.key||this._filterKey,o=t.values;A.has(i)||A.set(i,{});const l=A.get(i);if(r&&o.length>0){const k=[];for(let C=0;C<o.length;C++)k.push(o[C].toLowerCase());l[r]={col:this.colIndex,values:k}}else r&&delete l[r];const d=Object.keys(l),a=d.length>0,x=i.tBodies;for(let k=0;k<x.length;k++){const C=x[k].rows;for(let g=0;g<C.length;g++){const p=C[g];if(!a){p.removeAttribute(h);continue}let v=!0;for(let O=0;O<d.length;O++){const E=l[d[O]],M=p.cells[E.col],V=M?M.textContent.trim().toLowerCase():"";if(E.values.indexOf(V)===-1){v=!1;break}}v?p.removeAttribute(h):p.setAttribute(h,"true")}}},f.prototype.destroy=function(){if(this.dom[n]){if(this.colIndex!==null){const t=document.getElementById(this.targetId);if(t){const e=t.tagName==="TABLE"?t:t.querySelector("table");if(e&&A.has(e)){const i=A.get(e),r=this._filterKey;r&&i[r]&&delete i[r],Object.keys(i).length===0&&A.delete(e)}}}this.inputs.forEach(function(t){t._lnFilterChange&&(t.removeEventListener("change",t._lnFilterChange),delete t._lnFilterChange),delete t[n+"Bound"]}),this.dom.removeAttribute(u),delete this.dom[n]}},F(s,n,f,"ln-filter")})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function y(s,t,u){s.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:u||{}}))}function E(s,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(s,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}s()}function v(s,t,u,a){if(s.nodeType!==1)return;const o=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(s.querySelectorAll(o));s.matches&&s.matches(o)&&r.push(s);for(const e of r)e[u]||(e[u]=new a(e))}function T(s){const t={},u=s.elements;for(let a=0;a<u.length;a++){const i=u[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button"))if(i.type==="checkbox")t[i.name]||(t[i.name]=[]),i.checked&&t[i.name].push(i.value);else if(i.type==="radio")i.checked&&(t[i.name]=i.value);else if(i.type==="select-multiple"){t[i.name]=[];for(let o=0;o<i.options.length;o++)i.options[o].selected&&t[i.name].push(i.options[o].value)}else t[i.name]=i.value}return t}function S(s,t){const u=s.elements,a=[];for(let i=0;i<u.length;i++){const o=u[i];if(!o.name||!(o.name in t)||o.type==="file"||o.type==="submit"||o.type==="button")continue;const r=t[o.name];if(o.type==="checkbox")o.checked=Array.isArray(r)?r.indexOf(o.value)!==-1:!!r,a.push(o);else if(o.type==="radio")o.checked=o.value===String(r),a.push(o);else if(o.type==="select-multiple"){if(Array.isArray(r))for(let e=0;e<o.options.length;e++)o.options[e].selected=r.indexOf(o.options[e].value)!==-1;a.push(o)}else o.value=r,a.push(o)}return a}function w(s,t,u,a,i={}){const o=i.extraAttributes||[],r=i.onAttributeChange||null,e=i.onInit||null;function n(l){const d=l||document.body;v(d,s,t,u),e&&e(d)}return E(function(){const l=new MutationObserver(function(f){for(let h=0;h<f.length;h++){const c=f[h];if(c.type==="childList"){for(let p=0;p<c.addedNodes.length;p++){const m=c.addedNodes[p];m.nodeType===1&&(v(m,s,t,u),e&&e(m))}for(let p=0;p<c.removedNodes.length;p++){const m=c.removedNodes[p];if(m.nodeType===1){const L=s.indexOf("[")!==-1||s.indexOf(".")!==-1||s.indexOf("#")!==-1?s:"["+s+"]",b=Array.from(m.querySelectorAll(L));m.matches&&m.matches(L)&&b.push(m);for(let g=0;g<b.length;g++){const _=b[g][t];_&&typeof _.destroy=="function"&&_.destroy()}}}}else c.type==="attributes"&&(r&&c.target[t]?r(c.target,c.attributeName):(v(c.target,s,t,u),e&&e(c.target)))}});let d=[];if(s.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let h;for(;(h=f.exec(s))!==null;)d.push(h[1])}else d.push(s);l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:d.concat(o)})},a),window[t]=n,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){n(document.body)}):n(document.body),n}const A={};function x(s,t){A[s]=t}function C(s){return A[s]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=x,window.lnCore.getDataMapper=C),(function(){const s="data-ln-form",t="lnForm",u="data-ln-form-auto",a="data-ln-form-debounce",i="data-ln-validate",o="lnValidate";if(window[t]!==void 0)return;function r(e){this.dom=e,this._debounceTimer=null;const n=this;if(this._onValid=function(){n._updateSubmitButton()},this._onInvalid=function(){n._updateSubmitButton()},this._onSubmit=function(l){l.preventDefault(),n.submit()},this._onFill=function(l){l.detail&&n.fill(l.detail)},this._onFormReset=function(){n.reset()},this._onNativeReset=function(){setTimeout(function(){n._resetValidation()},0)},e.addEventListener("ln-validate:valid",this._onValid),e.addEventListener("ln-validate:invalid",this._onInvalid),e.addEventListener("submit",this._onSubmit),e.addEventListener("ln-form:fill",this._onFill),e.addEventListener("ln-form:reset",this._onFormReset),e.addEventListener("reset",this._onNativeReset),this._onAutoInput=null,e.hasAttribute(u)){const l=parseInt(e.getAttribute(a))||0;this._onAutoInput=function(){l>0?(clearTimeout(n._debounceTimer),n._debounceTimer=setTimeout(function(){n.submit()},l)):n.submit()},e.addEventListener("input",this._onAutoInput),e.addEventListener("change",this._onAutoInput)}return this._updateSubmitButton(),this}r.prototype._updateSubmitButton=function(){const e=this.dom.querySelectorAll('button[type="submit"], input[type="submit"]');if(!e.length)return;const n=this.dom.querySelectorAll("["+i+"]");let l=!1;if(n.length>0){let d=!1,f=!1;for(let h=0;h<n.length;h++){const c=n[h][o];c&&c._touched&&(d=!0),n[h].checkValidity()||(f=!0)}l=f||!d}for(let d=0;d<e.length;d++)e[d].disabled=l},r.prototype.fill=function(e){const n=S(this.dom,e);for(let l=0;l<n.length;l++){const d=n[l],f=d.tagName==="SELECT"||d.type==="checkbox"||d.type==="radio";d.dispatchEvent(new Event(f?"change":"input",{bubbles:!0}))}},r.prototype.submit=function(){const e=this.dom.querySelectorAll("["+i+"]");let n=!0;for(let d=0;d<e.length;d++){const f=e[d][o];f&&(f.validate()||(n=!1))}if(!n)return;const l=T(this.dom);y(this.dom,"ln-form:submit",{data:l})},r.prototype.reset=function(){this.dom.reset();const e=this.dom.querySelectorAll("input, textarea, select");for(let n=0;n<e.length;n++){const l=e[n],d=l.tagName==="SELECT"||l.type==="checkbox"||l.type==="radio";l.dispatchEvent(new Event(d?"change":"input",{bubbles:!0}))}this._resetValidation(),y(this.dom,"ln-form:reset-complete",{target:this.dom})},r.prototype._resetValidation=function(){const e=this.dom.querySelectorAll("["+i+"]");for(let n=0;n<e.length;n++){const l=e[n][o];l&&l.reset()}this._updateSubmitButton()},Object.defineProperty(r.prototype,"isValid",{get:function(){const e=this.dom.querySelectorAll("["+i+"]");for(let n=0;n<e.length;n++)if(!e[n].checkValidity())return!1;return!0}}),r.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-validate:valid",this._onValid),this.dom.removeEventListener("ln-validate:invalid",this._onInvalid),this.dom.removeEventListener("submit",this._onSubmit),this.dom.removeEventListener("ln-form:fill",this._onFill),this.dom.removeEventListener("ln-form:reset",this._onFormReset),this.dom.removeEventListener("reset",this._onNativeReset),this._onAutoInput&&(this.dom.removeEventListener("input",this._onAutoInput),this.dom.removeEventListener("change",this._onAutoInput)),clearTimeout(this._debounceTimer),y(this.dom,"ln-form:destroyed",{target:this.dom}),delete this.dom[t])},w(s,t,r,"ln-form")})()})();
1
+ (function(){"use strict";function y(s,t,u){s.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:u||{}}))}function E(s,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(s,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}s()}function v(s,t,u,a){if(s.nodeType!==1)return;const o=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(s.querySelectorAll(o));s.matches&&s.matches(o)&&r.push(s);for(const e of r)e[u]||(e[u]=new a(e))}function S(s){const t={},u=s.elements;for(let a=0;a<u.length;a++){const i=u[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button"))if(i.type==="checkbox")t[i.name]||(t[i.name]=[]),i.checked&&t[i.name].push(i.value);else if(i.type==="radio")i.checked&&(t[i.name]=i.value);else if(i.type==="select-multiple"){t[i.name]=[];for(let o=0;o<i.options.length;o++)i.options[o].selected&&t[i.name].push(i.options[o].value)}else t[i.name]=i.value}return t}function w(s,t){const u=s.elements,a=[];for(let i=0;i<u.length;i++){const o=u[i];if(!o.name||!(o.name in t)||o.type==="file"||o.type==="submit"||o.type==="button")continue;const r=t[o.name];if(o.type==="checkbox")o.checked=Array.isArray(r)?r.indexOf(o.value)!==-1:!!r,a.push(o);else if(o.type==="radio")o.checked=o.value===String(r),a.push(o);else if(o.type==="select-multiple"){if(Array.isArray(r))for(let e=0;e<o.options.length;e++)o.options[e].selected=r.indexOf(o.options[e].value)!==-1;a.push(o)}else o.value=r,a.push(o)}return a}function x(s,t,u,a,i={}){const o=i.extraAttributes||[],r=i.onAttributeChange||null,e=i.onInit||null;function n(l){const d=l||document.body;v(d,s,t,u),e&&e(d)}return E(function(){const l=new MutationObserver(function(f){for(let h=0;h<f.length;h++){const c=f[h];if(c.type==="childList"){for(let p=0;p<c.addedNodes.length;p++){const m=c.addedNodes[p];m.nodeType===1&&(v(m,s,t,u),e&&e(m))}for(let p=0;p<c.removedNodes.length;p++){const m=c.removedNodes[p];if(m.nodeType===1){const L=s.indexOf("[")!==-1||s.indexOf(".")!==-1||s.indexOf("#")!==-1?s:"["+s+"]",b=Array.from(m.querySelectorAll(L));m.matches&&m.matches(L)&&b.push(m);for(let g=0;g<b.length;g++){const T=b[g];if(!document.contains(T)){const _=T[t];_&&typeof _.destroy=="function"&&_.destroy()}}}}}else c.type==="attributes"&&(r&&c.target[t]?r(c.target,c.attributeName):(v(c.target,s,t,u),e&&e(c.target)))}});let d=[];if(s.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let h;for(;(h=f.exec(s))!==null;)d.push(h[1])}else d.push(s);l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:d.concat(o)})},a),window[t]=n,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){n(document.body)}):n(document.body),n}const A={};function C(s,t){A[s]=t}function O(s){return A[s]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=C,window.lnCore.getDataMapper=O),(function(){const s="data-ln-form",t="lnForm",u="data-ln-form-auto",a="data-ln-form-debounce",i="data-ln-validate",o="lnValidate";if(window[t]!==void 0)return;function r(e){this.dom=e,this._debounceTimer=null;const n=this;if(this._onValid=function(){n._updateSubmitButton()},this._onInvalid=function(){n._updateSubmitButton()},this._onSubmit=function(l){l.preventDefault(),n.submit()},this._onFill=function(l){l.detail&&n.fill(l.detail)},this._onFormReset=function(){n.reset()},this._onNativeReset=function(){setTimeout(function(){n._resetValidation()},0)},e.addEventListener("ln-validate:valid",this._onValid),e.addEventListener("ln-validate:invalid",this._onInvalid),e.addEventListener("submit",this._onSubmit),e.addEventListener("ln-form:fill",this._onFill),e.addEventListener("ln-form:reset",this._onFormReset),e.addEventListener("reset",this._onNativeReset),this._onAutoInput=null,e.hasAttribute(u)){const l=parseInt(e.getAttribute(a))||0;this._onAutoInput=function(){l>0?(clearTimeout(n._debounceTimer),n._debounceTimer=setTimeout(function(){n.submit()},l)):n.submit()},e.addEventListener("input",this._onAutoInput),e.addEventListener("change",this._onAutoInput)}return this._updateSubmitButton(),this}r.prototype._updateSubmitButton=function(){const e=this.dom.querySelectorAll('button[type="submit"], input[type="submit"]');if(!e.length)return;const n=this.dom.querySelectorAll("["+i+"]");let l=!1;if(n.length>0){let d=!1,f=!1;for(let h=0;h<n.length;h++){const c=n[h][o];c&&c._touched&&(d=!0),n[h].checkValidity()||(f=!0)}l=f||!d}for(let d=0;d<e.length;d++)e[d].disabled=l},r.prototype.fill=function(e){const n=w(this.dom,e);for(let l=0;l<n.length;l++){const d=n[l],f=d.tagName==="SELECT"||d.type==="checkbox"||d.type==="radio";d.dispatchEvent(new Event(f?"change":"input",{bubbles:!0}))}},r.prototype.submit=function(){const e=this.dom.querySelectorAll("["+i+"]");let n=!0;for(let d=0;d<e.length;d++){const f=e[d][o];f&&(f.validate()||(n=!1))}if(!n)return;const l=S(this.dom);y(this.dom,"ln-form:submit",{data:l})},r.prototype.reset=function(){this.dom.reset();const e=this.dom.querySelectorAll("input, textarea, select");for(let n=0;n<e.length;n++){const l=e[n],d=l.tagName==="SELECT"||l.type==="checkbox"||l.type==="radio";l.dispatchEvent(new Event(d?"change":"input",{bubbles:!0}))}this._resetValidation(),y(this.dom,"ln-form:reset-complete",{target:this.dom})},r.prototype._resetValidation=function(){const e=this.dom.querySelectorAll("["+i+"]");for(let n=0;n<e.length;n++){const l=e[n][o];l&&l.reset()}this._updateSubmitButton()},Object.defineProperty(r.prototype,"isValid",{get:function(){const e=this.dom.querySelectorAll("["+i+"]");for(let n=0;n<e.length;n++)if(!e[n].checkValidity())return!1;return!0}}),r.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-validate:valid",this._onValid),this.dom.removeEventListener("ln-validate:invalid",this._onInvalid),this.dom.removeEventListener("submit",this._onSubmit),this.dom.removeEventListener("ln-form:fill",this._onFill),this.dom.removeEventListener("ln-form:reset",this._onFormReset),this.dom.removeEventListener("reset",this._onNativeReset),this._onAutoInput&&(this.dom.removeEventListener("input",this._onAutoInput),this.dom.removeEventListener("change",this._onAutoInput)),clearTimeout(this._debounceTimer),y(this.dom,"ln-form:destroyed",{target:this.dom}),delete this.dom[t])},x(s,t,r,"ln-form")})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function h(e,t,c){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:c||{}}))}function _(e,t,c){const m=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:c||{}});return e.dispatchEvent(m),m}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function g(e,t,c,m){if(e.nodeType!==1)return;const b=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n=Array.from(e.querySelectorAll(b));e.matches&&e.matches(b)&&n.push(e);for(const o of n)o[c]||(o[c]=new m(o))}function y(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function x(e,t,c,m,p={}){const b=p.extraAttributes||[],n=p.onAttributeChange||null,o=p.onInit||null;function r(u){const i=u||document.body;g(i,e,t,c),o&&o(i)}return C(function(){const u=new MutationObserver(function(a){for(let s=0;s<a.length;s++){const d=a[s];if(d.type==="childList"){for(let f=0;f<d.addedNodes.length;f++){const l=d.addedNodes[f];l.nodeType===1&&(g(l,e,t,c),o&&o(l))}for(let f=0;f<d.removedNodes.length;f++){const l=d.removedNodes[f];if(l.nodeType===1){const O=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",A=Array.from(l.querySelectorAll(O));l.matches&&l.matches(O)&&A.push(l);for(let E=0;E<A.length;E++){const w=A[E][t];w&&typeof w.destroy=="function"&&w.destroy()}}}}else d.type==="attributes"&&(n&&d.target[t]?n(d.target,d.attributeName):(g(d.target,e,t,c),o&&o(d.target)))}});let i=[];if(e.indexOf("[")!==-1){const a=/\[([\w-]+)/g;let s;for(;(s=a.exec(e))!==null;)i.push(s[1])}else i.push(e);u.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.concat(b)})},m),window[t]=r,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){r(document.body)}):r(document.body),r}const L={};function T(e,t){L[e]=t}function k(e){return L[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=T,window.lnCore.getDataMapper=k),(function(){const e="data-ln-modal",t="lnModal";if(window[t]!==void 0)return;function c(n){const o=Array.from(n.querySelectorAll("[data-ln-modal-for]"));n.hasAttribute&&n.hasAttribute("data-ln-modal-for")&&o.push(n);for(const r of o){if(r[t+"Trigger"])continue;const u=function(i){if(i.ctrlKey||i.metaKey||i.button===1)return;i.preventDefault();const a=r.getAttribute("data-ln-modal-for"),s=document.getElementById(a);if(!s){console.warn('[ln-modal] No modal found for data-ln-modal-for="'+a+'"');return}if(!s[t])return;const d=s.getAttribute(e);s.setAttribute(e,d==="open"?"close":"open")};r.addEventListener("click",u),r[t+"Trigger"]=u}}function m(n){this.dom=n,this.isOpen=n.getAttribute(e)==="open";const o=this;return this._onEscape=function(r){r.key==="Escape"&&o.dom.setAttribute(e,"close")},this._onFocusTrap=function(r){if(r.key!=="Tab")return;const u=Array.prototype.filter.call(o.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),y);if(u.length===0)return;const i=u[0],a=u[u.length-1];r.shiftKey?document.activeElement===i&&(r.preventDefault(),a.focus()):document.activeElement===a&&(r.preventDefault(),i.focus())},this._onClose=function(r){r.preventDefault(),o.dom.setAttribute(e,"close")},b(this),this.isOpen&&(this.dom.setAttribute("aria-modal","true"),this.dom.setAttribute("role","dialog"),document.body.classList.add("ln-modal-open"),document.addEventListener("keydown",this._onEscape),document.addEventListener("keydown",this._onFocusTrap)),this}m.prototype.destroy=function(){if(!this.dom[t])return;this.isOpen&&(this.dom.removeAttribute("aria-modal"),document.removeEventListener("keydown",this._onEscape),document.removeEventListener("keydown",this._onFocusTrap),this._returnFocusEl=null,document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"));const n=this.dom.querySelectorAll("[data-ln-modal-close]");for(const r of n)r[t+"Close"]&&(r.removeEventListener("click",r[t+"Close"]),delete r[t+"Close"]);const o=document.querySelectorAll('[data-ln-modal-for="'+this.dom.id+'"]');for(const r of o)r[t+"Trigger"]&&(r.removeEventListener("click",r[t+"Trigger"]),delete r[t+"Trigger"]);h(this.dom,"ln-modal:destroyed",{modalId:this.dom.id,target:this.dom}),delete this.dom[t]};function p(n){const o=n[t];if(!o)return;const u=n.getAttribute(e)==="open";if(u!==o.isOpen)if(u){if(_(n,"ln-modal:before-open",{modalId:n.id,target:n}).defaultPrevented){n.setAttribute(e,"close");return}o.isOpen=!0,n.setAttribute("aria-modal","true"),n.setAttribute("role","dialog"),document.body.classList.add("ln-modal-open"),document.addEventListener("keydown",o._onEscape),document.addEventListener("keydown",o._onFocusTrap);const a=document.activeElement;o._returnFocusEl=a&&a!==document.body?a:null;const s=n.querySelector("[autofocus]");if(s&&y(s))s.focus();else{const d=n.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),f=Array.prototype.find.call(d,y);if(f)f.focus();else{const l=n.querySelectorAll("a[href], button:not([disabled])"),v=Array.prototype.find.call(l,y);v&&v.focus()}}h(n,"ln-modal:open",{modalId:n.id,target:n})}else{if(_(n,"ln-modal:before-close",{modalId:n.id,target:n}).defaultPrevented){n.setAttribute(e,"open");return}o.isOpen=!1,n.removeAttribute("aria-modal"),document.removeEventListener("keydown",o._onEscape),document.removeEventListener("keydown",o._onFocusTrap),h(n,"ln-modal:close",{modalId:n.id,target:n}),o._returnFocusEl&&document.contains(o._returnFocusEl)&&typeof o._returnFocusEl.focus=="function"&&o._returnFocusEl.focus(),o._returnFocusEl=null,document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open")}}function b(n){const o=n.dom.querySelectorAll("[data-ln-modal-close]");for(const r of o)r[t+"Close"]||(r.addEventListener("click",n._onClose),r[t+"Close"]=n._onClose)}x(e,t,m,"ln-modal",{extraAttributes:["data-ln-modal-for"],onAttributeChange:p,onInit:c})})()})();
1
+ (function(){"use strict";function h(t,e,c){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:c||{}}))}function _(t,e,c){const m=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:c||{}});return t.dispatchEvent(m),m}function C(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function g(t,e,c,m){if(t.nodeType!==1)return;const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",n=Array.from(t.querySelectorAll(b));t.matches&&t.matches(b)&&n.push(t);for(const o of n)o[c]||(o[c]=new m(o))}function y(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function T(t,e,c,m,p={}){const b=p.extraAttributes||[],n=p.onAttributeChange||null,o=p.onInit||null;function r(u){const i=u||document.body;g(i,t,e,c),o&&o(i)}return C(function(){const u=new MutationObserver(function(a){for(let s=0;s<a.length;s++){const d=a[s];if(d.type==="childList"){for(let f=0;f<d.addedNodes.length;f++){const l=d.addedNodes[f];l.nodeType===1&&(g(l,t,e,c),o&&o(l))}for(let f=0;f<d.removedNodes.length;f++){const l=d.removedNodes[f];if(l.nodeType===1){const O=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",A=Array.from(l.querySelectorAll(O));l.matches&&l.matches(O)&&A.push(l);for(let E=0;E<A.length;E++){const x=A[E];if(!document.contains(x)){const w=x[e];w&&typeof w.destroy=="function"&&w.destroy()}}}}}else d.type==="attributes"&&(n&&d.target[e]?n(d.target,d.attributeName):(g(d.target,t,e,c),o&&o(d.target)))}});let i=[];if(t.indexOf("[")!==-1){const a=/\[([\w-]+)/g;let s;for(;(s=a.exec(t))!==null;)i.push(s[1])}else i.push(t);u.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.concat(b)})},m),window[e]=r,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){r(document.body)}):r(document.body),r}const L={};function k(t,e){L[t]=e}function S(t){return L[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=k,window.lnCore.getDataMapper=S),(function(){const t="data-ln-modal",e="lnModal";if(window[e]!==void 0)return;function c(n){const o=Array.from(n.querySelectorAll("[data-ln-modal-for]"));n.hasAttribute&&n.hasAttribute("data-ln-modal-for")&&o.push(n);for(const r of o){if(r[e+"Trigger"])continue;const u=function(i){if(i.ctrlKey||i.metaKey||i.button===1)return;i.preventDefault();const a=r.getAttribute("data-ln-modal-for"),s=document.getElementById(a);if(!s){console.warn('[ln-modal] No modal found for data-ln-modal-for="'+a+'"');return}if(!s[e])return;const d=s.getAttribute(t);s.setAttribute(t,d==="open"?"close":"open")};r.addEventListener("click",u),r[e+"Trigger"]=u}}function m(n){this.dom=n,this.isOpen=n.getAttribute(t)==="open";const o=this;return this._onEscape=function(r){r.key==="Escape"&&o.dom.setAttribute(t,"close")},this._onFocusTrap=function(r){if(r.key!=="Tab")return;const u=Array.prototype.filter.call(o.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),y);if(u.length===0)return;const i=u[0],a=u[u.length-1];r.shiftKey?document.activeElement===i&&(r.preventDefault(),a.focus()):document.activeElement===a&&(r.preventDefault(),i.focus())},this._onClose=function(r){r.preventDefault(),o.dom.setAttribute(t,"close")},b(this),this.isOpen&&(this.dom.setAttribute("aria-modal","true"),this.dom.setAttribute("role","dialog"),document.body.classList.add("ln-modal-open"),document.addEventListener("keydown",this._onEscape),document.addEventListener("keydown",this._onFocusTrap)),this}m.prototype.destroy=function(){if(!this.dom[e])return;this.isOpen&&(this.dom.removeAttribute("aria-modal"),document.removeEventListener("keydown",this._onEscape),document.removeEventListener("keydown",this._onFocusTrap),this._returnFocusEl=null,document.querySelector("["+t+'="open"]')||document.body.classList.remove("ln-modal-open"));const n=this.dom.querySelectorAll("[data-ln-modal-close]");for(const r of n)r[e+"Close"]&&(r.removeEventListener("click",r[e+"Close"]),delete r[e+"Close"]);const o=document.querySelectorAll('[data-ln-modal-for="'+this.dom.id+'"]');for(const r of o)r[e+"Trigger"]&&(r.removeEventListener("click",r[e+"Trigger"]),delete r[e+"Trigger"]);h(this.dom,"ln-modal:destroyed",{modalId:this.dom.id,target:this.dom}),delete this.dom[e]};function p(n){const o=n[e];if(!o)return;const u=n.getAttribute(t)==="open";if(u!==o.isOpen)if(u){if(_(n,"ln-modal:before-open",{modalId:n.id,target:n}).defaultPrevented){n.setAttribute(t,"close");return}o.isOpen=!0,n.setAttribute("aria-modal","true"),n.setAttribute("role","dialog"),document.body.classList.add("ln-modal-open"),document.addEventListener("keydown",o._onEscape),document.addEventListener("keydown",o._onFocusTrap);const a=document.activeElement;o._returnFocusEl=a&&a!==document.body?a:null;const s=n.querySelector("[autofocus]");if(s&&y(s))s.focus();else{const d=n.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),f=Array.prototype.find.call(d,y);if(f)f.focus();else{const l=n.querySelectorAll("a[href], button:not([disabled])"),v=Array.prototype.find.call(l,y);v&&v.focus()}}h(n,"ln-modal:open",{modalId:n.id,target:n})}else{if(_(n,"ln-modal:before-close",{modalId:n.id,target:n}).defaultPrevented){n.setAttribute(t,"open");return}o.isOpen=!1,n.removeAttribute("aria-modal"),document.removeEventListener("keydown",o._onEscape),document.removeEventListener("keydown",o._onFocusTrap),h(n,"ln-modal:close",{modalId:n.id,target:n}),o._returnFocusEl&&document.contains(o._returnFocusEl)&&typeof o._returnFocusEl.focus=="function"&&o._returnFocusEl.focus(),o._returnFocusEl=null,document.querySelector("["+t+'="open"]')||document.body.classList.remove("ln-modal-open")}}function b(n){const o=n.dom.querySelectorAll("[data-ln-modal-close]");for(const r of o)r[e+"Close"]||(r.addEventListener("click",n._onClose),r[e+"Close"]=n._onClose)}T(t,e,m,"ln-modal",{extraAttributes:["data-ln-modal-for"],onAttributeChange:p,onInit:c})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function v(s,i,u){s.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:u||{}}))}function S(s,i){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(s,i)}),console.warn("["+i+'] Script loaded before <body> — add "defer" to your <script> tag');return}s()}function x(s,i,u,p){if(s.nodeType!==1)return;const y=i.indexOf("[")!==-1||i.indexOf(".")!==-1||i.indexOf("#")!==-1?i:"["+i+"]",m=Array.from(s.querySelectorAll(y));s.matches&&s.matches(y)&&m.push(s);for(const h of m)h[u]||(h[u]=new p(h))}function N(s){const i=s.closest("[lang]");return(i?i.lang:null)||navigator.language}function O(s,i,{get:u,set:p}){Object.defineProperty(s,"value",{get:function(){return u?u.call(this):i.get.call(this)},set:function(g){p?p.call(this,g,y=>i.set.call(this,y)):i.set.call(this,g)},configurable:!0})}function I(s,i,u,p,g={}){const y=g.extraAttributes||[],m=g.onAttributeChange||null,h=g.onInit||null;function t(a){const e=a||document.body;x(e,s,i,u),h&&h(e)}return S(function(){const a=new MutationObserver(function(c){for(let r=0;r<c.length;r++){const n=c[r];if(n.type==="childList"){for(let o=0;o<n.addedNodes.length;o++){const l=n.addedNodes[o];l.nodeType===1&&(x(l,s,i,u),h&&h(l))}for(let o=0;o<n.removedNodes.length;o++){const l=n.removedNodes[o];if(l.nodeType===1){const _=s.indexOf("[")!==-1||s.indexOf(".")!==-1||s.indexOf("#")!==-1?s:"["+s+"]",F=Array.from(l.querySelectorAll(_));l.matches&&l.matches(_)&&F.push(l);for(let b=0;b<F.length;b++){const E=F[b][i];E&&typeof E.destroy=="function"&&E.destroy()}}}}else n.type==="attributes"&&(m&&n.target[i]?m(n.target,n.attributeName):(x(n.target,s,i,u),h&&h(n.target)))}});let e=[];if(s.indexOf("[")!==-1){const c=/\[([\w-]+)/g;let r;for(;(r=c.exec(s))!==null;)e.push(r[1])}else e.push(s);a.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:e.concat(y)})},p),window[i]=t,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){t(document.body)}):t(document.body),t}const A={};function C(s,i){A[s]=i}function L(s){return A[s]||{ingress:i=>i,egress:i=>i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=C,window.lnCore.getDataMapper=L),(function(){const s="data-ln-number",i="lnNumber";if(window[i]!==void 0)return;const u={},p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function g(t){if(!u[t]){const a=new Intl.NumberFormat(t,{useGrouping:!0}),e=a.formatToParts(1234.5);let c="",r=".";for(let n=0;n<e.length;n++)e[n].type==="group"&&(c=e[n].value),e[n].type==="decimal"&&(r=e[n].value);u[t]={fmt:a,groupSep:c,decimalSep:r}}return u[t]}function y(t,a,e){if(e!==null){const c=parseInt(e,10),r=t+"|d"+c;return u[r]||(u[r]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:c})),u[r].format(a)}return g(t).fmt.format(a)}function m(t){if(t.tagName!=="INPUT")return console.warn("[ln-number] Can only be applied to <input>, got:",t.tagName),this;if(t[i])return t[i];t[i]=this,this.dom=t;const a=document.createElement("input");a.type="hidden",a.name=t.name,t.removeAttribute("name"),t.type="text",t.setAttribute("inputmode","decimal"),t.insertAdjacentElement("afterend",a),this._hidden=a;const e=this;Object.defineProperty(a,"value",{get:function(){return p.get.call(a)},set:function(r){if(p.set.call(a,r),r!==""&&!isNaN(parseFloat(r))){const n=parseFloat(r);e._displayFormatted(n),v(e.dom,"ln-number:input",{value:n,formatted:e.dom.value}),e.dom.dispatchEvent(new Event("input",{bubbles:!0}))}else r===""&&(e.dom.value="",v(e.dom,"ln-number:input",{value:NaN,formatted:""}),e.dom.dispatchEvent(new Event("input",{bubbles:!0})))}}),O(t,p,{get:function(){return p.get.call(t)},set:function(r,n){if(e._isFormatting){n(r);return}if(r===""){n(""),e._setHiddenRaw(""),v(t,"ln-number:input",{value:NaN,formatted:""}),t.dispatchEvent(new Event("input",{bubbles:!0}));return}let o=typeof r=="number"?r:parseFloat(String(r).replace(/[^\d.-]/g,""));if(isNaN(o))n(String(r)),e._setHiddenRaw(""),v(t,"ln-number:input",{value:NaN,formatted:String(r)}),t.dispatchEvent(new Event("input",{bubbles:!0}));else{e._setHiddenRaw(o);const l=y(N(t),o,t.getAttribute("data-ln-number-decimals"));n(l),v(t,"ln-number:input",{value:o,formatted:l}),t.dispatchEvent(new Event("input",{bubbles:!0}))}}}),this._onInput=function(){e._handleInput()},t.addEventListener("input",this._onInput),this._onPaste=function(r){r.preventDefault();const n=(r.clipboardData||window.clipboardData).getData("text"),o=g(N(t)),l=o.decimalSep.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");let f=n.replace(new RegExp("[^0-9\\-"+l+".]","g"),"");o.groupSep&&(f=f.split(o.groupSep).join("")),o.decimalSep!=="."&&(f=f.replace(o.decimalSep,"."));const _=parseFloat(f);isNaN(_)?(t.value="",e._hidden.value=""):e.value=_},t.addEventListener("paste",this._onPaste);const c=t.value;if(c!==""){const r=parseFloat(c);isNaN(r)||(this._displayFormatted(r),p.set.call(a,String(r)),v(t,"ln-number:input",{value:r,formatted:t.value}),t.dispatchEvent(new Event("input",{bubbles:!0})))}return this}m.prototype._handleInput=function(){const t=this.dom,a=g(N(t)),e=t.value;if(e===""){this._hidden.value="",v(t,"ln-number:input",{value:NaN,formatted:""});return}if(e==="-"){this._hidden.value="";return}const c=t.selectionStart;let r=0;for(let d=0;d<c;d++)/[0-9]/.test(e[d])&&r++;let n=e;if(a.groupSep&&(n=n.split(a.groupSep).join("")),n=n.replace(a.decimalSep,"."),e.endsWith(a.decimalSep)||e.endsWith(".")){const d=n.replace(/\.$/,""),w=parseFloat(d);isNaN(w)||this._setHiddenRaw(w);return}const o=n.indexOf(".");if(o!==-1&&n.slice(o+1).endsWith("0")){const w=parseFloat(n);isNaN(w)||this._setHiddenRaw(w);return}const l=t.getAttribute("data-ln-number-decimals");if(l!==null&&o!==-1){const d=parseInt(l,10);n.slice(o+1).length>d&&(n=n.slice(0,o+1+d))}const f=parseFloat(n);if(isNaN(f))return;const _=t.getAttribute("data-ln-number-min"),F=t.getAttribute("data-ln-number-max");if(_!==null&&f<parseFloat(_)||F!==null&&f>parseFloat(F))return;let b;if(l!==null)b=y(N(t),f,l);else{const d=o!==-1?n.slice(o+1).length:0;if(d>0){const w=N(t)+"|u"+d;u[w]||(u[w]=new Intl.NumberFormat(N(t),{useGrouping:!0,minimumFractionDigits:d,maximumFractionDigits:d})),b=u[w].format(f)}else b=a.fmt.format(f)}t.value=b;let E=r,D=0;for(let d=0;d<b.length&&E>0;d++)D=d+1,/[0-9]/.test(b[d])&&E--;E>0&&(D=b.length),t.setSelectionRange(D,D),this._setHiddenRaw(f),v(t,"ln-number:input",{value:f,formatted:b})},m.prototype._setHiddenRaw=function(t){p.set.call(this._hidden,String(t))},m.prototype._displayFormatted=function(t){this._isFormatting=!0,this.dom.value=y(N(this.dom),t,this.dom.getAttribute("data-ln-number-decimals")),this._isFormatting=!1},Object.defineProperty(m.prototype,"value",{get:function(){const t=this._hidden.value;return t===""?NaN:parseFloat(t)},set:function(t){if(typeof t!="number"||isNaN(t)){this.dom.value="",this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._displayFormatted(t),this._setHiddenRaw(t),v(this.dom,"ln-number:input",{value:t,formatted:this.dom.value}),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(m.prototype,"formatted",{get:function(){return this.dom.value}}),m.prototype.destroy=function(){this.dom[i]&&(this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("paste",this._onPaste),this.dom.name=this._hidden.name,this.dom.type="number",this.dom.removeAttribute("inputmode"),this._hidden.remove(),v(this.dom,"ln-number:destroyed",{target:this.dom}),delete this.dom[i])};function h(){new MutationObserver(function(){const t=document.querySelectorAll("["+s+"]");for(let a=0;a<t.length;a++){const e=t[a][i];e&&!isNaN(e.value)&&e._displayFormatted(e.value)}}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]})}I(s,i,m,"ln-number"),h()})()})();
1
+ (function(){"use strict";function v(s,i,u){s.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:u||{}}))}function S(s,i){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(s,i)}),console.warn("["+i+'] Script loaded before <body> — add "defer" to your <script> tag');return}s()}function x(s,i,u,p){if(s.nodeType!==1)return;const y=i.indexOf("[")!==-1||i.indexOf(".")!==-1||i.indexOf("#")!==-1?i:"["+i+"]",m=Array.from(s.querySelectorAll(y));s.matches&&s.matches(y)&&m.push(s);for(const h of m)h[u]||(h[u]=new p(h))}function E(s){const i=s.closest("[lang]");return(i?i.lang:null)||navigator.language}function O(s,i,{get:u,set:p}){Object.defineProperty(s,"value",{get:function(){return u?u.call(this):i.get.call(this)},set:function(g){p?p.call(this,g,y=>i.set.call(this,y)):i.set.call(this,g)},configurable:!0})}function I(s,i,u,p,g={}){const y=g.extraAttributes||[],m=g.onAttributeChange||null,h=g.onInit||null;function t(a){const e=a||document.body;x(e,s,i,u),h&&h(e)}return S(function(){const a=new MutationObserver(function(c){for(let r=0;r<c.length;r++){const n=c[r];if(n.type==="childList"){for(let o=0;o<n.addedNodes.length;o++){const l=n.addedNodes[o];l.nodeType===1&&(x(l,s,i,u),h&&h(l))}for(let o=0;o<n.removedNodes.length;o++){const l=n.removedNodes[o];if(l.nodeType===1){const _=s.indexOf("[")!==-1||s.indexOf(".")!==-1||s.indexOf("#")!==-1?s:"["+s+"]",F=Array.from(l.querySelectorAll(_));l.matches&&l.matches(_)&&F.push(l);for(let b=0;b<F.length;b++){const D=F[b];if(!document.contains(D)){const N=D[i];N&&typeof N.destroy=="function"&&N.destroy()}}}}}else n.type==="attributes"&&(m&&n.target[i]?m(n.target,n.attributeName):(x(n.target,s,i,u),h&&h(n.target)))}});let e=[];if(s.indexOf("[")!==-1){const c=/\[([\w-]+)/g;let r;for(;(r=c.exec(s))!==null;)e.push(r[1])}else e.push(s);a.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:e.concat(y)})},p),window[i]=t,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){t(document.body)}):t(document.body),t}const A={};function C(s,i){A[s]=i}function L(s){return A[s]||{ingress:i=>i,egress:i=>i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=C,window.lnCore.getDataMapper=L),(function(){const s="data-ln-number",i="lnNumber";if(window[i]!==void 0)return;const u={},p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function g(t){if(!u[t]){const a=new Intl.NumberFormat(t,{useGrouping:!0}),e=a.formatToParts(1234.5);let c="",r=".";for(let n=0;n<e.length;n++)e[n].type==="group"&&(c=e[n].value),e[n].type==="decimal"&&(r=e[n].value);u[t]={fmt:a,groupSep:c,decimalSep:r}}return u[t]}function y(t,a,e){if(e!==null){const c=parseInt(e,10),r=t+"|d"+c;return u[r]||(u[r]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:c})),u[r].format(a)}return g(t).fmt.format(a)}function m(t){if(t.tagName!=="INPUT")return console.warn("[ln-number] Can only be applied to <input>, got:",t.tagName),this;if(t[i])return t[i];t[i]=this,this.dom=t;const a=document.createElement("input");a.type="hidden",a.name=t.name,t.removeAttribute("name"),t.type="text",t.setAttribute("inputmode","decimal"),t.insertAdjacentElement("afterend",a),this._hidden=a;const e=this;Object.defineProperty(a,"value",{get:function(){return p.get.call(a)},set:function(r){if(p.set.call(a,r),r!==""&&!isNaN(parseFloat(r))){const n=parseFloat(r);e._displayFormatted(n),v(e.dom,"ln-number:input",{value:n,formatted:e.dom.value}),e.dom.dispatchEvent(new Event("input",{bubbles:!0}))}else r===""&&(e.dom.value="",v(e.dom,"ln-number:input",{value:NaN,formatted:""}),e.dom.dispatchEvent(new Event("input",{bubbles:!0})))}}),O(t,p,{get:function(){return p.get.call(t)},set:function(r,n){if(e._isFormatting){n(r);return}if(r===""){n(""),e._setHiddenRaw(""),v(t,"ln-number:input",{value:NaN,formatted:""}),t.dispatchEvent(new Event("input",{bubbles:!0}));return}let o=typeof r=="number"?r:parseFloat(String(r).replace(/[^\d.-]/g,""));if(isNaN(o))n(String(r)),e._setHiddenRaw(""),v(t,"ln-number:input",{value:NaN,formatted:String(r)}),t.dispatchEvent(new Event("input",{bubbles:!0}));else{e._setHiddenRaw(o);const l=y(E(t),o,t.getAttribute("data-ln-number-decimals"));n(l),v(t,"ln-number:input",{value:o,formatted:l}),t.dispatchEvent(new Event("input",{bubbles:!0}))}}}),this._onInput=function(){e._handleInput()},t.addEventListener("input",this._onInput),this._onPaste=function(r){r.preventDefault();const n=(r.clipboardData||window.clipboardData).getData("text"),o=g(E(t)),l=o.decimalSep.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");let f=n.replace(new RegExp("[^0-9\\-"+l+".]","g"),"");o.groupSep&&(f=f.split(o.groupSep).join("")),o.decimalSep!=="."&&(f=f.replace(o.decimalSep,"."));const _=parseFloat(f);isNaN(_)?(t.value="",e._hidden.value=""):e.value=_},t.addEventListener("paste",this._onPaste);const c=t.value;if(c!==""){const r=parseFloat(c);isNaN(r)||(this._displayFormatted(r),p.set.call(a,String(r)),v(t,"ln-number:input",{value:r,formatted:t.value}),t.dispatchEvent(new Event("input",{bubbles:!0})))}return this}m.prototype._handleInput=function(){const t=this.dom,a=g(E(t)),e=t.value;if(e===""){this._hidden.value="",v(t,"ln-number:input",{value:NaN,formatted:""});return}if(e==="-"){this._hidden.value="";return}const c=t.selectionStart;let r=0;for(let d=0;d<c;d++)/[0-9]/.test(e[d])&&r++;let n=e;if(a.groupSep&&(n=n.split(a.groupSep).join("")),n=n.replace(a.decimalSep,"."),e.endsWith(a.decimalSep)||e.endsWith(".")){const d=n.replace(/\.$/,""),w=parseFloat(d);isNaN(w)||this._setHiddenRaw(w);return}const o=n.indexOf(".");if(o!==-1&&n.slice(o+1).endsWith("0")){const w=parseFloat(n);isNaN(w)||this._setHiddenRaw(w);return}const l=t.getAttribute("data-ln-number-decimals");if(l!==null&&o!==-1){const d=parseInt(l,10);n.slice(o+1).length>d&&(n=n.slice(0,o+1+d))}const f=parseFloat(n);if(isNaN(f))return;const _=t.getAttribute("data-ln-number-min"),F=t.getAttribute("data-ln-number-max");if(_!==null&&f<parseFloat(_)||F!==null&&f>parseFloat(F))return;let b;if(l!==null)b=y(E(t),f,l);else{const d=o!==-1?n.slice(o+1).length:0;if(d>0){const w=E(t)+"|u"+d;u[w]||(u[w]=new Intl.NumberFormat(E(t),{useGrouping:!0,minimumFractionDigits:d,maximumFractionDigits:d})),b=u[w].format(f)}else b=a.fmt.format(f)}t.value=b;let D=r,N=0;for(let d=0;d<b.length&&D>0;d++)N=d+1,/[0-9]/.test(b[d])&&D--;D>0&&(N=b.length),t.setSelectionRange(N,N),this._setHiddenRaw(f),v(t,"ln-number:input",{value:f,formatted:b})},m.prototype._setHiddenRaw=function(t){p.set.call(this._hidden,String(t))},m.prototype._displayFormatted=function(t){this._isFormatting=!0,this.dom.value=y(E(this.dom),t,this.dom.getAttribute("data-ln-number-decimals")),this._isFormatting=!1},Object.defineProperty(m.prototype,"value",{get:function(){const t=this._hidden.value;return t===""?NaN:parseFloat(t)},set:function(t){if(typeof t!="number"||isNaN(t)){this.dom.value="",this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._displayFormatted(t),this._setHiddenRaw(t),v(this.dom,"ln-number:input",{value:t,formatted:this.dom.value}),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(m.prototype,"formatted",{get:function(){return this.dom.value}}),m.prototype.destroy=function(){this.dom[i]&&(this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("paste",this._onPaste),this.dom.name=this._hidden.name,this.dom.type="number",this.dom.removeAttribute("inputmode"),this._hidden.remove(),v(this.dom,"ln-number:destroyed",{target:this.dom}),delete this.dom[i])};function h(){new MutationObserver(function(){const t=document.querySelectorAll("["+s+"]");for(let a=0;a<t.length;a++){const e=t[a][i];e&&!isNaN(e.value)&&e._displayFormatted(e.value)}}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]})}I(s,i,m,"ln-number"),h()})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function A(t,e,r){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r||{}}))}function E(t,e,r){const g=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r||{}});return t.dispatchEvent(g),g}function x(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function O(t,e,r,g){if(t.nodeType!==1)return;const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",m=Array.from(t.querySelectorAll(f));t.matches&&t.matches(f)&&m.push(t);for(const d of m)d[r]||(d[r]=new g(d))}function I(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function k(t,e,r,g,u={}){const f=u.extraAttributes||[],m=u.onAttributeChange||null,d=u.onInit||null;function l(y){const i=y||document.body;O(i,t,e,r),d&&d(i)}return x(function(){const y=new MutationObserver(function(s){for(let a=0;a<s.length;a++){const n=s[a];if(n.type==="childList"){for(let o=0;o<n.addedNodes.length;o++){const p=n.addedNodes[o];p.nodeType===1&&(O(p,t,e,r),d&&d(p))}for(let o=0;o<n.removedNodes.length;o++){const p=n.removedNodes[o];if(p.nodeType===1){const h=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",b=Array.from(p.querySelectorAll(h));p.matches&&p.matches(h)&&b.push(p);for(let c=0;c<b.length;c++){const v=b[c][e];v&&typeof v.destroy=="function"&&v.destroy()}}}}else n.type==="attributes"&&(m&&n.target[e]?m(n.target,n.attributeName):(O(n.target,t,e,r),d&&d(n.target)))}});let i=[];if(t.indexOf("[")!==-1){const s=/\[([\w-]+)/g;let a;for(;(a=s.exec(t))!==null;)i.push(a[1])}else i.push(t);y.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.concat(f)})},g||(t.indexOf("[")===-1?t.replace("data-",""):"component")),window[e]=l,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body),l}const L={};function R(t,e){L[t]=e}function N(t){return L[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=N);function T(t,e,r,g){const u=g,f=window.innerWidth,m=window.innerHeight,d=e.width,l=e.height,y=(r||"bottom").split("-"),i=y[0],s=y[1]==="start"||y[1]==="end"?y[1]:"center",a={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},n=a[i]||a.bottom;function o(c){return c==="top"||c==="bottom"?s==="start"?t.left:s==="end"?t.right-d:t.left+(t.width-d)/2:s==="start"?t.top:s==="end"?t.bottom-l:t.top+(t.height-l)/2}function p(c){let v,C,w=!0;return c==="top"?(v=t.top-u-l,C=o(c),v<0&&(w=!1)):c==="bottom"?(v=t.bottom+u,C=o(c),v+l>m&&(w=!1)):c==="left"?(v=o(c),C=t.left-u-d,C<0&&(w=!1)):(v=o(c),C=t.right+u,C+d>f&&(w=!1)),{top:v,left:C,side:c,fits:w}}let _=null;for(let c=0;c<n.length;c++){const v=p(n[c]);if(v.fits){_=v;break}}_||(_=p(n[0]));let h=_.top,b=_.left;return d>=f?b=0:(b<0&&(b=0),b+d>f&&(b=f-d)),l>=m?h=0:(h<0&&(h=0),h+l>m&&(h=m-l)),{top:h,left:b,placement:_.side}}function M(t){if(!t||t.parentNode===document.body)return function(){};const e=t.parentNode,r=document.createComment("ln-teleport");return e.insertBefore(r,t),document.body.appendChild(t),function(){r.parentNode&&(r.parentNode.insertBefore(t,r),r.parentNode.removeChild(r))}}function D(t){if(!t)return{width:0,height:0};const e=t.style,r=e.visibility,g=e.display,u=e.position;e.visibility="hidden",e.display="block",e.position="fixed";const f=t.offsetWidth,m=t.offsetHeight;return e.visibility=r,e.display=g,e.position=u,{width:f,height:m}}(function(){const t="data-ln-popover",e="lnPopover",r="data-ln-popover-for",g="data-ln-popover-position";if(window[e]!==void 0)return;const u=[];let f=null;function m(){f||(f=function(i){if(i.key!=="Escape"||u.length===0)return;u[u.length-1].close()},document.addEventListener("keydown",f))}function d(){u.length>0||f&&(document.removeEventListener("keydown",f),f=null)}function l(i){return this.dom=i,this.isOpen=i.getAttribute(t)==="open",this.trigger=null,this._teleportRestore=null,this._previousFocus=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundReposition=null,i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.hasAttribute("role")||i.setAttribute("role","dialog"),this.isOpen&&this._applyOpen(null),this}l.prototype.open=function(i){this.isOpen||(this.trigger=i||null,this.dom.setAttribute(t,"open"))},l.prototype.close=function(){this.isOpen&&this.dom.setAttribute(t,"closed")},l.prototype.toggle=function(i){this.isOpen?this.close():this.open(i)},l.prototype._applyOpen=function(i){this.isOpen=!0,i&&(this.trigger=i),this._previousFocus=document.activeElement,this._teleportRestore=M(this.dom);const s=D(this.dom);if(this.trigger){const p=this.trigger.getBoundingClientRect(),_=this.dom.getAttribute(g)||"bottom",h=T(p,s,_,8);this.dom.style.top=h.top+"px",this.dom.style.left=h.left+"px",this.dom.setAttribute("data-ln-popover-placement",h.placement),this.trigger.setAttribute("aria-expanded","true")}const a=this.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),n=Array.prototype.find.call(a,I);n?n.focus():this.dom.focus();const o=this;this._boundDocClick=function(p){o.dom.contains(p.target)||o.trigger&&o.trigger.contains(p.target)||o.close()},o._docClickTimeout=setTimeout(function(){o._docClickTimeout=null,document.addEventListener("click",o._boundDocClick)},0),this._boundReposition=function(){if(!o.trigger)return;const p=o.trigger.getBoundingClientRect(),_=D(o.dom),h=o.dom.getAttribute(g)||"bottom",b=T(p,_,h,8);o.dom.style.top=b.top+"px",o.dom.style.left=b.left+"px",o.dom.setAttribute("data-ln-popover-placement",b.placement)},window.addEventListener("scroll",this._boundReposition,{passive:!0,capture:!0}),window.addEventListener("resize",this._boundReposition),u.push(this),m(),A(this.dom,"ln-popover:open",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger})},l.prototype._applyClose=function(){this.isOpen=!1,this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null),this._boundReposition&&(window.removeEventListener("scroll",this._boundReposition,{capture:!0}),window.removeEventListener("resize",this._boundReposition),this._boundReposition=null),this.dom.style.top="",this.dom.style.left="",this.dom.removeAttribute("data-ln-popover-placement"),this.trigger&&this.trigger.setAttribute("aria-expanded","false"),this._teleportRestore&&(this._teleportRestore(),this._teleportRestore=null);const i=u.indexOf(this);i!==-1&&u.splice(i,1),d(),this._previousFocus&&this.trigger&&this._previousFocus===this.trigger?this.trigger.focus():this.trigger&&document.activeElement===document.body&&this.trigger.focus(),this._previousFocus=null,A(this.dom,"ln-popover:close",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger}),this.trigger=null},l.prototype.destroy=function(){this.dom[e]&&(this.isOpen&&this._applyClose(),delete this.dom[e],A(this.dom,"ln-popover:destroyed",{popoverId:this.dom.id,target:this.dom}))};function y(i){this.dom=i;const s=i.getAttribute(r);return i.setAttribute("aria-haspopup","dialog"),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",s),this._onClick=function(a){if(a.ctrlKey||a.metaKey||a.button===1)return;a.preventDefault();const n=document.getElementById(s);!n||!n[e]||n[e].toggle(i)},i.addEventListener("click",this._onClick),this}y.prototype.destroy=function(){this.dom.removeEventListener("click",this._onClick),delete this.dom[e+"Trigger"]},k(t,e,l,"ln-popover",{onAttributeChange:function(i){const s=i[e];if(!s)return;const n=i.getAttribute(t)==="open";if(n!==s.isOpen)if(n){if(E(i,"ln-popover:before-open",{popoverId:i.id,target:i,trigger:s.trigger}).defaultPrevented){i.setAttribute(t,"closed");return}s._applyOpen(s.trigger)}else{if(E(i,"ln-popover:before-close",{popoverId:i.id,target:i,trigger:s.trigger}).defaultPrevented){i.setAttribute(t,"open");return}s._applyClose()}}}),k(r,e+"Trigger",y,"ln-popover-trigger")})()})();
1
+ (function(){"use strict";function A(t,e,r){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r||{}}))}function E(t,e,r){const g=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r||{}});return t.dispatchEvent(g),g}function x(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function O(t,e,r,g){if(t.nodeType!==1)return;const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",m=Array.from(t.querySelectorAll(f));t.matches&&t.matches(f)&&m.push(t);for(const d of m)d[r]||(d[r]=new g(d))}function I(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function k(t,e,r,g,u={}){const f=u.extraAttributes||[],m=u.onAttributeChange||null,d=u.onInit||null;function l(y){const i=y||document.body;O(i,t,e,r),d&&d(i)}return x(function(){const y=new MutationObserver(function(s){for(let a=0;a<s.length;a++){const n=s[a];if(n.type==="childList"){for(let o=0;o<n.addedNodes.length;o++){const p=n.addedNodes[o];p.nodeType===1&&(O(p,t,e,r),d&&d(p))}for(let o=0;o<n.removedNodes.length;o++){const p=n.removedNodes[o];if(p.nodeType===1){const h=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",b=Array.from(p.querySelectorAll(h));p.matches&&p.matches(h)&&b.push(p);for(let c=0;c<b.length;c++){const v=b[c];if(!document.contains(v)){const C=v[e];C&&typeof C.destroy=="function"&&C.destroy()}}}}}else n.type==="attributes"&&(m&&n.target[e]?m(n.target,n.attributeName):(O(n.target,t,e,r),d&&d(n.target)))}});let i=[];if(t.indexOf("[")!==-1){const s=/\[([\w-]+)/g;let a;for(;(a=s.exec(t))!==null;)i.push(a[1])}else i.push(t);y.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.concat(f)})},g||(t.indexOf("[")===-1?t.replace("data-",""):"component")),window[e]=l,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body),l}const L={};function R(t,e){L[t]=e}function N(t){return L[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=N);function T(t,e,r,g){const u=g,f=window.innerWidth,m=window.innerHeight,d=e.width,l=e.height,y=(r||"bottom").split("-"),i=y[0],s=y[1]==="start"||y[1]==="end"?y[1]:"center",a={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},n=a[i]||a.bottom;function o(c){return c==="top"||c==="bottom"?s==="start"?t.left:s==="end"?t.right-d:t.left+(t.width-d)/2:s==="start"?t.top:s==="end"?t.bottom-l:t.top+(t.height-l)/2}function p(c){let v,C,w=!0;return c==="top"?(v=t.top-u-l,C=o(c),v<0&&(w=!1)):c==="bottom"?(v=t.bottom+u,C=o(c),v+l>m&&(w=!1)):c==="left"?(v=o(c),C=t.left-u-d,C<0&&(w=!1)):(v=o(c),C=t.right+u,C+d>f&&(w=!1)),{top:v,left:C,side:c,fits:w}}let _=null;for(let c=0;c<n.length;c++){const v=p(n[c]);if(v.fits){_=v;break}}_||(_=p(n[0]));let h=_.top,b=_.left;return d>=f?b=0:(b<0&&(b=0),b+d>f&&(b=f-d)),l>=m?h=0:(h<0&&(h=0),h+l>m&&(h=m-l)),{top:h,left:b,placement:_.side}}function M(t){if(!t||t.parentNode===document.body)return function(){};const e=t.parentNode,r=document.createComment("ln-teleport");return e.insertBefore(r,t),document.body.appendChild(t),function(){r.parentNode&&(r.parentNode.insertBefore(t,r),r.parentNode.removeChild(r))}}function D(t){if(!t)return{width:0,height:0};const e=t.style,r=e.visibility,g=e.display,u=e.position;e.visibility="hidden",e.display="block",e.position="fixed";const f=t.offsetWidth,m=t.offsetHeight;return e.visibility=r,e.display=g,e.position=u,{width:f,height:m}}(function(){const t="data-ln-popover",e="lnPopover",r="data-ln-popover-for",g="data-ln-popover-position";if(window[e]!==void 0)return;const u=[];let f=null;function m(){f||(f=function(i){if(i.key!=="Escape"||u.length===0)return;u[u.length-1].close()},document.addEventListener("keydown",f))}function d(){u.length>0||f&&(document.removeEventListener("keydown",f),f=null)}function l(i){return this.dom=i,this.isOpen=i.getAttribute(t)==="open",this.trigger=null,this._teleportRestore=null,this._previousFocus=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundReposition=null,i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.hasAttribute("role")||i.setAttribute("role","dialog"),this.isOpen&&this._applyOpen(null),this}l.prototype.open=function(i){this.isOpen||(this.trigger=i||null,this.dom.setAttribute(t,"open"))},l.prototype.close=function(){this.isOpen&&this.dom.setAttribute(t,"closed")},l.prototype.toggle=function(i){this.isOpen?this.close():this.open(i)},l.prototype._applyOpen=function(i){this.isOpen=!0,i&&(this.trigger=i),this._previousFocus=document.activeElement,this._teleportRestore=M(this.dom);const s=D(this.dom);if(this.trigger){const p=this.trigger.getBoundingClientRect(),_=this.dom.getAttribute(g)||"bottom",h=T(p,s,_,8);this.dom.style.top=h.top+"px",this.dom.style.left=h.left+"px",this.dom.setAttribute("data-ln-popover-placement",h.placement),this.trigger.setAttribute("aria-expanded","true")}const a=this.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),n=Array.prototype.find.call(a,I);n?n.focus():this.dom.focus();const o=this;this._boundDocClick=function(p){o.dom.contains(p.target)||o.trigger&&o.trigger.contains(p.target)||o.close()},o._docClickTimeout=setTimeout(function(){o._docClickTimeout=null,document.addEventListener("click",o._boundDocClick)},0),this._boundReposition=function(){if(!o.trigger)return;const p=o.trigger.getBoundingClientRect(),_=D(o.dom),h=o.dom.getAttribute(g)||"bottom",b=T(p,_,h,8);o.dom.style.top=b.top+"px",o.dom.style.left=b.left+"px",o.dom.setAttribute("data-ln-popover-placement",b.placement)},window.addEventListener("scroll",this._boundReposition,{passive:!0,capture:!0}),window.addEventListener("resize",this._boundReposition),u.push(this),m(),A(this.dom,"ln-popover:open",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger})},l.prototype._applyClose=function(){this.isOpen=!1,this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null),this._boundReposition&&(window.removeEventListener("scroll",this._boundReposition,{capture:!0}),window.removeEventListener("resize",this._boundReposition),this._boundReposition=null),this.dom.style.top="",this.dom.style.left="",this.dom.removeAttribute("data-ln-popover-placement"),this.trigger&&this.trigger.setAttribute("aria-expanded","false"),this._teleportRestore&&(this._teleportRestore(),this._teleportRestore=null);const i=u.indexOf(this);i!==-1&&u.splice(i,1),d(),this._previousFocus&&this.trigger&&this._previousFocus===this.trigger?this.trigger.focus():this.trigger&&document.activeElement===document.body&&this.trigger.focus(),this._previousFocus=null,A(this.dom,"ln-popover:close",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger}),this.trigger=null},l.prototype.destroy=function(){this.dom[e]&&(this.isOpen&&this._applyClose(),delete this.dom[e],A(this.dom,"ln-popover:destroyed",{popoverId:this.dom.id,target:this.dom}))};function y(i){this.dom=i;const s=i.getAttribute(r);return i.setAttribute("aria-haspopup","dialog"),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",s),this._onClick=function(a){if(a.ctrlKey||a.metaKey||a.button===1)return;a.preventDefault();const n=document.getElementById(s);!n||!n[e]||n[e].toggle(i)},i.addEventListener("click",this._onClick),this}y.prototype.destroy=function(){this.dom.removeEventListener("click",this._onClick),delete this.dom[e+"Trigger"]},k(t,e,l,"ln-popover",{onAttributeChange:function(i){const s=i[e];if(!s)return;const n=i.getAttribute(t)==="open";if(n!==s.isOpen)if(n){if(E(i,"ln-popover:before-open",{popoverId:i.id,target:i,trigger:s.trigger}).defaultPrevented){i.setAttribute(t,"closed");return}s._applyOpen(s.trigger)}else{if(E(i,"ln-popover:before-close",{popoverId:i.id,target:i,trigger:s.trigger}).defaultPrevented){i.setAttribute(t,"open");return}s._applyClose()}}}),k(r,e+"Trigger",y,"ln-popover-trigger")})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function A(t,e,r){const u=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r||{}});return t.dispatchEvent(u),u}function v(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function y(t,e,r,u){if(t.nodeType!==1)return;const c=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",n=Array.from(t.querySelectorAll(c));t.matches&&t.matches(c)&&n.push(t);for(const i of n)i[r]||(i[r]=new u(i))}function T(t,e,r,u,m={}){const c=m.extraAttributes||[],n=m.onAttributeChange||null,i=m.onInit||null;function d(f){const s=f||document.body;y(s,t,e,r),i&&i(s)}return v(function(){const f=new MutationObserver(function(l){for(let p=0;p<l.length;p++){const o=l[p];if(o.type==="childList"){for(let h=0;h<o.addedNodes.length;h++){const a=o.addedNodes[h];a.nodeType===1&&(y(a,t,e,r),i&&i(a))}for(let h=0;h<o.removedNodes.length;h++){const a=o.removedNodes[h];if(a.nodeType===1){const w=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",g=Array.from(a.querySelectorAll(w));a.matches&&a.matches(w)&&g.push(a);for(let b=0;b<g.length;b++){const _=g[b][e];_&&typeof _.destroy=="function"&&_.destroy()}}}}else o.type==="attributes"&&(n&&o.target[e]?n(o.target,o.attributeName):(y(o.target,t,e,r),i&&i(o.target)))}});let s=[];if(t.indexOf("[")!==-1){const l=/\[([\w-]+)/g;let p;for(;(p=l.exec(t))!==null;)s.push(p[1])}else s.push(t);f.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:s.concat(c)})},u),window[e]=d,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){d(document.body)}):d(document.body),d}const C={};function E(t,e){C[t]=e}function x(t){return C[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=E,window.lnCore.getDataMapper=x),(function(){const t="data-ln-search",e="lnSearch",r="data-ln-search-initialized",u="data-ln-search-hide";if(window[e]!==void 0)return;function c(n){if(n.hasAttribute(r))return this;this.dom=n,this.targetId=n.getAttribute(t);const i=n.tagName;if(this.input=i==="INPUT"||i==="TEXTAREA"?n:n.querySelector('[name="search"]')||n.querySelector('input[type="search"]')||n.querySelector('input[type="text"]'),this.itemsSelector=n.getAttribute("data-ln-search-items")||null,this._debounceTimer=null,this._attachHandler(),this.input&&this.input.value.trim()){const d=this;queueMicrotask(function(){d._search(d.input.value.trim().toLowerCase())})}return n.setAttribute(r,""),this}c.prototype._attachHandler=function(){if(!this.input)return;const n=this;this._clearBtn=this.dom.querySelector("[data-ln-search-clear]"),this._clearBtn&&(this._onClear=function(){n.input.value="",n._search(""),n.input.focus()},this._clearBtn.addEventListener("click",this._onClear)),this._onInput=function(){clearTimeout(n._debounceTimer),n._debounceTimer=setTimeout(function(){n._search(n.input.value.trim().toLowerCase())},150)},this.input.addEventListener("input",this._onInput)},c.prototype._search=function(n){const i=document.getElementById(this.targetId);if(!i||A(i,"ln-search:change",{term:n,targetId:this.targetId}).defaultPrevented)return;const f=this.itemsSelector?i.querySelectorAll(this.itemsSelector):i.children;for(let s=0;s<f.length;s++){const l=f[s];l.removeAttribute(u),n&&!l.textContent.replace(/\s+/g," ").toLowerCase().includes(n)&&l.setAttribute(u,"true")}},c.prototype.destroy=function(){this.dom[e]&&(clearTimeout(this._debounceTimer),this.input&&this._onInput&&this.input.removeEventListener("input",this._onInput),this._clearBtn&&this._onClear&&this._clearBtn.removeEventListener("click",this._onClear),this.dom.removeAttribute(r),delete this.dom[e])},T(t,e,c,"ln-search")})()})();
1
+ (function(){"use strict";function T(t,e,r){const u=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r||{}});return t.dispatchEvent(u),u}function v(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function y(t,e,r,u){if(t.nodeType!==1)return;const c=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",n=Array.from(t.querySelectorAll(c));t.matches&&t.matches(c)&&n.push(t);for(const i of n)i[r]||(i[r]=new u(i))}function E(t,e,r,u,m={}){const c=m.extraAttributes||[],n=m.onAttributeChange||null,i=m.onInit||null;function d(f){const s=f||document.body;y(s,t,e,r),i&&i(s)}return v(function(){const f=new MutationObserver(function(l){for(let p=0;p<l.length;p++){const o=l[p];if(o.type==="childList"){for(let h=0;h<o.addedNodes.length;h++){const a=o.addedNodes[h];a.nodeType===1&&(y(a,t,e,r),i&&i(a))}for(let h=0;h<o.removedNodes.length;h++){const a=o.removedNodes[h];if(a.nodeType===1){const w=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",g=Array.from(a.querySelectorAll(w));a.matches&&a.matches(w)&&g.push(a);for(let b=0;b<g.length;b++){const A=g[b];if(!document.contains(A)){const _=A[e];_&&typeof _.destroy=="function"&&_.destroy()}}}}}else o.type==="attributes"&&(n&&o.target[e]?n(o.target,o.attributeName):(y(o.target,t,e,r),i&&i(o.target)))}});let s=[];if(t.indexOf("[")!==-1){const l=/\[([\w-]+)/g;let p;for(;(p=l.exec(t))!==null;)s.push(p[1])}else s.push(t);f.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:s.concat(c)})},u),window[e]=d,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){d(document.body)}):d(document.body),d}const C={};function x(t,e){C[t]=e}function I(t){return C[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=x,window.lnCore.getDataMapper=I),(function(){const t="data-ln-search",e="lnSearch",r="data-ln-search-initialized",u="data-ln-search-hide";if(window[e]!==void 0)return;function c(n){if(n.hasAttribute(r))return this;this.dom=n,this.targetId=n.getAttribute(t);const i=n.tagName;if(this.input=i==="INPUT"||i==="TEXTAREA"?n:n.querySelector('[name="search"]')||n.querySelector('input[type="search"]')||n.querySelector('input[type="text"]'),this.itemsSelector=n.getAttribute("data-ln-search-items")||null,this._debounceTimer=null,this._attachHandler(),this.input&&this.input.value.trim()){const d=this;queueMicrotask(function(){d._search(d.input.value.trim().toLowerCase())})}return n.setAttribute(r,""),this}c.prototype._attachHandler=function(){if(!this.input)return;const n=this;this._clearBtn=this.dom.querySelector("[data-ln-search-clear]"),this._clearBtn&&(this._onClear=function(){n.input.value="",n._search(""),n.input.focus()},this._clearBtn.addEventListener("click",this._onClear)),this._onInput=function(){clearTimeout(n._debounceTimer),n._debounceTimer=setTimeout(function(){n._search(n.input.value.trim().toLowerCase())},150)},this.input.addEventListener("input",this._onInput)},c.prototype._search=function(n){const i=document.getElementById(this.targetId);if(!i||T(i,"ln-search:change",{term:n,targetId:this.targetId}).defaultPrevented)return;const f=this.itemsSelector?i.querySelectorAll(this.itemsSelector):i.children;for(let s=0;s<f.length;s++){const l=f[s];l.removeAttribute(u),n&&!l.textContent.replace(/\s+/g," ").toLowerCase().includes(n)&&l.setAttribute(u,"true")}},c.prototype.destroy=function(){this.dom[e]&&(clearTimeout(this._debounceTimer),this.input&&this._onInput&&this.input.removeEventListener("input",this._onInput),this._clearBtn&&this._onClear&&this._clearBtn.removeEventListener("click",this._onClear),this.dom.removeAttribute(r),delete this.dom[e])},E(t,e,c,"ln-search")})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function p(n,o,f){n.dispatchEvent(new CustomEvent(o,{bubbles:!0,detail:f||{}}))}function A(n,o,f){const a=new CustomEvent(o,{bubbles:!0,cancelable:!0,detail:f||{}});return n.dispatchEvent(a),a}function w(n,o){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(n,o)}),console.warn("["+o+'] Script loaded before <body> — add "defer" to your <script> tag');return}n()}function g(n,o,f,a){if(n.nodeType!==1)return;const i=o.indexOf("[")!==-1||o.indexOf(".")!==-1||o.indexOf("#")!==-1?o:"["+o+"]",t=Array.from(n.querySelectorAll(i));n.matches&&n.matches(i)&&t.push(n);for(const e of t)e[f]||(e[f]=new a(e))}function _(n,o,f,a,m={}){const i=m.extraAttributes||[],t=m.onAttributeChange||null,e=m.onInit||null;function l(r){const c=r||document.body;g(c,n,o,f),e&&e(c)}return w(function(){const r=new MutationObserver(function(d){for(let u=0;u<d.length;u++){const s=d[u];if(s.type==="childList"){for(let h=0;h<s.addedNodes.length;h++){const b=s.addedNodes[h];b.nodeType===1&&(g(b,n,o,f),e&&e(b))}for(let h=0;h<s.removedNodes.length;h++){const b=s.removedNodes[h];if(b.nodeType===1){const x=n.indexOf("[")!==-1||n.indexOf(".")!==-1||n.indexOf("#")!==-1?n:"["+n+"]",v=Array.from(b.querySelectorAll(x));b.matches&&b.matches(x)&&v.push(b);for(let y=0;y<v.length;y++){const E=v[y][o];E&&typeof E.destroy=="function"&&E.destroy()}}}}else s.type==="attributes"&&(t&&s.target[o]?t(s.target,s.attributeName):(g(s.target,n,o,f),e&&e(s.target)))}});let c=[];if(n.indexOf("[")!==-1){const d=/\[([\w-]+)/g;let u;for(;(u=d.exec(n))!==null;)c.push(u[1])}else c.push(n);r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:c.concat(i)})},a),window[o]=l,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body),l}const L={};function C(n,o){L[n]=o}function O(n){return L[n]||{ingress:o=>o,egress:o=>o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=C,window.lnCore.getDataMapper=O),(function(){const n="data-ln-sortable",o="lnSortable",f="data-ln-sortable-handle";if(window[o]!==void 0)return;function a(i){this.dom=i,this.isEnabled=i.getAttribute(n)!=="disabled",this._dragging=null,i.setAttribute("aria-roledescription","sortable list");const t=this;return this._onPointerDown=function(e){t.isEnabled&&t._handlePointerDown(e)},i.addEventListener("pointerdown",this._onPointerDown),this}a.prototype.enable=function(){this.isEnabled||this.dom.setAttribute(n,"")},a.prototype.disable=function(){this.isEnabled&&this.dom.setAttribute(n,"disabled")},a.prototype.destroy=function(){this.dom[o]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),p(this.dom,"ln-sortable:destroyed",{target:this.dom}),delete this.dom[o])},a.prototype._handlePointerDown=function(i){let t=i.target.closest("["+f+"]"),e;if(t){for(e=t;e&&e.parentElement!==this.dom;)e=e.parentElement;if(!e||e.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+f+"]"))return;for(e=i.target;e&&e.parentElement!==this.dom;)e=e.parentElement;if(!e||e.parentElement!==this.dom)return;t=e}const r=Array.from(this.dom.children).indexOf(e);if(A(this.dom,"ln-sortable:before-drag",{item:e,index:r}).defaultPrevented)return;i.preventDefault(),t.setPointerCapture(i.pointerId),this._dragging=e,e.classList.add("ln-sortable--dragging"),e.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),p(this.dom,"ln-sortable:drag-start",{item:e,index:r});const d=this,u=function(h){d._handlePointerMove(h)},s=function(h){d._handlePointerEnd(h),t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",s),t.removeEventListener("pointercancel",s)};t.addEventListener("pointermove",u),t.addEventListener("pointerup",s),t.addEventListener("pointercancel",s)},a.prototype._handlePointerMove=function(i){if(!this._dragging)return;const t=Array.from(this.dom.children),e=this._dragging;for(const l of t)l.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const l of t){if(l===e)continue;const r=l.getBoundingClientRect(),c=r.top+r.height/2;if(i.clientY>=r.top&&i.clientY<c){l.classList.add("ln-sortable--drop-before");break}else if(i.clientY>=c&&i.clientY<=r.bottom){l.classList.add("ln-sortable--drop-after");break}}},a.prototype._handlePointerEnd=function(i){if(!this._dragging)return;const t=this._dragging,e=Array.from(this.dom.children),l=e.indexOf(t);let r=null,c=null;for(const d of e){if(d.classList.contains("ln-sortable--drop-before")){r=d,c="before";break}if(d.classList.contains("ln-sortable--drop-after")){r=d,c="after";break}}for(const d of e)d.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(t.classList.remove("ln-sortable--dragging"),t.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),r&&r!==t){c==="before"?this.dom.insertBefore(t,r):this.dom.insertBefore(t,r.nextElementSibling);const u=Array.from(this.dom.children).indexOf(t);p(this.dom,"ln-sortable:reordered",{item:t,oldIndex:l,newIndex:u})}this._dragging=null};function m(i){const t=i[o];if(!t)return;const e=i.getAttribute(n)!=="disabled";e!==t.isEnabled&&(t.isEnabled=e,p(i,e?"ln-sortable:enabled":"ln-sortable:disabled",{target:i}))}_(n,o,a,"ln-sortable",{onAttributeChange:m})})()})();
1
+ (function(){"use strict";function p(n,o,f){n.dispatchEvent(new CustomEvent(o,{bubbles:!0,detail:f||{}}))}function _(n,o,f){const a=new CustomEvent(o,{bubbles:!0,cancelable:!0,detail:f||{}});return n.dispatchEvent(a),a}function w(n,o){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(n,o)}),console.warn("["+o+'] Script loaded before <body> — add "defer" to your <script> tag');return}n()}function g(n,o,f,a){if(n.nodeType!==1)return;const i=o.indexOf("[")!==-1||o.indexOf(".")!==-1||o.indexOf("#")!==-1?o:"["+o+"]",t=Array.from(n.querySelectorAll(i));n.matches&&n.matches(i)&&t.push(n);for(const e of t)e[f]||(e[f]=new a(e))}function C(n,o,f,a,m={}){const i=m.extraAttributes||[],t=m.onAttributeChange||null,e=m.onInit||null;function l(r){const c=r||document.body;g(c,n,o,f),e&&e(c)}return w(function(){const r=new MutationObserver(function(d){for(let u=0;u<d.length;u++){const s=d[u];if(s.type==="childList"){for(let h=0;h<s.addedNodes.length;h++){const b=s.addedNodes[h];b.nodeType===1&&(g(b,n,o,f),e&&e(b))}for(let h=0;h<s.removedNodes.length;h++){const b=s.removedNodes[h];if(b.nodeType===1){const x=n.indexOf("[")!==-1||n.indexOf(".")!==-1||n.indexOf("#")!==-1?n:"["+n+"]",v=Array.from(b.querySelectorAll(x));b.matches&&b.matches(x)&&v.push(b);for(let y=0;y<v.length;y++){const A=v[y];if(!document.contains(A)){const E=A[o];E&&typeof E.destroy=="function"&&E.destroy()}}}}}else s.type==="attributes"&&(t&&s.target[o]?t(s.target,s.attributeName):(g(s.target,n,o,f),e&&e(s.target)))}});let c=[];if(n.indexOf("[")!==-1){const d=/\[([\w-]+)/g;let u;for(;(u=d.exec(n))!==null;)c.push(u[1])}else c.push(n);r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:c.concat(i)})},a),window[o]=l,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body),l}const L={};function O(n,o){L[n]=o}function D(n){return L[n]||{ingress:o=>o,egress:o=>o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=O,window.lnCore.getDataMapper=D),(function(){const n="data-ln-sortable",o="lnSortable",f="data-ln-sortable-handle";if(window[o]!==void 0)return;function a(i){this.dom=i,this.isEnabled=i.getAttribute(n)!=="disabled",this._dragging=null,i.setAttribute("aria-roledescription","sortable list");const t=this;return this._onPointerDown=function(e){t.isEnabled&&t._handlePointerDown(e)},i.addEventListener("pointerdown",this._onPointerDown),this}a.prototype.enable=function(){this.isEnabled||this.dom.setAttribute(n,"")},a.prototype.disable=function(){this.isEnabled&&this.dom.setAttribute(n,"disabled")},a.prototype.destroy=function(){this.dom[o]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),p(this.dom,"ln-sortable:destroyed",{target:this.dom}),delete this.dom[o])},a.prototype._handlePointerDown=function(i){let t=i.target.closest("["+f+"]"),e;if(t){for(e=t;e&&e.parentElement!==this.dom;)e=e.parentElement;if(!e||e.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+f+"]"))return;for(e=i.target;e&&e.parentElement!==this.dom;)e=e.parentElement;if(!e||e.parentElement!==this.dom)return;t=e}const r=Array.from(this.dom.children).indexOf(e);if(_(this.dom,"ln-sortable:before-drag",{item:e,index:r}).defaultPrevented)return;i.preventDefault(),t.setPointerCapture(i.pointerId),this._dragging=e,e.classList.add("ln-sortable--dragging"),e.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),p(this.dom,"ln-sortable:drag-start",{item:e,index:r});const d=this,u=function(h){d._handlePointerMove(h)},s=function(h){d._handlePointerEnd(h),t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",s),t.removeEventListener("pointercancel",s)};t.addEventListener("pointermove",u),t.addEventListener("pointerup",s),t.addEventListener("pointercancel",s)},a.prototype._handlePointerMove=function(i){if(!this._dragging)return;const t=Array.from(this.dom.children),e=this._dragging;for(const l of t)l.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const l of t){if(l===e)continue;const r=l.getBoundingClientRect(),c=r.top+r.height/2;if(i.clientY>=r.top&&i.clientY<c){l.classList.add("ln-sortable--drop-before");break}else if(i.clientY>=c&&i.clientY<=r.bottom){l.classList.add("ln-sortable--drop-after");break}}},a.prototype._handlePointerEnd=function(i){if(!this._dragging)return;const t=this._dragging,e=Array.from(this.dom.children),l=e.indexOf(t);let r=null,c=null;for(const d of e){if(d.classList.contains("ln-sortable--drop-before")){r=d,c="before";break}if(d.classList.contains("ln-sortable--drop-after")){r=d,c="after";break}}for(const d of e)d.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(t.classList.remove("ln-sortable--dragging"),t.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),r&&r!==t){c==="before"?this.dom.insertBefore(t,r):this.dom.insertBefore(t,r.nextElementSibling);const u=Array.from(this.dom.children).indexOf(t);p(this.dom,"ln-sortable:reordered",{item:t,oldIndex:l,newIndex:u})}this._dragging=null};function m(i){const t=i[o];if(!t)return;const e=i.getAttribute(n)!=="disabled";e!==t.isEnabled&&(t.isEnabled=e,p(i,e?"ln-sortable:enabled":"ln-sortable:disabled",{target:i}))}C(n,o,a,"ln-sortable",{onAttributeChange:m})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function _(t,o,l){t.dispatchEvent(new CustomEvent(o,{bubbles:!0,detail:l||{}}))}function d(t,o){if(!document.body){document.addEventListener("DOMContentLoaded",function(){d(t,o)}),console.warn("["+o+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}const f={};function g(t,o){f[t]=o}function w(t){return f[t]||{ingress:o=>o,egress:o=>o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=g,window.lnCore.getDataMapper=w);const E="ln:";function S(){return location.pathname.replace(/\/+$/,"").toLowerCase()||"/"}function p(t,o){const l=o.getAttribute("data-ln-persist"),c=l!==null&&l!==""?l:o.id;return c?E+t+":"+S()+":"+c:(console.warn('[ln-persist] Element requires id or data-ln-persist="key"',o),null)}function v(t,o){const l=p(t,o);if(!l)return null;try{const c=localStorage.getItem(l);return c!==null?JSON.parse(c):null}catch{return null}}function b(t,o,l){const c=p(t,o);if(c)try{localStorage.setItem(c,JSON.stringify(l))}catch{}}(function(){const t="lnTableSort",o="data-ln-sort",l="data-ln-sort-active";if(window[t]!==void 0)return;function c(i){a(i)}function a(i){const r=Array.from(i.querySelectorAll("table"));i.tagName==="TABLE"&&r.push(i),r.forEach(function(e){if(e[t])return;const s=Array.from(e.querySelectorAll("th["+o+"]"));s.length&&(e[t]=new u(e,s))})}function h(i,r){i.querySelectorAll("[data-ln-sort-icon]").forEach(function(s){const n=s.getAttribute("data-ln-sort-icon");r==null?s.classList.toggle("hidden",n!==null&&n!==""):s.classList.toggle("hidden",n!==r)})}function u(i,r){this.table=i,this.ths=r,this._col=-1,this._dir=null;const e=this;r.forEach(function(n,m){n[t+"Bound"]||(n[t+"Bound"]=!0,n._lnSortClick=function(A){const y=A.target.closest("button, a, input, select, textarea, [data-ln-dropdown]");y&&y!==n||e._handleClick(m,n)},n.addEventListener("click",n._lnSortClick))});const s=i.closest("[data-ln-table][data-ln-persist]");if(s){const n=v("table-sort",s);n&&n.dir&&n.col>=0&&n.col<r.length&&(this._handleClick(n.col,r[n.col]),n.dir==="desc"&&this._handleClick(n.col,r[n.col]))}return this}u.prototype._handleClick=function(i,r){let e;this._col!==i?e="asc":this._dir==="asc"?e="desc":this._dir==="desc"?e=null:e="asc",this.ths.forEach(function(n){n.removeAttribute(l),h(n,null)}),e===null?(this._col=-1,this._dir=null):(this._col=i,this._dir=e,r.setAttribute(l,e),h(r,e)),_(this.table,"ln-table:sort",{column:i,sortType:r.getAttribute(o),direction:e});const s=this.table.closest("[data-ln-table][data-ln-persist]");s&&(e===null?b("table-sort",s,null):b("table-sort",s,{col:i,dir:e}))},u.prototype.destroy=function(){this.table[t]&&(this.ths.forEach(function(i){i._lnSortClick&&(i.removeEventListener("click",i._lnSortClick),delete i._lnSortClick),delete i[t+"Bound"]}),delete this.table[t])};function C(){d(function(){new MutationObserver(function(r){r.forEach(function(e){e.type==="childList"?e.addedNodes.forEach(function(s){s.nodeType===1&&a(s)}):e.type==="attributes"&&a(e.target)})}).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[o]})},"ln-table-sort")}window[t]=c,C(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){c(document.body)}):c(document.body)})()})();
1
+ (function(){"use strict";function y(t,e,s){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s||{}}))}function f(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){f(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}const h={};function _(t,e){h[t]=e}function w(t){return h[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=_,window.lnCore.getDataMapper=w);const g="ln:";function S(){return location.pathname.replace(/\/+$/,"").toLowerCase()||"/"}function p(t,e){const s=e.getAttribute("data-ln-persist"),l=s!==null&&s!==""?s:e.id;return l?g+t+":"+S()+":"+l:(console.warn('[ln-persist] Element requires id or data-ln-persist="key"',e),null)}function m(t,e){const s=p(t,e);if(!s)return null;try{const l=localStorage.getItem(s);return l!==null?JSON.parse(l):null}catch{return null}}function b(t,e,s){const l=p(t,e);if(l)try{localStorage.setItem(l,JSON.stringify(s))}catch{}}(function(){const t="lnTableSort",e="data-ln-sort",s="data-ln-table-sort";if(window[t]!==void 0)return;function l(o){a(o)}function a(o){const r=Array.from(o.querySelectorAll("table"));o.tagName==="TABLE"&&r.push(o),r.forEach(function(n){if(n[t])return;const c=Array.from(n.querySelectorAll("th["+e+"]"));c.length&&(n[t]=new u(n,c))})}function u(o,r){this.table=o,this.ths=r,this._col=-1,this._dir=null;const n=this;r.forEach(function(i,E){if(i[t+"Bound"])return;i[t+"Bound"]=!0;const d=i.querySelector("["+s+"]");d&&(d._lnSortClick=function(){n._handleClick(E,i)},d.addEventListener("click",d._lnSortClick))});const c=o.closest("[data-ln-table][data-ln-persist]");if(c){const i=m("table-sort",c);i&&i.dir&&i.col>=0&&i.col<r.length&&(this._handleClick(i.col,r[i.col]),i.dir==="desc"&&this._handleClick(i.col,r[i.col]))}return this}u.prototype._handleClick=function(o,r){let n;this._col!==o?n="asc":this._dir==="asc"?n="desc":this._dir==="desc"?n=null:n="asc",this.ths.forEach(function(i){i.classList.remove("ln-sort-asc","ln-sort-desc")}),n===null?(this._col=-1,this._dir=null):(this._col=o,this._dir=n,r.classList.add(n==="asc"?"ln-sort-asc":"ln-sort-desc")),y(this.table,"ln-table:sort",{column:o,sortType:r.getAttribute(e),direction:n});const c=this.table.closest("[data-ln-table][data-ln-persist]");c&&(n===null?b("table-sort",c,null):b("table-sort",c,{col:o,dir:n}))},u.prototype.destroy=function(){this.table[t]&&(this.ths.forEach(function(o){const r=o.querySelector("["+s+"]");r&&r._lnSortClick&&(r.removeEventListener("click",r._lnSortClick),delete r._lnSortClick),delete o[t+"Bound"]}),delete this.table[t])};function C(){f(function(){new MutationObserver(function(r){r.forEach(function(n){n.type==="childList"?n.addedNodes.forEach(function(c){c.nodeType===1&&a(c)}):n.type==="attributes"&&a(n.target)})}).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[e]})},"ln-table-sort")}window[t]=l,C(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body)})()})();