@livenetworks/ashlar 2.1.1 → 2.1.3
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.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autoresize/src/ln-autoresize.js +3 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/lifecycle.js +24 -12
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +22 -12
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-dropdown/src/ln-dropdown.js +18 -5
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +1 -1
- package/components/ln-filter/src/ln-filter.js +11 -10
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/src/ln-form.js +11 -0
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/src/ln-list.js +14 -5
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +21 -10
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-popover/src/ln-popover.js +22 -5
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +103 -103
- package/components/ln-search/src/ln-search.js +9 -5
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/src/ln-sortable.js +52 -7
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/src/ln-tabs.js +12 -8
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/src/ln-time.js +17 -7
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/src/ln-validate.js +21 -7
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
-
"component": "ln-search",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-search-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-hash": {
|
|
13
|
-
"direction": null,
|
|
14
|
-
"sources": [
|
|
15
|
-
"src/ln-search.js"
|
|
16
|
-
],
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "URL hash routing key for search state persistence"
|
|
19
|
-
},
|
|
20
|
-
"data-ln-list-source": {
|
|
21
|
-
"direction": "author",
|
|
22
|
-
"sources": [
|
|
23
|
-
"src/ln-search.js"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"data-ln-search": {
|
|
27
|
-
"direction": "both",
|
|
28
|
-
"sources": [
|
|
29
|
-
"ln-search-dev.scss",
|
|
30
|
-
"src/ln-search.js"
|
|
31
|
-
],
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "Active search query term on target element or container"
|
|
34
|
-
},
|
|
35
|
-
"data-ln-search-clear": {
|
|
36
|
-
"direction": "author",
|
|
37
|
-
"sources": [
|
|
38
|
-
"src/ln-search.js"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"data-ln-search-clear-for": {
|
|
42
|
-
"direction": "author",
|
|
43
|
-
"sources": [
|
|
44
|
-
"src/ln-search.js"
|
|
45
|
-
],
|
|
46
|
-
"type": "trigger",
|
|
47
|
-
"description": "Click trigger to clear search input for target"
|
|
48
|
-
},
|
|
49
|
-
"data-ln-search-exclude": {
|
|
50
|
-
"direction": "author",
|
|
51
|
-
"sources": [
|
|
52
|
-
"src/ln-search.js"
|
|
53
|
-
],
|
|
54
|
-
"type": "string",
|
|
55
|
-
"description": "CSS selector matching child items to exclude from search"
|
|
56
|
-
},
|
|
57
|
-
"data-ln-search-fields": {
|
|
58
|
-
"direction": "author",
|
|
59
|
-
"sources": [
|
|
60
|
-
"src/ln-search.js"
|
|
61
|
-
],
|
|
62
|
-
"type": "list",
|
|
63
|
-
"description": "Comma-separated field names to include in client search"
|
|
64
|
-
},
|
|
65
|
-
"data-ln-search-for": {
|
|
66
|
-
"direction": "author",
|
|
67
|
-
"sources": [
|
|
68
|
-
"ln-search-dev.scss",
|
|
69
|
-
"src/ln-search.js"
|
|
70
|
-
],
|
|
71
|
-
"type": "string",
|
|
72
|
-
"description": "Target table or list element ID that this input controls"
|
|
73
|
-
},
|
|
74
|
-
"data-ln-search-hide": {
|
|
75
|
-
"direction": "
|
|
76
|
-
"sources": [
|
|
77
|
-
"ln-search.scss",
|
|
78
|
-
"src/ln-search.js"
|
|
79
|
-
],
|
|
80
|
-
"type": "enum",
|
|
81
|
-
"values": [
|
|
82
|
-
"collapse",
|
|
83
|
-
"none"
|
|
84
|
-
],
|
|
85
|
-
"fallback": "collapse",
|
|
86
|
-
"description": "CSS hiding strategy for non-matching rows"
|
|
87
|
-
},
|
|
88
|
-
"data-ln-search-items": {
|
|
89
|
-
"direction": "author",
|
|
90
|
-
"sources": [
|
|
91
|
-
"src/ln-search.js"
|
|
92
|
-
],
|
|
93
|
-
"type": "string",
|
|
94
|
-
"description": "CSS selector matching searchable child items"
|
|
95
|
-
},
|
|
96
|
-
"data-ln-table-source": {
|
|
97
|
-
"direction": "author",
|
|
98
|
-
"sources": [
|
|
99
|
-
"src/ln-search.js"
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
+
"component": "ln-search",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-search-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-hash": {
|
|
13
|
+
"direction": null,
|
|
14
|
+
"sources": [
|
|
15
|
+
"src/ln-search.js"
|
|
16
|
+
],
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "URL hash routing key for search state persistence"
|
|
19
|
+
},
|
|
20
|
+
"data-ln-list-source": {
|
|
21
|
+
"direction": "author",
|
|
22
|
+
"sources": [
|
|
23
|
+
"src/ln-search.js"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"data-ln-search": {
|
|
27
|
+
"direction": "both",
|
|
28
|
+
"sources": [
|
|
29
|
+
"ln-search-dev.scss",
|
|
30
|
+
"src/ln-search.js"
|
|
31
|
+
],
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Active search query term on target element or container"
|
|
34
|
+
},
|
|
35
|
+
"data-ln-search-clear": {
|
|
36
|
+
"direction": "author",
|
|
37
|
+
"sources": [
|
|
38
|
+
"src/ln-search.js"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"data-ln-search-clear-for": {
|
|
42
|
+
"direction": "author",
|
|
43
|
+
"sources": [
|
|
44
|
+
"src/ln-search.js"
|
|
45
|
+
],
|
|
46
|
+
"type": "trigger",
|
|
47
|
+
"description": "Click trigger to clear search input for target"
|
|
48
|
+
},
|
|
49
|
+
"data-ln-search-exclude": {
|
|
50
|
+
"direction": "author",
|
|
51
|
+
"sources": [
|
|
52
|
+
"src/ln-search.js"
|
|
53
|
+
],
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "CSS selector matching child items to exclude from search"
|
|
56
|
+
},
|
|
57
|
+
"data-ln-search-fields": {
|
|
58
|
+
"direction": "author",
|
|
59
|
+
"sources": [
|
|
60
|
+
"src/ln-search.js"
|
|
61
|
+
],
|
|
62
|
+
"type": "list",
|
|
63
|
+
"description": "Comma-separated field names to include in client search"
|
|
64
|
+
},
|
|
65
|
+
"data-ln-search-for": {
|
|
66
|
+
"direction": "author",
|
|
67
|
+
"sources": [
|
|
68
|
+
"ln-search-dev.scss",
|
|
69
|
+
"src/ln-search.js"
|
|
70
|
+
],
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "Target table or list element ID that this input controls"
|
|
73
|
+
},
|
|
74
|
+
"data-ln-search-hide": {
|
|
75
|
+
"direction": "both",
|
|
76
|
+
"sources": [
|
|
77
|
+
"ln-search.scss",
|
|
78
|
+
"src/ln-search.js"
|
|
79
|
+
],
|
|
80
|
+
"type": "enum",
|
|
81
|
+
"values": [
|
|
82
|
+
"collapse",
|
|
83
|
+
"none"
|
|
84
|
+
],
|
|
85
|
+
"fallback": "collapse",
|
|
86
|
+
"description": "CSS hiding strategy for non-matching rows"
|
|
87
|
+
},
|
|
88
|
+
"data-ln-search-items": {
|
|
89
|
+
"direction": "author",
|
|
90
|
+
"sources": [
|
|
91
|
+
"src/ln-search.js"
|
|
92
|
+
],
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "CSS selector matching searchable child items"
|
|
95
|
+
},
|
|
96
|
+
"data-ln-table-source": {
|
|
97
|
+
"direction": "author",
|
|
98
|
+
"sources": [
|
|
99
|
+
"src/ln-search.js"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -155,13 +155,17 @@ import { collapseSearchParts, matchesSearchTokens, normalizeSearchTerm, parseSea
|
|
|
155
155
|
|
|
156
156
|
for (let i = 0; i < items.length; i++) {
|
|
157
157
|
const el = items[i];
|
|
158
|
-
el.
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
if (el.hasAttribute(EXCLUDE_ATTR)) {
|
|
159
|
+
if (el.hasAttribute(HIDE_ATTR)) el.removeAttribute(HIDE_ATTR);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
161
162
|
|
|
162
|
-
const
|
|
163
|
-
|
|
163
|
+
const shouldHide = tokens.length > 0 && !matchesSearchTokens(_searchText(el), tokens);
|
|
164
|
+
const isHidden = el.hasAttribute(HIDE_ATTR);
|
|
165
|
+
if (shouldHide && !isHidden) {
|
|
164
166
|
el.setAttribute(HIDE_ATTR, 'true');
|
|
167
|
+
} else if (!shouldHide && isHidden) {
|
|
168
|
+
el.removeAttribute(HIDE_ATTR);
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!C(i))return}e.apply(console,t)}}function X(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,o={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&l[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&o[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);o[n.name]=n.value===""||isNaN(u)?null:u}else o[n.name]=n.value}return o}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const r=e.elements,i=[],o={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(n).split(",").map(function(a){return a.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ee(n);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<l.options.length;u++)l.options[u].selected=n.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),i.push(l)}return i}function ne(e,t,{get:r,set:i}){Object.defineProperty(e,"value",{get:function(){return r?r.call(this):t.get.call(this)},set:function(o){i?i.call(this,o,c=>t.set.call(this,c)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const $={};function re(e,t){$[e]=t}function oe(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){X(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function le(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];F[r]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const y={};function ce(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();t[d]!=null&&s.setAttribute(f,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],n=s.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();d in t&&s.classList.toggle(f,!!t[d])}}return e}function ue(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function T(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let c=0;c<o.length;c++){const l=o[c],s=l.attributes;for(let n=0;n<s.length;n++){const u=s[n];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function ae(e,t,r,i,o,c){const l={};for(let n=0;n<e.children.length;n++){const u=e.children[n],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],a=String(i(u));let f=l[a];if(f)o(f,u,n);else{const d=ce(r,c);if(!d||(T(d,u),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),o(f,u,n)}s.appendChild(f)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=T,window.lnCore.fill=N,window.lnCore.lnFill=ue,window.lnCore.renderList=ae);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function I(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function q(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function M(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const i=new Set(e||[]),o=function(c,l){const s=c.getAttribute(l);return s!==null&&i.has(s)?s:t};return A.set(r,o),o}function j(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function B(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function W(e,t,r,i,o){if(!e||t===null)return!0;const c=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{o?console.warn(n,o):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,r){for(const i in r){const[o,c,l]=r[i];Object.defineProperty(e,i,{get:function(){return o(t,c,l)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=M(i.values,i.fallback);break;case"integer":o=I;break;case"float":o=j;break;case"boolean":o=q;break;case"list":o=R;break;case"json":o=B;break;case"string":default:o=g;break}o||(o=g),t[i.prop]=[o,r,i.fallback]}return t}function fe(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=U,window.lnCore.attrSpec=V,window.lnCore.attrStr=g,window.lnCore.attrInt=I,window.lnCore.attrBool=q,window.lnCore.attrList=R,window.lnCore.attrEnum=M,window.lnCore.attrFloat=j,window.lnCore.attrJson=B);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function H(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&h(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function we(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function he(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function pe(e){const t=P(),r=e.observed||[];for(let i=0;i<r.length;i++){const o=r[i];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(c=>c.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=de(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,r,i){for(let o=0;o<e.length;o++){const c=e[o];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=P(),o=i.byAttr.get(t),c=D()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!o&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&C(l)){const s=i.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let u=0;u<s.length;u++)W(s[u].spec,n,t,s[u].componentTag,l)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&Q(s,l,t,e.oldValue),i.reactiveWildcard.length&&Q(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const n=o[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(H(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function v(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function _(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function me(e){const t=v();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let i=0;i<t.length;i++){const o=t[i];if(o.onSubtreeChange&&o.query){const c=o.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&o.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const o=e.addedNodes[i];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)o.matches&&o.matches(s.query)&&h(o,s);else if(o.matches&&o.matches(s.query)&&h(o,s),o.querySelectorAll){const n=o.querySelectorAll(s.query);for(let u=0;u<n.length;u++)h(n[u],s)}}s.onInit&&s.onInit(o)}}}for(let i=0;i<e.removedNodes.length;i++){const o=e.removedNodes[i];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!c)o.matches&&o.matches(n)&&_(o,s);else if(o.matches&&o.matches(n)&&_(o,s),o.querySelectorAll){const u=o.querySelectorAll(n);for(let a=0;a<u.length;a++)_(u[a],s)}}}}}}function J(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{me(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){v().push(e),J()}function K(e,t,r,i,o={}){const c=o.extraAttributes||[],l=o.onAttributeChange||null,s=o.onSubtreeChange||null,n=o.onInit||null,u=o.onAttrChange||null,a=o.effects||null,f=o.attributes||null,d=f?fe(f):a,De=f?new Set(Object.keys(f)):null,$e=o.persist||null;function m(k){const w=k||document.body;if(H(w,e,t,r),f&&D())for(const p in f){const Te=f[p],E=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&E.push(w);for(let L=0;L<E.length;L++){const O=E[L];C(O)&&W(Te,O.getAttribute(p),p,i,O)}}n&&n(w)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)S.push(w[1])}else S.push(e);pe({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:r,onInit:n,observed:S.concat(c),onAttributeChange:l,onAttrChange:u,effects:d,declared:De,persist:$e}),ge();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=o.subtreeQuery||(Fe?e:"["+e+"]");v().push({selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:s,query:Ne}),J(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K,window.lnCore.observeLifecycle=Ce);function G(){we()>0?he(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),m}function z(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,r={},i=z(t);if(!i)return r;const o=i.split("&");for(let c=0;c<o.length;c++){const l=o[c];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,u=s>-1?l.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function ye(e){if(!e)return null;const t=x();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const r=x();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");z(location.hash)!==o&&(location.hash=o)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Se(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=Se,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Ee);function Le(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Le);function Oe(e,t="-"){if(e==null)return"";const r=t||"-",i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,r).replace(new RegExp(`${i}+`,"g"),r).replace(new RegExp(`^${i}+|${i}+$`,"g"),"")}(function(){const e="data-ln-slug-from",t="lnSlug";if(window[t]!==void 0)return;const r={"data-ln-slug-from":{prop:"sourceName",type:"string",read:g,fallback:"",description:"Name of the source input field to derive URL slug from"}},i=V(r),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function c(l){if(l.tagName!=="INPUT")return console.warn("[ln-slug] Can only be applied to <input>, got:",l.tagName),this;const s=l.form;if(!s)return console.warn("[ln-slug] Slug input is not inside a <form>:",l),this;U(this,l,i);const n=s.elements[this.sourceName];if(!n)return console.warn('[ln-slug] Source field "'+this.sourceName+'" not found in form:',l),this;if(typeof n.addEventListener!="function")return console.warn('[ln-slug] Source field "'+this.sourceName+'" is a RadioNodeList (same-name group) — single source field required:',l),this;this.dom=l,this.form=s,this.source=n,this._pristine=l.value==="",this._mirroring=!1;const u=this;return ne(l,o,{get:function(){return o.get.call(l)},set:function(a){o.set.call(l,a),u._mirroring||(u._pristine=a===""||a===null||a===void 0)}}),this._onSource=function(){u._pristine&&u._mirror()},this._onSlug=function(){u._mirroring||(u._pristine=u.dom.value==="")},this._onFormReset=function(){setTimeout(function(){u._pristine=u.dom.value===""},0)},n.addEventListener("input",this._onSource),l.addEventListener("input",this._onSlug),s.addEventListener("reset",this._onFormReset),this._pristine&&n.value&&n.value.trim()!==""&&this._mirror(),this}c.prototype._mirror=function(){this._mirroring=!0,this.dom.value=Oe(this.source.value),this.dom.dispatchEvent(new Event("input",{bubbles:!0})),this._mirroring=!1},c.prototype.destroy=function(){this.dom[t]&&(this.source.removeEventListener("input",this._onSource),this.dom.removeEventListener("input",this._onSlug),this._onFormReset&&this.form&&this.form.removeEventListener("reset",this._onFormReset),Object.defineProperty(this.dom,"value",o),delete this.dom[t])},K(e,t,c,"ln-slug",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!C(i))return}e.apply(console,t)}}function ee(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,o={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&l[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);l[n.name]=n.value===""||isNaN(u)?null:u}else l[n.name]=n.value}return l}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const r=e.elements,i=[],l={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const u=String(n).split(",").map(function(a){return a.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=re(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<o.options.length;u++)o.options[u].selected=n.indexOf(o.options[u].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}function ie(e,t,{get:r,set:i}){Object.defineProperty(e,"value",{get:function(){return r?r.call(this):t.get.call(this)},set:function(l){i?i.call(this,l,s=>t.set.call(this,s)):t.set.call(this,l)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const F={};function le(e,t){F[e]=t}function se(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){ee(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=ce);const y={};function fe(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const c=l[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function de(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function T(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],c=o.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function we(e,t,r,i,l,s){const o={};for(let n=0;n<e.children.length;n++){const u=e.children[n],a=u.getAttribute("data-ln-render-key");a&&(o[a]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],a=String(i(u));let f=o[a];if(f)l(f,u,n);else{const d=fe(r,s);if(!d||(T(d,u),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),l(f,u,n)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=T,window.lnCore.fill=R,window.lnCore.lnFill=de,window.lnCore.renderList=we);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function I(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function q(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const i=new Set(e||[]),l=function(s,o){const c=s.getAttribute(o);return c!==null&&i.has(c)?c:t};return A.set(r,l),l}function B(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function W(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function U(e,t,r,i,l){if(!e||t===null)return!0;const s=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,r){for(const i in r){const[l,s,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function H(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=j(i.values,i.fallback);break;case"integer":l=I;break;case"float":l=B;break;case"boolean":l=q;break;case"list":l=M;break;case"json":l=W;break;case"string":default:l=g;break}l||(l=g),t[i.prop]=[l,r,i.fallback]}return t}function he(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function pe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=H,window.lnCore.attrStr=g,window.lnCore.attrInt=I,window.lnCore.attrBool=q,window.lnCore.attrList=M,window.lnCore.attrEnum=j,window.lnCore.attrFloat=B,window.lnCore.attrJson=W);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function P(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&h(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)h(c[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function me(e){const t=Q(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=pe(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,r,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function Ce(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=Q(),l=i.byAttr.get(t),s=$()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&C(o)){const c=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let u=0;u<c.length;u++)U(c[u].spec,n,t,c[u].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=i.byReactive.get(t);c&&J(c,o,t,e.oldValue),i.reactiveWildcard.length&&J(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const n=l[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(P(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ce(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function x(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ae(e){const t=_();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=v();if(e.target&&i.length)for(let l=0;l<i.length;l++){const s=i[l],o=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)s.matches&&s.matches(n.query)&&h(s,n);else if(s.matches&&s.matches(n.query)&&h(s,n),s.querySelectorAll){const u=s.querySelectorAll(n.query);for(let a=0;a<u.length;a++)h(u[a],n)}}n.onInit&&n.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],u=n.query;if(u){if(!o)s.matches&&s.matches(u)&&x(s,n);else if(s.matches&&s.matches(u)&&x(s,n),s.querySelectorAll){const a=s.querySelectorAll(u);for(let f=0;f<a.length;f++)x(a[f],n)}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{Ae(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&v().push(e),K()}function z(e,t,r,i,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,u=l.onAttrChange||null,a=l.effects||null,f=l.attributes||null,d=f?he(f):a,Ne=f?new Set(Object.keys(f)):null,Re=l.persist||null;function m(E){const w=E||document.body;if(P(w,e,t,r),f&&$())for(const p in f){const Ie=f[p],L=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&L.push(w);for(let O=0;O<L.length;O++){const D=L[O];C(D)&&U(Ie,D.getAttribute(p),p,i,D)}}n&&n(w)}const k=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)k.push(w[1])}else k.push(e);me({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:r,onInit:n,observed:k.concat(s),onAttributeChange:o,onAttrChange:u,effects:d,declared:Ne,persist:Re}),ye();const Te=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,X=l.subtreeQuery||(Te?e:"["+e+"]"),Y={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:X};_().push(Y),c&&X&&v().push(Y),K(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=_e);function Z(){be()>0?ge(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),m}function G(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},i=G(t);if(!i)return r;const l=i.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function ve(e){if(!e)return null;const t=S();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");G(location.hash)!==l&&(location.hash=l)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=De);function $e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=$e);function Fe(e,t="-"){if(e==null)return"";const r=t||"-",i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,r).replace(new RegExp(`${i}+`,"g"),r).replace(new RegExp(`^${i}+|${i}+$`,"g"),"")}(function(){const e="data-ln-slug-from",t="lnSlug";if(window[t]!==void 0)return;const r={"data-ln-slug-from":{prop:"sourceName",type:"string",read:g,fallback:"",description:"Name of the source input field to derive URL slug from"}},i=H(r),l=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(o){if(o.tagName!=="INPUT")return console.warn("[ln-slug] Can only be applied to <input>, got:",o.tagName),this;const c=o.form;if(!c)return console.warn("[ln-slug] Slug input is not inside a <form>:",o),this;V(this,o,i);const n=c.elements[this.sourceName];if(!n)return console.warn('[ln-slug] Source field "'+this.sourceName+'" not found in form:',o),this;if(typeof n.addEventListener!="function")return console.warn('[ln-slug] Source field "'+this.sourceName+'" is a RadioNodeList (same-name group) — single source field required:',o),this;this.dom=o,this.form=c,this.source=n,this._pristine=o.value==="",this._mirroring=!1;const u=this;return ie(o,l,{get:function(){return l.get.call(o)},set:function(a){l.set.call(o,a),u._mirroring||(u._pristine=a===""||a===null||a===void 0)}}),this._onSource=function(){u._pristine&&u._mirror()},this._onSlug=function(){u._mirroring||(u._pristine=u.dom.value==="")},this._onFormReset=function(){setTimeout(function(){u._pristine=u.dom.value===""},0)},n.addEventListener("input",this._onSource),o.addEventListener("input",this._onSlug),c.addEventListener("reset",this._onFormReset),this._pristine&&n.value&&n.value.trim()!==""&&this._mirror(),this}s.prototype._mirror=function(){this._mirroring=!0,this.dom.value=Fe(this.source.value),this.dom.dispatchEvent(new Event("input",{bubbles:!0})),this._mirroring=!1},s.prototype.destroy=function(){this.dom[t]&&(this.source.removeEventListener("input",this._onSource),this.dom.removeEventListener("input",this._onSlug),this._onFormReset&&this.form&&this.form.removeEventListener("reset",this._onFormReset),Object.defineProperty(this.dom,"value",l),delete this.dom[t])},z(e,t,s,"ln-slug",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){n=t[o];break}if(!O(n))return}e.apply(console,t)}}function he(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function K(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});return e.dispatchEvent(o),o}function I(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){I(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function D(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function we(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,o={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const i=c[s];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<c.length;s++){const i=c[s];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(n&&i.matches&&i.matches(n)))if(i.type==="checkbox")r&&l[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&o[i.name].push(i.options[u].value)}else if(r&&i.type==="hidden")o[i.name]=i.value;else if(r&&(i.type==="number"||i.type==="range")){const u=Number(i.value);o[i.name]=i.value===""||isNaN(u)?null:u}else o[i.name]=i.value}return o}function be(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ge(e,t){const r=e.elements,n=[],o={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const i=t[s];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(i).split(",").map(function(h){return h.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=be(i);n.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),n.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<l.options.length;u++)l.options[u].selected=i.indexOf(l.options[u].value)!==-1;n.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),n.push(l)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=we);const z={};function me(e,t){z[e]=t}function ye(e){return z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ye);function Ce(e){const t=e?e.closest("[lang]"):null,r=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function Ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,I(function(){new MutationObserver(function(){he(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function _e(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];P[r]=t}function ve(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=_e,window.lnCore.getLocaleFallback=ve,window.lnCore.ensureLocaleObserver=Ae);const q={};function Se(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=q[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Q(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],i=s.getAttribute("data-ln-field");t[i]!=null&&(s.textContent=t[i])}const n=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<n.length;l++){const s=n[l],i=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const h=i[u].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),C=h[1].trim();t[C]!=null&&s.setAttribute(w,t[C])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const s=o[l],i=s.getAttribute("data-ln-show");i in t&&s.classList.toggle("hidden",!t[i])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],i=s.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const h=i[u].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),C=h[1].trim();C in t&&s.classList.toggle(w,!!t[C])}}return e}function xe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)Q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function J(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const n=function(c,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let c=0;c<o.length;c++){const l=o[c],s=l.attributes;for(let i=0;i<s.length;i++){const u=s[i];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ke(e,t,r,n,o,c){const l={};for(let i=0;i<e.children.length;i++){const u=e.children[i],h=u.getAttribute("data-ln-render-key");h&&(l[h]=u)}const s=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],h=String(n(u));let w=l[h];if(w)o(w,u,i);else{const C=Se(r,c);if(!C||(J(C,u),w=C.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",h),o(w,u,i)}s.appendChild(w)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=Q,window.lnCore.lnFill=xe,window.lnCore.renderList=ke);function T(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function G(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function X(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const o=n.trim().toLowerCase();return!(o==="false"||o==="0")}function Y(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const F=new Map;function Z(e,t){const r=(e?e.join("|"):"")+"::"+t;if(F.has(r))return F.get(r);const n=new Set(e||[]),o=function(c,l){const s=c.getAttribute(l);return s!==null&&n.has(s)?s:t};return F.set(r,o),o}function ee(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function te(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function ne(e,t,r,n,o){if(!e||t===null)return!0;const c=n||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=i=>{o?console.warn(i,o):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(s(`[${c}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(s(`[${c}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return s(`[${c}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,r){for(const n in r){const[o,c,l]=r[n];Object.defineProperty(e,n,{get:function(){return o(t,c,l)},enumerable:!0,configurable:!0})}return e}function oe(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let o=n.read;if(!o&&n.type)switch(n.type){case"enum":o=Z(n.values,n.fallback);break;case"integer":o=G;break;case"float":o=ee;break;case"boolean":o=X;break;case"list":o=Y;break;case"json":o=te;break;case"string":default:o=T;break}o||(o=T),t[n.prop]=[o,r,n.fallback]}return t}function Ee(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function Ie(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=T,window.lnCore.attrInt=G,window.lnCore.attrBool=X,window.lnCore.attrList=Y,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=ee,window.lnCore.attrJson=te);function S(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ie(e,t,r,n){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(c)&&S(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let i=0;i<s.length;i++)S(s[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function N(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function le(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Le(e){const t=le(),r=e.observed||[];for(let n=0;n<r.length;n++){const o=r[n];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const o=t.byDeclaredAttr.get(n);o.some(c=>c.componentTag===e.componentTag)||o.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=Ie(e);if(n===null)t.reactiveWildcard.push(e);else for(const o of n)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function se(e,t,r,n){for(let o=0;o<e.length;o++){const c=e[o];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,n):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,n)}}function Oe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=le(),o=n.byAttr.get(t),c=U()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!o&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&O(l)){const s=n.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let u=0;u<s.length;u++)ne(s[u].spec,i,t,s[u].componentTag,l)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=n.byReactive.get(t);s&&se(s,l,t,e.oldValue),n.reactiveWildcard.length&&se(n.reactiveWildcard,l,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(ie(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,I(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Oe(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function qe(e){const t=$();if(!t.length)return;const r=e.target;if(r){const n=r.nodeType===1?r:r.parentElement;if(n&&(n.isContentEditable||n.closest&&n.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange&&o.query){const c=o.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&o.onSubtreeChange(l,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)o.matches&&o.matches(s.query)&&S(o,s);else if(o.matches&&o.matches(s.query)&&S(o,s),o.querySelectorAll){const i=o.querySelectorAll(s.query);for(let u=0;u<i.length;u++)S(i[u],s)}}s.onInit&&s.onInit(o)}}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l],i=s.query;if(i){if(!c)o.matches&&o.matches(i)&&R(o,s);else if(o.matches&&o.matches(i)&&R(o,s),o.querySelectorAll){const u=o.querySelectorAll(i);for(let h=0;h<u.length;h++)R(u[h],s)}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,I(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{qe(n)}catch(o){console.error("[ln-core] lifecycle handler failed",n.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Fe(e){$().push(e),ce()}function ae(e,t,r,n,o={}){const c=o.extraAttributes||[],l=o.onAttributeChange||null,s=o.onSubtreeChange||null,i=o.onInit||null,u=o.onAttrChange||null,h=o.effects||null,w=o.attributes||null,C=w?Ee(w):h,d=w?new Set(Object.keys(w)):null,m=o.persist||null;function a(v){const p=v||document.body;if(ie(p,e,t,r),w&&U())for(const A in w){const V=w[A],x=Array.from(p.querySelectorAll("["+A+"]"));p.matches&&p.matches("["+A+"]")&&x.push(p);for(let k=0;k<x.length;k++){const E=x[k];O(E)&&ne(V,E.getAttribute(A),A,n,E)}}i&&i(p)}const g=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)g.push(p[1])}else g.push(e);Le({selector:e,attribute:t,componentTag:n,attributes:w,ComponentFn:r,onInit:i,observed:g.concat(c),onAttributeChange:l,onAttrChange:u,effects:C,declared:d,persist:m}),De();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=o.subtreeQuery||(f?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:s,query:b}),ce(),window[t]=a,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ae,window.lnCore.observeLifecycle=Fe);function y(){Te()>0?N(function(){a(document.body)}):a(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),a}function Ne(e){let t=!1;for(let r=0;r<e.length;r++){const n=e[r];if(!(n===""||n==null)&&(t=!0,!Number.isFinite(Number(n))))return"string"}return t?"number":"string"}function $e(e,t,r,n){if(r==="number"){const l=parseFloat(e),s=parseFloat(t);return(isNaN(l)?0:l)-(isNaN(s)?0:s)}const o=e!=null?String(e):"",c=t!=null?String(t):"";return n?n.compare(o,c):o<c?-1:o>c?1:0}function ue(e){return(e||"").replace(/^#/,"")}function B(e){const t=e===void 0?location.hash:e,r={},n=ue(t);if(!n)return r;const o=n.split("&");for(let c=0;c<o.length;c++){const l=o[c];if(!l)continue;const s=l.indexOf(":"),i=s>-1?l.slice(0,s):l,u=s>-1?l.slice(s+1):"";if(i)try{r[i]=decodeURIComponent(u)}catch{r[i]=u}}return r}function M(e){if(!e)return null;const t=B();return e in t?t[e]:null}function de(e,t){if(!e)return;const r=B();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");ue(location.hash)!==o&&(location.hash=o)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function L(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function j(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Be(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),o=n?n.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=B,window.lnCore.hashGet=M,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=L,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=j,window.lnCore.hashFilterEncode=Be,window.lnCore.hashFilterDecode=Me);function je(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=je);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function He(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function Ve(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function We(e,t,r,n){const o=_(e);if(o==="none")return()=>0;const c=o==="desc"?-1:1,l=typeof n=="function"?n:s=>s;return function(s,i){const u=l(s),h=l(i);return $e(u,h,t,r)*c}}function H(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function Ue(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const r=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(r&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(r));if(e.tagName==="TABLE"){const n=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(n)return Array.from(n.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",r="data-ln-sort-field",n="data-ln-sort-state",o="data-ln-sort-dir",c="data-ln-hash";if(window[t]!==void 0)return;function l(d,m){return d.getAttribute(m)||null}const s={"data-ln-sort":{prop:"targetId",type:"string",read:T,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:l,effect:C,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:l,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:C,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:C,description:"URL hash routing key for sort state persistence"}},i=oe(s),u=new WeakMap;function h(d,m,a){if(m){const g=d.querySelector('[data-ln-field="'+m+'"]');return g?D(g):""}return a!=null&&d.cells&&d.cells[a]?D(d.cells[a]):D(d)}function w(d){this.dom=d,re(this,d,i);const m=d.closest("th");this.column=!this.field&&m?m.cellIndex:null,this._state=_(d.getAttribute(n)),d.hasAttribute(n)||d.setAttribute(n,this._state),this._destroyed=!1,this.nsKey=L(d,"sort"),this.hashEnabled=!!this.nsKey;const a=this;this._onClick=function(f){const b=f.target.closest("["+o+"]");if(!b)return;const y=_(b.getAttribute(o));a._apply(y)},d.addEventListener("click",this._onClick),this._onSortChange=function(f){if(a._destroyed||!f.detail)return;const b=a._resolveTarget();if(!(b&&(f.target===b||b.contains(f.target))||f.detail.targetId&&f.detail.targetId===a.targetId))return;if(Ve({field:a.field,column:a.column},{field:f.detail.field,column:f.detail.column})){const p=_(f.detail.direction);p&&d.getAttribute(n)!==p&&(a._state=p,d.setAttribute(n,p),a._updateAriaSort(p));return}d.getAttribute(n)!=="none"&&(a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const f=M(a.nsKey),b=j(f);if(b)a.field!==null&&b.fieldOrColumn===a.field||a.column!==null&&String(a.column)===b.fieldOrColumn?a._state!==b.direction&&a._apply(b.direction,!0):a._state!=="none"&&(a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none"));else if(a._state!=="none"){a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none");const y=a._resolveTarget();y&&(K(y,"ln-sort:change",{field:a.field,column:a.column,direction:"none",targetId:a.targetId}).defaultPrevented||a._defaultSort(y,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let g=!1;if(this.hashEnabled){const f=M(this.nsKey),b=j(f);b&&((a.field!==null&&b.fieldOrColumn===a.field||a.column!==null&&String(a.column)===b.fieldOrColumn)&&N(function(){a._destroyed||a._apply(b.direction,!0)}),g=!0)}if(!g){const f=_(d.getAttribute(n));f&&f!=="none"&&N(function(){a._destroyed||a._apply(f,!0)})}return this}w.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},w.prototype._updateAriaSort=function(d){const m=this.dom.closest("th");m&&m.setAttribute("aria-sort",He(d))},w.prototype._apply=function(d,m){if(this._destroyed)return;if(!this.field&&this.column===null){const y=this.dom.closest("th");y&&y.cellIndex!==void 0&&(this.column=y.cellIndex)}const a=_(d);this._state=a,this.dom.getAttribute(n)!==a&&this.dom.setAttribute(n,a),this._updateAriaSort(a);const g=this._resolveTarget();if(!g)return;const f={field:this.field,column:this.column,direction:a,targetId:this.targetId};if(!m&&this.hashEnabled){const y=fe(this.field!==null?this.field:this.column,a);de(this.nsKey,y)}K(g,"ln-sort:change",f).defaultPrevented||this._defaultSort(g,a)},w.prototype._defaultSort=function(d,m){const a=Ue(d,this.itemsSelector);if(!a.length)return;const g=a[0].parentNode,f=a.filter(function(p){return!H(p)});if(!f.length)return;u.has(d)||u.set(d,f.slice());let b;if(m==="none"){const p=u.get(d)||f;u.delete(d),b=p.filter(function(A){return A.parentNode===g&&!H(A)})}else{const p=this.field,A=this.column,V=f.map(function(W){return h(W,p,A)}),x=Ne(V),k=typeof Intl<"u"?new Intl.Collator(Ce(this.dom),{sensitivity:"base",numeric:!0}):null,E=We(m,x,k,function(W){return h(W,p,A)});b=f.slice().sort(E)}const y=document.createDocumentFragment();let v=0;for(let p=0;p<a.length;p++){const A=a[p];H(A)?y.appendChild(A):v<b.length&&y.appendChild(b[v++])}g.appendChild(y)},w.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function C(d,m){const a=d[t];if(!(!a||a._destroyed))if(m===r){const g=d.closest("th");a.column=!a.field&&g?g.cellIndex:null}else if(m===n){const g=_(d.getAttribute(n));g!==a._state&&a._apply(g)}else m===c&&(a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=L(d,"sort"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange))}ae(e,t,w,"ln-sort",{attributes:s,persist:{attr:n,hashActive:function(d){return!!L(d,"sort")}}})})()})();
|
|
1
|
+
(function(){"use strict";function K(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function D(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!D(r))return}e.apply(console,t)}}function we(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function q(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function pe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function be(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function me(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const o=t[c];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(h){return h.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ge(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=me,window.lnCore.serializeForm=be,window.lnCore.resolveFormMethod=pe);const P={};function ye(e,t){P[e]=t}function Ce(e){return P[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ye,window.lnCore.getDataMapper=Ce);function Ae(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function _e(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){we(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function ve(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];Q[n]=t}function Se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ve,window.lnCore.getLocaleFallback=Se,window.lnCore.ensureLocaleObserver=_e);const F={};function xe(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=F[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function J(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const h=o[u].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),A=h[1].trim();t[A]!=null&&c.setAttribute(f,t[A])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const h=o[u].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),A=h[1].trim();A in t&&c.classList.toggle(f,!!t[A])}}return e}function ke(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)J(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function G(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ee(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],h=u.getAttribute("data-ln-render-key");h&&(l[h]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],h=String(r(u));let f=l[h];if(f)i(f,u,o);else{const A=xe(n,s);if(!A||(G(A,u),f=A.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",h),i(f,u,o)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=J,window.lnCore.lnFill=ke,window.lnCore.renderList=Ee);function L(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function X(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Y(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function Z(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const N=new Map;function ee(e,t){const n=(e?e.join("|"):"")+"::"+t;if(N.has(n))return N.get(n);const r=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return N.set(n,i),i}function te(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ne(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function re(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ie(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=ee(r.values,r.fallback);break;case"integer":i=X;break;case"float":i=te;break;case"boolean":i=Y;break;case"list":i=Z;break;case"json":i=ne;break;case"string":default:i=L;break}i||(i=L),t[r.prop]=[i,n,r.fallback]}return t}function Ie(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function Te(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=oe,window.lnCore.attrSpec=ie,window.lnCore.attrStr=L,window.lnCore.attrInt=X,window.lnCore.attrBool=Y,window.lnCore.attrList=Z,window.lnCore.attrEnum=ee,window.lnCore.attrFloat=te,window.lnCore.attrJson=ne);function k(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function le(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&k(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)k(c[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function R(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function se(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Oe(e){const t=se(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Te(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ce(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function De(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=se(),i=r.byAttr.get(t),s=K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&D(l)){const c=r.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<c.length;u++)re(c[u].spec,o,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&ce(c,l,t,e.oldValue),r.reactiveWildcard.length&&ce(r.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(le(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function qe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{De(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function B(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Fe(e){const t=$();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=B();if(e.target&&r.length)for(let i=0;i<r.length;i++){const s=r[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const o=t[c];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)s.matches&&s.matches(o.query)&&k(s,o);else if(s.matches&&s.matches(o.query)&&k(s,o),s.querySelectorAll){const u=s.querySelectorAll(o.query);for(let h=0;h<u.length;h++)k(u[h],o)}}o.onInit&&o.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const o=t[c],u=o.query;if(u){if(!l)s.matches&&s.matches(u)&&M(s,o);else if(s.matches&&s.matches(u)&&M(s,o),s.querySelectorAll){const h=s.querySelectorAll(u);for(let f=0;f<h.length;f++)M(h[f],o)}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Fe(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){$().push(e),e.onSubtreeChange&&e.query&&B().push(e),ae()}function ue(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,h=i.effects||null,f=i.attributes||null,A=f?Ie(f):h,d=f?new Set(Object.keys(f)):null,g=i.persist||null;function a(y){const C=y||document.body;if(le(C,e,t,n),f&&K())for(const S in f){const U=f[S],E=Array.from(C.querySelectorAll("["+S+"]"));C.matches&&C.matches("["+S+"]")&&E.push(C);for(let I=0;I<E.length;I++){const x=E[I];D(x)&&re(U,x.getAttribute(S),S,r,x)}}o&&o(C)}const b=[];if(e.indexOf("[")!==-1){const y=/\[([\w-]+)/g;let C;for(;(C=y.exec(e))!==null;)b.push(C[1])}else b.push(e);Oe({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:o,observed:b.concat(s),onAttributeChange:l,onAttrChange:u,effects:A,declared:d,persist:g}),qe();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,p=i.subtreeQuery||(w?e:"["+e+"]"),m={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:p};$().push(m),c&&p&&B().push(m),ae(),window[t]=a,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ue,window.lnCore.observeLifecycle=Ne);function v(){Le()>0?R(function(){a(document.body)}):a(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v(),a}function Re(e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(!(r===""||r==null)&&(t=!0,!Number.isFinite(Number(r))))return"string"}return t?"number":"string"}function $e(e,t,n,r){if(n==="number"){const l=parseFloat(e),c=parseFloat(t);return(isNaN(l)?0:l)-(isNaN(c)?0:c)}const i=e!=null?String(e):"",s=t!=null?String(t):"";return r?r.compare(i,s):i<s?-1:i>s?1:0}function de(e){return(e||"").replace(/^#/,"")}function j(e){const t=e===void 0?location.hash:e,n={},r=de(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),o=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function H(e){if(!e)return null;const t=j();return e in t?t[e]:null}function fe(e,t){if(!e)return;const n=j();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");de(location.hash)!==i&&(location.hash=i)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function O(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function he(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function V(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Me(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=j,window.lnCore.hashGet=H,window.lnCore.hashSet=fe,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=O,window.lnCore.hashSortEncode=he,window.lnCore.hashSortDecode=V,window.lnCore.hashFilterEncode=Me,window.lnCore.hashFilterDecode=je);function He(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=He);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function Ve(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function We(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function Ue(e,t,n,r){const i=_(e);if(i==="none")return()=>0;const s=i==="desc"?-1:1,l=typeof r=="function"?r:c=>c;return function(c,o){const u=l(c),h=l(o);return $e(u,h,t,n)*s}}function W(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function Ke(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const n=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(n&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(n));if(e.tagName==="TABLE"){const r=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(r)return Array.from(r.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",n="data-ln-sort-field",r="data-ln-sort-state",i="data-ln-sort-dir",s="data-ln-hash";if(window[t]!==void 0)return;function l(d,g){return d.getAttribute(g)||null}const c={"data-ln-sort":{prop:"targetId",type:"string",read:L,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:l,effect:A,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:l,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:A,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:A,description:"URL hash routing key for sort state persistence"}},o=ie(c),u=new WeakMap;function h(d,g,a){if(g){const b=d.querySelector('[data-ln-field="'+g+'"]');return b?q(b):""}return a!=null&&d.cells&&d.cells[a]?q(d.cells[a]):q(d)}function f(d){this.dom=d,oe(this,d,o);const g=d.closest("th");this.column=!this.field&&g?g.cellIndex:null,this._state=_(d.getAttribute(r)),d.hasAttribute(r)||d.setAttribute(r,this._state),this._destroyed=!1,this.nsKey=O(d,"sort"),this.hashEnabled=!!this.nsKey;const a=this;this._onClick=function(w){const p=w.target.closest("["+i+"]");if(!p)return;const m=_(p.getAttribute(i));a._apply(m)},d.addEventListener("click",this._onClick),this._onSortChange=function(w){if(a._destroyed||!w.detail)return;const p=a._resolveTarget();if(!(p&&(w.target===p||p.contains(w.target))||w.detail.targetId&&w.detail.targetId===a.targetId))return;if(We({field:a.field,column:a.column},{field:w.detail.field,column:w.detail.column})){const y=_(w.detail.direction);y&&d.getAttribute(r)!==y&&(a._state=y,d.setAttribute(r,y),a._updateAriaSort(y));return}d.getAttribute(r)!=="none"&&(a._state="none",d.setAttribute(r,"none"),a._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const w=H(a.nsKey),p=V(w);if(p)a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn?a._state!==p.direction&&a._apply(p.direction,!0):a._state!=="none"&&(a._state="none",d.setAttribute(r,"none"),a._updateAriaSort("none"));else if(a._state!=="none"){a._state="none",d.setAttribute(r,"none"),a._updateAriaSort("none");const m=a._resolveTarget();m&&(z(m,"ln-sort:change",{field:a.field,column:a.column,direction:"none",targetId:a.targetId}).defaultPrevented||a._defaultSort(m,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const w=H(this.nsKey),p=V(w);p&&((a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn)&&R(function(){a._destroyed||a._apply(p.direction,!0)}),b=!0)}if(!b){const w=_(d.getAttribute(r));w&&w!=="none"&&R(function(){a._destroyed||a._apply(w,!0)})}return this}f.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},f.prototype._updateAriaSort=function(d){const g=this.dom.closest("th");g&&g.setAttribute("aria-sort",Ve(d))},f.prototype._apply=function(d,g){if(this._destroyed)return;if(!this.field&&this.column===null){const m=this.dom.closest("th");m&&m.cellIndex!==void 0&&(this.column=m.cellIndex)}const a=_(d);this._state=a,this.dom.getAttribute(r)!==a&&this.dom.setAttribute(r,a),this._updateAriaSort(a);const b=this._resolveTarget();if(!b)return;const w={field:this.field,column:this.column,direction:a,targetId:this.targetId};if(!g&&this.hashEnabled){const m=he(this.field!==null?this.field:this.column,a);fe(this.nsKey,m)}z(b,"ln-sort:change",w).defaultPrevented||this._defaultSort(b,a)},f.prototype._defaultSort=function(d,g){const a=Ke(d,this.itemsSelector);if(!a.length)return;const b=a[0].parentNode,w=a.filter(function(y){return!W(y)});if(!w.length)return;u.has(d)||u.set(d,w.slice());let p;if(g==="none"){const y=u.get(d)||w;u.delete(d),p=y.filter(function(C){return C.parentNode===b&&!W(C)})}else{const y=this.field,C=this.column,S=w.map(function(x){return h(x,y,C)}),U=Re(S),E=typeof Intl<"u"?new Intl.Collator(Ae(this.dom),{sensitivity:"base",numeric:!0}):null,I=Ue(g,U,E,function(x){return h(x,y,C)});p=w.slice().sort(I)}const m=document.createDocumentFragment();let v=0;for(let y=0;y<a.length;y++){const C=a[y];W(C)?m.appendChild(C):v<p.length&&m.appendChild(p[v++])}b.appendChild(m)},f.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function A(d,g){const a=d[t];if(!(!a||a._destroyed))if(g===n){const b=d.closest("th");a.column=!a.field&&b?b.cellIndex:null}else if(g===r){const b=_(d.getAttribute(r));b!==a._state&&a._apply(b)}else g===s&&(a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=O(d,"sort"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange))}ue(e,t,f,"ln-sort",{attributes:c,persist:{attr:r,hashActive:function(d){return!!O(d,"sort")}}})})()})();
|